Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jposada202020 committed Jul 14, 2023
1 parent af5e62e commit ffc952d
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 81 deletions.
1 change: 0 additions & 1 deletion docs/_static/favicon.ico.license
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
SPDX-FileCopyrightText: 2023 Immaterial

SPDX-License-Identifier: CC-BY-4.0

65 changes: 2 additions & 63 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

# SPDX-FileCopyrightText: 2023 Jose D. Montoya
#
# SPDX-License-Identifier: MIT
Expand All @@ -16,8 +14,8 @@
from mock import Mock

to_be_mocked = [
'micropython',
'machine',
"micropython",
"machine",
]
for module in to_be_mocked:
sys.modules[module] = Mock()
Expand All @@ -32,7 +30,6 @@
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_immaterial",
]
Expand Down Expand Up @@ -203,61 +200,3 @@
# These paths are either relative to html_static_path
# or fully qualified paths (eg. https://...)
html_css_files = ["extra_css.css"]


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
# Latex figure (float) alignment
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(
master_doc,
"MicroPython_mcp9808_Library.tex",
"MicroPython mcp9808 Library Documentation",
author,
"manual",
),
]

# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(
master_doc,
"MicroPython_mcp9808_Library",
"MicroPython mcp9808 Library Documentation",
[author],
1,
),
]

# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(
master_doc,
"MicroPython_mcp9808_Library",
"MicroPython mcp9808 Library Documentation",
author,
"MicroPython_mcp9808_Library",
"One line description of project.",
"Miscellaneous",
),
]
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Table of Contents
.. toctree::
:caption: Other Links

Download from GitHub <https://github.com/jposada202020/MciroPython_MCP9808/releases/latest>
Download from GitHub <https://github.com/jposada202020/MicroPython_MCP9808/releases/latest>
4 changes: 2 additions & 2 deletions examples/mcp9808_hysteresis.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
for hysteresis in mcp9808.hysteresis_values:
print("Current Hysteresis setting: ", mcp.hysteresis)
for _ in range(10):
temp = mcp.temperature
print("Temperature: {:.2f}C".format(temp))
print(f"Temperature: {mcp.temperature:.2f}°C")
print()
time.sleep(0.5)
mcp.hysteresis = hysteresis
4 changes: 2 additions & 2 deletions examples/mcp9808_power_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
for power_mode in mcp9808.power_mode_values:
print("Current Power mode setting: ", mcp.power_mode)
for _ in range(10):
temp = mcp.temperature
print("Temperature: {:.2f}C".format(temp))
print(f"Temperature: {mcp.temperature:.2f}°C")
print()
time.sleep(0.5)
mcp.power_mode = power_mode
4 changes: 2 additions & 2 deletions examples/mcp9808_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
mcp = mcp9808.MCP9808(i2c)

while True:
temp = mcp.temperature
print("Temperature: {:.2f}C".format(temp))
print(f"Temperature: {mcp.temperature:.2f}°C")
print()
time.sleep(0.5)
3 changes: 2 additions & 1 deletion examples/mcp9808_temperature_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
mcp.temperature_critical = 35

while True:
print("Temperature: {:.2f}C".format(mcp.temperature))
print(f"Temperature: {mcp.temperature:.2f}°C")
print()
alert_status = mcp.alert_status
if alert_status.high_alert:
print("Temperature above high set limit!")
Expand Down
4 changes: 2 additions & 2 deletions examples/mcp9808_temperature_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
for temperature_resolution in mcp9808.temperature_resolution_values:
print("Current Temperature resolution setting: ", mcp.temperature_resolution)
for _ in range(10):
temp = mcp.temperature
print("Temperature: {:.2f}C".format(temp))
print(f"Temperature: {mcp.temperature:.2f}°C")
print()
time.sleep(0.5)
mcp.temperature_resolution = temperature_resolution
3 changes: 0 additions & 3 deletions micropython_mcp9808/i2c_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def __get__(
obj,
objtype=None,
) -> int:

mem_value = obj._i2c.readfrom_mem(obj._address, self.register, self.lenght)

reg = 0
Expand All @@ -84,7 +83,6 @@ def __get__(
return reg

def __set__(self, obj, value: int) -> None:

memory_value = obj._i2c.readfrom_mem(obj._address, self.register, self.lenght)

reg = 0
Expand Down Expand Up @@ -117,7 +115,6 @@ def __get__(
obj,
objtype=None,
):

if self.lenght <= 2:
value = struct.unpack(
self.format,
Expand Down
2 changes: 0 additions & 2 deletions micropython_mcp9808/mcp9808.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ def temperature(self):

@staticmethod
def _convert_temperature(temp: bytearray) -> float:

temp[0] = temp[0] & 0x1F
if temp[0] & 0x10 == 0x10:
temp[0] = temp[0] & 0x0F
Expand All @@ -195,7 +194,6 @@ def temperature_upper(self, value: int) -> None:
self._limit_temperatures(value, _UPPER_TEMP)

def _get_temperature(self, register_address):

data = bytearray(2)
self._i2c.readfrom_mem_into(self._address, register_address, data)

Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ authors = [
urls = {Homepage = "https://github.com/jposada202020/MicroPython_MCP9808"}
keywords = [
"sensor",
"micropython",
"mcp9808",
"temperature",
"microchip",
"mcp9808",
"temperature",
"micropython",
]
Expand Down

0 comments on commit ffc952d

Please sign in to comment.