Skip to content

Commit

Permalink
fix: relay
Browse files Browse the repository at this point in the history
  • Loading branch information
acesyde committed Feb 16, 2024
1 parent 16f0cb6 commit 73c2b7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/mylight_systems/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MyLightSystemsCoordinatorData(NamedTuple):
msb_discharge: Measure
green_energy: Measure
battery_state: Measure
master_relay_state: str
master_relay_state: str | None


# https://developers.home-assistant.io/docs/integration_fetching_data#coordinated-single-api-poll-for-data-for-all-entities
Expand Down
2 changes: 1 addition & 1 deletion custom_components/mylight_systems/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry, async_add_e

switches: list[MyLightSystemsSwitchEntityDescription] = []

if entry.data[CONF_MASTER_RELAY_ID] is not None:
if entry.data.get(CONF_MASTER_RELAY_ID, None) is not None:
switches.append(master_relay_switch)

async_add_entities(
Expand Down

0 comments on commit 73c2b7e

Please sign in to comment.