small reworks in frontend and scripts, mostly finalized ansible deploy script -- still needs testing
This commit is contained in:
parent
f41dfc4f86
commit
e57f803a52
25 changed files with 440 additions and 90 deletions
|
@ -8,17 +8,15 @@ class RelayState:
|
|||
|
||||
|
||||
def resp_to_relay_state(cmd: str) -> RelayState:
|
||||
state = True if cmd.find("ON") > -1 else False
|
||||
state = True if cmd.find("ON") > -1 else False #TODO maybe better handling of other
|
||||
#state = False if cmd.find("OFF") > -1 and state == None else None
|
||||
|
||||
r_state = RelayState(0, state)
|
||||
id = 0
|
||||
|
||||
id = None
|
||||
if cmd.startswith("T"):
|
||||
id = int(cmd[1]) + (8 if cmd[2] == "B" else 0)
|
||||
elif cmd.startswith("re_"):
|
||||
id = int(cmd[3]) + (8 if cmd[4] == "B" else 0)
|
||||
|
||||
else:
|
||||
id = None
|
||||
r_state = RelayState(id, state)
|
||||
return r_state
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue