Skip to content

Commit

Permalink
bugfix migrate_to_ramses_rf()
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdavb committed Aug 8, 2022
1 parent 1869f6e commit 3a42341
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/ramses_cc/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def migrate_to_ramses_rf(hass: HomeAssistant, domain: str, unique_id: str):

if entity_id := registry.async_get_entity_id(domain, OLD_PLATFORM, unique_id):

if hass.states.get(entity_id).state == STATE_UNAVAILABLE: # HACK
hass.states.get(entity_id).state = STATE_UNKNOWN
if (entity := hass.states.get(entity_id)) and entity.state == STATE_UNAVAILABLE:
hass.states.get(entity_id).state = STATE_UNKNOWN # HACK

try:
registry.async_update_entity_platform(entity_id, PLATFORM)
Expand Down

0 comments on commit 3a42341

Please sign in to comment.