Skip to content

Commit 363fbb6

Browse files
authored
Merge pull request #37 from jposada202020/updating_example
fixing_example
2 parents 4a1b777 + a9f8400 commit 363fbb6

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

docs/examples.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,13 @@ Show the MCP9808 to setup different temperature values
1616
.. literalinclude:: ../examples/mcp9808_temperature_limits.py
1717
:caption: examples/mcp9808_temperature_limits.py
1818
:linenos:
19+
20+
MQTT with HomeAssistant
21+
------------------------
22+
23+
python script to read mcp9808 temperature and publish it in mqtt.
24+
Using discovery topic to create entity in Home Assistant.
25+
26+
.. literalinclude:: ../examples/mcp9808_average_temp_mqtt.py
27+
:caption: examples/mcp9808_average_temp_mqtt.py
28+
:linenos:

examples/mcp9808_temperature_limits.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525

2626
# Showing temperature Limits
2727
while True:
28-
if mcp.below_lt:
28+
if mcp.below_lower:
2929
print("too cold!")
30-
if mcp.above_ut:
30+
if mcp.above_upper:
3131
print("getting hot!")
32-
if mcp.above_ct:
32+
if mcp.above_critical:
3333
print("Above critical temp!")

0 commit comments

Comments
 (0)