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.
pull/28258/head
Floris Van der krieken 2019-10-27 05:18:23 +01:00 committed by Martin Hjelmare
parent 868f88a4e0
commit 2747f08385
3 changed files with 9 additions and 2 deletions

View File

@ -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)

View File

@ -4,5 +4,5 @@
"documentation": "https://www.home-assistant.io/integrations/unifiled",
"dependencies": [],
"codeowners": ["@florisvdk"],
"requirements": ["unifiled==0.10"]
"requirements": ["unifiled==0.11"]
}

View File

@ -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