More cleanup
This commit is contained in:
parent
8f615e179e
commit
969e702238
@ -32,7 +32,7 @@ class MQTTHandler:
|
|||||||
self.handler_id = handler_id
|
self.handler_id = handler_id
|
||||||
self.mqtt_config = mqtt_config
|
self.mqtt_config = mqtt_config
|
||||||
|
|
||||||
self.topic_base = f"asset/{handler_id}"
|
self.topic_base = f"device/{handler_id}"
|
||||||
self.status_topic = f"{self.topic_base}/status"
|
self.status_topic = f"{self.topic_base}/status"
|
||||||
self.command_topic = f"{self.topic_base}/command"
|
self.command_topic = f"{self.topic_base}/command"
|
||||||
self.property_topic = f"{self.topic_base}/property"
|
self.property_topic = f"{self.topic_base}/property"
|
||||||
|
|||||||
6
main.py
6
main.py
@ -1,17 +1,13 @@
|
|||||||
#! /usr/bin/env python3
|
#! /usr/bin/env python3
|
||||||
|
|
||||||
import aiomqtt
|
|
||||||
import aioserial
|
import aioserial
|
||||||
import asyncio
|
import asyncio
|
||||||
import paho
|
|
||||||
import socket
|
import socket
|
||||||
import signal
|
import signal
|
||||||
|
|
||||||
from ubxhandler import UBXHandler
|
from ubxhandler import UBXHandler
|
||||||
from handler import MQTTConfig
|
from handler import MQTTConfig
|
||||||
|
|
||||||
BAUD = 115200
|
|
||||||
|
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
handler_id = f"example-gps-{socket.gethostname()}"
|
handler_id = f"example-gps-{socket.gethostname()}"
|
||||||
@ -19,7 +15,7 @@ async def main():
|
|||||||
|
|
||||||
serial_port = aioserial.AioSerial(
|
serial_port = aioserial.AioSerial(
|
||||||
port="/tmp/ttyV0",
|
port="/tmp/ttyV0",
|
||||||
baudrate=BAUD,
|
baudrate=115200,
|
||||||
timeout=0.05, # 50 ms
|
timeout=0.05, # 50 ms
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user