mirror of
https://github.com/daniviga/bite.git
synced 2025-02-19 23:06:03 +01:00
Use shared subscription
This commit is contained in:
parent
2a443815b0
commit
32b6350c35
@ -32,7 +32,8 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
async def mqtt_broker(self):
|
async def mqtt_broker(self):
|
||||||
async with Client(MQTT_HOST, port=MQTT_PORT) as client:
|
async with Client(MQTT_HOST, port=MQTT_PORT) as client:
|
||||||
await client.subscribe("#")
|
# use shared subscription for HA/balancing
|
||||||
|
await client.subscribe("$share/telemetry/#")
|
||||||
async with client.unfiltered_messages() as messages:
|
async with client.unfiltered_messages() as messages:
|
||||||
async for message in messages:
|
async for message in messages:
|
||||||
payload = json.loads(message.payload.decode('utf-8'))
|
payload = json.loads(message.payload.decode('utf-8'))
|
||||||
|
Loading…
Reference in New Issue
Block a user