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
parent
868f88a4e0
commit
2747f08385
|
@ -57,6 +57,7 @@ class UnifiLedLight(Light):
|
||||||
self._name = light["name"]
|
self._name = light["name"]
|
||||||
self._unique_id = light["id"]
|
self._unique_id = light["id"]
|
||||||
self._state = light["status"]["output"]
|
self._state = light["status"]["output"]
|
||||||
|
self._available = light["isOnline"]
|
||||||
self._brightness = self._api.convertfrom100to255(light["status"]["led"])
|
self._brightness = self._api.convertfrom100to255(light["status"]["led"])
|
||||||
self._features = SUPPORT_BRIGHTNESS
|
self._features = SUPPORT_BRIGHTNESS
|
||||||
|
|
||||||
|
@ -65,6 +66,11 @@ class UnifiLedLight(Light):
|
||||||
"""Return the display name of this light."""
|
"""Return the display name of this light."""
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def available(self):
|
||||||
|
"""Return the available state of this light."""
|
||||||
|
return self._available
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def brightness(self):
|
def brightness(self):
|
||||||
"""Return the brightness name of this light."""
|
"""Return the brightness name of this light."""
|
||||||
|
@ -103,3 +109,4 @@ class UnifiLedLight(Light):
|
||||||
self._brightness = self._api.convertfrom100to255(
|
self._brightness = self._api.convertfrom100to255(
|
||||||
self._api.getlightbrightness(self._unique_id)
|
self._api.getlightbrightness(self._unique_id)
|
||||||
)
|
)
|
||||||
|
self._available = self._api.getlightavailable(self._unique_id)
|
||||||
|
|
|
@ -4,5 +4,5 @@
|
||||||
"documentation": "https://www.home-assistant.io/integrations/unifiled",
|
"documentation": "https://www.home-assistant.io/integrations/unifiled",
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"codeowners": ["@florisvdk"],
|
"codeowners": ["@florisvdk"],
|
||||||
"requirements": ["unifiled==0.10"]
|
"requirements": ["unifiled==0.11"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1922,7 +1922,7 @@ twentemilieu==0.1.0
|
||||||
twilio==6.32.0
|
twilio==6.32.0
|
||||||
|
|
||||||
# homeassistant.components.unifiled
|
# homeassistant.components.unifiled
|
||||||
unifiled==0.10
|
unifiled==0.11
|
||||||
|
|
||||||
# homeassistant.components.upcloud
|
# homeassistant.components.upcloud
|
||||||
upcloud-api==0.4.3
|
upcloud-api==0.4.3
|
||||||
|
|
Loading…
Reference in New Issue