From 2747f08385ef6560347db54d77a663caa5db423f Mon Sep 17 00:00:00 2001 From: Floris Van der krieken Date: Sun, 27 Oct 2019 05:18:23 +0100 Subject: [PATCH] Add available state to unifiled integration (#28189) * Added Unifi Led * fixed manifest * fixed style issue * removed unused setting * added sugested changes. * fixed order * fixed settings that are required * Fix review issues * fix variable name that was too short * Testing something * Reverted to a previous version for testing * Reverted testing changes. * Add available status and increase version of unifiled package version. * No io in init function. --- homeassistant/components/unifiled/light.py | 7 +++++++ homeassistant/components/unifiled/manifest.json | 2 +- requirements_all.txt | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/unifiled/light.py b/homeassistant/components/unifiled/light.py index 3dd1a8d5dc9..6b0b1e2edf1 100644 --- a/homeassistant/components/unifiled/light.py +++ b/homeassistant/components/unifiled/light.py @@ -57,6 +57,7 @@ class UnifiLedLight(Light): self._name = light["name"] self._unique_id = light["id"] self._state = light["status"]["output"] + self._available = light["isOnline"] self._brightness = self._api.convertfrom100to255(light["status"]["led"]) self._features = SUPPORT_BRIGHTNESS @@ -65,6 +66,11 @@ class UnifiLedLight(Light): """Return the display name of this light.""" return self._name + @property + def available(self): + """Return the available state of this light.""" + return self._available + @property def brightness(self): """Return the brightness name of this light.""" @@ -103,3 +109,4 @@ class UnifiLedLight(Light): self._brightness = self._api.convertfrom100to255( self._api.getlightbrightness(self._unique_id) ) + self._available = self._api.getlightavailable(self._unique_id) diff --git a/homeassistant/components/unifiled/manifest.json b/homeassistant/components/unifiled/manifest.json index fbf05470c6d..927798bd9ce 100644 --- a/homeassistant/components/unifiled/manifest.json +++ b/homeassistant/components/unifiled/manifest.json @@ -4,5 +4,5 @@ "documentation": "https://www.home-assistant.io/integrations/unifiled", "dependencies": [], "codeowners": ["@florisvdk"], - "requirements": ["unifiled==0.10"] + "requirements": ["unifiled==0.11"] } diff --git a/requirements_all.txt b/requirements_all.txt index a0c4b747f41..d02d11d5f58 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1922,7 +1922,7 @@ twentemilieu==0.1.0 twilio==6.32.0 # homeassistant.components.unifiled -unifiled==0.10 +unifiled==0.11 # homeassistant.components.upcloud upcloud-api==0.4.3