Skip to content

Commit

Permalink
Fix binary restore
Browse files Browse the repository at this point in the history
  • Loading branch information
Bre77 committed Jul 9, 2024
1 parent c7a3f91 commit d1e1675
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/teslemetry/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ async def async_added_to_hass(self) -> None:
"""Handle entity which will be added."""
await super().async_added_to_hass()
if (state := await self.async_get_last_state()) is not None:
self._state = state.state == "on"
self._attr_is_on = state.state == "on"

def _async_update_attrs(self) -> None:
"""Update the attributes of the binary sensor."""
Expand Down

0 comments on commit d1e1675

Please sign in to comment.