Skip to content

Commit

Permalink
Restore support for Python 3.9
Browse files Browse the repository at this point in the history
Fixes: #16
  • Loading branch information
stefanor committed Oct 27, 2024
1 parent dbaf5c0 commit e6e69ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Currently supported:

- Before installing, you need to have `python3` installed, with a
working `venv` module.
- On Debian/Ubuntu/Raspbian, this means installing the `python3-venv` package.
- On Debian/Ubuntu/Raspberry Pi OS, this means installing the `python3-venv` package.
- Supported Python 3 versions: >= 3.9
- Install this plugin through SignalK / npm.
- Use the native Victron app to obtain advertisement keys for
communicating with your Victron devices.
Expand Down
9 changes: 5 additions & 4 deletions plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import json
import logging
import sys
from typing import Any, Callable, TypeAlias
from typing import Any, Callable, Union

from bleak.backends.device import BLEDevice
from victron_ble.devices import (
Expand All @@ -26,16 +26,17 @@

logger = logging.getLogger("signalk-victron-ble")

SignalKDelta: TypeAlias = dict[str, list[dict[str, Any]]]
SignalKDeltaValues: TypeAlias = list[dict[str, int | float | str | None]]
# 3.9 compatible TypeAliases
SignalKDelta = dict[str, list[dict[str, Any]]]
SignalKDeltaValues = list[dict[str, Union[int, float, str, None]]]


@dataclasses.dataclass
class ConfiguredDevice:
id: str
mac: str
advertisement_key: str
secondary_battery: str | None
secondary_battery: Union[str, None]


class SignalKScanner(Scanner):
Expand Down

0 comments on commit e6e69ba

Please sign in to comment.