Skip to content

Commit b419fc3

Browse files
committed
Don't check for secrets if not using MQTT
1 parent ba50b47 commit b419fc3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

FunHouse_Motion_Outlet/code.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
OUTLET_STATE_TOPIC = "funhouse/outlet/state"
1313
OUTLET_COMMAND_TOPIC = "funhouse/outlet/set"
1414
MOTION_TIMEOUT = 300 # Timeout in seconds
15-
USE_MQTT = True
15+
USE_MQTT = False
1616

17-
try:
18-
from secrets import secrets
19-
except ImportError:
20-
print("WiFi secrets are kept in secrets.py, please add them there!")
21-
raise
17+
if USE_MQTT:
18+
try:
19+
from secrets import secrets
20+
except ImportError:
21+
print("WiFi secrets are kept in secrets.py, please add them there!")
22+
raise
2223

2324
def set_outlet_state(value):
2425
global last_pir_timestamp

0 commit comments

Comments
 (0)