improve setting the node_id in the modbus

This commit is contained in:
Stefan Allius
2024-10-16 23:20:23 +02:00
parent db06d8c8e6
commit c5f184a730
4 changed files with 31 additions and 18 deletions

View File

@@ -135,6 +135,8 @@ class Talent(Message):
self.modbus_polling = inv['modbus_polling']
logger.debug(f'SerialNo {serial_no} allowed! area:{self.sug_area}') # noqa: E501
self.db.set_pv_module_details(inv)
if self.mb:
self.mb.set_node_id(self.node_id)
else:
self.node_id = ''
self.sug_area = ''
@@ -590,8 +592,7 @@ class Talent(Message):
return
for key, update, _ in self.mb.recv_resp(self.db, data[
hdr_len:],
self.node_id):
hdr_len:]):
if update:
self._set_mqtt_timestamp(key, self._utc())
self.new_data[key] = True