Skip to content

Commit

Permalink
Add async_added_to_hass method to request update at startup so as to …
Browse files Browse the repository at this point in the history
…avoid waiting for scan interval
  • Loading branch information
robert-alfaro committed Aug 24, 2024
1 parent eb35e12 commit a47cfa4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/poolmath/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ def __init__(self, hass, entry, name, poolmath_client, async_add_entities_callba

self._async_add_entities_callback = async_add_entities_callback

async def async_added_to_hass(self):
"""Request an update to bypass scan_interval at startup."""
self.async_schedule_update_ha_state(True)

@property
def name(self):
"""Return the name of the sensor."""
Expand Down

0 comments on commit a47cfa4

Please sign in to comment.