#!/usr/bin/env python3
# ANL:waggle-license
#  This file is part of the Waggle Platform.  Please see the file
#  LICENSE.waggle.txt for the legal details of the copyright and software
#  license.  For more details on the Waggle project, visit:
#           http://www.wa8.gl
# ANL:waggle-license
from waggle.plugin import Plugin
from random import random
import time

plugin = Plugin()

while True:
    value = random()

    print('adding measurement', value, flush=True)

    plugin.add_measurement({
        'id': 1,
        'sub_id': 1,
        'value': value,
    })

    plugin.publish_measurements()

    time.sleep(1)
