Skip to content

Commit

Permalink
trigger update also when we are running in poll mode (makes updates f…
Browse files Browse the repository at this point in the history
…aster)
  • Loading branch information
gluap committed Jul 22, 2022
1 parent fd5dc82 commit c9f2aeb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions custom_components/duofern/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,10 @@ def update_callback(id, key, value):
if id is not None:
try:
device = hass.data[DOMAIN]['devices'][id] # Get device by id
if not device.should_poll: # Only trigger update if this entity is not polling
try:
device.schedule_update_ha_state(True) # Trigger update on the updated entity
except AssertionError:
_LOGGER.info("Update callback called before HA is ready") # Trying to update before HA is ready
try:
device.schedule_update_ha_state(True) # Trigger update on the updated entity
except AssertionError:
_LOGGER.info("Update callback called before HA is ready") # Trying to update before HA is ready
except KeyError:
_LOGGER.info("Update callback called on unknown device id") # Ignore invalid device ids

Expand Down
2 changes: 1 addition & 1 deletion custom_components/duofern/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"issue_tracker": "https://github.com/gluap/pyduofern-hacs/issues" ,
"codeowners": ["@gluap"],
"requirements": ["pyduofern==0.34.1"],
"version": "0.3.1"
"version": "0.3.2"
}

0 comments on commit c9f2aeb

Please sign in to comment.