2017-03-30 09:58:55 +00:00
|
|
|
'''
|
|
|
|
Created on Dec 24, 2016
|
|
|
|
|
|
|
|
@author: tkl
|
|
|
|
'''
|
|
|
|
import sys
|
2017-03-30 12:09:49 +00:00
|
|
|
sys.path.append('source/')
|
2017-03-30 09:58:55 +00:00
|
|
|
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())
|