read inverter & logger version
This commit is contained in:
@@ -18,13 +18,14 @@ class RegisterMap:
|
||||
0x41020019: {'reg': Register.COLLECT_INTERVAL, 'fmt': '<B', 'ratio': 1}, # noqa: E501
|
||||
0x4102001a: {'reg': Register.HEARTBEAT_INTERVAL, 'fmt': '<B', 'ratio': 1}, # noqa: E501
|
||||
0x4102001c: {'reg': Register.SIGNAL_STRENGTH, 'fmt': '<B', 'ratio': 1}, # noqa: E501
|
||||
0x4102001e: {'reg': Register.COLLECTOR_FW_VERSION, 'fmt': '!40s'}, # noqa: E501
|
||||
0x4102001e: {'reg': Register.CHIP_MODEL, 'fmt': '!40s'}, # noqa: E501
|
||||
0x4102004c: {'reg': Register.IP_ADRESS, 'fmt': '!16s'}, # noqa: E501
|
||||
0x41020064: {'reg': Register.VERSION, 'fmt': '!40s'}, # noqa: E501
|
||||
0x41020064: {'reg': Register.COLLECTOR_FW_VERSION, 'fmt': '!40s'}, # noqa: E501
|
||||
|
||||
0x4201001c: {'reg': Register.POWER_ON_TIME, 'fmt': '<H', 'ratio': 1}, # noqa: E501
|
||||
0x42010020: {'reg': Register.SERIAL_NUMBER, 'fmt': '!16s'}, # noqa: E501
|
||||
0x420100c0: {'reg': Register.INVERTER_STATUS, 'fmt': '!H'}, # noqa: E501
|
||||
0x420100d0: {'reg': Register.VERSION, 'fmt': '!H', 'eval': "f'v{(result>>12)}.{(result>>8)&0xf}.{(result>>4)&0xf}{result&0xf}'"}, # noqa: E501
|
||||
0x420100d2: {'reg': Register.GRID_VOLTAGE, 'fmt': '!H', 'ratio': 0.1}, # noqa: E501
|
||||
0x420100d4: {'reg': Register.GRID_CURRENT, 'fmt': '!H', 'ratio': 0.01}, # noqa: E501
|
||||
0x420100d6: {'reg': Register.GRID_FREQUENCY, 'fmt': '!H', 'ratio': 0.01}, # noqa: E501
|
||||
|
||||
@@ -305,14 +305,11 @@ class SolarmanV5(Message):
|
||||
|
||||
def __process_data(self, ftype):
|
||||
inv_update = False
|
||||
ctrl_update = False
|
||||
msg_type = self.control >> 8
|
||||
for key, update in self.db.parse(self._recv_buffer, msg_type, ftype):
|
||||
if update:
|
||||
if key == 'inverter':
|
||||
inv_update = True
|
||||
if key == 'controller':
|
||||
ctrl_update = True
|
||||
self.new_data[key] = True
|
||||
|
||||
if inv_update:
|
||||
@@ -331,13 +328,6 @@ class SolarmanV5(Message):
|
||||
logger.info(f'Model: {Model}')
|
||||
self.db.set_db_def_value(Register.EQUIPMENT_MODEL, Model)
|
||||
|
||||
if ctrl_update:
|
||||
db = self.db
|
||||
Version = db.get_db_value(Register.COLLECTOR_FW_VERSION, 0)
|
||||
if isinstance(Version, str):
|
||||
Model = Version.split('_')[0]
|
||||
self.db.set_db_def_value(Register.CHIP_MODEL, Model)
|
||||
|
||||
'''
|
||||
Message handler methods
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user