removed max lifetime
This commit is contained in:
parent
4b571ab688
commit
f07a6384cd
1 changed files with 5 additions and 6 deletions
11
pulse.py
11
pulse.py
|
@ -17,8 +17,7 @@ TIBBERTOKEN=os.getenv('TIBBERTOKEN', '')
|
||||||
URL = os.getenv('URL',"" )
|
URL = os.getenv('URL',"" )
|
||||||
BUCKET = os.getenv('BUCKET',"tibber" )
|
BUCKET = os.getenv('BUCKET',"tibber" )
|
||||||
ORG = os.getenv('ORG',"Default" )
|
ORG = os.getenv('ORG',"Default" )
|
||||||
duration_seconds = 3600
|
|
||||||
start_time = time.time()
|
|
||||||
|
|
||||||
#logging
|
#logging
|
||||||
logger = logging.getLogger("TibberInflux")
|
logger = logging.getLogger("TibberInflux")
|
||||||
|
@ -33,7 +32,7 @@ logger.addHandler(ch)
|
||||||
|
|
||||||
logger.setLevel(logging.INFO)
|
logger.setLevel(logging.INFO)
|
||||||
|
|
||||||
__version__ = "v0.0.5"
|
__version__ = "v0.0.6"
|
||||||
logger.info(__version__)
|
logger.info(__version__)
|
||||||
client = InfluxDBClient(url=URL, token=TOKEN, org=ORG)
|
client = InfluxDBClient(url=URL, token=TOKEN, org=ORG)
|
||||||
|
|
||||||
|
@ -63,12 +62,12 @@ async def run():
|
||||||
await home.rt_subscribe(_incoming)
|
await home.rt_subscribe(_incoming)
|
||||||
|
|
||||||
|
|
||||||
while time.time() - start_time < duration_seconds:
|
while 1:
|
||||||
await asyncio.sleep(5)
|
await asyncio.sleep(5)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
loop.run_until_complete(run())
|
|
||||||
exit(0)
|
loop.run_until_complete(run())
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue