mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +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):
|
||||
""" Turn the device on. """
|
||||
|
||||
_LOGGING.info("Turning on Turtle Mode")
|
||||
self.toggle_turtle_mode()
|
||||
if self._state == STATE_OFF:
|
||||
_LOGGING.info("Turning on Turtle Mode")
|
||||
self.toggle_turtle_mode()
|
||||
|
||||
def turn_off(self, **kwargs):
|
||||
""" Turn the device off. """
|
||||
|
||||
_LOGGING.info("Turning off Turtle Mode ")
|
||||
self.toggle_turtle_mode()
|
||||
if self._state == STATE_ON:
|
||||
_LOGGING.info("Turning off Turtle Mode ")
|
||||
self.toggle_turtle_mode()
|
||||
|
||||
def toggle_turtle_mode(self):
|
||||
""" Toggle turtle mode. """
|
||||
|
Loading…
x
Reference in New Issue
Block a user