Skip to content

Commit

Permalink
Give OhmeChargeSchedulesCoordinator a kick to update
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-r authored Jan 3, 2024
1 parent 3deeccf commit 3638472
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/ohme/const.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Component constants"""
DOMAIN = "ohme"
USER_AGENT = "dan-r-homeassistant-ohme"
INTEGRATION_VERSION = "0.3.0"
INTEGRATION_VERSION = "0.3.1"

DATA_CLIENT = "client"
DATA_COORDINATORS = "coordinators"
Expand Down
9 changes: 9 additions & 0 deletions custom_components/ohme/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ def __init__(self, coordinator, coordinator_schedules, hass: HomeAssistant, clie

self._attr_device_info = client.get_device_info()

async def async_added_to_hass(self) -> None:
"""When entity is added to hass."""
await super().async_added_to_hass()
self.async_on_remove(
self.coordinator_schedules.async_add_listener(
self._handle_coordinator_update, None
)
)

@property
def unique_id(self):
"""The unique ID of the switch."""
Expand Down
9 changes: 9 additions & 0 deletions custom_components/ohme/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ def __init__(self, coordinator, coordinator_schedules, hass: HomeAssistant, clie
"number.{}", "ohme_target_time", hass=hass)

self._attr_device_info = client.get_device_info()

async def async_added_to_hass(self) -> None:
"""When entity is added to hass."""
await super().async_added_to_hass()
self.async_on_remove(
self.coordinator_schedules.async_add_listener(
self._handle_coordinator_update, None
)
)

@property
def unique_id(self):
Expand Down

0 comments on commit 3638472

Please sign in to comment.