mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Merge pull request #1451 from MartinHjelmare/mysensors-assumed-state
Add assumed_state to mysensors switch and light
This commit is contained in:
commit
2823d8f0d8
@ -116,6 +116,11 @@ class MySensorsLight(Light):
|
|||||||
"""Return True if entity is available."""
|
"""Return True if entity is available."""
|
||||||
return self.value_type in self._values
|
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
|
@property
|
||||||
def is_on(self):
|
def is_on(self):
|
||||||
"""True if device is on."""
|
"""True if device is on."""
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
homeassistant.components.mysensors.
|
Connect to a MySensors gateway via pymysensors API.
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
MySensors component that connects to a MySensors gateway via pymysensors
|
|
||||||
API.
|
|
||||||
|
|
||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/sensor.mysensors/
|
https://home-assistant.io/components/sensor.mysensors/
|
||||||
|
@ -149,6 +149,11 @@ class MySensorsSwitch(SwitchDevice):
|
|||||||
"""Return True if entity is available."""
|
"""Return True if entity is available."""
|
||||||
return self.value_type in self._values
|
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):
|
def update(self):
|
||||||
"""Update the controller with the latest value from a sensor."""
|
"""Update the controller with the latest value from a sensor."""
|
||||||
node = self.gateway.sensors[self.node_id]
|
node = self.gateway.sensors[self.node_id]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user