Skip to content

Commit

Permalink
Fix failed switch setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mletenay committed May 6, 2024
1 parent bf511e9 commit a879387
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion custom_components/goodwe/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async def async_setup_entry(
OPERATION_MODE,
inverter,
[v for k, v in _MODE_TO_OPTION.items() if k in supported_modes],
_MODE_TO_OPTION[active_mode],
_MODE_TO_OPTION.get(active_mode),
current_eco_power,
current_eco_soc,
)
Expand Down
13 changes: 7 additions & 6 deletions custom_components/goodwe/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ async def async_setup_entry(
# Inverter model does not support this feature
_LOGGER.debug("Could not read %s value", description.setting)
else:
entity = InverterSwitchEntity(
device_info,
description,
inverter,
current_state == 1,
entities.append(
InverterSwitchEntity(
device_info,
description,
inverter,
current_state == 1,
)
)
entities.append(entity)

async_add_entities(entities)

Expand Down

0 comments on commit a879387

Please sign in to comment.