Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
Update trait.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DewGew authored Jan 8, 2023
1 parent 9f8a9bb commit 234f041
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trait.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def execute(self, command, params):
url = DOMOTICZ_URL + '/json.htm?type=command&param=switchscene&idx=' + self.state.id + '&switchcmd='
if params['on'] is True and state == 'Off':
url += 'On'
elif params['on'] is False and state == 'On':
elif params['on'] is False and state != 'Off':
url += 'Off'
else:
raise SmartHomeError(ERR_ALREADY_IN_STATE,
Expand All @@ -210,7 +210,7 @@ def execute(self, command, params):
url = DOMOTICZ_URL + '/json.htm?type=command&param=switchlight&idx=' + self.state.id + '&switchcmd='
if params['on'] is True and state == 'Off':
url += 'On'
elif params['on'] is False and state == 'On':
elif params['on'] is False and state != 'Off':
url += 'Off'
else:
raise SmartHomeError(ERR_ALREADY_IN_STATE,
Expand Down

0 comments on commit 234f041

Please sign in to comment.