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

Commit

Permalink
Remove Already instate report error
Browse files Browse the repository at this point in the history
  • Loading branch information
DewGew committed Jan 2, 2023
1 parent cbc0139 commit 967ee45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion const.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

"""Constants for Google Assistant."""
VERSION = '1.22.47'
VERSION = '1.22.48'
PUBLIC_URL = 'https://[your public url]'
CONFIGFILE = 'config/config.yaml'
LOGFILE = 'dzga.log'
Expand Down
6 changes: 2 additions & 4 deletions trait.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,9 @@ 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':
else params['on'] is False and state == 'On':
url += 'Off'
else:
raise SmartHomeError(ERR_ALREADY_IN_STATE,
'Unable to execute {} for {}. Already in state '.format(command, self.state.entity_id))


if protected:
url = url + '&passcode=' + configuration['Domoticz']['switchProtectionPass']
Expand Down

0 comments on commit 967ee45

Please sign in to comment.