chickenhouse/source/light.py
Thomas Klaehn e541023bba ci: enable continuous integration
Signed-off-by: Thomas Klaehn <thomas.klaehn@u-blox.com>
2018-08-27 11:26:31 +02:00

20 lines
400 B
Python

'''
Created on Dec 24, 2016
@author: tkl
'''
import sys
sys.path.append('source/')
import time
import light_sensor
import mqtt
def main():
conn = mqtt.Mqtt(hostname='proxy')
light = light_sensor.LightSensor(1, 0x23)
conn.transmit("outdoor/chickenhouse/sensors/light", \
str(int(time.time())) + " " + str(light.read()))
if __name__ == "__main__":
sys.exit(main())