StyraHem / ShellyForHASS

Shelly smart home platform for Home Assistant
MIT License
621 stars 112 forks source link

Error receive CoAP [BUG] #447

Closed dashdrum closed 4 years ago

dashdrum commented 4 years ago

Environment

Describe the bug

I see this error many times each day (a couple thousand times): Error receive CoAP

Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/pyShelly/coap.py", line 182, in _loop self._root.update_block(device_id, device_type, File "/usr/local/lib/python3.8/site-packages/pyShelly/init.py", line 242, in update_block block.update(data, ipaddr) File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 92, in update dev.update(data) File "/usr/local/lib/python3.8/site-packages/pyShelly/switch.py", line 46, in update self._update(state > 0, {'last_event' : self.last_event, TypeError: '>' not supported between instances of 'NoneType' and 'int'

I have a Shelly dimmer on my system using cloud and it is quite unreliable in Home Assistant. Most of the time it is unavailable. No problems using the Shelly cloud or Google Assistant to operate it.

Shelly 1 switch works without issue in Hass and Cloud

Steps to Reproduce

No steps needed. Errors start when Hass is started.

Expected behavior

No error message Ability to control dimmer switch in Hass

Screenshots

Traceback/Error logs

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyShelly/coap.py", line 182, in _loop
    self._root.update_block(device_id, device_type,
  File "/usr/local/lib/python3.8/site-packages/pyShelly/__init__.py", line 242, in update_block
    block.update(data, ipaddr)
  File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 92, in update
    dev.update(data)
  File "/usr/local/lib/python3.8/site-packages/pyShelly/switch.py", line 46, in update
    self._update(state > 0, {'last_event' : self.last_event,
TypeError: '>' not supported between instances of 'NoneType' and 'int'

Additional context

dashdrum commented 4 years ago

After checking the versions of software in my Docker container, I've found that pyShelly is woefully out of date - running version 0.1.7. I'll try to update.

Bug withdrawn.