From a2a691f232da063b93bada9941c7bf332769012a Mon Sep 17 00:00:00 2001 From: G Johansson Date: Wed, 25 May 2022 02:40:26 +0200 Subject: [PATCH] Improve Sensibo terminology (#72451) --- homeassistant/components/sensibo/number.py | 4 ++-- homeassistant/components/sensibo/select.py | 4 ++-- homeassistant/components/sensibo/sensor.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/sensibo/number.py b/homeassistant/components/sensibo/number.py index 69d9237da7a..fc18e28f1a3 100644 --- a/homeassistant/components/sensibo/number.py +++ b/homeassistant/components/sensibo/number.py @@ -29,7 +29,7 @@ class SensiboNumberEntityDescription( """Class describing Sensibo Number entities.""" -NUMBER_TYPES = ( +DEVICE_NUMBER_TYPES = ( SensiboNumberEntityDescription( key="calibration_temp", remote_key="temperature", @@ -65,7 +65,7 @@ async def async_setup_entry( async_add_entities( SensiboNumber(coordinator, device_id, description) for device_id, device_data in coordinator.data.parsed.items() - for description in NUMBER_TYPES + for description in DEVICE_NUMBER_TYPES ) diff --git a/homeassistant/components/sensibo/select.py b/homeassistant/components/sensibo/select.py index c442fbc1374..56b8fbac4fd 100644 --- a/homeassistant/components/sensibo/select.py +++ b/homeassistant/components/sensibo/select.py @@ -29,7 +29,7 @@ class SensiboSelectEntityDescription( """Class describing Sensibo Number entities.""" -SELECT_TYPES = ( +DEVICE_SELECT_TYPES = ( SensiboSelectEntityDescription( key="horizontalSwing", remote_key="horizontal_swing_mode", @@ -57,7 +57,7 @@ async def async_setup_entry( async_add_entities( SensiboSelect(coordinator, device_id, description) for device_id, device_data in coordinator.data.parsed.items() - for description in SELECT_TYPES + for description in DEVICE_SELECT_TYPES if description.key in device_data.full_features ) diff --git a/homeassistant/components/sensibo/sensor.py b/homeassistant/components/sensibo/sensor.py index 307cfac6003..7ac871a61eb 100644 --- a/homeassistant/components/sensibo/sensor.py +++ b/homeassistant/components/sensibo/sensor.py @@ -99,7 +99,7 @@ MOTION_SENSOR_TYPES: tuple[SensiboMotionSensorEntityDescription, ...] = ( value_fn=lambda data: data.temperature, ), ) -DEVICE_SENSOR_TYPES: tuple[SensiboDeviceSensorEntityDescription, ...] = ( +PURE_SENSOR_TYPES: tuple[SensiboDeviceSensorEntityDescription, ...] = ( SensiboDeviceSensorEntityDescription( key="pm25", device_class=SensorDeviceClass.PM25, @@ -137,8 +137,8 @@ async def async_setup_entry( entities.extend( SensiboDeviceSensor(coordinator, device_id, description) for device_id, device_data in coordinator.data.parsed.items() - for description in DEVICE_SENSOR_TYPES - if getattr(device_data, description.key) is not None + for description in PURE_SENSOR_TYPES + if device_data.model == "pure" ) async_add_entities(entities)