weather_01_collect_and_post_weather_data_carouge.py 430 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/usr/bin/env python3

"""
Creates entity in IoT platform, and loops for ever sending updates on the weather data for Carouge
"""

import time
import logging
from weather_api import *

logger = logging.getLogger()
logger.setLevel(logging.INFO)

# Create entity in case it doesnt exist
create_weather_entity_in_platform()

# Send updates in a loop
while True:
    time.sleep(POST_DATA_PERIOD)
    post_weather_data_to_platform()