diff --git a/custom_components/rs_wfirex4/__init__.py b/custom_components/rs_wfirex4/__init__.py index 75d981a..1fdcdc3 100644 --- a/custom_components/rs_wfirex4/__init__.py +++ b/custom_components/rs_wfirex4/__init__.py @@ -47,6 +47,6 @@ async def async_setup(hass, configs): else: config['uid'] = format_mac(config.get(CONF_MAC)) for component in PLATFORMS: - await hass.helpers.discovery.async_load_platform(component, DOMAIN, config, configs) + hass.async_create_task(discovery.async_load_platform(hass, component, DOMAIN, config, configs)) return True diff --git a/custom_components/rs_wfirex4/manifest.json b/custom_components/rs_wfirex4/manifest.json index 8a084fd..aae8e5d 100644 --- a/custom_components/rs_wfirex4/manifest.json +++ b/custom_components/rs_wfirex4/manifest.json @@ -5,6 +5,6 @@ "dependencies": [], "codeowners": ["@nao-pon"], "requirements": [], - "version": "2022.2.0", + "version": "2022.2.1", "iot_class": "local_polling" } diff --git a/custom_components/rs_wfirex4/remote.py b/custom_components/rs_wfirex4/remote.py index fd35db1..0807be0 100644 --- a/custom_components/rs_wfirex4/remote.py +++ b/custom_components/rs_wfirex4/remote.py @@ -60,12 +60,15 @@ async def async_setup_platform(hass, configs, async_add_entities, config=None): """Set up the RS-WFIREX4 remote.""" if config == None: - return False + return host = config.get(CONF_HOST) name = config.get(CONF_NAME) uid = config.get('uid') + if host == None or name == None or uid == None: + return + remote = Wfirex4Remote(name, host, uid, Store(hass, CODE_STORAGE_VERSION, f"rs_wfirex4_codes"), Store(hass, FLAG_STORAGE_VERSION, f"rs_wfirex4_{uid}_flags"), diff --git a/custom_components/rs_wfirex4/sensor.py b/custom_components/rs_wfirex4/sensor.py index 85f1dfc..bf153b5 100644 --- a/custom_components/rs_wfirex4/sensor.py +++ b/custom_components/rs_wfirex4/sensor.py @@ -43,12 +43,15 @@ async def async_setup_platform(hass, configs, async_add_entities, config=None): """Representation of a RS-WFIREX4 sensors.""" if config == None: - return False + return host = config.get(CONF_HOST) name = config.get(CONF_NAME) uid = config.get('uid') + if host == None or name == None or uid == None: + return + entities = [] for sensor_type in SENSOR_TYPES.keys(): entities.append(Wfirex4SensorEntity(name, sensor_type, uid))