forked from home-assistant/core
Only toggle if in the correct state.
This commit is contained in:
@@ -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()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user