Fix utility_meter calibration with float values (#35186)

This commit is contained in:
Diogo Gomes authored and GitHub committed 2020-05-05 02:44:00 +02:00
1 parent 96b84ff348
commit 53c1aba7df
2 files changed
+13 -2

No files matched your search

@@ -119,6 +119,17 @@ async def test_state(hass):
assert state is not None
assert state.state == "100"
await hass.services.async_call(
DOMAIN,
SERVICE_CALIBRATE_METER,
{ATTR_ENTITY_ID: "sensor.energy_bill_midpeak", ATTR_VALUE: "0.123"},
blocking=True,
)
await hass.async_block_till_done()
state = hass.states.get("sensor.energy_bill_midpeak")
assert state is not None
assert state.state == "0.123"
async def test_net_consumption(hass):
"""Test utility sensor state."""