From 005d5acf4e31d0f924bb0cca41a2c85380697869 Mon Sep 17 00:00:00 2001 From: mrfrostfire Date: Wed, 6 Apr 2022 09:27:16 +0200 Subject: [PATCH] pr fix --- custom_components/zaptec/switch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/zaptec/switch.py b/custom_components/zaptec/switch.py index 458d4b1..2e04087 100644 --- a/custom_components/zaptec/switch.py +++ b/custom_components/zaptec/switch.py @@ -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