mirror of
https://github.com/home-assistant/core.git
synced 2025-08-10 16:15:08 +02:00
Expose Wemo component availability to home assistant
This commit is contained in:
@@ -107,6 +107,11 @@ class WemoLight(Light):
|
|||||||
"""Flag supported features."""
|
"""Flag supported features."""
|
||||||
return SUPPORT_WEMO
|
return SUPPORT_WEMO
|
||||||
|
|
||||||
|
@property
|
||||||
|
def available(self):
|
||||||
|
"""Return if light is available."""
|
||||||
|
return self.device.state['available']
|
||||||
|
|
||||||
def turn_on(self, **kwargs):
|
def turn_on(self, **kwargs):
|
||||||
"""Turn the light on."""
|
"""Turn the light on."""
|
||||||
transitiontime = int(kwargs.get(ATTR_TRANSITION, 0))
|
transitiontime = int(kwargs.get(ATTR_TRANSITION, 0))
|
||||||
@@ -195,6 +200,11 @@ class WemoDimmer(Light):
|
|||||||
"""Return true if dimmer is on. Standby is on."""
|
"""Return true if dimmer is on. Standby is on."""
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
|
@property
|
||||||
|
def available(self):
|
||||||
|
"""Return if dimmer is available."""
|
||||||
|
return self.device.state['available']
|
||||||
|
|
||||||
def _update(self, force_update=True):
|
def _update(self, force_update=True):
|
||||||
"""Update the device state."""
|
"""Update the device state."""
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user