move forward_at_cmd_resp into InfosG3P class

- the variable is shared between the two connections
of an inverter. One is for the TSUN cloud and the
other for the device.
This commit is contained in:
Stefan Allius
2025-03-30 20:12:06 +02:00
parent 6503d0a40e
commit 020fc731dd
2 changed files with 15 additions and 7 deletions

View File

@@ -193,11 +193,19 @@ class RegisterSel:
class InfosG3P(Infos):
__slots__ = ('client_mode', )
__slots__ = ('client_mode', 'forward_at_cmd_resp')
def __init__(self, client_mode: bool):
super().__init__()
self.client_mode = client_mode
# shared value between both inverter connections
self.forward_at_cmd_resp = False
'''Flag if response for the last at command must be send to the cloud.
False: send result only to the MQTT broker, cause the AT+ command
came from there
True: send response packet to the cloud, cause the AT+ command
came from the cloud'''
self.set_db_def_value(Register.MANUFACTURER, 'TSUN')
self.set_db_def_value(Register.EQUIPMENT_MODEL, 'TSOL-MSxx00')
self.set_db_def_value(Register.CHIP_TYPE, 'IGEN TECH')