define __slots__
This commit is contained in:
@@ -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