Skip to content

fixing_example #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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!")