From eae183e669b2fb2a3ae630d5f3d287cb5ec343af Mon Sep 17 00:00:00 2001 From: Rich Oberholtzer Date: Fri, 22 Nov 2019 15:24:24 -0500 Subject: [PATCH] adding more infromation to console to troubelshoot --- r0b3bot.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/r0b3bot.py b/r0b3bot.py index 423b74f..62640b6 100644 --- a/r0b3bot.py +++ b/r0b3bot.py @@ -32,7 +32,7 @@ HASS_IP_ADDRESS = config.get('bot-config', 'hass_ip_address') HASS_LIGHT = config.get('bot-config', 'hass_light') hassURL = "http://" + HASS_IP_ADDRESS + ":8123/api/states/" + HASS_LIGHT hassHEADERS = { - 'Authorization': f'Bearer {HASS_API_KEY}', + 'Authorization': f"Bearer {HASS_API_KEY}", 'content-type': 'application/json', } @@ -40,6 +40,12 @@ OCTOPRINT_IP_ADDRESS = config.get('bot-config', 'octoprint_ip_address') DISCORD_AUTH_TOKEN = config.get('bot-config', 'discord_auth_token') +# Printing configuration details to console +print(f"HomeAssistant URL: {hassURL}") +print(f"HomeAssistant URL HEADERS: {hassHEADERS}") +print(f"HomeAssistant Light: {HASS_LIGHT}") +print(f"OctoPrint IP Address: {OCTOPRINT_IP_ADDRESS}") + # This is now deprecated and will be replaced with using the REST hassapi = remote.API(HASS_IP_ADDRESS, HASS_API_KEY) @@ -225,6 +231,7 @@ async def printstat(ctx): print(" - Getting Printer Light Status") #work_lights = remote.get_state(hassapi, 'switch.work_lights') work_lights = requests.get(hassURL, hassHEADERS) + print(f" Response from HomeAssistant: {work_lights}") # Making sure that the API request succeeded. If it has, there will be a state attribute added to # work_lights. -- 2.39.5