Skip to content

Commit

Permalink
[ENH] Data collector cli
Browse files Browse the repository at this point in the history
  • Loading branch information
dragarthPl committed May 17, 2024
1 parent 1244a06 commit 0c4acc1
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions src/stove_connector/stream_stove_data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import json
import os
from datetime import datetime
from typing import Any

import click
from loguru import logger

import redis
Expand Down Expand Up @@ -110,13 +113,30 @@ async def stream(self) -> None:
counter += 1


if __name__ == '__main__':
stream_ip = "192.168.1.236"
stream_port = 9801
@click.command()
@click.option('--stream_ip', envvar="STREAM_IP", help="The IP address of the stove driver")
@click.option('--stream_port', envvar="STREAM_PORT", help="The port of the stove driver")
@click.option(
'--redis_ip',
envvar="REDIS_IP",
default="localhost",
help="The IP address of the redis server",
)
@click.option(
'--redis_port',
envvar="REDIS_PORT",
default=6379,
help="The port of the redis server",
)
def cli(stream_ip: str, stream_port: int, redis_ip: str, redis_port: int):
stream_stove_data = StreamStoveData(
ip_stove_driver=stream_ip,
port_stove_driver=stream_port,
redis_ip="localhost",
redis_port=6379
redis_ip=redis_ip,
redis_port=redis_port
)
asyncio.run(stream_stove_data.stream())
asyncio.run(stream_stove_data.stream())


if __name__ == '__main__':
cli()

0 comments on commit 0c4acc1

Please sign in to comment.