Skip to content

Commit

Permalink
pr fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfrostfire authored Apr 6, 2022
1 parent b408075 commit 005d5ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/zaptec/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async def async_setup_platform(
hass: HomeAssistantType, config: ConfigType, async_add_entities, discovery_info=None
) -> bool: # pylint: disable=unused-argument
"""Setup switch platform."""
acc = hass.data[DOMAIN]["api"]
acc = hass.data.get(DOMAIN, {}).get("api")
if acc is None:
_LOGGER.debug("Didn't setup switch the api wasnt ready")
return False
Expand Down

0 comments on commit 005d5ac

Please sign in to comment.