add modbus scanner config for HA Add-ons
This commit is contained in:
@@ -152,6 +152,16 @@ def ConfigComplete():
|
|||||||
'pv4': {'manufacturer': 'man4',
|
'pv4': {'manufacturer': 'man4',
|
||||||
'type': 'type4'},
|
'type': 'type4'},
|
||||||
'suggested_area': 'Garage2',
|
'suggested_area': 'Garage2',
|
||||||
|
'sensor_list': 688},
|
||||||
|
'Y170000000000002': {'modbus_polling': False,
|
||||||
|
'modbus_scanning': {
|
||||||
|
'bytes': 16,
|
||||||
|
'start': 2048,
|
||||||
|
'step': 1024
|
||||||
|
},
|
||||||
|
'monitor_sn': 2000000001,
|
||||||
|
'node_id': 'PV-Garage3/',
|
||||||
|
'suggested_area': 'Garage3',
|
||||||
'sensor_list': 688}
|
'sensor_list': 688}
|
||||||
},
|
},
|
||||||
'batteries': {
|
'batteries': {
|
||||||
@@ -224,8 +234,9 @@ def test_full_config(ConfigComplete):
|
|||||||
},
|
},
|
||||||
'inverters': {'allow_all': False,
|
'inverters': {'allow_all': False,
|
||||||
'R170000000000001': {'modbus_polling': False, 'node_id': 'PV-Garage/', 'sensor_list': 0x02B0, 'suggested_area': 'Garage', 'pv1': {'type': 'type1', 'manufacturer': 'man1'}, 'pv2': {'type': 'type2', 'manufacturer': 'man2'}},
|
'R170000000000001': {'modbus_polling': False, 'node_id': 'PV-Garage/', 'sensor_list': 0x02B0, 'suggested_area': 'Garage', 'pv1': {'type': 'type1', 'manufacturer': 'man1'}, 'pv2': {'type': 'type2', 'manufacturer': 'man2'}},
|
||||||
'Y170000000000001': {'modbus_polling': True, 'monitor_sn': 2000000000, 'node_id': 'PV-Garage2/', 'sensor_list': 0x02B0, 'suggested_area': 'Garage2', 'pv1': {'type': 'type1', 'manufacturer': 'man1'}, 'pv2': {'type': 'type2', 'manufacturer': 'man2'}, 'pv3': {'type': 'type3', 'manufacturer': 'man3'}, 'pv4': {'type': 'type4', 'manufacturer': 'man4'}}
|
'Y170000000000001': {'modbus_polling': True, 'monitor_sn': 2000000000, 'node_id': 'PV-Garage2/', 'sensor_list': 0x02B0, 'suggested_area': 'Garage2', 'pv1': {'type': 'type1', 'manufacturer': 'man1'}, 'pv2': {'type': 'type2', 'manufacturer': 'man2'}, 'pv3': {'type': 'type3', 'manufacturer': 'man3'}, 'pv4': {'type': 'type4', 'manufacturer': 'man4'}},
|
||||||
}
|
'Y170000000000002': {'modbus_polling': False, 'monitor_sn': 2000000001, 'node_id': 'PV-Garage3/', 'sensor_list': 0x02B0, 'suggested_area': 'Garage3', 'modbus_scanning': {'start': 2048, 'step': 1024, 'bytes': 16}}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
validated = Config.conf_schema.validate(cnf)
|
validated = Config.conf_schema.validate(cnf)
|
||||||
|
|||||||
@@ -380,6 +380,15 @@ def test_full_config(ConfigComplete):
|
|||||||
"pv4.manufacturer": "man4",
|
"pv4.manufacturer": "man4",
|
||||||
"pv4.type": "type4",
|
"pv4.type": "type4",
|
||||||
"sensor_list": 688
|
"sensor_list": 688
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"serial": "Y170000000000002",
|
||||||
|
"monitor_sn": 2000000001,
|
||||||
|
"modbus_polling": false,
|
||||||
|
"modbus_scanning.start": 2048,
|
||||||
|
"node_id": "PV-Garage3",
|
||||||
|
"suggested_area": "Garage3",
|
||||||
|
"sensor_list": 688
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"batteries": [
|
"batteries": [
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ schema:
|
|||||||
client_mode.host: match(\b((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\b)?
|
client_mode.host: match(\b((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\b)?
|
||||||
client_mode.port: port?
|
client_mode.port: port?
|
||||||
client_mode.forward: bool?
|
client_mode.forward: bool?
|
||||||
|
modbus_scanning.start: int(0,65535)?
|
||||||
|
modbus_scanning.step: int(0,65535)?
|
||||||
|
modbus_scanning.bytes: int(1,80)?
|
||||||
pv1.manufacturer: str?
|
pv1.manufacturer: str?
|
||||||
pv1.type: str?
|
pv1.type: str?
|
||||||
pv2.manufacturer: str?
|
pv2.manufacturer: str?
|
||||||
|
|||||||
Reference in New Issue
Block a user