Skip to content
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
29 changes: 1 addition & 28 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,4 @@
{
"python.languageServer": "Pylance",
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
"python.analysis.typeCheckingMode": "basic",
"python.analysis.extraPaths": [
"lib/apds9960",
"lib/bme280",
"lib/bq27441",
"lib/daplink_bridge",
"lib/daplink_flash",
"lib/gc9a01",
"lib/hts221",
"lib/im34dt05",
"lib/ism330dl",
"lib/lis2mdl",
"lib/mcp23009e",
"lib/ssd1327",
"lib/steami_config",
"lib/vl53l1x",
"lib/wsen-hids",
"lib/wsen-pads"
],
"python.analysis.stubPath": "typings",
"python.analysis.diagnosticSeverityOverrides": {
"reportMissingModuleSource": "none",
"reportWildcardImportFromLibrary": "none",
"reportGeneralTypeIssues": "warning"
},
"pylint.enabled": false,
"mypy-type-checker.enabled": false
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python"
}
2 changes: 0 additions & 2 deletions lib/apds9960/examples/light_theremin.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
# Map the light range to an index in our note array (0 to 14)
note_index = (clamped_light - MIN_LIGHT) * (TOTAL_NOTES - 1) // range_light


# Fetch the perfect harmonic frequency
freq = PENTATONIC_NOTES[note_index]

Expand All @@ -77,7 +76,6 @@
print("Light: {} | Note: {} | Freq: {} Hz".format(light_level, note_index, freq), end="\r")
last_freq = freq


sleep_ms(20)

except KeyboardInterrupt:
Expand Down
1 change: 0 additions & 1 deletion lib/mcp23009e/examples/i2c_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
reset.value(1)



print("=" * 60)
print("Scanner I2C - Recherche des périphériques")
print("=" * 60)
Expand Down
2 changes: 1 addition & 1 deletion lib/steami_config/steami_config/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# Reverse map: short key -> sensor name.
_KEY_SENSORS = {v: k for k, v in _SENSOR_KEYS.items()}


class SteamiConfig(object):
"""Persistent configuration stored in the DAPLink F103 config zone.

Expand Down Expand Up @@ -239,7 +240,6 @@ def get_accelerometer_calibration(self):
"oz": cal.get("oz", 0.0),
}


def apply_accelerometer_calibration(self, ism330dl_instance):
"""Apply stored accelerometer calibration to an ISM330DL instance."""
if type(ism330dl_instance).__name__.lower() != "ism330dl":
Expand Down
2 changes: 1 addition & 1 deletion lib/steami_screen/steami_screen/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

# --- Cardinal position names ---


class Screen:
"""High-level wrapper around a raw display backend."""

Expand Down Expand Up @@ -196,7 +197,6 @@ def bar(self, val, max_val=100, y_offset=0, color=LIGHT):
if fill_w > 0:
self._fill_rect(bx, by, fill_w, bar_h, color)


def gauge(self, val, min_val=0, max_val=100, color=LIGHT):
"""Draw a circular arc gauge (270 deg, gap at bottom).

Expand Down
1 change: 1 addition & 0 deletions lib/wsen-pads/examples/altitude.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

sensor = WSEN_PADS(i2c)


def pressure_to_altitude(p):
return 44330 * (1 - (p / SEA_LEVEL_PRESSURE) ** EXPONENT)

Expand Down
1 change: 1 addition & 0 deletions lib/wsen-pads/examples/pressure_trend.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
MAX_VALUES = 10
THRESHOLD = 0.5 # sensitivity (hPa)


def get_trend(values):
if len(values) < 2:
return "N/A"
Expand Down
1 change: 1 addition & 0 deletions lib/wsen-pads/examples/temp_pressure_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
i2c = I2C(1)
sensor = WSEN_PADS(i2c)


def bar_graph(value, vmin, vmax, width=20):
# Clamp value
if value < vmin:
Expand Down
28 changes: 28 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ select = [
"C90", # McCabe cyclomatic complexity
"DTZ", # flake8-datetimez
"E", # pycodestyle
"E203", # (preview) whitespace before ':', ';', or ','
"E225", # (preview) missing whitespace around operator
"E261", # (preview) at least two spaces before inline comment
"E262", # (preview) inline comment must start with '# '
"E265", # (preview) block comment must start with '# '
"E302", # (preview) expected 2 blank lines before function/class definition
"E303", # (preview) too many blank lines
"EXE", # flake8-executable
"F", # Pyflakes
"G", # flake8-logging-format
Expand Down Expand Up @@ -125,3 +128,28 @@ quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"

[tool.pyright]
typeCheckingMode = "basic"
stubPath = "typings"
extraPaths = [
"lib/apds9960",
"lib/bme280",
"lib/bq27441",
"lib/daplink_bridge",
"lib/daplink_flash",
"lib/gc9a01",
"lib/hts221",
"lib/im34dt05",
"lib/ism330dl",
"lib/lis2mdl",
"lib/mcp23009e",
"lib/ssd1327",
"lib/steami_config",
"lib/steami_screen",
"lib/vl53l1x",
"lib/wsen-hids",
"lib/wsen-pads",
]
reportMissingModuleSource = "none"
reportWildcardImportFromLibrary = "none"
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def pytest_addoption(parser):
)



def pytest_collection_modifyitems(config, items):
port = config.getoption("--port")
driver = config.getoption("--driver")
Expand Down
Loading