Last active
February 12, 2018 19:28
-
-
Save kinkerl/5c76558652e4102716180dede30b0a5f to your computer and use it in GitHub Desktop.
main.py for microhomie quickstart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import utime | |
import settings | |
from homie.node.dht22 import DHT22 | |
from homie import HomieDevice | |
# Homie device setup | |
homie_device = HomieDevice(settings) | |
homie_device.add_node(DHT22(interval=60, pin=2)) | |
homie_device.publish_properties() | |
while True: | |
# Push the new data to MQTT | |
homie_device.publish_data() | |
# Sleep a little bit | |
utime.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment