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

Commit

Permalink
get state from domoticz before execution
Browse files Browse the repository at this point in the history
  • Loading branch information
DewGew authored Jan 5, 2023
1 parent 33cc139 commit f123e80
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions smarthome.py
Original file line number Diff line number Diff line change
Expand Up @@ -1032,11 +1032,10 @@ def smarthome_query(self, payload, token):
"""
response = {}
devices = {}
getDevices()


for device in payload.get('devices', []):
devid = device['id']
#_GoogleEntity(aogDevs.get(devid, None)).async_update()
_GoogleEntity(aogDevs.get(devid, None)).async_update()
state = aogDevs.get(devid, None)
if not state:
# If we can't find a state, the device is offline
Expand Down Expand Up @@ -1068,6 +1067,7 @@ def smarthome_exec(self, payload, token):
for device, execution in product(command['devices'],
command['execution']):
entity_id = device['id']
_GoogleEntity(aogDevs.get(entity_id, None)).async_update() # Get states before execution

# Happens if error occurred. Skip entity for further processing
if entity_id in results:
Expand Down

0 comments on commit f123e80

Please sign in to comment.