Add support for Flo "pucks" (#47074)

So far the Flo integration only supports shutoff valves. Add support for Flo leak detector pucks, which measure temperature and humidity in addition to providing leak alerts.
This commit is contained in:
Adam Ernst
2021-03-08 06:36:03 -06:00
committed by GitHub
parent d37fb7d88d
commit ad86eb4be3
14 changed files with 389 additions and 66 deletions

View File

@@ -14,14 +14,19 @@ async def test_sensors(hass, config_entry, aioclient_mock_fixture):
)
await hass.async_block_till_done()
assert len(hass.data[FLO_DOMAIN][config_entry.entry_id]["devices"]) == 1
assert len(hass.data[FLO_DOMAIN][config_entry.entry_id]["devices"]) == 2
# we should have 5 entities for the device
# we should have 5 entities for the valve
assert hass.states.get("sensor.current_system_mode").state == "home"
assert hass.states.get("sensor.today_s_water_usage").state == "3.7"
assert hass.states.get("sensor.water_flow_rate").state == "0"
assert hass.states.get("sensor.water_pressure").state == "54.2"
assert hass.states.get("sensor.water_temperature").state == "21.1"
assert hass.states.get("sensor.water_temperature").state == "21"
# and 3 entities for the detector
assert hass.states.get("sensor.temperature").state == "16"
assert hass.states.get("sensor.humidity").state == "43"
assert hass.states.get("sensor.battery").state == "100"
async def test_manual_update_entity(
@@ -34,7 +39,7 @@ async def test_manual_update_entity(
)
await hass.async_block_till_done()
assert len(hass.data[FLO_DOMAIN][config_entry.entry_id]["devices"]) == 1
assert len(hass.data[FLO_DOMAIN][config_entry.entry_id]["devices"]) == 2
await async_setup_component(hass, "homeassistant", {})