Improve Sensibo terminology (#72451)

pull/72467/head
G Johansson 2022-05-25 02:40:26 +02:00 committed by GitHub
parent 301341a49f
commit a2a691f232
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -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
)

View File

@ -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
)

View File

@ -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)