Merge pull request #1451 from MartinHjelmare/mysensors-assumed-state
Add assumed_state to mysensors switch and lightpull/1449/merge
commit
2823d8f0d8
|
@ -116,6 +116,11 @@ class MySensorsLight(Light):
|
|||
"""Return True if entity is available."""
|
||||
return self.value_type in self._values
|
||||
|
||||
@property
|
||||
def assumed_state(self):
|
||||
"""Return True if unable to access real state of entity."""
|
||||
return self.gateway.optimistic
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
"""True if device is on."""
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
"""
|
||||
homeassistant.components.mysensors.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
MySensors component that connects to a MySensors gateway via pymysensors
|
||||
API.
|
||||
Connect to a MySensors gateway via pymysensors API.
|
||||
|
||||
For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/sensor.mysensors/
|
||||
|
|
|
@ -149,6 +149,11 @@ class MySensorsSwitch(SwitchDevice):
|
|||
"""Return True if entity is available."""
|
||||
return self.value_type in self._values
|
||||
|
||||
@property
|
||||
def assumed_state(self):
|
||||
"""Return True if unable to access real state of entity."""
|
||||
return self.gateway.optimistic
|
||||
|
||||
def update(self):
|
||||
"""Update the controller with the latest value from a sensor."""
|
||||
node = self.gateway.sensors[self.node_id]
|
||||
|
|
Loading…
Reference in New Issue