Only toggle if in the correct state.
This commit is contained in:
parent
1c55878271
commit
c1b62bf672
1 changed files with 6 additions and 4 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue