Skip to content

Commit

Permalink
Include all enphase_envoy devices in async_remove_config_entry_device (
Browse files Browse the repository at this point in the history
…#124533)

* Include all enphase_envoy devices in async_remove_config_entry_device

* refactor if tests
  • Loading branch information
catsmanac authored Sep 8, 2024
1 parent d3badb8 commit 2ef1c96
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions homeassistant/components/enphase_envoy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,16 @@ async def async_remove_config_entry_device(
envoy_serial_num = config_entry.unique_id
if envoy_serial_num in dev_ids:
return False
if envoy_data and envoy_data.inverters:
for inverter in envoy_data.inverters:
if str(inverter) in dev_ids:
if envoy_data:
if envoy_data.inverters:
for inverter in envoy_data.inverters:
if str(inverter) in dev_ids:
return False
if envoy_data.encharge_inventory:
for encharge in envoy_data.encharge_inventory:
if str(encharge) in dev_ids:
return False
if envoy_data.enpower:
if str(envoy_data.enpower.serial_number) in dev_ids:
return False
return True

0 comments on commit 2ef1c96

Please sign in to comment.