Add switch support to the Flo integration (#38268)

* Add switch domain to Flo integration

* lint

* updates post rebase

* fix after rebase

* remove device state attrs

* oops

* stale name and docstring
This commit is contained in:
David F. Mulcahey authored and GitHub committed 2020-08-13 07:52:30 -04:00
1 parent 52a9921ed3
commit ca5e752514
7 files changed
+357 -1

No files matched your search

+10
View File
@@ -162,6 +162,16 @@ class FloDeviceDataUpdateCoordinator(DataUpdateCoordinator):
or self.pending_warning_alerts_count
)
@property
def last_known_valve_state(self) -> str:
"""Return the last known valve state for the device."""
return self._device_information["valve"]["lastKnown"]
@property
def target_valve_state(self) -> str:
"""Return the target valve state for the device."""
return self._device_information["valve"]["target"]
async def _update_device(self, *_) -> None:
"""Update the device information from the API."""
self._device_information = await self.api_client.device.get_info(