Skip to content

Commit

Permalink
Merge pull request #37 from jposada202020/updating_example
Browse files Browse the repository at this point in the history
fixing_example
  • Loading branch information
FoamyGuy authored Jul 31, 2023
2 parents 4a1b777 + a9f8400 commit 363fbb6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,13 @@ Show the MCP9808 to setup different temperature values
.. literalinclude:: ../examples/mcp9808_temperature_limits.py
:caption: examples/mcp9808_temperature_limits.py
:linenos:

MQTT with HomeAssistant
------------------------

python script to read mcp9808 temperature and publish it in mqtt.
Using discovery topic to create entity in Home Assistant.

.. literalinclude:: ../examples/mcp9808_average_temp_mqtt.py
:caption: examples/mcp9808_average_temp_mqtt.py
:linenos:
6 changes: 3 additions & 3 deletions examples/mcp9808_temperature_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

# Showing temperature Limits
while True:
if mcp.below_lt:
if mcp.below_lower:
print("too cold!")
if mcp.above_ut:
if mcp.above_upper:
print("getting hot!")
if mcp.above_ct:
if mcp.above_critical:
print("Above critical temp!")

0 comments on commit 363fbb6

Please sign in to comment.