File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -119,13 +119,13 @@ def is_on(self):
119119
120120 This is the magic part of this sensor along with the async_added_to_hass method below.
121121 The async_added_to_hass method adds a listener to the coordinator so when the event is started or stopped
122- it calls the async_write_ha_state function. async_write_ha_state gets the current value from this is_on method.
122+ it calls the schedule_update_ha_state function. schedule_update_ha_state gets the current value from this is_on method.
123123 """
124124 return self ._coordinator .get_event_timestamp (self ._event_name ) > 0
125125
126126 async def async_added_to_hass (self ):
127127 """Connect to dispatcher listening for entity data notifications."""
128- self ._coordinator .add_dahua_event_listener (self ._event_name , self .async_write_ha_state )
128+ self ._coordinator .add_dahua_event_listener (self ._event_name , self .schedule_update_ha_state )
129129
130130 @property
131131 def should_poll (self ) -> bool :
You can’t perform that action at this time.
0 commit comments