fixing variable calling #30

Merged
Rich merged 1 commits from 2-homeassistant-api-connection-is-broken into master 2019-11-27 19:36:46 +00:00
+2 -2
View File
@@ -255,7 +255,7 @@ async def printstat(ctx):
#remote.call_service(hassapi, 'switch', 'turn_on', {'entity_id':'{}'.format(HASS_LIGHT)})
hassAPIRUL = HASS_IP_ADDRESS + "/api/services/switch/turn_on"
payload = {
"entity": HASS_LIGHT
"entity": f"{HASS_LIGHT}"
}
requests.post(hassAPIURL, data=payload, headers=hassHEADERS)
except:
@@ -289,7 +289,7 @@ async def printstat(ctx):
#remote.call_service(hassapi, 'switch', 'turn_on', {'entity_id':'{}'.format(HASS_LIGHT)})
hassAPIRUL = HASS_IP_ADDRESS + "/api/services/switch/turn_off"
payload = {
"entity": HASS_LIGHT
"entity": f"{HASS_LIGHT}"
}
requests.post(hassAPIURL, data=payload, headers=hassHEADERS)
except: