Skip to content

Instantly share code, notes, and snippets.

@danielsiwiec
Last active December 23, 2020 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielsiwiec/f536b9d25b894d54b2b01db26ddc2c4d to your computer and use it in GitHub Desktop.
Save danielsiwiec/f536b9d25b894d54b2b01db26ddc2c4d to your computer and use it in GitHub Desktop.
esp8266-thermostat
props = load_props()
connect_to_wifi(props['wifi_sid'], props['wifi_pass'])
mqtt = MQTT(props['client_id'], props['iot_endpoint'], props['iot_topic'])
thermistor = Thermistor()
while True:
temp = thermistor.get_temp()
mqtt.send({'temp': temp})
deep_sleep_seconds(props['sleep_seconds'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment