File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 12
12
OUTLET_STATE_TOPIC = "funhouse/outlet/state"
13
13
OUTLET_COMMAND_TOPIC = "funhouse/outlet/set"
14
14
MOTION_TIMEOUT = 300 # Timeout in seconds
15
+ USE_MQTT = True
15
16
16
17
try :
17
18
from secrets import secrets
@@ -32,7 +33,7 @@ def set_outlet_state(value):
32
33
publish_outlet_state ()
33
34
34
35
def publish_outlet_state ():
35
- if OUTLET_STATE_TOPIC and OUTLET_COMMAND_TOPIC :
36
+ if USE_MQTT :
36
37
funhouse .peripherals .led = True
37
38
output = "on" if outlet .value else "off"
38
39
# Publish the Dotstar State
@@ -88,7 +89,7 @@ def timeleft():
88
89
funhouse .splash .append (status )
89
90
90
91
# Initialize a new MQTT Client object
91
- if OUTLET_STATE_TOPIC and OUTLET_COMMAND_TOPIC :
92
+ if USE_MQTT :
92
93
funhouse .network .init_mqtt (
93
94
secrets ["mqtt_broker" ],
94
95
secrets ["mqtt_port" ],
@@ -112,4 +113,5 @@ def timeleft():
112
113
set_outlet_state (False )
113
114
funhouse .set_text (timeleft (), countdown_label )
114
115
# Check any topics we are subscribed to
115
- funhouse .network .mqtt_loop (0.5 )
116
+ if USE_MQTT :
117
+ funhouse .network .mqtt_loop (0.5 )
You can’t perform that action at this time.
0 commit comments