Add entity translations to Sensibo (#96091)

This commit is contained in:
Joost Lekkerkerker 2023-07-08 16:50:46 +02:00 committed by GitHub
parent de211de598
commit 598610e313
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 130 additions and 55 deletions

View File

@ -54,8 +54,8 @@ class SensiboDeviceBinarySensorEntityDescription(
FILTER_CLEAN_REQUIRED_DESCRIPTION = SensiboDeviceBinarySensorEntityDescription( FILTER_CLEAN_REQUIRED_DESCRIPTION = SensiboDeviceBinarySensorEntityDescription(
key="filter_clean", key="filter_clean",
translation_key="filter_clean",
device_class=BinarySensorDeviceClass.PROBLEM, device_class=BinarySensorDeviceClass.PROBLEM,
name="Filter clean required",
value_fn=lambda data: data.filter_clean, value_fn=lambda data: data.filter_clean,
) )
@ -64,20 +64,18 @@ MOTION_SENSOR_TYPES: tuple[SensiboMotionBinarySensorEntityDescription, ...] = (
key="alive", key="alive",
device_class=BinarySensorDeviceClass.CONNECTIVITY, device_class=BinarySensorDeviceClass.CONNECTIVITY,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
name="Alive",
value_fn=lambda data: data.alive, value_fn=lambda data: data.alive,
), ),
SensiboMotionBinarySensorEntityDescription( SensiboMotionBinarySensorEntityDescription(
key="is_main_sensor", key="is_main_sensor",
translation_key="is_main_sensor",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
name="Main sensor",
icon="mdi:connection", icon="mdi:connection",
value_fn=lambda data: data.is_main_sensor, value_fn=lambda data: data.is_main_sensor,
), ),
SensiboMotionBinarySensorEntityDescription( SensiboMotionBinarySensorEntityDescription(
key="motion", key="motion",
device_class=BinarySensorDeviceClass.MOTION, device_class=BinarySensorDeviceClass.MOTION,
name="Motion",
icon="mdi:motion-sensor", icon="mdi:motion-sensor",
value_fn=lambda data: data.motion, value_fn=lambda data: data.motion,
), ),
@ -86,8 +84,8 @@ MOTION_SENSOR_TYPES: tuple[SensiboMotionBinarySensorEntityDescription, ...] = (
MOTION_DEVICE_SENSOR_TYPES: tuple[SensiboDeviceBinarySensorEntityDescription, ...] = ( MOTION_DEVICE_SENSOR_TYPES: tuple[SensiboDeviceBinarySensorEntityDescription, ...] = (
SensiboDeviceBinarySensorEntityDescription( SensiboDeviceBinarySensorEntityDescription(
key="room_occupied", key="room_occupied",
translation_key="room_occupied",
device_class=BinarySensorDeviceClass.MOTION, device_class=BinarySensorDeviceClass.MOTION,
name="Room occupied",
icon="mdi:motion-sensor", icon="mdi:motion-sensor",
value_fn=lambda data: data.room_occupied, value_fn=lambda data: data.room_occupied,
), ),
@ -100,30 +98,30 @@ DEVICE_SENSOR_TYPES: tuple[SensiboDeviceBinarySensorEntityDescription, ...] = (
PURE_SENSOR_TYPES: tuple[SensiboDeviceBinarySensorEntityDescription, ...] = ( PURE_SENSOR_TYPES: tuple[SensiboDeviceBinarySensorEntityDescription, ...] = (
SensiboDeviceBinarySensorEntityDescription( SensiboDeviceBinarySensorEntityDescription(
key="pure_ac_integration", key="pure_ac_integration",
translation_key="pure_ac_integration",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
device_class=BinarySensorDeviceClass.CONNECTIVITY, device_class=BinarySensorDeviceClass.CONNECTIVITY,
name="Pure Boost linked with AC",
value_fn=lambda data: data.pure_ac_integration, value_fn=lambda data: data.pure_ac_integration,
), ),
SensiboDeviceBinarySensorEntityDescription( SensiboDeviceBinarySensorEntityDescription(
key="pure_geo_integration", key="pure_geo_integration",
translation_key="pure_geo_integration",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
device_class=BinarySensorDeviceClass.CONNECTIVITY, device_class=BinarySensorDeviceClass.CONNECTIVITY,
name="Pure Boost linked with presence",
value_fn=lambda data: data.pure_geo_integration, value_fn=lambda data: data.pure_geo_integration,
), ),
SensiboDeviceBinarySensorEntityDescription( SensiboDeviceBinarySensorEntityDescription(
key="pure_measure_integration", key="pure_measure_integration",
translation_key="pure_measure_integration",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
device_class=BinarySensorDeviceClass.CONNECTIVITY, device_class=BinarySensorDeviceClass.CONNECTIVITY,
name="Pure Boost linked with indoor air quality",
value_fn=lambda data: data.pure_measure_integration, value_fn=lambda data: data.pure_measure_integration,
), ),
SensiboDeviceBinarySensorEntityDescription( SensiboDeviceBinarySensorEntityDescription(
key="pure_prime_integration", key="pure_prime_integration",
translation_key="pure_prime_integration",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
device_class=BinarySensorDeviceClass.CONNECTIVITY, device_class=BinarySensorDeviceClass.CONNECTIVITY,
name="Pure Boost linked with outdoor air quality",
value_fn=lambda data: data.pure_prime_integration, value_fn=lambda data: data.pure_prime_integration,
), ),
FILTER_CLEAN_REQUIRED_DESCRIPTION, FILTER_CLEAN_REQUIRED_DESCRIPTION,

View File

@ -33,7 +33,7 @@ class SensiboButtonEntityDescription(
DEVICE_BUTTON_TYPES = SensiboButtonEntityDescription( DEVICE_BUTTON_TYPES = SensiboButtonEntityDescription(
key="reset_filter", key="reset_filter",
name="Reset filter", translation_key="reset_filter",
icon="mdi:air-filter", icon="mdi:air-filter",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
data_key="filter_clean", data_key="filter_clean",

View File

@ -49,6 +49,8 @@ def async_handle_api_call(
class SensiboBaseEntity(CoordinatorEntity[SensiboDataUpdateCoordinator]): class SensiboBaseEntity(CoordinatorEntity[SensiboDataUpdateCoordinator]):
"""Representation of a Sensibo Base Entity.""" """Representation of a Sensibo Base Entity."""
_attr_has_entity_name = True
def __init__( def __init__(
self, self,
coordinator: SensiboDataUpdateCoordinator, coordinator: SensiboDataUpdateCoordinator,
@ -68,8 +70,6 @@ class SensiboBaseEntity(CoordinatorEntity[SensiboDataUpdateCoordinator]):
class SensiboDeviceBaseEntity(SensiboBaseEntity): class SensiboDeviceBaseEntity(SensiboBaseEntity):
"""Representation of a Sensibo Device.""" """Representation of a Sensibo Device."""
_attr_has_entity_name = True
def __init__( def __init__(
self, self,
coordinator: SensiboDataUpdateCoordinator, coordinator: SensiboDataUpdateCoordinator,
@ -93,8 +93,6 @@ class SensiboDeviceBaseEntity(SensiboBaseEntity):
class SensiboMotionBaseEntity(SensiboBaseEntity): class SensiboMotionBaseEntity(SensiboBaseEntity):
"""Representation of a Sensibo Motion Entity.""" """Representation of a Sensibo Motion Entity."""
_attr_has_entity_name = True
def __init__( def __init__(
self, self,
coordinator: SensiboDataUpdateCoordinator, coordinator: SensiboDataUpdateCoordinator,

View File

@ -38,8 +38,8 @@ class SensiboNumberEntityDescription(
DEVICE_NUMBER_TYPES = ( DEVICE_NUMBER_TYPES = (
SensiboNumberEntityDescription( SensiboNumberEntityDescription(
key="calibration_temp", key="calibration_temp",
translation_key="calibration_temperature",
remote_key="temperature", remote_key="temperature",
name="Temperature calibration",
icon="mdi:thermometer", icon="mdi:thermometer",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
@ -50,8 +50,8 @@ DEVICE_NUMBER_TYPES = (
), ),
SensiboNumberEntityDescription( SensiboNumberEntityDescription(
key="calibration_hum", key="calibration_hum",
translation_key="calibration_humidity",
remote_key="humidity", remote_key="humidity",
name="Humidity calibration",
icon="mdi:water", icon="mdi:water",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,

View File

@ -41,7 +41,6 @@ DEVICE_SELECT_TYPES = (
SensiboSelectEntityDescription( SensiboSelectEntityDescription(
key="horizontalSwing", key="horizontalSwing",
data_key="horizontal_swing_mode", data_key="horizontal_swing_mode",
name="Horizontal swing",
icon="mdi:air-conditioner", icon="mdi:air-conditioner",
value_fn=lambda data: data.horizontal_swing_mode, value_fn=lambda data: data.horizontal_swing_mode,
options_fn=lambda data: data.horizontal_swing_modes, options_fn=lambda data: data.horizontal_swing_modes,
@ -51,7 +50,6 @@ DEVICE_SELECT_TYPES = (
SensiboSelectEntityDescription( SensiboSelectEntityDescription(
key="light", key="light",
data_key="light_mode", data_key="light_mode",
name="Light",
icon="mdi:flashlight", icon="mdi:flashlight",
value_fn=lambda data: data.light_mode, value_fn=lambda data: data.light_mode,
options_fn=lambda data: data.light_modes, options_fn=lambda data: data.light_modes,

View File

@ -67,8 +67,8 @@ class SensiboDeviceSensorEntityDescription(
FILTER_LAST_RESET_DESCRIPTION = SensiboDeviceSensorEntityDescription( FILTER_LAST_RESET_DESCRIPTION = SensiboDeviceSensorEntityDescription(
key="filter_last_reset", key="filter_last_reset",
translation_key="filter_last_reset",
device_class=SensorDeviceClass.TIMESTAMP, device_class=SensorDeviceClass.TIMESTAMP,
name="Filter last reset",
icon="mdi:timer", icon="mdi:timer",
value_fn=lambda data: data.filter_last_reset, value_fn=lambda data: data.filter_last_reset,
extra_fn=None, extra_fn=None,
@ -77,22 +77,22 @@ FILTER_LAST_RESET_DESCRIPTION = SensiboDeviceSensorEntityDescription(
MOTION_SENSOR_TYPES: tuple[SensiboMotionSensorEntityDescription, ...] = ( MOTION_SENSOR_TYPES: tuple[SensiboMotionSensorEntityDescription, ...] = (
SensiboMotionSensorEntityDescription( SensiboMotionSensorEntityDescription(
key="rssi", key="rssi",
translation_key="rssi",
device_class=SensorDeviceClass.SIGNAL_STRENGTH, device_class=SensorDeviceClass.SIGNAL_STRENGTH,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS_MILLIWATT, native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
name="rssi",
icon="mdi:wifi", icon="mdi:wifi",
value_fn=lambda data: data.rssi, value_fn=lambda data: data.rssi,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
), ),
SensiboMotionSensorEntityDescription( SensiboMotionSensorEntityDescription(
key="battery_voltage", key="battery_voltage",
translation_key="battery_voltage",
device_class=SensorDeviceClass.VOLTAGE, device_class=SensorDeviceClass.VOLTAGE,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfElectricPotential.VOLT, native_unit_of_measurement=UnitOfElectricPotential.VOLT,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
name="Battery voltage",
icon="mdi:battery", icon="mdi:battery",
value_fn=lambda data: data.battery_voltage, value_fn=lambda data: data.battery_voltage,
), ),
@ -101,7 +101,6 @@ MOTION_SENSOR_TYPES: tuple[SensiboMotionSensorEntityDescription, ...] = (
device_class=SensorDeviceClass.HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
name="Humidity",
icon="mdi:water", icon="mdi:water",
value_fn=lambda data: data.humidity, value_fn=lambda data: data.humidity,
), ),
@ -109,7 +108,6 @@ MOTION_SENSOR_TYPES: tuple[SensiboMotionSensorEntityDescription, ...] = (
key="temperature", key="temperature",
device_class=SensorDeviceClass.TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
name="Temperature",
icon="mdi:thermometer", icon="mdi:thermometer",
value_fn=lambda data: data.temperature, value_fn=lambda data: data.temperature,
), ),
@ -120,18 +118,16 @@ PURE_SENSOR_TYPES: tuple[SensiboDeviceSensorEntityDescription, ...] = (
device_class=SensorDeviceClass.PM25, device_class=SensorDeviceClass.PM25,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
name="PM2.5",
icon="mdi:air-filter", icon="mdi:air-filter",
value_fn=lambda data: data.pm25, value_fn=lambda data: data.pm25,
extra_fn=None, extra_fn=None,
), ),
SensiboDeviceSensorEntityDescription( SensiboDeviceSensorEntityDescription(
key="pure_sensitivity", key="pure_sensitivity",
name="Pure sensitivity", translation_key="sensitivity",
icon="mdi:air-filter", icon="mdi:air-filter",
value_fn=lambda data: data.pure_sensitivity, value_fn=lambda data: data.pure_sensitivity,
extra_fn=None, extra_fn=None,
translation_key="sensitivity",
), ),
FILTER_LAST_RESET_DESCRIPTION, FILTER_LAST_RESET_DESCRIPTION,
) )
@ -139,35 +135,35 @@ PURE_SENSOR_TYPES: tuple[SensiboDeviceSensorEntityDescription, ...] = (
DEVICE_SENSOR_TYPES: tuple[SensiboDeviceSensorEntityDescription, ...] = ( DEVICE_SENSOR_TYPES: tuple[SensiboDeviceSensorEntityDescription, ...] = (
SensiboDeviceSensorEntityDescription( SensiboDeviceSensorEntityDescription(
key="timer_time", key="timer_time",
translation_key="timer_time",
device_class=SensorDeviceClass.TIMESTAMP, device_class=SensorDeviceClass.TIMESTAMP,
name="Timer end time",
icon="mdi:timer", icon="mdi:timer",
value_fn=lambda data: data.timer_time, value_fn=lambda data: data.timer_time,
extra_fn=lambda data: {"id": data.timer_id, "turn_on": data.timer_state_on}, extra_fn=lambda data: {"id": data.timer_id, "turn_on": data.timer_state_on},
), ),
SensiboDeviceSensorEntityDescription( SensiboDeviceSensorEntityDescription(
key="feels_like", key="feels_like",
translation_key="feels_like",
device_class=SensorDeviceClass.TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
name="Temperature feels like",
value_fn=lambda data: data.feelslike, value_fn=lambda data: data.feelslike,
extra_fn=None, extra_fn=None,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
), ),
SensiboDeviceSensorEntityDescription( SensiboDeviceSensorEntityDescription(
key="climate_react_low", key="climate_react_low",
translation_key="climate_react_low",
device_class=SensorDeviceClass.TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
name="Climate React low temperature threshold",
value_fn=lambda data: data.smart_low_temp_threshold, value_fn=lambda data: data.smart_low_temp_threshold,
extra_fn=lambda data: data.smart_low_state, extra_fn=lambda data: data.smart_low_state,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
), ),
SensiboDeviceSensorEntityDescription( SensiboDeviceSensorEntityDescription(
key="climate_react_high", key="climate_react_high",
translation_key="climate_react_high",
device_class=SensorDeviceClass.TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
name="Climate React high temperature threshold",
value_fn=lambda data: data.smart_high_temp_threshold, value_fn=lambda data: data.smart_high_temp_threshold,
extra_fn=lambda data: data.smart_high_state, extra_fn=lambda data: data.smart_high_state,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
@ -175,7 +171,6 @@ DEVICE_SENSOR_TYPES: tuple[SensiboDeviceSensorEntityDescription, ...] = (
SensiboDeviceSensorEntityDescription( SensiboDeviceSensorEntityDescription(
key="climate_react_type", key="climate_react_type",
translation_key="smart_type", translation_key="smart_type",
name="Climate React type",
value_fn=lambda data: data.smart_type, value_fn=lambda data: data.smart_type,
extra_fn=None, extra_fn=None,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
@ -186,19 +181,19 @@ DEVICE_SENSOR_TYPES: tuple[SensiboDeviceSensorEntityDescription, ...] = (
AIRQ_SENSOR_TYPES: tuple[SensiboDeviceSensorEntityDescription, ...] = ( AIRQ_SENSOR_TYPES: tuple[SensiboDeviceSensorEntityDescription, ...] = (
SensiboDeviceSensorEntityDescription( SensiboDeviceSensorEntityDescription(
key="airq_tvoc", key="airq_tvoc",
translation_key="airq_tvoc",
native_unit_of_measurement=CONCENTRATION_PARTS_PER_BILLION, native_unit_of_measurement=CONCENTRATION_PARTS_PER_BILLION,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
icon="mdi:air-filter", icon="mdi:air-filter",
name="AirQ TVOC",
value_fn=lambda data: data.tvoc, value_fn=lambda data: data.tvoc,
extra_fn=None, extra_fn=None,
), ),
SensiboDeviceSensorEntityDescription( SensiboDeviceSensorEntityDescription(
key="airq_co2", key="airq_co2",
translation_key="airq_co2",
device_class=SensorDeviceClass.CO2, device_class=SensorDeviceClass.CO2,
native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
name="AirQ CO2",
value_fn=lambda data: data.co2, value_fn=lambda data: data.co2,
extra_fn=None, extra_fn=None,
), ),
@ -210,15 +205,14 @@ ELEMENT_SENSOR_TYPES: tuple[SensiboDeviceSensorEntityDescription, ...] = (
device_class=SensorDeviceClass.PM25, device_class=SensorDeviceClass.PM25,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
name="PM 2.5",
value_fn=lambda data: data.pm25, value_fn=lambda data: data.pm25,
extra_fn=None, extra_fn=None,
), ),
SensiboDeviceSensorEntityDescription( SensiboDeviceSensorEntityDescription(
key="tvoc", key="tvoc",
translation_key="tvoc",
native_unit_of_measurement=CONCENTRATION_PARTS_PER_BILLION, native_unit_of_measurement=CONCENTRATION_PARTS_PER_BILLION,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
name="TVOC",
value_fn=lambda data: data.tvoc, value_fn=lambda data: data.tvoc,
extra_fn=None, extra_fn=None,
), ),
@ -227,7 +221,6 @@ ELEMENT_SENSOR_TYPES: tuple[SensiboDeviceSensorEntityDescription, ...] = (
device_class=SensorDeviceClass.CO2, device_class=SensorDeviceClass.CO2,
native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
name="CO2",
value_fn=lambda data: data.co2, value_fn=lambda data: data.co2,
extra_fn=None, extra_fn=None,
), ),
@ -243,7 +236,6 @@ ELEMENT_SENSOR_TYPES: tuple[SensiboDeviceSensorEntityDescription, ...] = (
key="iaq", key="iaq",
device_class=SensorDeviceClass.AQI, device_class=SensorDeviceClass.AQI,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
name="Air quality",
value_fn=lambda data: data.iaq, value_fn=lambda data: data.iaq,
extra_fn=None, extra_fn=None,
), ),

View File

@ -31,23 +31,45 @@
} }
}, },
"entity": { "entity": {
"sensor": { "binary_sensor": {
"sensitivity": { "filter_clean": {
"state": { "name": "Filter clean required"
"n": "Normal", },
"s": "Sensitive" "is_main_sensor": {
"name": "Main sensor"
},
"room_occupied": {
"name": "Room occupied"
},
"pure_ac_integration": {
"name": "Pure Boost linked with AC"
},
"pure_geo_integration": {
"name": "Pure Boost linked with presence"
},
"pure_measure_integration": {
"name": "Pure Boost linked with indoor air quality"
},
"pure_prime_integration": {
"name": "Pure Boost linked with outdoor air quality"
} }
}, },
"smart_type": { "button": {
"state": { "reset_filter": {
"temperature": "Temperature", "name": "Reset filter"
"feelslike": "Feels like",
"humidity": "Humidity"
} }
},
"number": {
"calibration_temperature": {
"name": "Temperature calibration"
},
"calibration_humidity": {
"name": "Humidity calibration"
} }
}, },
"select": { "select": {
"horizontalswing": { "horizontalswing": {
"name": "Horizontal swing",
"state": { "state": {
"stopped": "Stopped", "stopped": "Stopped",
"fixedleft": "Fixed left", "fixedleft": "Fixed left",
@ -61,12 +83,79 @@
} }
}, },
"light": { "light": {
"name": "Light",
"state": { "state": {
"on": "[%key:common::state::on%]", "on": "[%key:common::state::on%]",
"dim": "Dim", "dim": "Dim",
"off": "[%key:common::state::off%]" "off": "[%key:common::state::off%]"
} }
} }
},
"sensor": {
"filter_last_reset": {
"name": "Filter last reset"
},
"rssi": {
"name": "RSSI"
},
"battery_voltage": {
"name": "Battery voltage"
},
"sensitivity": {
"name": "Pure sensitivity",
"state": {
"n": "Normal",
"s": "Sensitive"
}
},
"timer_time": {
"name": "Timer end time"
},
"feels_like": {
"name": "Temperature feels like"
},
"climate_react_low": {
"name": "Climate React low temperature threshold"
},
"climate_react_high": {
"name": "Climate React high temperature threshold"
},
"smart_type": {
"name": "Climate React type",
"state": {
"temperature": "Temperature",
"feelslike": "Feels like",
"humidity": "Humidity"
}
},
"airq_tvoc": {
"name": "AirQ TVOC"
},
"airq_co2": {
"name": "AirQ CO2"
},
"tvoc": {
"name": "TVOC"
},
"ethanol": {
"name": "Ethanol"
}
},
"switch": {
"timer_on_switch": {
"name": "Timer"
},
"climate_react_switch": {
"name": "Climate React"
},
"pure_boost_switch": {
"name": "Pure Boost"
}
},
"update": {
"fw_ver_available": {
"name": "Update available"
}
} }
} }
} }

View File

@ -45,8 +45,8 @@ class SensiboDeviceSwitchEntityDescription(
DEVICE_SWITCH_TYPES: tuple[SensiboDeviceSwitchEntityDescription, ...] = ( DEVICE_SWITCH_TYPES: tuple[SensiboDeviceSwitchEntityDescription, ...] = (
SensiboDeviceSwitchEntityDescription( SensiboDeviceSwitchEntityDescription(
key="timer_on_switch", key="timer_on_switch",
translation_key="timer_on_switch",
device_class=SwitchDeviceClass.SWITCH, device_class=SwitchDeviceClass.SWITCH,
name="Timer",
icon="mdi:timer", icon="mdi:timer",
value_fn=lambda data: data.timer_on, value_fn=lambda data: data.timer_on,
extra_fn=lambda data: {"id": data.timer_id, "turn_on": data.timer_state_on}, extra_fn=lambda data: {"id": data.timer_id, "turn_on": data.timer_state_on},
@ -56,8 +56,8 @@ DEVICE_SWITCH_TYPES: tuple[SensiboDeviceSwitchEntityDescription, ...] = (
), ),
SensiboDeviceSwitchEntityDescription( SensiboDeviceSwitchEntityDescription(
key="climate_react_switch", key="climate_react_switch",
translation_key="climate_react_switch",
device_class=SwitchDeviceClass.SWITCH, device_class=SwitchDeviceClass.SWITCH,
name="Climate React",
icon="mdi:wizard-hat", icon="mdi:wizard-hat",
value_fn=lambda data: data.smart_on, value_fn=lambda data: data.smart_on,
extra_fn=lambda data: {"type": data.smart_type}, extra_fn=lambda data: {"type": data.smart_type},
@ -70,8 +70,8 @@ DEVICE_SWITCH_TYPES: tuple[SensiboDeviceSwitchEntityDescription, ...] = (
PURE_SWITCH_TYPES: tuple[SensiboDeviceSwitchEntityDescription, ...] = ( PURE_SWITCH_TYPES: tuple[SensiboDeviceSwitchEntityDescription, ...] = (
SensiboDeviceSwitchEntityDescription( SensiboDeviceSwitchEntityDescription(
key="pure_boost_switch", key="pure_boost_switch",
translation_key="pure_boost_switch",
device_class=SwitchDeviceClass.SWITCH, device_class=SwitchDeviceClass.SWITCH,
name="Pure Boost",
value_fn=lambda data: data.pure_boost_enabled, value_fn=lambda data: data.pure_boost_enabled,
extra_fn=None, extra_fn=None,
command_on="async_turn_on_off_pure_boost", command_on="async_turn_on_off_pure_boost",

View File

@ -41,9 +41,9 @@ class SensiboDeviceUpdateEntityDescription(
DEVICE_SENSOR_TYPES: tuple[SensiboDeviceUpdateEntityDescription, ...] = ( DEVICE_SENSOR_TYPES: tuple[SensiboDeviceUpdateEntityDescription, ...] = (
SensiboDeviceUpdateEntityDescription( SensiboDeviceUpdateEntityDescription(
key="fw_ver_available", key="fw_ver_available",
translation_key="fw_ver_available",
device_class=UpdateDeviceClass.FIRMWARE, device_class=UpdateDeviceClass.FIRMWARE,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
name="Update available",
icon="mdi:rocket-launch", icon="mdi:rocket-launch",
value_version=lambda data: data.fw_ver, value_version=lambda data: data.fw_ver,
value_available=lambda data: data.fw_ver_available, value_available=lambda data: data.fw_ver_available,

View File

@ -23,7 +23,7 @@ async def test_binary_sensor(
) -> None: ) -> None:
"""Test the Sensibo binary sensor.""" """Test the Sensibo binary sensor."""
state1 = hass.states.get("binary_sensor.hallway_motion_sensor_alive") state1 = hass.states.get("binary_sensor.hallway_motion_sensor_connectivity")
state2 = hass.states.get("binary_sensor.hallway_motion_sensor_main_sensor") state2 = hass.states.get("binary_sensor.hallway_motion_sensor_main_sensor")
state3 = hass.states.get("binary_sensor.hallway_motion_sensor_motion") state3 = hass.states.get("binary_sensor.hallway_motion_sensor_motion")
state4 = hass.states.get("binary_sensor.hallway_room_occupied") state4 = hass.states.get("binary_sensor.hallway_room_occupied")
@ -57,7 +57,7 @@ async def test_binary_sensor(
) )
await hass.async_block_till_done() await hass.async_block_till_done()
state1 = hass.states.get("binary_sensor.hallway_motion_sensor_alive") state1 = hass.states.get("binary_sensor.hallway_motion_sensor_connectivity")
state3 = hass.states.get("binary_sensor.hallway_motion_sensor_motion") state3 = hass.states.get("binary_sensor.hallway_motion_sensor_motion")
assert state1.state == "off" assert state1.state == "off"
assert state3.state == "off" assert state3.state == "off"