Fix utility_meter calibration with float values (#35186)

This commit is contained in:
Diogo Gomes authored and Paulus Schoutsen committed 2020-05-04 18:03:05 -07:00
1 parent c03e3ce961
commit 96576a9775
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."""