define __slots__ for class ByteFifo (#202)

* define __slots__ for class ByteFifo

* disable set-timezone action

* set set-timezone to UTC

* try MathRobin/timezone-action@v1.1

* set TZ to "Europe/Berlin"

* define __slots__
This commit is contained in:
Stefan Allius
2024-10-15 22:16:22 +02:00
committed by GitHub
parent 6b9c13ddfe
commit 6da5d2cef6
5 changed files with 13 additions and 7 deletions

View File

@@ -24,18 +24,15 @@ permissions:
contents: read
pull-requests: read # allows SonarCloud to decorate PRs with analysis results
env:
TZ: "Europe/Berlin"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set timezone
uses: szenius/set-timezone@v2.0
with:
timezoneLinux: "Europe/Berlin"
timezoneMacos: "Europe/Berlin"
timezoneWindows: "Europe/Berlin"
# - name: Start Mosquitto
# uses: namoshek/mosquitto-github-action@v1
# with:

View File

@@ -7,6 +7,8 @@ else: # pragma: no cover
class ByteFifo:
""" a byte FIFO buffer with trigger callback """
__slots__ = ('__buf', '__trigger_cb')
def __init__(self):
self.__buf = bytearray()
self.__trigger_cb = None

View File

@@ -10,6 +10,8 @@ else: # pragma: no cover
class RegisterMap:
__slots__ = ()
map = {
0x00092ba8: {'reg': Register.COLLECTOR_FW_VERSION},
0x000927c0: {'reg': Register.CHIP_TYPE},
@@ -91,6 +93,7 @@ class RegisterMap:
class InfosG3(Infos):
__slots__ = ()
def ha_confs(self, ha_prfx: str, node_id: str, snr: str,
sug_area: str = '') \

View File

@@ -10,8 +10,8 @@ else: # pragma: no cover
class RegisterMap:
# make the class read/only by using __slots__
__slots__ = ()
map = {
# 0x41020007: {'reg': Register.DEVICE_SNR, 'fmt': '<L'}, # noqa: E501
0x41020018: {'reg': Register.DATA_UP_INTERVAL, 'fmt': '<B', 'ratio': 60, 'dep': ProxyMode.SERVER}, # noqa: E501
@@ -68,6 +68,8 @@ class RegisterMap:
class InfosG3P(Infos):
__slots__ = ('client_mode', )
def __init__(self, client_mode: bool):
super().__init__()
self.client_mode = client_mode

View File

@@ -152,6 +152,8 @@ class ClrAtMidnight:
class Infos:
__slots__ = ('db', 'tracer', )
LIGHTNING = 'mdi:lightning-bolt'
COUNTER = 'mdi:counter'
GAUGE = 'mdi:gauge'