Skip to content

Commit

Permalink
better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
awalford16 committed Dec 6, 2024
1 parent 381937c commit 1fdec0d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .deploy/office-lights/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ replicaCount: 1
image:
repository: adamwalford/office-lights
pullPolicy: IfNotPresent
# tag: 0.1.0-arm64
tag: 0.2.0

imagePullSecrets: []
nameOverride: ""
Expand Down
5 changes: 2 additions & 3 deletions src/office-lights/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from mqtt import MQTT
from timer import DeviceTimer

MQTT_SUBSCRIPTION = "office/lights"
MQTT_SUBSCRIPTION = "office/test"
DEFAULT_LIGHT_STATE = "FOCUS"
IS_DISABLED = False

Expand Down Expand Up @@ -32,14 +32,13 @@ def on_message(client, userdata, message):
return

if not IS_DISABLED:
print(f"Setting state to {state}")

# If state is not supported, return with no action
if not hasattr(States, state):
print(f"Invalid State, nothing to do")
return

# Update the light state
print(f"Setting state to {state}")
hue.change_light_state(Groups.OFFICE, True, States[state])
print(f"Starting light timeout of: {activity_timer.timeout}")

Expand Down
2 changes: 1 addition & 1 deletion src/office-lights/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_on_message(client, userdata, msg):
client.loop_start()

# Publish a message to a topic
message = "TEST" # Your message here
message = "OFF" # Your message here
# client.publish(topic, message)
# client.publish(topic, "ALERT")
# client.publish(topic, message)
Expand Down

0 comments on commit 1fdec0d

Please sign in to comment.