Skip to content

Commit

Permalink
Fix TH bug in local mode #110
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed May 23, 2020
1 parent 10c3047 commit bced78a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom_components/sonoff/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ async def async_added_to_hass(self) -> None:
self._should_poll = device.pop(CONF_FORCE_UPDATE, False)

def _update_handler(self, state: dict, attrs: dict):
self._attrs.update(attrs)
# TH bug in local mode https://github.com/AlexxIT/SonoffLAN/issues/110
if not (self._is_th_3_4_0 and attrs.get('temperature') == 0 and
attrs.get('humidity') == 0):
self._attrs.update(attrs)

# TODO: handle online
# if 'online' in state:
Expand Down

0 comments on commit bced78a

Please sign in to comment.