diff --git a/homeassistant/components/zha/alarm_control_panel.py b/homeassistant/components/zha/alarm_control_panel.py index 21cacfa5dd4..bb7cfe67fb3 100644 --- a/homeassistant/components/zha/alarm_control_panel.py +++ b/homeassistant/components/zha/alarm_control_panel.py @@ -81,7 +81,7 @@ async def async_setup_entry( class ZHAAlarmControlPanel(ZhaEntity, AlarmControlPanelEntity): """Entity for ZHA alarm control devices.""" - _attr_name: str = "Alarm control panel" + _attr_translation_key: str = "alarm_control_panel" _attr_code_format = CodeFormat.TEXT _attr_supported_features = ( AlarmControlPanelEntityFeature.ARM_HOME diff --git a/homeassistant/components/zha/binary_sensor.py b/homeassistant/components/zha/binary_sensor.py index 9929b43a439..0118625293a 100644 --- a/homeassistant/components/zha/binary_sensor.py +++ b/homeassistant/components/zha/binary_sensor.py @@ -43,15 +43,6 @@ IAS_ZONE_CLASS_MAPPING = { IasZone.ZoneType.Vibration_Movement_Sensor: BinarySensorDeviceClass.VIBRATION, } -IAS_ZONE_NAME_MAPPING = { - IasZone.ZoneType.Motion_Sensor: "Motion", - IasZone.ZoneType.Contact_Switch: "Opening", - IasZone.ZoneType.Fire_Sensor: "Smoke", - IasZone.ZoneType.Water_Sensor: "Moisture", - IasZone.ZoneType.Carbon_Monoxide_Sensor: "Gas", - IasZone.ZoneType.Vibration_Movement_Sensor: "Vibration", -} - STRICT_MATCH = functools.partial(ZHA_ENTITIES.strict_match, Platform.BINARY_SENSOR) MULTI_MATCH = functools.partial(ZHA_ENTITIES.multipass_match, Platform.BINARY_SENSOR) CONFIG_DIAGNOSTIC_MATCH = functools.partial( @@ -119,8 +110,8 @@ class Accelerometer(BinarySensor): """ZHA BinarySensor.""" SENSOR_ATTR = "acceleration" - _attr_name: str = "Accelerometer" _attr_device_class: BinarySensorDeviceClass = BinarySensorDeviceClass.MOVING + _attr_translation_key: str = "accelerometer" @MULTI_MATCH(cluster_handler_names=CLUSTER_HANDLER_OCCUPANCY) @@ -128,7 +119,6 @@ class Occupancy(BinarySensor): """ZHA BinarySensor.""" SENSOR_ATTR = "occupancy" - _attr_name: str = "Occupancy" _attr_device_class: BinarySensorDeviceClass = BinarySensorDeviceClass.OCCUPANCY @@ -136,13 +126,14 @@ class Occupancy(BinarySensor): class HueOccupancy(Occupancy): """ZHA Hue occupancy.""" + _attr_device_class: BinarySensorDeviceClass = BinarySensorDeviceClass.OCCUPANCY + @STRICT_MATCH(cluster_handler_names=CLUSTER_HANDLER_ON_OFF) class Opening(BinarySensor): """ZHA OnOff BinarySensor.""" SENSOR_ATTR = "on_off" - _attr_name: str = "Opening" _attr_device_class: BinarySensorDeviceClass = BinarySensorDeviceClass.OPENING # Client/out cluster attributes aren't stored in the zigpy database, but are properly stored in the runtime cache. @@ -161,7 +152,7 @@ class BinaryInput(BinarySensor): """ZHA BinarySensor.""" SENSOR_ATTR = "present_value" - _attr_name: str = "Binary input" + _attr_translation_key: str = "binary_input" @STRICT_MATCH( @@ -179,7 +170,6 @@ class BinaryInput(BinarySensor): class Motion(Opening): """ZHA OnOff BinarySensor with motion device class.""" - _attr_name: str = "Motion" _attr_device_class: BinarySensorDeviceClass = BinarySensorDeviceClass.MOTION @@ -190,10 +180,12 @@ class IASZone(BinarySensor): SENSOR_ATTR = "zone_status" @property - def name(self) -> str | None: + def translation_key(self) -> str | None: """Return the name of the sensor.""" zone_type = self._cluster_handler.cluster.get("zone_type") - return IAS_ZONE_NAME_MAPPING.get(zone_type, "iaszone") + if zone_type in IAS_ZONE_CLASS_MAPPING: + return None + return "ias_zone" @property def device_class(self) -> BinarySensorDeviceClass | None: @@ -242,7 +234,6 @@ class SinopeLeakStatus(BinarySensor): """Sinope water leak sensor.""" SENSOR_ATTR = "leak_status" - _attr_name = "Moisture" _attr_device_class = BinarySensorDeviceClass.MOISTURE @@ -258,7 +249,7 @@ class FrostLock(BinarySensor): SENSOR_ATTR = "frost_lock" _unique_id_suffix = "frost_lock" _attr_device_class: BinarySensorDeviceClass = BinarySensorDeviceClass.LOCK - _attr_name: str = "Frost lock" + _attr_translation_key: str = "frost_lock" @MULTI_MATCH(cluster_handler_names="ikea_airpurifier") @@ -269,7 +260,7 @@ class ReplaceFilter(BinarySensor): _unique_id_suffix = "replace_filter" _attr_device_class: BinarySensorDeviceClass = BinarySensorDeviceClass.PROBLEM _attr_entity_category: EntityCategory = EntityCategory.DIAGNOSTIC - _attr_name: str = "Replace filter" + _attr_translation_key: str = "replace_filter" @MULTI_MATCH(cluster_handler_names="opple_cluster", models={"aqara.feeder.acn001"}) @@ -279,7 +270,6 @@ class AqaraPetFeederErrorDetected(BinarySensor): SENSOR_ATTR = "error_detected" _unique_id_suffix = "error_detected" _attr_device_class: BinarySensorDeviceClass = BinarySensorDeviceClass.PROBLEM - _attr_name: str = "Error detected" @MULTI_MATCH( @@ -291,8 +281,8 @@ class XiaomiPlugConsumerConnected(BinarySensor): SENSOR_ATTR = "consumer_connected" _unique_id_suffix = "consumer_connected" - _attr_name: str = "Consumer connected" _attr_device_class: BinarySensorDeviceClass = BinarySensorDeviceClass.PLUG + _attr_translation_key: str = "consumer_connected" @MULTI_MATCH(cluster_handler_names="opple_cluster", models={"lumi.airrtc.agl001"}) @@ -302,7 +292,6 @@ class AqaraThermostatWindowOpen(BinarySensor): SENSOR_ATTR = "window_open" _unique_id_suffix = "window_open" _attr_device_class: BinarySensorDeviceClass = BinarySensorDeviceClass.WINDOW - _attr_name: str = "Window open" @MULTI_MATCH(cluster_handler_names="opple_cluster", models={"lumi.airrtc.agl001"}) @@ -312,7 +301,7 @@ class AqaraThermostatValveAlarm(BinarySensor): SENSOR_ATTR = "valve_alarm" _unique_id_suffix = "valve_alarm" _attr_device_class: BinarySensorDeviceClass = BinarySensorDeviceClass.PROBLEM - _attr_name: str = "Valve alarm" + _attr_translation_key: str = "valve_alarm" @CONFIG_DIAGNOSTIC_MATCH( @@ -324,7 +313,7 @@ class AqaraThermostatCalibrated(BinarySensor): SENSOR_ATTR = "calibrated" _unique_id_suffix = "calibrated" _attr_entity_category: EntityCategory = EntityCategory.DIAGNOSTIC - _attr_name: str = "Calibrated" + _attr_translation_key: str = "calibrated" @CONFIG_DIAGNOSTIC_MATCH( @@ -336,7 +325,7 @@ class AqaraThermostatExternalSensor(BinarySensor): SENSOR_ATTR = "sensor" _unique_id_suffix = "sensor" _attr_entity_category: EntityCategory = EntityCategory.DIAGNOSTIC - _attr_name: str = "External sensor" + _attr_translation_key: str = "external_sensor" @MULTI_MATCH(cluster_handler_names="opple_cluster", models={"lumi.sensor_smoke.acn03"}) @@ -345,5 +334,5 @@ class AqaraLinkageAlarmState(BinarySensor): SENSOR_ATTR = "linkage_alarm_state" _unique_id_suffix = "linkage_alarm_state" - _attr_name: str = "Linkage alarm state" _attr_device_class: BinarySensorDeviceClass = BinarySensorDeviceClass.SMOKE + _attr_translation_key: str = "linkage_alarm_state" diff --git a/homeassistant/components/zha/button.py b/homeassistant/components/zha/button.py index 35fee436ec5..e16ae082eda 100644 --- a/homeassistant/components/zha/button.py +++ b/homeassistant/components/zha/button.py @@ -105,7 +105,6 @@ class ZHAIdentifyButton(ZHAButton): _attr_device_class = ButtonDeviceClass.IDENTIFY _attr_entity_category = EntityCategory.DIAGNOSTIC - _attr_name = "Identify" _command_name = "identify" def get_args(self) -> list[Any]: @@ -150,10 +149,10 @@ class FrostLockResetButton(ZHAAttributeButton): _unique_id_suffix = "reset_frost_lock" _attribute_name = "frost_lock_reset" - _attr_name = "Frost lock reset" _attribute_value = 0 _attr_device_class = ButtonDeviceClass.RESTART _attr_entity_category = EntityCategory.CONFIG + _attr_translation_key = "reset_frost_lock" @CONFIG_DIAGNOSTIC_MATCH( @@ -164,10 +163,10 @@ class NoPresenceStatusResetButton(ZHAAttributeButton): _unique_id_suffix = "reset_no_presence_status" _attribute_name = "reset_no_presence_status" - _attr_name = "Presence status reset" _attribute_value = 1 _attr_device_class = ButtonDeviceClass.RESTART _attr_entity_category = EntityCategory.CONFIG + _attr_translation_key = "reset_no_presence_status" @MULTI_MATCH(cluster_handler_names="opple_cluster", models={"aqara.feeder.acn001"}) @@ -176,8 +175,8 @@ class AqaraPetFeederFeedButton(ZHAAttributeButton): _unique_id_suffix = "feeding" _attribute_name = "feeding" - _attr_name = "Feed" _attribute_value = 1 + _attr_translation_key = "feed" @CONFIG_DIAGNOSTIC_MATCH( @@ -188,6 +187,6 @@ class AqaraSelfTestButton(ZHAAttributeButton): _unique_id_suffix = "self_test" _attribute_name = "self_test" - _attr_name = "Self-test" _attribute_value = 1 _attr_entity_category = EntityCategory.CONFIG + _attr_translation_key = "self_test" diff --git a/homeassistant/components/zha/climate.py b/homeassistant/components/zha/climate.py index 1151d2fe59d..95abaf1c83e 100644 --- a/homeassistant/components/zha/climate.py +++ b/homeassistant/components/zha/climate.py @@ -140,7 +140,7 @@ class Thermostat(ZhaEntity, ClimateEntity): _attr_precision = PRECISION_TENTHS _attr_temperature_unit = UnitOfTemperature.CELSIUS - _attr_name: str = "Thermostat" + _attr_translation_key: str = "thermostat" def __init__(self, unique_id, zha_device, cluster_handlers, **kwargs): """Initialize ZHA Thermostat instance.""" diff --git a/homeassistant/components/zha/cover.py b/homeassistant/components/zha/cover.py index f2aed0390f3..d142aa2726b 100644 --- a/homeassistant/components/zha/cover.py +++ b/homeassistant/components/zha/cover.py @@ -73,7 +73,7 @@ async def async_setup_entry( class ZhaCover(ZhaEntity, CoverEntity): """Representation of a ZHA cover.""" - _attr_name: str = "Cover" + _attr_translation_key: str = "cover" def __init__(self, unique_id, zha_device, cluster_handlers, **kwargs): """Init this sensor.""" @@ -205,7 +205,7 @@ class Shade(ZhaEntity, CoverEntity): """ZHA Shade.""" _attr_device_class = CoverDeviceClass.SHADE - _attr_name: str = "Shade" + _attr_translation_key: str = "shade" def __init__( self, @@ -313,9 +313,8 @@ class Shade(ZhaEntity, CoverEntity): class KeenVent(Shade): """Keen vent cover.""" - _attr_name: str = "Keen vent" - _attr_device_class = CoverDeviceClass.DAMPER + _attr_translation_key: str = "keen_vent" async def async_open_cover(self, **kwargs: Any) -> None: """Open the cover.""" diff --git a/homeassistant/components/zha/fan.py b/homeassistant/components/zha/fan.py index 73b128db109..5473b7f0183 100644 --- a/homeassistant/components/zha/fan.py +++ b/homeassistant/components/zha/fan.py @@ -80,6 +80,7 @@ class BaseFan(FanEntity): """Base representation of a ZHA fan.""" _attr_supported_features = FanEntityFeature.SET_SPEED + _attr_translation_key: str = "fan" @property def preset_modes(self) -> list[str]: @@ -133,8 +134,6 @@ class BaseFan(FanEntity): class ZhaFan(BaseFan, ZhaEntity): """Representation of a ZHA fan.""" - _attr_name: str = "Fan" - def __init__(self, unique_id, zha_device, cluster_handlers, **kwargs): """Init this sensor.""" super().__init__(unique_id, zha_device, cluster_handlers, **kwargs) @@ -181,6 +180,8 @@ class ZhaFan(BaseFan, ZhaEntity): class FanGroup(BaseFan, ZhaGroupEntity): """Representation of a fan group.""" + _attr_translation_key: str = "fan_group" + def __init__( self, entity_ids: list[str], unique_id: str, group_id: int, zha_device, **kwargs ) -> None: @@ -262,8 +263,6 @@ IKEA_PRESET_MODES = list(IKEA_NAME_TO_PRESET_MODE) class IkeaFan(BaseFan, ZhaEntity): """Representation of a ZHA fan.""" - _attr_name: str = "IKEA fan" - def __init__(self, unique_id, zha_device, cluster_handlers, **kwargs): """Init this sensor.""" super().__init__(unique_id, zha_device, cluster_handlers, **kwargs) diff --git a/homeassistant/components/zha/light.py b/homeassistant/components/zha/light.py index 967d0fc9134..6770ca3b563 100644 --- a/homeassistant/components/zha/light.py +++ b/homeassistant/components/zha/light.py @@ -637,8 +637,8 @@ class BaseLight(LogMixin, light.LightEntity): class Light(BaseLight, ZhaEntity): """Representation of a ZHA or ZLL light.""" - _attr_name: str = "Light" _attr_supported_color_modes: set[ColorMode] + _attr_translation_key: str = "light" _REFRESH_INTERVAL = (45, 75) def __init__( @@ -1066,7 +1066,6 @@ class Light(BaseLight, ZhaEntity): class HueLight(Light): """Representation of a HUE light which does not report attributes.""" - _attr_name: str = "Light" _REFRESH_INTERVAL = (3, 5) @@ -1078,7 +1077,6 @@ class HueLight(Light): class ForceOnLight(Light): """Representation of a light which does not respect on/off for move_to_level_with_on_off commands.""" - _attr_name: str = "Light" _FORCE_ON = True @@ -1090,8 +1088,6 @@ class ForceOnLight(Light): class MinTransitionLight(Light): """Representation of a light which does not react to any "move to" calls with 0 as a transition.""" - _attr_name: str = "Light" - # Transitions are counted in 1/10th of a second increments, so this is the smallest _DEFAULT_MIN_TRANSITION_TIME = 0.1 @@ -1100,6 +1096,8 @@ class MinTransitionLight(Light): class LightGroup(BaseLight, ZhaGroupEntity): """Representation of a light group.""" + _attr_translation_key: str = "light_group" + def __init__( self, entity_ids: list[str], diff --git a/homeassistant/components/zha/lock.py b/homeassistant/components/zha/lock.py index 9bac9a59a38..ccfb5434154 100644 --- a/homeassistant/components/zha/lock.py +++ b/homeassistant/components/zha/lock.py @@ -97,7 +97,7 @@ async def async_setup_entry( class ZhaDoorLock(ZhaEntity, LockEntity): """Representation of a ZHA lock.""" - _attr_name: str = "Door lock" + _attr_translation_key: str = "door_lock" def __init__(self, unique_id, zha_device, cluster_handlers, **kwargs): """Init this sensor.""" diff --git a/homeassistant/components/zha/number.py b/homeassistant/components/zha/number.py index 01cfa763cd5..ad5f1debcd8 100644 --- a/homeassistant/components/zha/number.py +++ b/homeassistant/components/zha/number.py @@ -278,7 +278,7 @@ async def async_setup_entry( class ZhaNumber(ZhaEntity, NumberEntity): """Representation of a ZHA Number entity.""" - _attr_name: str = "Number" + _attr_translation_key: str = "number" def __init__( self, @@ -459,7 +459,7 @@ class AqaraMotionDetectionInterval(ZHANumberConfigurationEntity): _attr_native_min_value: float = 2 _attr_native_max_value: float = 65535 _zcl_attribute: str = "detection_interval" - _attr_name = "Detection interval" + _attr_translation_key: str = "detection_interval" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_LEVEL) @@ -471,7 +471,7 @@ class OnOffTransitionTimeConfigurationEntity(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0x0000 _attr_native_max_value: float = 0xFFFF _zcl_attribute: str = "on_off_transition_time" - _attr_name = "On/Off transition time" + _attr_translation_key: str = "on_off_transition_time" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_LEVEL) @@ -483,7 +483,7 @@ class OnLevelConfigurationEntity(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0x00 _attr_native_max_value: float = 0xFF _zcl_attribute: str = "on_level" - _attr_name = "On level" + _attr_translation_key: str = "on_level" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_LEVEL) @@ -495,7 +495,7 @@ class OnTransitionTimeConfigurationEntity(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0x0000 _attr_native_max_value: float = 0xFFFE _zcl_attribute: str = "on_transition_time" - _attr_name = "On transition time" + _attr_translation_key: str = "on_transition_time" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_LEVEL) @@ -507,7 +507,7 @@ class OffTransitionTimeConfigurationEntity(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0x0000 _attr_native_max_value: float = 0xFFFE _zcl_attribute: str = "off_transition_time" - _attr_name = "Off transition time" + _attr_translation_key: str = "off_transition_time" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_LEVEL) @@ -519,7 +519,7 @@ class DefaultMoveRateConfigurationEntity(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0x00 _attr_native_max_value: float = 0xFE _zcl_attribute: str = "default_move_rate" - _attr_name = "Default move rate" + _attr_translation_key: str = "default_move_rate" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_LEVEL) @@ -531,7 +531,7 @@ class StartUpCurrentLevelConfigurationEntity(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0x00 _attr_native_max_value: float = 0xFF _zcl_attribute: str = "start_up_current_level" - _attr_name = "Start-up current level" + _attr_translation_key: str = "start_up_current_level" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_COLOR) @@ -543,7 +543,7 @@ class StartUpColorTemperatureConfigurationEntity(ZHANumberConfigurationEntity): _attr_native_min_value: float = 153 _attr_native_max_value: float = 500 _zcl_attribute: str = "start_up_color_temperature" - _attr_name = "Start-up color temperature" + _attr_translation_key: str = "start_up_color_temperature" def __init__( self, @@ -576,7 +576,7 @@ class TimerDurationMinutes(ZHANumberConfigurationEntity): _attr_native_max_value: float = 0x257 _attr_native_unit_of_measurement: str | None = UNITS[72] _zcl_attribute: str = "timer_duration" - _attr_name = "Timer duration" + _attr_translation_key: str = "timer_duration" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names="ikea_airpurifier") @@ -591,7 +591,7 @@ class FilterLifeTime(ZHANumberConfigurationEntity): _attr_native_max_value: float = 0xFFFFFFFF _attr_native_unit_of_measurement: str | None = UNITS[72] _zcl_attribute: str = "filter_life_time" - _attr_name = "Filter life time" + _attr_translation_key: str = "filter_life_time" @CONFIG_DIAGNOSTIC_MATCH( @@ -607,7 +607,7 @@ class TiRouterTransmitPower(ZHANumberConfigurationEntity): _attr_native_min_value: float = -20 _attr_native_max_value: float = 20 _zcl_attribute: str = "transmit_power" - _attr_name = "Transmit power" + _attr_translation_key: str = "transmit_power" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -621,7 +621,7 @@ class InovelliRemoteDimmingUpSpeed(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0 _attr_native_max_value: float = 126 _zcl_attribute: str = "dimming_speed_up_remote" - _attr_name: str = "Remote dimming up speed" + _attr_translation_key: str = "dimming_speed_up_remote" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -635,7 +635,7 @@ class InovelliButtonDelay(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0 _attr_native_max_value: float = 9 _zcl_attribute: str = "button_delay" - _attr_name: str = "Button delay" + _attr_translation_key: str = "button_delay" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -649,7 +649,7 @@ class InovelliLocalDimmingUpSpeed(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0 _attr_native_max_value: float = 127 _zcl_attribute: str = "dimming_speed_up_local" - _attr_name: str = "Local dimming up speed" + _attr_translation_key: str = "dimming_speed_up_local" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -663,6 +663,8 @@ class InovelliLocalRampRateOffToOn(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0 _attr_native_max_value: float = 127 _zcl_attribute: str = "ramp_rate_off_to_on_local" + _attr_translation_key: str = "ramp_rate_off_to_on_local" + _attr_name: str = "Local ramp rate off to on" @@ -677,7 +679,7 @@ class InovelliRemoteDimmingSpeedOffToOn(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0 _attr_native_max_value: float = 127 _zcl_attribute: str = "ramp_rate_off_to_on_remote" - _attr_name: str = "Remote ramp rate off to on" + _attr_translation_key: str = "ramp_rate_off_to_on_remote" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -691,7 +693,7 @@ class InovelliRemoteDimmingDownSpeed(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0 _attr_native_max_value: float = 127 _zcl_attribute: str = "dimming_speed_down_remote" - _attr_name: str = "Remote dimming down speed" + _attr_translation_key: str = "dimming_speed_down_remote" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -705,7 +707,7 @@ class InovelliLocalDimmingDownSpeed(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0 _attr_native_max_value: float = 127 _zcl_attribute: str = "dimming_speed_down_local" - _attr_name: str = "Local dimming down speed" + _attr_translation_key: str = "dimming_speed_down_local" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -719,7 +721,7 @@ class InovelliLocalRampRateOnToOff(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0 _attr_native_max_value: float = 127 _zcl_attribute: str = "ramp_rate_on_to_off_local" - _attr_name: str = "Local ramp rate on to off" + _attr_translation_key: str = "ramp_rate_on_to_off_local" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -733,7 +735,7 @@ class InovelliRemoteDimmingSpeedOnToOff(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0 _attr_native_max_value: float = 127 _zcl_attribute: str = "ramp_rate_on_to_off_remote" - _attr_name: str = "Remote ramp rate on to off" + _attr_translation_key: str = "ramp_rate_on_to_off_remote" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -747,7 +749,7 @@ class InovelliMinimumLoadDimmingLevel(ZHANumberConfigurationEntity): _attr_native_min_value: float = 1 _attr_native_max_value: float = 254 _zcl_attribute: str = "minimum_level" - _attr_name: str = "Minimum load dimming level" + _attr_translation_key: str = "minimum_level" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -761,7 +763,7 @@ class InovelliMaximumLoadDimmingLevel(ZHANumberConfigurationEntity): _attr_native_min_value: float = 2 _attr_native_max_value: float = 255 _zcl_attribute: str = "maximum_level" - _attr_name: str = "Maximum load dimming level" + _attr_translation_key: str = "maximum_level" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -775,7 +777,7 @@ class InovelliAutoShutoffTimer(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0 _attr_native_max_value: float = 32767 _zcl_attribute: str = "auto_off_timer" - _attr_name: str = "Automatic switch shutoff timer" + _attr_translation_key: str = "auto_off_timer" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -789,7 +791,7 @@ class InovelliLoadLevelIndicatorTimeout(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0 _attr_native_max_value: float = 11 _zcl_attribute: str = "load_level_indicator_timeout" - _attr_name: str = "Load level indicator timeout" + _attr_translation_key: str = "load_level_indicator_timeout" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -803,7 +805,7 @@ class InovelliDefaultAllLEDOnColor(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0 _attr_native_max_value: float = 255 _zcl_attribute: str = "led_color_when_on" - _attr_name: str = "Default all LED on color" + _attr_translation_key: str = "led_color_when_on" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -817,7 +819,7 @@ class InovelliDefaultAllLEDOffColor(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0 _attr_native_max_value: float = 255 _zcl_attribute: str = "led_color_when_off" - _attr_name: str = "Default all LED off color" + _attr_translation_key: str = "led_color_when_off" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -831,7 +833,7 @@ class InovelliDefaultAllLEDOnIntensity(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0 _attr_native_max_value: float = 100 _zcl_attribute: str = "led_intensity_when_on" - _attr_name: str = "Default all LED on intensity" + _attr_translation_key: str = "led_intensity_when_on" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -845,7 +847,7 @@ class InovelliDefaultAllLEDOffIntensity(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0 _attr_native_max_value: float = 100 _zcl_attribute: str = "led_intensity_when_off" - _attr_name: str = "Default all LED off intensity" + _attr_translation_key: str = "led_intensity_when_off" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -859,7 +861,7 @@ class InovelliDoubleTapUpLevel(ZHANumberConfigurationEntity): _attr_native_min_value: float = 2 _attr_native_max_value: float = 254 _zcl_attribute: str = "double_tap_up_level" - _attr_name: str = "Double tap up level" + _attr_translation_key: str = "double_tap_up_level" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_INOVELLI) @@ -873,7 +875,7 @@ class InovelliDoubleTapDownLevel(ZHANumberConfigurationEntity): _attr_native_min_value: float = 0 _attr_native_max_value: float = 254 _zcl_attribute: str = "double_tap_down_level" - _attr_name: str = "Double tap down level" + _attr_translation_key: str = "double_tap_down_level" @CONFIG_DIAGNOSTIC_MATCH( @@ -888,7 +890,8 @@ class AqaraPetFeederServingSize(ZHANumberConfigurationEntity): _attr_native_min_value: float = 1 _attr_native_max_value: float = 10 _zcl_attribute: str = "serving_size" - _attr_name: str = "Serving to dispense" + _attr_translation_key: str = "serving_size" + _attr_mode: NumberMode = NumberMode.BOX _attr_icon: str = "mdi:counter" @@ -905,7 +908,8 @@ class AqaraPetFeederPortionWeight(ZHANumberConfigurationEntity): _attr_native_min_value: float = 1 _attr_native_max_value: float = 100 _zcl_attribute: str = "portion_weight" - _attr_name: str = "Portion weight" + _attr_translation_key: str = "portion_weight" + _attr_mode: NumberMode = NumberMode.BOX _attr_native_unit_of_measurement: str = UnitOfMass.GRAMS _attr_icon: str = "mdi:weight-gram" @@ -924,7 +928,8 @@ class AqaraThermostatAwayTemp(ZHANumberConfigurationEntity): _attr_native_max_value: float = 30 _attr_multiplier: float = 0.01 _zcl_attribute: str = "away_preset_temperature" - _attr_name: str = "Away preset temperature" + _attr_translation_key: str = "away_preset_temperature" + _attr_mode: NumberMode = NumberMode.SLIDER _attr_native_unit_of_measurement: str = UnitOfTemperature.CELSIUS _attr_icon: str = ICONS[0] diff --git a/homeassistant/components/zha/select.py b/homeassistant/components/zha/select.py index 6f7563e2e23..980f589819c 100644 --- a/homeassistant/components/zha/select.py +++ b/homeassistant/components/zha/select.py @@ -122,7 +122,7 @@ class ZHADefaultToneSelectEntity(ZHANonZCLSelectEntity): _unique_id_suffix = IasWd.Warning.WarningMode.__name__ _enum = IasWd.Warning.WarningMode - _attr_name = "Default siren tone" + _attr_translation_key: str = "default_siren_tone" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_IAS_WD) @@ -131,7 +131,7 @@ class ZHADefaultSirenLevelSelectEntity(ZHANonZCLSelectEntity): _unique_id_suffix = IasWd.Warning.SirenLevel.__name__ _enum = IasWd.Warning.SirenLevel - _attr_name = "Default siren level" + _attr_translation_key: str = "default_siren_level" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_IAS_WD) @@ -140,7 +140,7 @@ class ZHADefaultStrobeLevelSelectEntity(ZHANonZCLSelectEntity): _unique_id_suffix = IasWd.StrobeLevel.__name__ _enum = IasWd.StrobeLevel - _attr_name = "Default strobe level" + _attr_translation_key: str = "default_strobe_level" @CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_IAS_WD) @@ -149,7 +149,7 @@ class ZHADefaultStrobeSelectEntity(ZHANonZCLSelectEntity): _unique_id_suffix = Strobe.__name__ _enum = Strobe - _attr_name = "Default strobe" + _attr_translation_key: str = "default_strobe" class ZCLEnumSelectEntity(ZhaEntity, SelectEntity): @@ -234,7 +234,7 @@ class ZHAStartupOnOffSelectEntity(ZCLEnumSelectEntity): _unique_id_suffix = OnOff.StartUpOnOff.__name__ _select_attr = "start_up_on_off" _enum = OnOff.StartUpOnOff - _attr_name = "Start-up behavior" + _attr_translation_key: str = "start_up_on_off" class TuyaPowerOnState(types.enum8): @@ -276,7 +276,7 @@ class TuyaPowerOnStateSelectEntity(ZCLEnumSelectEntity): _unique_id_suffix = "power_on_state" _select_attr = "power_on_state" _enum = TuyaPowerOnState - _attr_name = "Power on state" + _attr_translation_key: str = "power_on_state" class TuyaBacklightMode(types.enum8): @@ -297,7 +297,7 @@ class TuyaBacklightModeSelectEntity(ZCLEnumSelectEntity): _unique_id_suffix = "backlight_mode" _select_attr = "backlight_mode" _enum = TuyaBacklightMode - _attr_name = "Backlight mode" + _attr_translation_key: str = "backlight_mode" class MoesBacklightMode(types.enum8): @@ -336,7 +336,7 @@ class MoesBacklightModeSelectEntity(ZCLEnumSelectEntity): _unique_id_suffix = "backlight_mode" _select_attr = "backlight_mode" _enum = MoesBacklightMode - _attr_name = "Backlight mode" + _attr_translation_key: str = "backlight_mode" class AqaraMotionSensitivities(types.enum8): @@ -357,7 +357,7 @@ class AqaraMotionSensitivity(ZCLEnumSelectEntity): _unique_id_suffix = "motion_sensitivity" _select_attr = "motion_sensitivity" _enum = AqaraMotionSensitivities - _attr_name = "Motion sensitivity" + _attr_translation_key: str = "motion_sensitivity" class HueV1MotionSensitivities(types.enum8): @@ -378,8 +378,8 @@ class HueV1MotionSensitivity(ZCLEnumSelectEntity): _unique_id_suffix = "motion_sensitivity" _select_attr = "sensitivity" - _attr_name = "Hue motion sensitivity" _enum = HueV1MotionSensitivities + _attr_translation_key: str = "motion_sensitivity" class HueV2MotionSensitivities(types.enum8): @@ -402,8 +402,8 @@ class HueV2MotionSensitivity(ZCLEnumSelectEntity): _unique_id_suffix = "motion_sensitivity" _select_attr = "sensitivity" - _attr_name = "Hue motion sensitivity" _enum = HueV2MotionSensitivities + _attr_translation_key: str = "motion_sensitivity" class AqaraMonitoringModess(types.enum8): @@ -422,7 +422,7 @@ class AqaraMonitoringMode(ZCLEnumSelectEntity): _unique_id_suffix = "monitoring_mode" _select_attr = "monitoring_mode" _enum = AqaraMonitoringModess - _attr_name = "Monitoring mode" + _attr_translation_key: str = "monitoring_mode" class AqaraApproachDistances(types.enum8): @@ -442,7 +442,7 @@ class AqaraApproachDistance(ZCLEnumSelectEntity): _unique_id_suffix = "approach_distance" _select_attr = "approach_distance" _enum = AqaraApproachDistances - _attr_name = "Approach distance" + _attr_translation_key: str = "approach_distance" class AqaraE1ReverseDirection(types.enum8): @@ -461,7 +461,7 @@ class AqaraCurtainMode(ZCLEnumSelectEntity): _unique_id_suffix = "window_covering_mode" _select_attr = "window_covering_mode" _enum = AqaraE1ReverseDirection - _attr_name = "Curtain mode" + _attr_translation_key: str = "window_covering_mode" class InovelliOutputMode(types.enum1): @@ -480,7 +480,7 @@ class InovelliOutputModeEntity(ZCLEnumSelectEntity): _unique_id_suffix = "output_mode" _select_attr = "output_mode" _enum = InovelliOutputMode - _attr_name: str = "Output mode" + _attr_translation_key: str = "output_mode" class InovelliSwitchType(types.enum8): @@ -501,7 +501,7 @@ class InovelliSwitchTypeEntity(ZCLEnumSelectEntity): _unique_id_suffix = "switch_type" _select_attr = "switch_type" _enum = InovelliSwitchType - _attr_name: str = "Switch type" + _attr_translation_key: str = "switch_type" class InovelliLedScalingMode(types.enum1): @@ -520,7 +520,7 @@ class InovelliLedScalingModeEntity(ZCLEnumSelectEntity): _unique_id_suffix = "led_scaling_mode" _select_attr = "led_scaling_mode" _enum = InovelliLedScalingMode - _attr_name: str = "Led scaling mode" + _attr_translation_key: str = "led_scaling_mode" class InovelliNonNeutralOutput(types.enum1): @@ -539,7 +539,7 @@ class InovelliNonNeutralOutputEntity(ZCLEnumSelectEntity): _unique_id_suffix = "increased_non_neutral_output" _select_attr = "increased_non_neutral_output" _enum = InovelliNonNeutralOutput - _attr_name: str = "Non neutral output" + _attr_translation_key: str = "increased_non_neutral_output" class AqaraFeedingMode(types.enum8): @@ -558,7 +558,7 @@ class AqaraPetFeederMode(ZCLEnumSelectEntity): _unique_id_suffix = "feeding_mode" _select_attr = "feeding_mode" _enum = AqaraFeedingMode - _attr_name = "Mode" + _attr_translation_key: str = "feeding_mode" _attr_icon: str = "mdi:wrench-clock" @@ -579,4 +579,4 @@ class AqaraThermostatPreset(ZCLEnumSelectEntity): _unique_id_suffix = "preset" _select_attr = "preset" _enum = AqaraThermostatPresetMode - _attr_name = "Preset" + _attr_translation_key: str = "preset" diff --git a/homeassistant/components/zha/sensor.py b/homeassistant/components/zha/sensor.py index 66b422e0d8b..8ddedebfa79 100644 --- a/homeassistant/components/zha/sensor.py +++ b/homeassistant/components/zha/sensor.py @@ -195,7 +195,7 @@ class AnalogInput(Sensor): """Sensor that displays analog input values.""" SENSOR_ATTR = "present_value" - _attr_name: str = "Analog input" + _attr_translation_key: str = "analog_input" @MULTI_MATCH(cluster_handler_names=CLUSTER_HANDLER_POWER_CONFIGURATION) @@ -207,7 +207,6 @@ class Battery(Sensor): _attr_device_class: SensorDeviceClass = SensorDeviceClass.BATTERY _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT _attr_entity_category = EntityCategory.DIAGNOSTIC - _attr_name: str = "Battery" _attr_native_unit_of_measurement = PERCENTAGE @classmethod @@ -265,7 +264,6 @@ class ElectricalMeasurement(Sensor): SENSOR_ATTR = "active_power" _attr_device_class: SensorDeviceClass = SensorDeviceClass.POWER _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT - _attr_name: str = "Active power" _attr_native_unit_of_measurement: str = UnitOfPower.WATT _div_mul_prefix = "ac_power" @@ -325,7 +323,6 @@ class ElectricalMeasurementApparentPower(ElectricalMeasurement): SENSOR_ATTR = "apparent_power" _unique_id_suffix = "apparent_power" _attr_device_class: SensorDeviceClass = SensorDeviceClass.APPARENT_POWER - _attr_name: str = "Apparent power" _attr_native_unit_of_measurement = UnitOfApparentPower.VOLT_AMPERE _div_mul_prefix = "ac_power" @@ -338,7 +335,6 @@ class ElectricalMeasurementRMSCurrent(ElectricalMeasurement): SENSOR_ATTR = "rms_current" _unique_id_suffix = "rms_current" _attr_device_class: SensorDeviceClass = SensorDeviceClass.CURRENT - _attr_name: str = "RMS current" _attr_native_unit_of_measurement = UnitOfElectricCurrent.AMPERE _div_mul_prefix = "ac_current" @@ -351,7 +347,6 @@ class ElectricalMeasurementRMSVoltage(ElectricalMeasurement): SENSOR_ATTR = "rms_voltage" _unique_id_suffix = "rms_voltage" _attr_device_class: SensorDeviceClass = SensorDeviceClass.VOLTAGE - _attr_name: str = "RMS voltage" _attr_native_unit_of_measurement = UnitOfElectricPotential.VOLT _div_mul_prefix = "ac_voltage" @@ -364,7 +359,7 @@ class ElectricalMeasurementFrequency(ElectricalMeasurement): SENSOR_ATTR = "ac_frequency" _unique_id_suffix = "ac_frequency" _attr_device_class: SensorDeviceClass = SensorDeviceClass.FREQUENCY - _attr_name: str = "AC frequency" + _attr_translation_key: str = "ac_frequency" _attr_native_unit_of_measurement = UnitOfFrequency.HERTZ _div_mul_prefix = "ac_frequency" @@ -377,7 +372,6 @@ class ElectricalMeasurementPowerFactor(ElectricalMeasurement): SENSOR_ATTR = "power_factor" _unique_id_suffix = "power_factor" _attr_device_class: SensorDeviceClass = SensorDeviceClass.POWER_FACTOR - _attr_name: str = "Power factor" _attr_native_unit_of_measurement = PERCENTAGE @@ -396,7 +390,6 @@ class Humidity(Sensor): SENSOR_ATTR = "measured_value" _attr_device_class: SensorDeviceClass = SensorDeviceClass.HUMIDITY _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT - _attr_name: str = "Humidity" _divisor = 100 _attr_native_unit_of_measurement = PERCENTAGE @@ -409,7 +402,7 @@ class SoilMoisture(Sensor): SENSOR_ATTR = "measured_value" _attr_device_class: SensorDeviceClass = SensorDeviceClass.HUMIDITY _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT - _attr_name: str = "Soil moisture" + _attr_translation_key: str = "soil_moisture" _divisor = 100 _attr_native_unit_of_measurement = PERCENTAGE @@ -422,7 +415,7 @@ class LeafWetness(Sensor): SENSOR_ATTR = "measured_value" _attr_device_class: SensorDeviceClass = SensorDeviceClass.HUMIDITY _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT - _attr_name: str = "Leaf wetness" + _attr_translation_key: str = "leaf_wetness" _divisor = 100 _attr_native_unit_of_measurement = PERCENTAGE @@ -435,7 +428,6 @@ class Illuminance(Sensor): SENSOR_ATTR = "measured_value" _attr_device_class: SensorDeviceClass = SensorDeviceClass.ILLUMINANCE _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT - _attr_name: str = "Illuminance" _attr_native_unit_of_measurement = LIGHT_LUX def formatter(self, value: int) -> int: @@ -454,7 +446,7 @@ class SmartEnergyMetering(Sensor): SENSOR_ATTR: int | str = "instantaneous_demand" _attr_device_class: SensorDeviceClass = SensorDeviceClass.POWER _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT - _attr_name: str = "Instantaneous demand" + _attr_translation_key: str = "instantaneous_demand" unit_of_measure_map = { 0x00: UnitOfPower.WATT, @@ -509,7 +501,7 @@ class SmartEnergySummation(SmartEnergyMetering): _unique_id_suffix = "summation_delivered" _attr_device_class: SensorDeviceClass = SensorDeviceClass.ENERGY _attr_state_class: SensorStateClass = SensorStateClass.TOTAL_INCREASING - _attr_name: str = "Summation delivered" + _attr_translation_key: str = "summation_delivered" unit_of_measure_map = { 0x00: UnitOfEnergy.KILO_WATT_HOUR, @@ -567,7 +559,7 @@ class Tier1SmartEnergySummation(PolledSmartEnergySummation): SENSOR_ATTR: int | str = "current_tier1_summ_delivered" _unique_id_suffix = "tier1_summation_delivered" - _attr_name: str = "Tier 1 summation delivered" + _attr_translation_key: str = "tier1_summation_delivered" @MULTI_MATCH( @@ -580,7 +572,7 @@ class Tier2SmartEnergySummation(PolledSmartEnergySummation): SENSOR_ATTR: int | str = "current_tier2_summ_delivered" _unique_id_suffix = "tier2_summation_delivered" - _attr_name: str = "Tier 2 summation delivered" + _attr_translation_key: str = "tier2_summation_delivered" @MULTI_MATCH( @@ -593,7 +585,7 @@ class Tier3SmartEnergySummation(PolledSmartEnergySummation): SENSOR_ATTR: int | str = "current_tier3_summ_delivered" _unique_id_suffix = "tier3_summation_delivered" - _attr_name: str = "Tier 3 summation delivered" + _attr_translation_key: str = "tier3_summation_delivered" @MULTI_MATCH( @@ -606,7 +598,7 @@ class Tier4SmartEnergySummation(PolledSmartEnergySummation): SENSOR_ATTR: int | str = "current_tier4_summ_delivered" _unique_id_suffix = "tier4_summation_delivered" - _attr_name: str = "Tier 4 summation delivered" + _attr_translation_key: str = "tier4_summation_delivered" @MULTI_MATCH( @@ -619,7 +611,7 @@ class Tier5SmartEnergySummation(PolledSmartEnergySummation): SENSOR_ATTR: int | str = "current_tier5_summ_delivered" _unique_id_suffix = "tier5_summation_delivered" - _attr_name: str = "Tier 5 summation delivered" + _attr_translation_key: str = "tier5_summation_delivered" @MULTI_MATCH( @@ -632,7 +624,7 @@ class Tier6SmartEnergySummation(PolledSmartEnergySummation): SENSOR_ATTR: int | str = "current_tier6_summ_delivered" _unique_id_suffix = "tier6_summation_delivered" - _attr_name: str = "Tier 6 summation delivered" + _attr_translation_key: str = "tier6_summation_delivered" @MULTI_MATCH(cluster_handler_names=CLUSTER_HANDLER_PRESSURE) @@ -643,7 +635,6 @@ class Pressure(Sensor): SENSOR_ATTR = "measured_value" _attr_device_class: SensorDeviceClass = SensorDeviceClass.PRESSURE _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT - _attr_name: str = "Pressure" _decimals = 0 _attr_native_unit_of_measurement = UnitOfPressure.HPA @@ -656,7 +647,6 @@ class Temperature(Sensor): SENSOR_ATTR = "measured_value" _attr_device_class: SensorDeviceClass = SensorDeviceClass.TEMPERATURE _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT - _attr_name: str = "Temperature" _divisor = 100 _attr_native_unit_of_measurement = UnitOfTemperature.CELSIUS @@ -669,7 +659,7 @@ class DeviceTemperature(Sensor): SENSOR_ATTR = "current_temperature" _attr_device_class: SensorDeviceClass = SensorDeviceClass.TEMPERATURE _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT - _attr_name: str = "Device temperature" + _attr_translation_key: str = "device_temperature" _divisor = 100 _attr_native_unit_of_measurement = UnitOfTemperature.CELSIUS _attr_entity_category = EntityCategory.DIAGNOSTIC @@ -683,7 +673,6 @@ class CarbonDioxideConcentration(Sensor): SENSOR_ATTR = "measured_value" _attr_device_class: SensorDeviceClass = SensorDeviceClass.CO2 _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT - _attr_name: str = "Carbon dioxide concentration" _decimals = 0 _multiplier = 1e6 _attr_native_unit_of_measurement = CONCENTRATION_PARTS_PER_MILLION @@ -697,7 +686,6 @@ class CarbonMonoxideConcentration(Sensor): SENSOR_ATTR = "measured_value" _attr_device_class: SensorDeviceClass = SensorDeviceClass.CO _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT - _attr_name: str = "Carbon monoxide concentration" _decimals = 0 _multiplier = 1e6 _attr_native_unit_of_measurement = CONCENTRATION_PARTS_PER_MILLION @@ -712,7 +700,6 @@ class VOCLevel(Sensor): SENSOR_ATTR = "measured_value" _attr_device_class: SensorDeviceClass = SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT - _attr_name: str = "VOC level" _decimals = 0 _multiplier = 1e6 _attr_native_unit_of_measurement = CONCENTRATION_MICROGRAMS_PER_CUBIC_METER @@ -732,7 +719,6 @@ class PPBVOCLevel(Sensor): SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS_PARTS ) _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT - _attr_name: str = "VOC level" _decimals = 0 _multiplier = 1 _attr_native_unit_of_measurement = CONCENTRATION_PARTS_PER_BILLION @@ -746,7 +732,6 @@ class PM25(Sensor): SENSOR_ATTR = "measured_value" _attr_device_class: SensorDeviceClass = SensorDeviceClass.PM25 _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT - _attr_name: str = "Particulate matter" _decimals = 0 _multiplier = 1 _attr_native_unit_of_measurement = CONCENTRATION_MICROGRAMS_PER_CUBIC_METER @@ -759,7 +744,7 @@ class FormaldehydeConcentration(Sensor): SENSOR_ATTR = "measured_value" _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT - _attr_name: str = "Formaldehyde concentration" + _attr_translation_key: str = "formaldehyde" _decimals = 0 _multiplier = 1e6 _attr_native_unit_of_measurement = CONCENTRATION_PARTS_PER_MILLION @@ -774,7 +759,7 @@ class ThermostatHVACAction(Sensor): """Thermostat HVAC action sensor.""" _unique_id_suffix = "hvac_action" - _attr_name: str = "HVAC action" + _attr_translation_key: str = "hvac_action" @classmethod def create_entity( @@ -901,7 +886,7 @@ class RSSISensor(Sensor): _attr_entity_category = EntityCategory.DIAGNOSTIC _attr_entity_registry_enabled_default = False _attr_should_poll = True # BaseZhaEntity defaults to False - _attr_name: str = "RSSI" + _attr_translation_key: str = "rssi" @classmethod def create_entity( @@ -933,9 +918,9 @@ class LQISensor(RSSISensor): SENSOR_ATTR = "lqi" _unique_id_suffix = "lqi" - _attr_name: str = "LQI" _attr_device_class = None _attr_native_unit_of_measurement = None + _attr_translation_key = "lqi" @MULTI_MATCH( @@ -952,7 +937,7 @@ class TimeLeft(Sensor): _unique_id_suffix = "time_left" _attr_device_class: SensorDeviceClass = SensorDeviceClass.DURATION _attr_icon = "mdi:timer" - _attr_name: str = "Time left" + _attr_translation_key: str = "timer_time_left" _attr_native_unit_of_measurement = UnitOfTime.MINUTES @@ -965,7 +950,7 @@ class IkeaDeviceRunTime(Sensor): _unique_id_suffix = "device_run_time" _attr_device_class: SensorDeviceClass = SensorDeviceClass.DURATION _attr_icon = "mdi:timer" - _attr_name: str = "Device run time" + _attr_translation_key: str = "device_run_time" _attr_native_unit_of_measurement = UnitOfTime.MINUTES _attr_entity_category: EntityCategory = EntityCategory.DIAGNOSTIC @@ -979,7 +964,7 @@ class IkeaFilterRunTime(Sensor): _unique_id_suffix = "filter_run_time" _attr_device_class: SensorDeviceClass = SensorDeviceClass.DURATION _attr_icon = "mdi:timer" - _attr_name: str = "Filter run time" + _attr_translation_key: str = "filter_run_time" _attr_native_unit_of_measurement = UnitOfTime.MINUTES _attr_entity_category: EntityCategory = EntityCategory.DIAGNOSTIC @@ -998,7 +983,7 @@ class AqaraPetFeederLastFeedingSource(Sensor): SENSOR_ATTR = "last_feeding_source" _unique_id_suffix = "last_feeding_source" - _attr_name: str = "Last feeding source" + _attr_translation_key: str = "last_feeding_source" _attr_icon = "mdi:devices" def formatter(self, value: int) -> int | float | None: @@ -1013,7 +998,7 @@ class AqaraPetFeederLastFeedingSize(Sensor): SENSOR_ATTR = "last_feeding_size" _unique_id_suffix = "last_feeding_size" - _attr_name: str = "Last feeding size" + _attr_translation_key: str = "last_feeding_size" _attr_icon: str = "mdi:counter" @@ -1024,7 +1009,7 @@ class AqaraPetFeederPortionsDispensed(Sensor): SENSOR_ATTR = "portions_dispensed" _unique_id_suffix = "portions_dispensed" - _attr_name: str = "Portions dispensed today" + _attr_translation_key: str = "portions_dispensed_today" _attr_state_class: SensorStateClass = SensorStateClass.TOTAL_INCREASING _attr_icon: str = "mdi:counter" @@ -1036,7 +1021,7 @@ class AqaraPetFeederWeightDispensed(Sensor): SENSOR_ATTR = "weight_dispensed" _unique_id_suffix = "weight_dispensed" - _attr_name: str = "Weight dispensed today" + _attr_translation_key: str = "weight_dispensed_today" _attr_native_unit_of_measurement = UnitOfMass.GRAMS _attr_state_class: SensorStateClass = SensorStateClass.TOTAL_INCREASING _attr_icon: str = "mdi:weight-gram" @@ -1049,7 +1034,7 @@ class AqaraSmokeDensityDbm(Sensor): SENSOR_ATTR = "smoke_density_dbm" _unique_id_suffix = "smoke_density_dbm" - _attr_name: str = "Smoke density" + _attr_translation_key: str = "smoke_density" _attr_native_unit_of_measurement = "dB/m" _attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT _attr_icon: str = "mdi:google-circles-communities" diff --git a/homeassistant/components/zha/strings.json b/homeassistant/components/zha/strings.json index 21bf95f7ce6..56381d993b8 100644 --- a/homeassistant/components/zha/strings.json +++ b/homeassistant/components/zha/strings.json @@ -529,5 +529,403 @@ } } } + }, + "entity": { + "alarm_control_panel": { + "alarm_control_panel": { + "name": "[%key:component::alarm_control_panel::title%]" + } + }, + "binary_sensor": { + "accelerometer": { + "name": "Accelerometer" + }, + "binary_input": { + "name": "Binary input" + }, + "frost_lock": { + "name": "Frost lock" + }, + "replace_filter": { + "name": "Replace filter" + }, + "consumer_connected": { + "name": "Consumer connected" + }, + "valve_alarm": { + "name": "Valve alarm" + }, + "calibrated": { + "name": "Calibrated" + }, + "external_sensor": { + "name": "External sensor" + }, + "linkage_alarm_state": { + "name": "Linkage alarm state" + }, + "ias_zone": { + "name": "IAS zone" + } + }, + "button": { + "reset_frost_lock": { + "name": "Frost lock reset" + }, + "reset_no_presence_status": { + "name": "Presence status reset" + }, + "feed": { + "name": "Feed" + }, + "self_test": { + "name": "Self-test" + } + }, + "climate": { + "thermostat": { + "name": "[%key:component::climate::entity_component::_::name%]" + } + }, + "cover": { + "cover": { + "name": "[%key:component::cover::title%]" + }, + "shade": { + "name": "[%key:component::cover::entity_component::shade::name%]" + }, + "keen_vent": { + "name": "Keen vent" + } + }, + "fan": { + "fan": { + "name": "[%key:component::fan::title%]" + }, + "fan_group": { + "name": "Fan group" + } + }, + "light": { + "light": { + "name": "[%key:component::light::title%]" + }, + "light_group": { + "name": "Light group" + } + }, + "lock": { + "door_lock": { + "name": "Door lock" + } + }, + "number": { + "number": { + "name": "[%key:component::number::entity_component::_::name%]" + }, + "detection_interval": { + "name": "Detection interval" + }, + "on_level": { + "name": "On level" + }, + "on_off_transition_time": { + "name": "On/Off transition time" + }, + "on_transition_time": { + "name": "On transition time" + }, + "off_transition_time": { + "name": "Off transition time" + }, + "default_move_rate": { + "name": "Default move rate" + }, + "start_up_current_level": { + "name": "Start-up current level" + }, + "start_up_color_temperature": { + "name": "Start-up color temperature" + }, + "timer_duration": { + "name": "Timer duration" + }, + "filter_life_time": { + "name": "Filter life time" + }, + "transmit_power": { + "name": "Transmit power" + }, + "dimming_speed_up_remote": { + "name": "Remote dimming up speed" + }, + "button_delay": { + "name": "Button delay" + }, + "dimming_speed_up_local": { + "name": "Local dimming up speed" + }, + "ramp_rate_off_to_on_local": { + "name": "Local ramp rate off to on" + }, + "ramp_rate_off_to_on_remote": { + "name": "Remote ramp rate off to on" + }, + "dimming_speed_down_remote": { + "name": "Remote dimming down speed" + }, + "dimming_speed_down_local": { + "name": "Local dimming down speed" + }, + "ramp_rate_on_to_off_local": { + "name": "Local ramp rate on to off" + }, + "ramp_rate_on_to_off_remote": { + "name": "Remote ramp rate on to off" + }, + "minimum_level": { + "name": "Minimum load dimming level" + }, + "maximum_level": { + "name": "Maximum load dimming level" + }, + "auto_off_timer": { + "name": "Automatic switch shutoff timer" + }, + "load_level_indicator_timeout": { + "name": "Load level indicator timeout" + }, + "led_color_when_on": { + "name": "Default all LED on color" + }, + "led_color_when_off": { + "name": "Default all LED off color" + }, + "led_intensity_when_on": { + "name": "Default all LED on intensity" + }, + "led_intensity_when_off": { + "name": "Default all LED off intensity" + }, + "double_tap_up_level": { + "name": "Double tap up level" + }, + "double_tap_down_level": { + "name": "Double tap down level" + }, + "serving_size": { + "name": "Serving to dispense" + }, + "portion_weight": { + "name": "Portion weight" + }, + "away_preset_temperature": { + "name": "Away preset temperature" + } + }, + "select": { + "default_siren_tone": { + "name": "Default siren tone" + }, + "default_siren_level": { + "name": "Default siren level" + }, + "default_strobe_level": { + "name": "Default strobe level" + }, + "default_strobe": { + "name": "Default strobe" + }, + "start_up_on_off": { + "name": "Start-up behavior" + }, + "power_on_state": { + "name": "Power on state" + }, + "backlight_mode": { + "name": "Backlight mode" + }, + "motion_sensitivity": { + "name": "Motion sensitivity" + }, + "monitoring_mode": { + "name": "Monitoring mode" + }, + "approach_distance": { + "name": "Approach distance" + }, + "window_covering_mode": { + "name": "Curtain mode" + }, + "output_mode": { + "name": "Output mode" + }, + "switch_type": { + "name": "Switch type" + }, + "led_scaling_mode": { + "name": "Led scaling mode" + }, + "increased_non_neutral_output": { + "name": "Non neutral output" + }, + "feeding_mode": { + "name": "Mode" + }, + "preset": { + "name": "Preset" + } + }, + "sensor": { + "analog_input": { + "name": "Analog input" + }, + "ac_frequency": { + "name": "AC frequency" + }, + "soil_moisture": { + "name": "Soil moisture" + }, + "leaf_wetness": { + "name": "Leaf wetness" + }, + "instantaneous_demand": { + "name": "Instantaneous demand" + }, + "summation_delivered": { + "name": "Summation delivered" + }, + "tier1_summation_delivered": { + "name": "Tier 1 summation delivered" + }, + "tier2_summation_delivered": { + "name": "Tier 2 summation delivered" + }, + "tier3_summation_delivered": { + "name": "Tier 3 summation delivered" + }, + "tier4_summation_delivered": { + "name": "Tier 4 summation delivered" + }, + "tier5_summation_delivered": { + "name": "Tier 5 summation delivered" + }, + "tier6_summation_delivered": { + "name": "Tier 6 summation delivered" + }, + "device_temperature": { + "name": "Device temperature" + }, + "formaldehyde": { + "name": "Formaldehyde concentration" + }, + "hvac_action": { + "name": "HVAC action" + }, + "rssi": { + "name": "RSSI" + }, + "lqi": { + "name": "LQI" + }, + "timer_time_left": { + "name": "Time left" + }, + "device_run_time": { + "name": "Device run time" + }, + "filter_run_time": { + "name": "Filter run time" + }, + "last_feeding_source": { + "name": "Last feeding source" + }, + "last_feeding_size": { + "name": "Last feeding size" + }, + "portions_dispensed_today": { + "name": "Portions dispensed today" + }, + "weight_dispensed_today": { + "name": "Weight dispensed today" + }, + "smoke_density": { + "name": "Smoke density" + } + }, + "switch": { + "switch": { + "name": "[%key:component::switch::title%]" + }, + "window_detection_function": { + "name": "Invert window detection" + }, + "trigger_indicator": { + "name": "LED trigger indicator" + }, + "power_outage_memory": { + "name": "Power outage memory" + }, + "child_lock": { + "name": "Child lock" + }, + "disable_led": { + "name": "Disable LED" + }, + "invert_switch": { + "name": "Invert switch" + }, + "smart_bulb_mode": { + "name": "Smart bulb mode" + }, + "double_tap_up_enabled": { + "name": "Double tap up enabled" + }, + "double_tap_down_enabled": { + "name": "Double tap down enabled" + }, + "aux_switch_scenes": { + "name": "Aux switch scenes" + }, + "binding_off_to_on_sync_level": { + "name": "Binding off to on sync level" + }, + "local_protection": { + "name": "Local protection" + }, + "one_led_mode": { + "name": "Only 1 LED mode" + }, + "firmware_progress_led": { + "name": "Firmware progress LED" + }, + "relay_click_in_on_off_mode": { + "name": "Disable relay click in on off mode" + }, + "disable_clear_notifications_double_tap": { + "name": "Disable config 2x tap to clear notifications" + }, + "led_indicator": { + "name": "LED indicator" + }, + "window_detection": { + "name": "Window detection" + }, + "valve_detection": { + "name": "Valve detection" + }, + "heartbeat_indicator": { + "name": "Heartbeat indicator" + }, + "linkage_alarm": { + "name": "Linkage alarm" + }, + "buzzer_manual_mute": { + "name": "Buzzer manual mute" + }, + "buzzer_manual_alarm": { + "name": "Buzzer manual alarm" + } + } } } diff --git a/homeassistant/components/zha/switch.py b/homeassistant/components/zha/switch.py index 6224eb02598..495c9470e53 100644 --- a/homeassistant/components/zha/switch.py +++ b/homeassistant/components/zha/switch.py @@ -63,7 +63,7 @@ async def async_setup_entry( class Switch(ZhaEntity, SwitchEntity): """ZHA switch.""" - _attr_name: str = "Switch" + _attr_translation_key = "switch" def __init__( self, @@ -276,7 +276,7 @@ class OnOffWindowDetectionFunctionConfigurationEntity(ZHASwitchConfigurationEnti _unique_id_suffix = "on_off_window_opened_detection" _zcl_attribute: str = "window_detection_function" _zcl_inverter_attribute: str = "window_detection_function_inverter" - _attr_name: str = "Invert window detection" + _attr_translation_key = "window_detection_function" @CONFIG_DIAGNOSTIC_MATCH( @@ -287,7 +287,7 @@ class P1MotionTriggerIndicatorSwitch(ZHASwitchConfigurationEntity): _unique_id_suffix = "trigger_indicator" _zcl_attribute: str = "trigger_indicator" - _attr_name = "LED trigger indicator" + _attr_translation_key = "trigger_indicator" @CONFIG_DIAGNOSTIC_MATCH( @@ -299,7 +299,7 @@ class XiaomiPlugPowerOutageMemorySwitch(ZHASwitchConfigurationEntity): _unique_id_suffix = "power_outage_memory" _zcl_attribute: str = "power_outage_memory" - _attr_name = "Power outage memory" + _attr_translation_key = "power_outage_memory" @CONFIG_DIAGNOSTIC_MATCH( @@ -312,7 +312,7 @@ class HueMotionTriggerIndicatorSwitch(ZHASwitchConfigurationEntity): _unique_id_suffix = "trigger_indicator" _zcl_attribute: str = "trigger_indicator" - _attr_name = "LED trigger indicator" + _attr_translation_key = "trigger_indicator" @CONFIG_DIAGNOSTIC_MATCH( @@ -324,7 +324,7 @@ class ChildLock(ZHASwitchConfigurationEntity): _unique_id_suffix = "child_lock" _zcl_attribute: str = "child_lock" - _attr_name = "Child lock" + _attr_translation_key = "child_lock" @CONFIG_DIAGNOSTIC_MATCH( @@ -336,7 +336,7 @@ class DisableLed(ZHASwitchConfigurationEntity): _unique_id_suffix = "disable_led" _zcl_attribute: str = "disable_led" - _attr_name = "Disable LED" + _attr_translation_key = "disable_led" @CONFIG_DIAGNOSTIC_MATCH( @@ -347,7 +347,7 @@ class InovelliInvertSwitch(ZHASwitchConfigurationEntity): _unique_id_suffix = "invert_switch" _zcl_attribute: str = "invert_switch" - _attr_name: str = "Invert switch" + _attr_translation_key = "invert_switch" @CONFIG_DIAGNOSTIC_MATCH( @@ -358,7 +358,7 @@ class InovelliSmartBulbMode(ZHASwitchConfigurationEntity): _unique_id_suffix = "smart_bulb_mode" _zcl_attribute: str = "smart_bulb_mode" - _attr_name: str = "Smart bulb mode" + _attr_translation_key = "smart_bulb_mode" @CONFIG_DIAGNOSTIC_MATCH( @@ -369,7 +369,7 @@ class InovelliDoubleTapUpEnabled(ZHASwitchConfigurationEntity): _unique_id_suffix = "double_tap_up_enabled" _zcl_attribute: str = "double_tap_up_enabled" - _attr_name: str = "Double tap up enabled" + _attr_translation_key = "double_tap_up_enabled" @CONFIG_DIAGNOSTIC_MATCH( @@ -380,7 +380,7 @@ class InovelliDoubleTapDownEnabled(ZHASwitchConfigurationEntity): _unique_id_suffix = "double_tap_down_enabled" _zcl_attribute: str = "double_tap_down_enabled" - _attr_name: str = "Double tap down enabled" + _attr_translation_key = "double_tap_down_enabled" @CONFIG_DIAGNOSTIC_MATCH( @@ -391,7 +391,7 @@ class InovelliAuxSwitchScenes(ZHASwitchConfigurationEntity): _unique_id_suffix = "aux_switch_scenes" _zcl_attribute: str = "aux_switch_scenes" - _attr_name: str = "Aux switch scenes" + _attr_translation_key = "aux_switch_scenes" @CONFIG_DIAGNOSTIC_MATCH( @@ -402,7 +402,7 @@ class InovelliBindingOffToOnSyncLevel(ZHASwitchConfigurationEntity): _unique_id_suffix = "binding_off_to_on_sync_level" _zcl_attribute: str = "binding_off_to_on_sync_level" - _attr_name: str = "Binding off to on sync level" + _attr_translation_key = "binding_off_to_on_sync_level" @CONFIG_DIAGNOSTIC_MATCH( @@ -413,7 +413,7 @@ class InovelliLocalProtection(ZHASwitchConfigurationEntity): _unique_id_suffix = "local_protection" _zcl_attribute: str = "local_protection" - _attr_name: str = "Local protection" + _attr_translation_key = "local_protection" @CONFIG_DIAGNOSTIC_MATCH( @@ -424,7 +424,7 @@ class InovelliOnOffLEDMode(ZHASwitchConfigurationEntity): _unique_id_suffix = "on_off_led_mode" _zcl_attribute: str = "on_off_led_mode" - _attr_name: str = "Only 1 LED mode" + _attr_translation_key = "one_led_mode" @CONFIG_DIAGNOSTIC_MATCH( @@ -435,7 +435,7 @@ class InovelliFirmwareProgressLED(ZHASwitchConfigurationEntity): _unique_id_suffix = "firmware_progress_led" _zcl_attribute: str = "firmware_progress_led" - _attr_name: str = "Firmware progress LED" + _attr_translation_key = "firmware_progress_led" @CONFIG_DIAGNOSTIC_MATCH( @@ -446,7 +446,7 @@ class InovelliRelayClickInOnOffMode(ZHASwitchConfigurationEntity): _unique_id_suffix = "relay_click_in_on_off_mode" _zcl_attribute: str = "relay_click_in_on_off_mode" - _attr_name: str = "Disable relay click in on off mode" + _attr_translation_key = "relay_click_in_on_off_mode" @CONFIG_DIAGNOSTIC_MATCH( @@ -457,7 +457,7 @@ class InovelliDisableDoubleTapClearNotificationsMode(ZHASwitchConfigurationEntit _unique_id_suffix = "disable_clear_notifications_double_tap" _zcl_attribute: str = "disable_clear_notifications_double_tap" - _attr_name: str = "Disable config 2x tap to clear notifications" + _attr_translation_key = "disable_clear_notifications_double_tap" @CONFIG_DIAGNOSTIC_MATCH( @@ -468,7 +468,7 @@ class AqaraPetFeederLEDIndicator(ZHASwitchConfigurationEntity): _unique_id_suffix = "disable_led_indicator" _zcl_attribute: str = "disable_led_indicator" - _attr_name = "LED indicator" + _attr_translation_key = "led_indicator" _force_inverted = True _attr_icon: str = "mdi:led-on" @@ -481,7 +481,7 @@ class AqaraPetFeederChildLock(ZHASwitchConfigurationEntity): _unique_id_suffix = "child_lock" _zcl_attribute: str = "child_lock" - _attr_name = "Child lock" + _attr_translation_key = "child_lock" _attr_icon: str = "mdi:account-lock" @@ -494,7 +494,7 @@ class TuyaChildLockSwitch(ZHASwitchConfigurationEntity): _unique_id_suffix = "child_lock" _zcl_attribute: str = "child_lock" - _attr_name = "Child lock" + _attr_translation_key = "child_lock" _attr_icon: str = "mdi:account-lock" @@ -506,7 +506,7 @@ class AqaraThermostatWindowDetection(ZHASwitchConfigurationEntity): _unique_id_suffix = "window_detection" _zcl_attribute: str = "window_detection" - _attr_name = "Window detection" + _attr_translation_key = "window_detection" @CONFIG_DIAGNOSTIC_MATCH( @@ -517,7 +517,7 @@ class AqaraThermostatValveDetection(ZHASwitchConfigurationEntity): _unique_id_suffix = "valve_detection" _zcl_attribute: str = "valve_detection" - _attr_name = "Valve detection" + _attr_translation_key = "valve_detection" @CONFIG_DIAGNOSTIC_MATCH( @@ -528,7 +528,7 @@ class AqaraThermostatChildLock(ZHASwitchConfigurationEntity): _unique_id_suffix = "child_lock" _zcl_attribute: str = "child_lock" - _attr_name = "Child lock" + _attr_translation_key = "child_lock" _attr_icon: str = "mdi:account-lock" @@ -540,7 +540,7 @@ class AqaraHeartbeatIndicator(ZHASwitchConfigurationEntity): _unique_id_suffix = "heartbeat_indicator" _zcl_attribute: str = "heartbeat_indicator" - _attr_name = "Heartbeat indicator" + _attr_translation_key = "heartbeat_indicator" _attr_icon: str = "mdi:heart-flash" @@ -552,7 +552,7 @@ class AqaraLinkageAlarm(ZHASwitchConfigurationEntity): _unique_id_suffix = "linkage_alarm" _zcl_attribute: str = "linkage_alarm" - _attr_name = "Linkage alarm" + _attr_translation_key = "linkage_alarm" _attr_icon: str = "mdi:shield-link-variant" @@ -564,7 +564,7 @@ class AqaraBuzzerManualMute(ZHASwitchConfigurationEntity): _unique_id_suffix = "buzzer_manual_mute" _zcl_attribute: str = "buzzer_manual_mute" - _attr_name = "Buzzer manual mute" + _attr_translation_key = "buzzer_manual_mute" _attr_icon: str = "mdi:volume-off" @@ -576,5 +576,5 @@ class AqaraBuzzerManualAlarm(ZHASwitchConfigurationEntity): _unique_id_suffix = "buzzer_manual_alarm" _zcl_attribute: str = "buzzer_manual_alarm" - _attr_name = "Buzzer manual alarm" + _attr_translation_key = "buzzer_manual_alarm" _attr_icon: str = "mdi:bullhorn" diff --git a/tests/components/zha/test_binary_sensor.py b/tests/components/zha/test_binary_sensor.py index 1b4f5b56924..b41499dada7 100644 --- a/tests/components/zha/test_binary_sensor.py +++ b/tests/components/zha/test_binary_sensor.py @@ -98,10 +98,22 @@ async def async_test_iaszone_on_off(hass, cluster, entity_id): @pytest.mark.parametrize( - ("device", "on_off_test", "cluster_name", "reporting"), + ("device", "on_off_test", "cluster_name", "reporting", "name"), [ - (DEVICE_IAS, async_test_iaszone_on_off, "ias_zone", (0,)), - (DEVICE_OCCUPANCY, async_test_binary_sensor_on_off, "occupancy", (1,)), + ( + DEVICE_IAS, + async_test_iaszone_on_off, + "ias_zone", + (0,), + "FakeManufacturer FakeModel IAS zone", + ), + ( + DEVICE_OCCUPANCY, + async_test_binary_sensor_on_off, + "occupancy", + (1,), + "FakeManufacturer FakeModel Occupancy", + ), ], ) async def test_binary_sensor( @@ -112,6 +124,7 @@ async def test_binary_sensor( on_off_test, cluster_name, reporting, + name, ) -> None: """Test ZHA binary_sensor platform.""" zigpy_device = zigpy_device_mock(device) @@ -119,6 +132,7 @@ async def test_binary_sensor( entity_id = find_entity_id(Platform.BINARY_SENSOR, zha_device, hass) assert entity_id is not None + assert hass.states.get(entity_id).name == name assert hass.states.get(entity_id).state == STATE_OFF await async_enable_traffic(hass, [zha_device], enabled=False) # test that the sensors exist and are in the unavailable state @@ -186,11 +200,12 @@ async def test_binary_sensor_migration_not_migrated( ) -> None: """Test temporary ZHA IasZone binary_sensor migration to zigpy cache.""" - entity_id = "binary_sensor.fakemanufacturer_fakemodel_iaszone" + entity_id = "binary_sensor.fakemanufacturer_fakemodel_ias_zone" core_rs(entity_id, state=restored_state, attributes={}) # migration sensor state await async_mock_load_restore_state_from_storage(hass) zigpy_device = zigpy_device_mock(DEVICE_IAS) + zha_device = await zha_device_restored(zigpy_device) entity_id = find_entity_id(Platform.BINARY_SENSOR, zha_device, hass) @@ -209,7 +224,7 @@ async def test_binary_sensor_migration_already_migrated( ) -> None: """Test temporary ZHA IasZone binary_sensor migration doesn't migrate multiple times.""" - entity_id = "binary_sensor.fakemanufacturer_fakemodel_iaszone" + entity_id = "binary_sensor.fakemanufacturer_fakemodel_ias_zone" core_rs(entity_id, state=STATE_OFF, attributes={"migrated_to_cache": True}) await async_mock_load_restore_state_from_storage(hass) diff --git a/tests/components/zha/test_discover.py b/tests/components/zha/test_discover.py index 768f974d928..c55f614d80f 100644 --- a/tests/components/zha/test_discover.py +++ b/tests/components/zha/test_discover.py @@ -144,7 +144,7 @@ async def test_devices( _, platform, entity_cls, unique_id, cluster_handlers = call[0] # the factory can return None. We filter these out to get an accurate created entity count response = entity_cls.create_entity(unique_id, zha_dev, cluster_handlers) - if response and not contains_ignored_suffix(response.name): + if response and not contains_ignored_suffix(response.unique_id): created_entity_count += 1 unique_id_head = UNIQUE_ID_HD.match(unique_id).group( 0 diff --git a/tests/components/zha/test_registries.py b/tests/components/zha/test_registries.py index 6f36ee624e9..2eb61402a95 100644 --- a/tests/components/zha/test_registries.py +++ b/tests/components/zha/test_registries.py @@ -596,6 +596,13 @@ def test_entity_names() -> None: if hasattr(entity, "_attr_name"): # The entity has a name assert isinstance(entity._attr_name, str) and entity._attr_name + elif hasattr(entity, "_attr_translation_key"): + assert ( + isinstance(entity._attr_translation_key, str) + and entity._attr_translation_key + ) + elif hasattr(entity, "_attr_device_class"): + assert entity._attr_device_class else: # The only exception (for now) is IASZone assert entity is IASZone diff --git a/tests/components/zha/test_sensor.py b/tests/components/zha/test_sensor.py index b9d9511a6d1..7c11077c55d 100644 --- a/tests/components/zha/test_sensor.py +++ b/tests/components/zha/test_sensor.py @@ -347,7 +347,7 @@ async def async_test_device_temperature(hass, cluster, entity_id): ), ( homeautomation.ElectricalMeasurement.cluster_id, - "active_power", + "power", async_test_electrical_measurement, 7, {"ac_power_divisor": 1000, "ac_power_multiplier": 1}, @@ -363,7 +363,7 @@ async def async_test_device_temperature(hass, cluster, entity_id): ), ( homeautomation.ElectricalMeasurement.cluster_id, - "rms_current", + "current", async_test_em_rms_current, 7, {"ac_current_divisor": 1000, "ac_current_multiplier": 1}, @@ -371,7 +371,7 @@ async def async_test_device_temperature(hass, cluster, entity_id): ), ( homeautomation.ElectricalMeasurement.cluster_id, - "rms_voltage", + "voltage", async_test_em_rms_voltage, 7, {"ac_voltage_divisor": 10, "ac_voltage_multiplier": 1}, @@ -613,9 +613,7 @@ async def test_electrical_measurement_init( ) cluster = zigpy_device.endpoints[1].in_clusters[cluster_id] zha_device = await zha_device_joined(zigpy_device) - entity_id = find_entity_id( - Platform.SENSOR, zha_device, hass, qualifier="active_power" - ) + entity_id = "sensor.fakemanufacturer_fakemodel_power" # allow traffic to flow through the gateway and devices await async_enable_traffic(hass, [zha_device]) @@ -660,23 +658,23 @@ async def test_electrical_measurement_init( homeautomation.ElectricalMeasurement.cluster_id, {"apparent_power", "rms_voltage", "rms_current"}, { - "active_power", + "power", "ac_frequency", "power_factor", }, { "apparent_power", - "rms_voltage", - "rms_current", + "voltage", + "current", }, ), ( homeautomation.ElectricalMeasurement.cluster_id, {"apparent_power", "rms_current", "ac_frequency", "power_factor"}, - {"rms_voltage", "active_power"}, + {"voltage", "power"}, { "apparent_power", - "rms_current", + "current", "ac_frequency", "power_factor", }, @@ -685,10 +683,10 @@ async def test_electrical_measurement_init( homeautomation.ElectricalMeasurement.cluster_id, set(), { - "rms_voltage", - "active_power", + "voltage", + "power", "apparent_power", - "rms_current", + "current", "ac_frequency", "power_factor", }, @@ -909,7 +907,7 @@ async def test_elec_measurement_sensor_type( ) -> None: """Test ZHA electrical measurement sensor type.""" - entity_id = ENTITY_ID_PREFIX.format("active_power") + entity_id = ENTITY_ID_PREFIX.format("power") zigpy_dev = elec_measurement_zigpy_dev zigpy_dev.endpoints[1].electrical_measurement.PLUGGED_ATTR_READS[ "measurement_type" @@ -958,7 +956,7 @@ async def test_elec_measurement_skip_unsupported_attribute( ) -> None: """Test ZHA electrical measurement skipping update of unsupported attributes.""" - entity_id = ENTITY_ID_PREFIX.format("active_power") + entity_id = ENTITY_ID_PREFIX.format("power") zha_dev = elec_measurement_zha_dev cluster = zha_dev.device.endpoints[1].electrical_measurement diff --git a/tests/components/zha/zha_devices_list.py b/tests/components/zha/zha_devices_list.py index bba5ee124ba..3be6322d1eb 100644 --- a/tests/components/zha/zha_devices_list.py +++ b/tests/components/zha/zha_devices_list.py @@ -100,7 +100,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-5-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.bosch_isw_zpr1_wp13_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.bosch_isw_zpr1_wp13_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-5-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -196,7 +196,7 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "PolledElectricalMeasurement", - DEV_SIG_ENT_MAP_ID: "sensor.centralite_3210_l_active_power", + DEV_SIG_ENT_MAP_ID: "sensor.centralite_3210_l_power", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-apparent_power"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -206,12 +206,12 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_current"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSCurrent", - DEV_SIG_ENT_MAP_ID: "sensor.centralite_3210_l_rms_current", + DEV_SIG_ENT_MAP_ID: "sensor.centralite_3210_l_current", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_voltage"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSVoltage", - DEV_SIG_ENT_MAP_ID: "sensor.centralite_3210_l_rms_voltage", + DEV_SIG_ENT_MAP_ID: "sensor.centralite_3210_l_voltage", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-ac_frequency"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -319,7 +319,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.centralite_3315_s_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.centralite_3315_s_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-1-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -374,7 +374,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.centralite_3320_l_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.centralite_3320_l_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-1-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -429,7 +429,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.centralite_3326_l_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.centralite_3326_l_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-1-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -484,7 +484,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.centralite_motion_sensor_a_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.centralite_motion_sensor_a_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-1-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -603,7 +603,7 @@ DEVICES = [ DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", DEV_SIG_ENT_MAP_ID: ( - "binary_sensor.climaxtechnology_sd8sc_00_00_03_12tc_iaszone" + "binary_sensor.climaxtechnology_sd8sc_00_00_03_12tc_ias_zone" ), }, ("button", "00:11:22:33:44:55:66:77-1-3"): { @@ -678,7 +678,7 @@ DEVICES = [ DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", DEV_SIG_ENT_MAP_ID: ( - "binary_sensor.climaxtechnology_ws15_00_00_03_03tc_iaszone" + "binary_sensor.climaxtechnology_ws15_00_00_03_03tc_ias_zone" ), }, ("button", "00:11:22:33:44:55:66:77-1-3"): { @@ -764,7 +764,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.heiman_smokesensor_em_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.heiman_smokesensor_em_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-1-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -832,7 +832,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.heiman_co_v16_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.heiman_co_v16_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-1-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -895,7 +895,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.heiman_warningdevice_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.heiman_warningdevice_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-1-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -933,7 +933,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-6-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.hivehome_com_mot003_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.hivehome_com_mot003_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-6-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -2081,12 +2081,12 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "PolledElectricalMeasurement", - DEV_SIG_ENT_MAP_ID: "sensor.lumi_lumi_plug_maus01_active_power", + DEV_SIG_ENT_MAP_ID: "sensor.lumi_lumi_plug_maus01_power", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_voltage"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSVoltage", - DEV_SIG_ENT_MAP_ID: "sensor.lumi_lumi_plug_maus01_rms_voltage", + DEV_SIG_ENT_MAP_ID: "sensor.lumi_lumi_plug_maus01_voltage", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-power_factor"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -2156,7 +2156,7 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "PolledElectricalMeasurement", - DEV_SIG_ENT_MAP_ID: "sensor.lumi_lumi_relay_c2acn01_active_power", + DEV_SIG_ENT_MAP_ID: "sensor.lumi_lumi_relay_c2acn01_power", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-apparent_power"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -2166,12 +2166,12 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_current"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSCurrent", - DEV_SIG_ENT_MAP_ID: "sensor.lumi_lumi_relay_c2acn01_rms_current", + DEV_SIG_ENT_MAP_ID: "sensor.lumi_lumi_relay_c2acn01_current", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_voltage"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSVoltage", - DEV_SIG_ENT_MAP_ID: "sensor.lumi_lumi_relay_c2acn01_rms_voltage", + DEV_SIG_ENT_MAP_ID: "sensor.lumi_lumi_relay_c2acn01_voltage", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-ac_frequency"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -3205,7 +3205,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.lumi_lumi_sensor_wleak_aq1_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.lumi_lumi_sensor_wleak_aq1_ias_zone", }, ("sensor", "00:11:22:33:44:55:66:77-1-2"): { DEV_SIG_CLUSTER_HANDLERS: ["device_temperature"], @@ -3378,7 +3378,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.nyce_3010_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.nyce_3010_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-1-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -3421,7 +3421,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.nyce_3014_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.nyce_3014_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-1-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -3629,9 +3629,7 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-3-2820"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "PolledElectricalMeasurement", - DEV_SIG_ENT_MAP_ID: ( - "sensor.osram_lightify_rt_tunable_white_active_power" - ), + DEV_SIG_ENT_MAP_ID: ("sensor.osram_lightify_rt_tunable_white_power"), }, ("sensor", "00:11:22:33:44:55:66:77-3-2820-apparent_power"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -3643,16 +3641,12 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-3-2820-rms_current"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSCurrent", - DEV_SIG_ENT_MAP_ID: ( - "sensor.osram_lightify_rt_tunable_white_rms_current" - ), + DEV_SIG_ENT_MAP_ID: ("sensor.osram_lightify_rt_tunable_white_current"), }, ("sensor", "00:11:22:33:44:55:66:77-3-2820-rms_voltage"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSVoltage", - DEV_SIG_ENT_MAP_ID: ( - "sensor.osram_lightify_rt_tunable_white_rms_voltage" - ), + DEV_SIG_ENT_MAP_ID: ("sensor.osram_lightify_rt_tunable_white_voltage"), }, ("sensor", "00:11:22:33:44:55:66:77-3-2820-ac_frequency"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -3881,7 +3875,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.samjin_button_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.samjin_button_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-1-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -3929,7 +3923,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.samjin_multi_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.samjin_multi_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-1-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -3982,7 +3976,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.samjin_water_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.samjin_water_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-1-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -4035,7 +4029,7 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "PolledElectricalMeasurement", - DEV_SIG_ENT_MAP_ID: "sensor.securifi_ltd_unk_model_active_power", + DEV_SIG_ENT_MAP_ID: "sensor.securifi_ltd_unk_model_power", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-apparent_power"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -4045,12 +4039,12 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_current"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSCurrent", - DEV_SIG_ENT_MAP_ID: "sensor.securifi_ltd_unk_model_rms_current", + DEV_SIG_ENT_MAP_ID: "sensor.securifi_ltd_unk_model_current", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_voltage"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSVoltage", - DEV_SIG_ENT_MAP_ID: "sensor.securifi_ltd_unk_model_rms_voltage", + DEV_SIG_ENT_MAP_ID: "sensor.securifi_ltd_unk_model_voltage", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-ac_frequency"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -4098,7 +4092,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.sercomm_corp_sz_dws04n_sf_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.sercomm_corp_sz_dws04n_sf_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-1-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -4163,7 +4157,7 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "PolledElectricalMeasurement", - DEV_SIG_ENT_MAP_ID: "sensor.sercomm_corp_sz_esw01_active_power", + DEV_SIG_ENT_MAP_ID: "sensor.sercomm_corp_sz_esw01_power", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-apparent_power"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -4173,12 +4167,12 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_current"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSCurrent", - DEV_SIG_ENT_MAP_ID: "sensor.sercomm_corp_sz_esw01_rms_current", + DEV_SIG_ENT_MAP_ID: "sensor.sercomm_corp_sz_esw01_current", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_voltage"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSVoltage", - DEV_SIG_ENT_MAP_ID: "sensor.sercomm_corp_sz_esw01_rms_voltage", + DEV_SIG_ENT_MAP_ID: "sensor.sercomm_corp_sz_esw01_voltage", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-ac_frequency"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -4231,7 +4225,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.sercomm_corp_sz_pir04_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.sercomm_corp_sz_pir04_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-1-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -4289,7 +4283,7 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "PolledElectricalMeasurement", - DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_rm3250zb_active_power", + DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_rm3250zb_power", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-apparent_power"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -4301,12 +4295,12 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_current"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSCurrent", - DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_rm3250zb_rms_current", + DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_rm3250zb_current", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_voltage"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSVoltage", - DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_rm3250zb_rms_voltage", + DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_rm3250zb_voltage", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-ac_frequency"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -4374,7 +4368,7 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "PolledElectricalMeasurement", - DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_th1123zb_active_power", + DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_th1123zb_power", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-apparent_power"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -4386,12 +4380,12 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_current"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSCurrent", - DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_th1123zb_rms_current", + DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_th1123zb_current", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_voltage"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSVoltage", - DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_th1123zb_rms_voltage", + DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_th1123zb_voltage", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-ac_frequency"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -4464,7 +4458,7 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "PolledElectricalMeasurement", - DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_th1124zb_active_power", + DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_th1124zb_power", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-apparent_power"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -4476,12 +4470,12 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_current"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSCurrent", - DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_th1124zb_rms_current", + DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_th1124zb_current", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_voltage"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSVoltage", - DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_th1124zb_rms_voltage", + DEV_SIG_ENT_MAP_ID: "sensor.sinope_technologies_th1124zb_voltage", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-ac_frequency"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -4544,7 +4538,7 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurement", - DEV_SIG_ENT_MAP_ID: "sensor.smartthings_outletv4_active_power", + DEV_SIG_ENT_MAP_ID: "sensor.smartthings_outletv4_power", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-apparent_power"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -4554,12 +4548,12 @@ DEVICES = [ ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_current"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSCurrent", - DEV_SIG_ENT_MAP_ID: "sensor.smartthings_outletv4_rms_current", + DEV_SIG_ENT_MAP_ID: "sensor.smartthings_outletv4_current", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-rms_voltage"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], DEV_SIG_ENT_MAP_CLASS: "ElectricalMeasurementRMSVoltage", - DEV_SIG_ENT_MAP_ID: "sensor.smartthings_outletv4_rms_voltage", + DEV_SIG_ENT_MAP_ID: "sensor.smartthings_outletv4_voltage", }, ("sensor", "00:11:22:33:44:55:66:77-1-2820-ac_frequency"): { DEV_SIG_CLUSTER_HANDLERS: ["electrical_measurement"], @@ -4731,7 +4725,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.visonic_mct_340_e_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.visonic_mct_340_e_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-1-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -4896,7 +4890,7 @@ DEVICES = [ ("binary_sensor", "00:11:22:33:44:55:66:77-1-1280"): { DEV_SIG_CLUSTER_HANDLERS: ["ias_zone"], DEV_SIG_ENT_MAP_CLASS: "IASZone", - DEV_SIG_ENT_MAP_ID: "binary_sensor.netvox_z308e3ed_iaszone", + DEV_SIG_ENT_MAP_ID: "binary_sensor.netvox_z308e3ed_ias_zone", }, ("button", "00:11:22:33:44:55:66:77-1-3"): { DEV_SIG_CLUSTER_HANDLERS: ["identify"], @@ -5526,7 +5520,7 @@ DEVICES = [ ("select", "00:11:22:33:44:55:66:77-2-1030-motion_sensitivity"): { DEV_SIG_CLUSTER_HANDLERS: ["philips_occupancy"], DEV_SIG_ENT_MAP_CLASS: "HueV1MotionSensitivity", - DEV_SIG_ENT_MAP_ID: "select.philips_sml001_hue_motion_sensitivity", + DEV_SIG_ENT_MAP_ID: "select.philips_sml001_motion_sensitivity", }, }, },