From fd6c14eaae0c63c0335c6db71739d9937db3b903 Mon Sep 17 00:00:00 2001 From: Rich O Date: Wed, 27 Nov 2019 15:27:44 -0500 Subject: [PATCH] dumping out error --- r0b3bot.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/r0b3bot.py b/r0b3bot.py index e7dee8d..02f7645 100644 --- a/r0b3bot.py +++ b/r0b3bot.py @@ -270,7 +270,9 @@ async def printstat(ctx): print(f" - POST Response: {response.text}") except: # Do nothing if this fails - print(" ! Unable to turn on light") + e = sys.exc_info()[0] + + print(f" ! Unable to turn on light; DUMP: {e}") await ctx.send("Sorry, I was unable to turn on the light.") pass @@ -292,7 +294,8 @@ 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 = f'service_data={{"entity_id": "{HASS_LIGHT}"}}' - requests.post(hassAPIURL, headers=hassHEADERS, data=payload) + response = requests.post(hassAPIURL, headers=hassHEADERS, data=payload) + except: # Do nothing is this fails print(" ! Unable to turn off light") -- 2.39.5