mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Only toggle if in the correct state.
This commit is contained in:
parent
1c55878271
commit
c1b62bf672
@ -117,12 +117,14 @@ class TransmissionSwitch(ToggleEntity):
|
|||||||
def turn_on(self, **kwargs):
|
def turn_on(self, **kwargs):
|
||||||
""" Turn the device on. """
|
""" Turn the device on. """
|
||||||
|
|
||||||
|
if self._state == STATE_OFF:
|
||||||
_LOGGING.info("Turning on Turtle Mode")
|
_LOGGING.info("Turning on Turtle Mode")
|
||||||
self.toggle_turtle_mode()
|
self.toggle_turtle_mode()
|
||||||
|
|
||||||
def turn_off(self, **kwargs):
|
def turn_off(self, **kwargs):
|
||||||
""" Turn the device off. """
|
""" Turn the device off. """
|
||||||
|
|
||||||
|
if self._state == STATE_ON:
|
||||||
_LOGGING.info("Turning off Turtle Mode ")
|
_LOGGING.info("Turning off Turtle Mode ")
|
||||||
self.toggle_turtle_mode()
|
self.toggle_turtle_mode()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user