mirror of
https://github.com/OMGeeky/flucto-heisskleber.git
synced 2026-02-15 22:14:31 +01:00
* Add start, stop and __repr__ to sink and source types. * Merge conflicts on mqtt async pub and resampler. * Add start() and stop() functions to udp and zmq. Change tests accordingly. * Rename broker, ip, interface to common config name "host". * Updated "host" entry in config files. * Add lazyload to mqtt-source.
20 lines
449 B
Python
20 lines
449 B
Python
import asyncio
|
|
|
|
from heisskleber.mqtt import AsyncMqttSubscriber, MqttConf
|
|
from heisskleber.stream import Resampler, ResamplerConf
|
|
|
|
|
|
async def main():
|
|
conf = MqttConf(host="localhost", port=1883, user="", password="")
|
|
sub = AsyncMqttSubscriber(conf, topic="#")
|
|
|
|
resampler = Resampler(ResamplerConf(), sub)
|
|
|
|
while True:
|
|
data = await resampler.receive()
|
|
print(data)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|