added systemd service config files and misc changes, still need to finish writing the reworked tse box controller
This commit is contained in:
parent
81218eb21a
commit
e595fb97ce
10 changed files with 131 additions and 8 deletions
|
@ -32,9 +32,9 @@ def parse_barco_response(raw: str):
|
|||
|
||||
|
||||
async def barco_telnet_command(client, writer, select: str):
|
||||
onSub = f"p1/projektorji/{select}/#"
|
||||
print('TEST', onSub)
|
||||
onMatch = f"p1/projektorji/{select}/ukaz/+"
|
||||
onSub = f"p1/projectors/{select}/#"
|
||||
#print('TEST', onSub)
|
||||
onMatch = f"p1/projectors/{select}/command/+"
|
||||
await client.subscribe(onSub)
|
||||
async with client.messages() as msgs:
|
||||
async for mesg in msgs:
|
||||
|
@ -46,7 +46,7 @@ async def barco_telnet_command(client, writer, select: str):
|
|||
# print("test")
|
||||
cmd = mesg.topic.value.split("/")[-1]
|
||||
#val = '1' if mesg.payload.decode() == 'ON' else '0'
|
||||
val = '1' if mesg.payload.decode() == 'ON' else '0'
|
||||
val = '1' if mesg.payload.decode() == 'ON' else '0' # refactor to direct 0 and 1
|
||||
barcoCmd = f"[{cmdMap[cmd]}{val}]"
|
||||
print("Received: [" + mesg.topic.value + "] payload: [" + mesg.payload.decode() + "]")
|
||||
print("Sending command to Barco: " + barcoCmd)
|
||||
|
@ -62,7 +62,7 @@ async def barco_telnet_read_status(client, reader, select: str):
|
|||
if parsed == None:
|
||||
continue #TODO alert for errors
|
||||
print(f"Updating topic [{parsed[0]}] with value [{parsed[1]}]")
|
||||
await client.publish(f"p1/projektorji/{select}/status/{parsed[0]}", payload=parsed[1])
|
||||
await client.publish(f"p1/projectors/{select}/status/{parsed[0]}", payload=parsed[1])
|
||||
|
||||
|
||||
async def barco_telnet_query_status(writer, select: str):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue