Skip to content

Commit

Permalink
Version 2022.2.1
Browse files Browse the repository at this point in the history
Do not block other processing when setting up this component.
  • Loading branch information
nao-pon committed Feb 11, 2022
1 parent ce22d0f commit ec332c6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion custom_components/rs_wfirex4/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion custom_components/rs_wfirex4/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"dependencies": [],
"codeowners": ["@nao-pon"],
"requirements": [],
"version": "2022.2.0",
"version": "2022.2.1",
"iot_class": "local_polling"
}
5 changes: 4 additions & 1 deletion custom_components/rs_wfirex4/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
5 changes: 4 additions & 1 deletion custom_components/rs_wfirex4/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit ec332c6

Please sign in to comment.