From d849b12bc7ecc56eec235d9128fee85941bebb56 Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 24 Apr 2026 15:41:51 +0200 Subject: [PATCH] Add distance device class to Ecowitt lightning distance sensors (#168995) --- homeassistant/components/ecowitt/sensor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/ecowitt/sensor.py b/homeassistant/components/ecowitt/sensor.py index 296490511cbe..284677e13967 100644 --- a/homeassistant/components/ecowitt/sensor.py +++ b/homeassistant/components/ecowitt/sensor.py @@ -213,11 +213,13 @@ ECOWITT_SENSORS_MAPPING: Final = { ), EcoWittSensorTypes.LIGHTNING_DISTANCE_KM: SensorEntityDescription( key="LIGHTNING_DISTANCE_KM", + device_class=SensorDeviceClass.DISTANCE, native_unit_of_measurement=UnitOfLength.KILOMETERS, state_class=SensorStateClass.MEASUREMENT, ), EcoWittSensorTypes.LIGHTNING_DISTANCE_MILES: SensorEntityDescription( key="LIGHTNING_DISTANCE_MILES", + device_class=SensorDeviceClass.DISTANCE, native_unit_of_measurement=UnitOfLength.MILES, state_class=SensorStateClass.MEASUREMENT, ),