slcp-opi-zero-installer/config_generator.py

19 lines
599 B
Python
Raw Normal View History

2022-11-17 06:37:50 +00:00
import json
from getpass import getpass
print("Siwat Light Control Protocol Configuration Generator")
server = input("MQTT Server Hostname / IP Address : ")
username = ""
password = ""
while True:
use_auth = input("Does this server require username and password to login (yes/no) : ")
if use_auth.lower() == "yes":
username = input("Username : ")
password = getpass("Password : ")
break
elif use_auth.lower() == "no":
break
print("Please answer yes / no")
base_topic = input("MQTT Base Topic : ")
frame_time = input("Frame Time (1/refresh rate) : ")