Skip to content

Commit

Permalink
Fix pool filter connectivity sensor naming (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdpuk authored May 31, 2024
1 parent 978b541 commit 6c5bc75
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions custom_components/bestway/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,31 +65,38 @@ async def async_setup_entry(
entities: list[BestwayEntity] = []

for device_id, device in coordinator.api.devices.items():
# All devices support the connectivity sensor
entities.append(
DeviceConnectivitySensor(
coordinator,
config_entry,
device_id,
_SPA_CONNECTIVITY_SENSOR_DESCRIPTION,
)
)

if device.device_type in [
BestwayDeviceType.AIRJET_SPA,
BestwayDeviceType.AIRJET_V01_SPA,
BestwayDeviceType.HYDROJET_SPA,
BestwayDeviceType.HYDROJET_PRO_SPA,
]:
entities.append(
DeviceErrorsSensor(
coordinator, config_entry, device_id, _SPA_ERRORS_SENSOR_DESCRIPTION
)
entities.extend(
[
DeviceConnectivitySensor(
coordinator,
config_entry,
device_id,
_SPA_CONNECTIVITY_SENSOR_DESCRIPTION,
),
DeviceErrorsSensor(
coordinator,
config_entry,
device_id,
_SPA_ERRORS_SENSOR_DESCRIPTION,
),
]
)

if device.device_type == BestwayDeviceType.POOL_FILTER:
entities.extend(
[
DeviceConnectivitySensor(
coordinator,
config_entry,
device_id,
_POOL_FILTER_CONNECTIVITY_SENSOR_DESCRIPTION,
),
PoolFilterChangeRequiredSensor(
coordinator, config_entry, device_id
),
Expand Down

0 comments on commit 6c5bc75

Please sign in to comment.