Skip to content

Commit

Permalink
Fixed control placed in wrong method
Browse files Browse the repository at this point in the history
  • Loading branch information
anotherjulien committed Sep 3, 2021
1 parent fd9961f commit 71be4ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/myhome/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
)

async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
if PLATFORM not in hass.data[DOMAIN][CONF]: return True

hass.data[DOMAIN][CONF][PLATFORM] = {}
_configured_switches = config.get(CONF_DEVICES)

Expand All @@ -65,6 +63,8 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
hass.data[DOMAIN][CONF][PLATFORM][where] = {CONF_NAME: name, CONF_DEVICE_CLASS: device_class, CONF_MANUFACTURER: manufacturer, CONF_DEVICE_MODEL: model}

async def async_setup_entry(hass, config_entry, async_add_entities):
if PLATFORM not in hass.data[DOMAIN][CONF]: return True

_switches = []
_configured_switches = hass.data[DOMAIN][CONF][PLATFORM]

Expand Down

0 comments on commit 71be4ca

Please sign in to comment.