Add support for refreshing synology_dsm sensors (#35141)
* Add support for refreshing synology_dsm sensors Now supports `home_assistant.update_entity` service * Don't immediately update sensors on add This fixes all sensors being forcefully refreshed when setup.pull/35159/head
parent
e7b9cecec9
commit
42750088b9
|
@ -61,7 +61,7 @@ async def async_setup_entry(
|
|||
for sensor_type in STORAGE_DISK_SENSORS
|
||||
]
|
||||
|
||||
async_add_entities(sensors, True)
|
||||
async_add_entities(sensors)
|
||||
|
||||
|
||||
class SynoNasSensor(Entity):
|
||||
|
@ -132,6 +132,10 @@ class SynoNasSensor(Entity):
|
|||
"""No polling needed."""
|
||||
return False
|
||||
|
||||
async def async_update(self):
|
||||
"""Only used by the generic entity update service."""
|
||||
await self._api.update()
|
||||
|
||||
async def async_added_to_hass(self):
|
||||
"""Register state update callback."""
|
||||
self._unsub_dispatcher = async_dispatcher_connect(
|
||||
|
|
Loading…
Reference in New Issue