Update diagnostics for BSBLan (#124508)

* update diagnostics to include static

and make room for multiple coordinator data objects

* fix mac address is not stored in config_entry but on device
This commit is contained in:
Willem-Jan van Rootselaar 2024-08-30 10:41:07 +02:00 committed by GitHub
parent f5e0382123
commit 252f05e0f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 60 additions and 39 deletions

View File

@ -20,5 +20,8 @@ async def async_get_config_entry_diagnostics(
return {
"info": data.info.to_dict(),
"device": data.device.to_dict(),
"state": data.coordinator.data.state.to_dict(),
"coordinator_data": {
"state": data.coordinator.data.state.to_dict(),
},
"static": data.static.to_dict(),
}

View File

@ -22,10 +22,10 @@ class BSBLanEntity(CoordinatorEntity[BSBLanUpdateCoordinator]):
def __init__(self, coordinator: BSBLanUpdateCoordinator, data: BSBLanData) -> None:
"""Initialize BSBLan entity."""
super().__init__(coordinator, data)
host = self.coordinator.config_entry.data["host"]
mac = self.coordinator.config_entry.data["mac"]
host = coordinator.config_entry.data["host"]
mac = data.device.MAC
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, data.device.MAC)},
identifiers={(DOMAIN, mac)},
connections={(CONNECTION_NETWORK_MAC, format_mac(mac))},
name=data.device.name,
manufacturer="BSBLAN Inc.",

View File

@ -1,6 +1,52 @@
# serializer version: 1
# name: test_diagnostics
dict({
'coordinator_data': dict({
'state': dict({
'current_temperature': dict({
'data_type': 0,
'desc': '',
'name': 'Room temp 1 actual value',
'unit': '°C',
'value': '18.6',
}),
'hvac_action': dict({
'data_type': 1,
'desc': 'Raumtempbegrenzung',
'name': 'Status heating circuit 1',
'unit': '',
'value': '122',
}),
'hvac_mode': dict({
'data_type': 1,
'desc': 'Komfort',
'name': 'Operating mode',
'unit': '',
'value': 'heat',
}),
'hvac_mode2': dict({
'data_type': 1,
'desc': 'Reduziert',
'name': 'Operating mode',
'unit': '',
'value': '2',
}),
'room1_thermostat_mode': dict({
'data_type': 1,
'desc': 'Kein Bedarf',
'name': 'Raumthermostat 1',
'unit': '',
'value': '0',
}),
'target_temperature': dict({
'data_type': 0,
'desc': '',
'name': 'Room temperature Comfort setpoint',
'unit': '°C',
'value': '18.5',
}),
}),
}),
'device': dict({
'MAC': '00:80:41:19:69:90',
'name': 'BSB-LAN',
@ -30,48 +76,20 @@
'value': 'RVS21.831F/127',
}),
}),
'state': dict({
'current_temperature': dict({
'static': dict({
'max_temp': dict({
'data_type': 0,
'desc': '',
'name': 'Room temp 1 actual value',
'name': 'Summer/winter changeover temp heat circuit 1',
'unit': '°C',
'value': '18.6',
'value': '20.0',
}),
'hvac_action': dict({
'data_type': 1,
'desc': 'Raumtempbegrenzung',
'name': 'Status heating circuit 1',
'unit': '',
'value': '122',
}),
'hvac_mode': dict({
'data_type': 1,
'desc': 'Komfort',
'name': 'Operating mode',
'unit': '',
'value': 'heat',
}),
'hvac_mode2': dict({
'data_type': 1,
'desc': 'Reduziert',
'name': 'Operating mode',
'unit': '',
'value': '2',
}),
'room1_thermostat_mode': dict({
'data_type': 1,
'desc': 'Kein Bedarf',
'name': 'Raumthermostat 1',
'unit': '',
'value': '0',
}),
'target_temperature': dict({
'min_temp': dict({
'data_type': 0,
'desc': '',
'name': 'Room temperature Comfort setpoint',
'name': 'Room temp frost protection setpoint',
'unit': '°C',
'value': '18.5',
'value': '8.0',
}),
}),
})