diff --git a/homeassistant/components/landisgyr_heat_meter/sensor.py b/homeassistant/components/landisgyr_heat_meter/sensor.py index af966297421..244515a07d4 100644 --- a/homeassistant/components/landisgyr_heat_meter/sensor.py +++ b/homeassistant/components/landisgyr_heat_meter/sensor.py @@ -77,6 +77,7 @@ HEAT_METER_SENSOR_TYPES = ( icon="mdi:fire", name="Heat previous year GJ", native_unit_of_measurement=UnitOfEnergy.GIGA_JOULE, + device_class=SensorDeviceClass.ENERGY, entity_category=EntityCategory.DIAGNOSTIC, value_fn=lambda res: getattr(res, "heat_previous_year_gj", None), ), diff --git a/tests/components/landisgyr_heat_meter/snapshots/test_sensor.ambr b/tests/components/landisgyr_heat_meter/snapshots/test_sensor.ambr index e149073d9c8..9c62ca3f94b 100644 --- a/tests/components/landisgyr_heat_meter/snapshots/test_sensor.ambr +++ b/tests/components/landisgyr_heat_meter/snapshots/test_sensor.ambr @@ -31,6 +31,7 @@ }), StateSnapshot({ 'attributes': ReadOnlyDict({ + 'device_class': 'energy', 'friendly_name': 'Heat Meter Heat previous year GJ', 'icon': 'mdi:fire', 'unit_of_measurement': ,