Skip to content

Commit

Permalink
Fix bad conditions.
Browse files Browse the repository at this point in the history
  • Loading branch information
lnx85 committed May 3, 2024
1 parent a628472 commit 1319f54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions custom_components/delios/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ async def async_setup_entry(
"""Add binary sensors for passed config_entry in HA."""
inverter = inverter_from_data(config_entry.data)
hass.data.setdefault(DOMAIN, {})
if not inverter.unique_id in hass.data[DOMAIN]:
if inverter.unique_id not in hass.data[DOMAIN]:
hass.data[DOMAIN][inverter.unique_id] = {}
if not BINARY_SENSOR_DOMAIN in hass.data[DOMAIN][inverter.unique_id]:
if BINARY_SENSOR_DOMAIN not in hass.data[DOMAIN][inverter.unique_id]:
hass.data[DOMAIN][inverter.unique_id][BINARY_SENSOR_DOMAIN] = {}
sensors_coordinator = DeliosSensorsCoordinator(hass, inverter)
await sensors_coordinator.setup()
Expand Down
4 changes: 2 additions & 2 deletions custom_components/delios/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ async def async_setup_entry(
"""Add sensors for passed config_entry in HA."""
inverter = inverter_from_data(config_entry.data)
hass.data.setdefault(DOMAIN, {})
if not inverter.unique_id in hass.data[DOMAIN]:
if inverter.unique_id not in hass.data[DOMAIN]:
hass.data[DOMAIN][inverter.unique_id] = {}
if not SENSOR_DOMAIN in hass.data[DOMAIN][inverter.unique_id]:
if SENSOR_DOMAIN not in hass.data[DOMAIN][inverter.unique_id]:
hass.data[DOMAIN][inverter.unique_id][SENSOR_DOMAIN] = {}
sensors_coordinator = DeliosSensorsCoordinator(hass, inverter)
await sensors_coordinator.setup()
Expand Down

0 comments on commit 1319f54

Please sign in to comment.