mirror of
https://github.com/OMGeeky/flucto-heisskleber.git
synced 2026-01-06 11:39:44 +01:00
19 lines
455 B
Python
19 lines
455 B
Python
import asyncio
|
|
|
|
from heisskleber.mqtt import AsyncMqttSubscriber, MqttConf
|
|
|
|
|
|
async def main():
|
|
conf = MqttConf(broker="localhost", port=1883, user="", password="")
|
|
sub = AsyncMqttSubscriber(conf, topic="#")
|
|
# async for topic, message in sub:
|
|
# print(message)
|
|
_ = asyncio.create_task(sub.run())
|
|
while True:
|
|
topic, message = await sub.receive()
|
|
print(message)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|