@@ -1073,23 +1073,31 @@ async def _setup_node(self, node_id: int) -> None:
1073
1073
def log_node_long_setup (time_start : float ) -> None :
1074
1074
"""Temporary measure to track a locked-up SDK issue in some (special) circumstances."""
1075
1075
time_mins = int ((time .time () - time_start ) / 60 )
1076
+ if TYPE_CHECKING :
1077
+ assert self .server .loop
1078
+ assert self .chip_controller
1079
+ # get productlabel or modelname from raw attributes
1076
1080
node_model = node_data .attributes .get (
1077
1081
"0/40/14" , node_data .attributes .get ("0/40/3" , "" )
1078
1082
)
1079
1083
node_name = f"Node { node_id } ({ node_model } )"
1084
+ # get current IP the sdk is using to communicate with the device
1085
+ if sdk_ip_info := self .chip_controller .GetAddressAndPort (node_id ):
1086
+ ip_address = sdk_ip_info [0 ]
1087
+ else :
1088
+ ip_address = "unknown"
1080
1089
1081
1090
node_logger .error (
1082
1091
f"\n \n ATTENTION: { node_name } did not complete setup in { time_mins } minutes.\n " # noqa: G004
1083
1092
"This is an indication of a (connectivity) issue with this device. \n "
1093
+ f"IP-address in use for this device: { ip_address } \n "
1084
1094
"Try powercycling this device and/or relocate it closer to a Border Router or \n "
1085
1095
"WiFi Access Point. If this issue persists, please create an issue report on \n "
1086
1096
"the Matter channel of the Home Assistant Discord server or on Github:\n "
1087
1097
"https://github.com/home-assistant/core/issues/new?assignees=&labels="
1088
1098
"integration%3A%20matter&projects=&template=bug_report.yml\n " ,
1089
1099
)
1090
1100
# reschedule itself
1091
- if TYPE_CHECKING :
1092
- assert self .server .loop
1093
1101
log_timers [node_id ] = self .server .loop .call_later (
1094
1102
15 * 60 , log_node_long_setup , time_start
1095
1103
)
0 commit comments