MQTT Switch to expose assumed_state if optimistic
This commit is contained in:
parent
8f70630790
commit
443b39bccd
2 changed files with 8 additions and 1 deletions
|
@ -97,6 +97,11 @@ class MqttSwitch(SwitchDevice):
|
|||
""" True if device is on. """
|
||||
return self._state
|
||||
|
||||
@property
|
||||
def assumed_state(self):
|
||||
"""Return True if we do optimistic updates."""
|
||||
return self._optimistic
|
||||
|
||||
def turn_on(self, **kwargs):
|
||||
""" Turn the device on. """
|
||||
mqtt.publish(self.hass, self._command_topic, self._payload_on,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue