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