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:
9
.github/workflows/python-app.yml
vendored
9
.github/workflows/python-app.yml
vendored
@@ -24,18 +24,15 @@ permissions:
|
|||||||
contents: read
|
contents: read
|
||||||
pull-requests: read # allows SonarCloud to decorate PRs with analysis results
|
pull-requests: read # allows SonarCloud to decorate PRs with analysis results
|
||||||
|
|
||||||
|
env:
|
||||||
|
TZ: "Europe/Berlin"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set timezone
|
|
||||||
uses: szenius/set-timezone@v2.0
|
|
||||||
with:
|
|
||||||
timezoneLinux: "Europe/Berlin"
|
|
||||||
timezoneMacos: "Europe/Berlin"
|
|
||||||
timezoneWindows: "Europe/Berlin"
|
|
||||||
# - name: Start Mosquitto
|
# - name: Start Mosquitto
|
||||||
# uses: namoshek/mosquitto-github-action@v1
|
# uses: namoshek/mosquitto-github-action@v1
|
||||||
# with:
|
# with:
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ else: # pragma: no cover
|
|||||||
|
|
||||||
class ByteFifo:
|
class ByteFifo:
|
||||||
""" a byte FIFO buffer with trigger callback """
|
""" a byte FIFO buffer with trigger callback """
|
||||||
|
__slots__ = ('__buf', '__trigger_cb')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.__buf = bytearray()
|
self.__buf = bytearray()
|
||||||
self.__trigger_cb = None
|
self.__trigger_cb = None
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ else: # pragma: no cover
|
|||||||
|
|
||||||
|
|
||||||
class RegisterMap:
|
class RegisterMap:
|
||||||
|
__slots__ = ()
|
||||||
|
|
||||||
map = {
|
map = {
|
||||||
0x00092ba8: {'reg': Register.COLLECTOR_FW_VERSION},
|
0x00092ba8: {'reg': Register.COLLECTOR_FW_VERSION},
|
||||||
0x000927c0: {'reg': Register.CHIP_TYPE},
|
0x000927c0: {'reg': Register.CHIP_TYPE},
|
||||||
@@ -91,6 +93,7 @@ class RegisterMap:
|
|||||||
|
|
||||||
|
|
||||||
class InfosG3(Infos):
|
class InfosG3(Infos):
|
||||||
|
__slots__ = ()
|
||||||
|
|
||||||
def ha_confs(self, ha_prfx: str, node_id: str, snr: str,
|
def ha_confs(self, ha_prfx: str, node_id: str, snr: str,
|
||||||
sug_area: str = '') \
|
sug_area: str = '') \
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ else: # pragma: no cover
|
|||||||
|
|
||||||
class RegisterMap:
|
class RegisterMap:
|
||||||
# make the class read/only by using __slots__
|
# make the class read/only by using __slots__
|
||||||
|
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
|
|
||||||
map = {
|
map = {
|
||||||
# 0x41020007: {'reg': Register.DEVICE_SNR, 'fmt': '<L'}, # noqa: E501
|
# 0x41020007: {'reg': Register.DEVICE_SNR, 'fmt': '<L'}, # noqa: E501
|
||||||
0x41020018: {'reg': Register.DATA_UP_INTERVAL, 'fmt': '<B', 'ratio': 60, 'dep': ProxyMode.SERVER}, # 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):
|
class InfosG3P(Infos):
|
||||||
|
__slots__ = ('client_mode', )
|
||||||
|
|
||||||
def __init__(self, client_mode: bool):
|
def __init__(self, client_mode: bool):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.client_mode = client_mode
|
self.client_mode = client_mode
|
||||||
|
|||||||
@@ -152,6 +152,8 @@ class ClrAtMidnight:
|
|||||||
|
|
||||||
|
|
||||||
class Infos:
|
class Infos:
|
||||||
|
__slots__ = ('db', 'tracer', )
|
||||||
|
|
||||||
LIGHTNING = 'mdi:lightning-bolt'
|
LIGHTNING = 'mdi:lightning-bolt'
|
||||||
COUNTER = 'mdi:counter'
|
COUNTER = 'mdi:counter'
|
||||||
GAUGE = 'mdi:gauge'
|
GAUGE = 'mdi:gauge'
|
||||||
|
|||||||
Reference in New Issue
Block a user