define __slots__

This commit is contained in:
Stefan Allius
2024-10-15 22:11:19 +02:00
parent 3863454a84
commit db06d8c8e6
3 changed files with 8 additions and 1 deletions

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'