Skip to content

Commit

Permalink
fix(sensor): don't set RAW state if we have JSONDecodeError while pro…
Browse files Browse the repository at this point in the history
…cessing MQTT message payload
  • Loading branch information
IATkachenko committed Jan 11, 2022
1 parent 0c7cbd7 commit dd6f744
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions custom_components/sleep_as_android/sensor.py
Expand Up @@ -123,8 +123,6 @@ def process_message(self, msg):

except json.decoder.JSONDecodeError:
_LOGGER.warning("expected JSON payload. got '%s' instead", msg.payload)
self._state = msg.payload
self.async_write_ha_state()

@property
def should_poll(self):
Expand Down

0 comments on commit dd6f744

Please sign in to comment.