From 6ceb9736069de997405750b20ab6dba93196ff97 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Thu, 22 Jun 2023 16:03:28 +0200 Subject: [PATCH] Add entity translations for Abode (#94169) --- homeassistant/components/abode/sensor.py | 4 +--- tests/components/abode/test_sensor.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/abode/sensor.py b/homeassistant/components/abode/sensor.py index 546d57ab3e7..11821773938 100644 --- a/homeassistant/components/abode/sensor.py +++ b/homeassistant/components/abode/sensor.py @@ -22,17 +22,14 @@ from .const import DOMAIN SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( SensorEntityDescription( key=CONST.TEMP_STATUS_KEY, - name="Temperature", device_class=SensorDeviceClass.TEMPERATURE, ), SensorEntityDescription( key=CONST.HUMI_STATUS_KEY, - name="Humidity", device_class=SensorDeviceClass.HUMIDITY, ), SensorEntityDescription( key=CONST.LUX_STATUS_KEY, - name="Lux", device_class=SensorDeviceClass.ILLUMINANCE, ), ) @@ -56,6 +53,7 @@ class AbodeSensor(AbodeDevice, SensorEntity): """A sensor implementation for Abode devices.""" _device: AbodeSense + _attr_has_entity_name = True def __init__( self, diff --git a/tests/components/abode/test_sensor.py b/tests/components/abode/test_sensor.py index 67892dfafb4..755dfbf584e 100644 --- a/tests/components/abode/test_sensor.py +++ b/tests/components/abode/test_sensor.py @@ -37,7 +37,7 @@ async def test_attributes(hass: HomeAssistant) -> None: assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Environment Sensor Humidity" assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.HUMIDITY - state = hass.states.get("sensor.environment_sensor_lux") + state = hass.states.get("sensor.environment_sensor_illuminance") assert state.state == "1.0" assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == "lx"