Landis+Gyr Heat Meter: add heat previous year GJ as diagnostic (#78690)

Add heat previous year GJ as diagnostic
This commit is contained in:
Vincent Knoop Pathuis 2022-09-28 08:28:31 +02:00 committed by GitHub
parent e360a4fa9e
commit 9ee81fdd77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -44,6 +44,14 @@ HEAT_METER_SENSOR_TYPES = (
native_unit_of_measurement=ENERGY_MEGA_WATT_HOUR,
entity_category=EntityCategory.DIAGNOSTIC,
),
# Diagnostic entity for debugging, this will match the value in GJ of previous year indicated on the meter's display
SensorEntityDescription(
key="heat_previous_year_gj",
icon="mdi:fire",
name="Heat previous year GJ",
native_unit_of_measurement="GJ",
entity_category=EntityCategory.DIAGNOSTIC,
),
SensorEntityDescription(
key="volume_previous_year_m3",
icon="mdi:fire",

View file

@ -76,7 +76,7 @@ async def test_create_sensors(mock_heat_meter, hass):
await hass.async_block_till_done()
# check if 26 attributes have been created
assert len(hass.states.async_all()) == 26
assert len(hass.states.async_all()) == 27
entity_reg = entity_registry.async_get(hass)
state = hass.states.get("sensor.heat_meter_heat_usage")