Skip to content

Commit

Permalink
Merge pull request #3 from gjohansson-ST/unknown-state
Browse files Browse the repository at this point in the history
Handle unknown state
  • Loading branch information
gjohansson-ST committed Jan 27, 2024
2 parents 7482ee3 + 42a1bef commit d72e67c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/attribute_as_sensor/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"integration_type": "helper",
"iot_class": "local_push",
"issue_tracker": "https://github.com/gjohansson-ST/attribute_as_sensor/issues",
"version": "1.0"
"version": "1.1"
}
2 changes: 1 addition & 1 deletion custom_components/attribute_as_sensor/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def _async_attribute_sensor_state_listener(
if (
new_state is None
or new_state.state is None
or new_state.state == STATE_UNAVAILABLE
or new_state.state in [STATE_UNAVAILABLE, STATE_UNKNOWN]
):
self._attr_native_value = STATE_UNKNOWN
if not update_state:
Expand Down

0 comments on commit d72e67c

Please sign in to comment.