Skip to content

Commit

Permalink
fix: set extra state during each save
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Luckey committed Nov 30, 2024
1 parent c518567 commit 912616b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions custom_components/somfy_cul/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,17 @@ def _set_state(self, state):
self._attr_current_cover_position = state.get(
ATTR_CURRENT_POS, self._attr_current_cover_position
)
self._attr_extra_state_attributes = {
"enc_key": self._enc_key,
"rolling_code": self._rolling_code,
}
self.schedule_update_ha_state(force_refresh=True)

def _async_save_state(self):
self._attr_extra_state_attributes = {
"enc_key": self._enc_key,
"rolling_code": self._rolling_code,
}
self.schedule_update_ha_state()
self.hass.loop.call_soon_threadsafe(self._async_save_state_task)

Expand Down

0 comments on commit 912616b

Please sign in to comment.