1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 04:50:05 +00:00

Use ENERGY_KILO_WATT_HOUR constant (#33962)

This commit is contained in:
springstan
2020-04-10 20:21:29 +02:00
committed by GitHub
parent c3c4752fa5
commit 02c9e47db8
13 changed files with 132 additions and 60 deletions

View File

@@ -40,7 +40,9 @@ async def prometheus_client(loop, hass, hass_client):
sensor2.entity_id = "sensor.radio_energy"
await sensor2.async_update_ha_state()
sensor3 = DemoSensor(None, "Electricity price", 0.123, None, "SEK/kWh", None)
sensor3 = DemoSensor(
None, "Electricity price", 0.123, None, f"SEK/{ENERGY_KILO_WATT_HOUR}", None
)
sensor3.hass = hass
sensor3.entity_id = "sensor.electricity_price"
await sensor3.async_update_ha_state()