mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
update
This commit is contained in:
parent
a9a650edb6
commit
fd7808e6f4
@ -6,7 +6,7 @@ Allows to configure a MQTT switch.
|
|||||||
|
|
||||||
In an ideal scenario, the MQTT device will have a state topic to publish
|
In an ideal scenario, the MQTT device will have a state topic to publish
|
||||||
state changes. If these messages are published with RETAIN flag, the MQTT
|
state changes. If these messages are published with RETAIN flag, the MQTT
|
||||||
switch will receive an instant state update after subscription and will
|
switch will receive an instant state update after subscription and will
|
||||||
start with correct state. Otherwise, the initial state of the switch will
|
start with correct state. Otherwise, the initial state of the switch will
|
||||||
be false/off.
|
be false/off.
|
||||||
|
|
||||||
@ -91,6 +91,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||||||
config.get('optimistic', DEFAULT_OPTIMISTIC))])
|
config.get('optimistic', DEFAULT_OPTIMISTIC))])
|
||||||
|
|
||||||
|
|
||||||
|
#pylint: disable-msg=too-many-arguments
|
||||||
class MqttSwitch(SwitchDevice):
|
class MqttSwitch(SwitchDevice):
|
||||||
""" Represents a switch that can be togggled using MQTT """
|
""" Represents a switch that can be togggled using MQTT """
|
||||||
def __init__(self, hass, name, state_topic, command_topic,
|
def __init__(self, hass, name, state_topic, command_topic,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user