Tidy up logging
This commit is contained in:
4
api.py
4
api.py
@@ -9,7 +9,7 @@ def getReq(endpoint) -> dict:
|
||||
"Authorization": "Bearer " + TOKEN,
|
||||
"content-type": "application/json"
|
||||
}
|
||||
print("Starting request for " + endpoint)
|
||||
print("GET " + endpoint)
|
||||
try:
|
||||
response = get(HASS_URL + endpoint, headers=headers)
|
||||
return response.json()
|
||||
@@ -22,7 +22,7 @@ def postReq(endpoint, d) -> bool:
|
||||
"Authorization": "Bearer " + TOKEN,
|
||||
"content-type": "application/json"
|
||||
}
|
||||
print("Starting post request to " + endpoint)
|
||||
print("POST " + endpoint)
|
||||
try:
|
||||
response = post(HASS_URL + endpoint, headers=headers, json=d)
|
||||
return response.status_code == 200
|
||||
|
||||
1
app.py
1
app.py
@@ -102,7 +102,6 @@ class App:
|
||||
self.scr_n -= 1
|
||||
self.lcd.left["v"] = False
|
||||
self.lcd.right["v"] = False
|
||||
print(f"Screen change: {c}")
|
||||
return c
|
||||
|
||||
def handleButtons(self) -> bool:
|
||||
|
||||
@@ -138,10 +138,8 @@ class LightsScreen(Screen):
|
||||
# otherwise display the outline lightbulb icon in grey, centrally in the light's grid square
|
||||
else:
|
||||
color = colour(80, 80, 80)
|
||||
print("Drawing light off")
|
||||
with open("images/lightbulb-off.bmp", "rb") as file_handle:
|
||||
reader = BMPFileReader(file_handle)
|
||||
print("Drawing light off - loaded file")
|
||||
img_height = reader.get_height()
|
||||
x_offset = w//2 + xo - reader.get_width()//2
|
||||
y_offset = h//2 + yo - reader.get_height()//2 - 4
|
||||
@@ -161,7 +159,6 @@ class LightsScreen(Screen):
|
||||
self._invalidConfig(lcd)
|
||||
return
|
||||
self._updateData()
|
||||
print("Updating lights")
|
||||
# for each light to be displayed
|
||||
for i in range(0, len(self.d)):
|
||||
# if its settings have changed, re-draw them without clearing the display
|
||||
|
||||
Reference in New Issue
Block a user