From 82907aaad9eaa8b8ae312e52f475826feda447f8 Mon Sep 17 00:00:00 2001 From: Brett Rowan <121075405+b-rowan@users.noreply.github.com> Date: Sun, 7 Apr 2024 17:34:48 -0600 Subject: [PATCH] Update data when the miner is updated to active. --- custom_components/miner/switch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/miner/switch.py b/custom_components/miner/switch.py index 6c11c74..3083253 100644 --- a/custom_components/miner/switch.py +++ b/custom_components/miner/switch.py @@ -88,6 +88,7 @@ async def async_turn_on(self) -> None: raise TypeError(f"{miner}: Shutdown not supported.") self._attr_is_on = True await miner.resume_mining() + self.coordinator.data["is_mining"] = True self.async_write_ha_state() async def async_turn_off(self) -> None: @@ -98,6 +99,7 @@ async def async_turn_off(self) -> None: raise TypeError(f"{miner}: Shutdown not supported.") self._attr_is_on = False await miner.stop_mining() + self.coordinator.data["is_mining"] = False self.async_write_ha_state() @callback