Skip to content

Commit

Permalink
Set charging state optimistically
Browse files Browse the repository at this point in the history
  • Loading branch information
jhansche committed Apr 13, 2024
1 parent c30c59f commit 38cd799
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/teslafi/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ def _handle_coordinator_update(self) -> None:

async def async_turn_on(self, **kwargs: Any) -> None:
await self.entity_description.cmd(self.coordinator, True)
self._attr_is_on = True
return self.async_write_ha_state()

async def async_turn_off(self, **kwargs: Any) -> None:
await self.entity_description.cmd(self.coordinator, False)
self._attr_is_on = False
return self.async_write_ha_state()


Expand Down

0 comments on commit 38cd799

Please sign in to comment.