@@ -1171,6 +1171,14 @@ def _on_mdns_service_state_change(
1171
1171
if not name .startswith (self .fabric_id_hex ):
1172
1172
# filter out messages that are not for our fabric
1173
1173
return
1174
+ LOGGER .debug ("Received %s MDNS event for %s" , state_change , name )
1175
+ if state_change not in (
1176
+ ServiceStateChange .Added ,
1177
+ ServiceStateChange .Updated ,
1178
+ ):
1179
+ # we're not interested in removals as this is already
1180
+ # handled in the subscription logic
1181
+ return
1174
1182
if existing := self ._mdns_queues .get (name ):
1175
1183
queue = existing [0 ]
1176
1184
else :
@@ -1193,20 +1201,18 @@ async def _process_mdns_queue(
1193
1201
if node_id not in self ._nodes :
1194
1202
continue # this should not happen, but just in case
1195
1203
node = self ._nodes [node_id ]
1196
- if state_change in (
1204
+ if state_change not in (
1197
1205
ServiceStateChange .Added ,
1198
1206
ServiceStateChange .Updated ,
1199
1207
):
1200
- if node .available :
1201
- continue # node is already set-up, no action needed
1202
- LOGGER .info ("Node %s discovered on MDNS" , node_id )
1203
- # setup the node
1204
- await self ._setup_node (node_id )
1205
- elif state_change == ServiceStateChange .Removed :
1206
- if not node .available :
1207
- continue # node is already offline, nothing to do
1208
- LOGGER .info ("Node %s vanished according to MDNS" , node_id )
1209
- await self ._node_offline (node_id )
1208
+ # this should be already filtered out, but just in case
1209
+ continue
1210
+ if node .available :
1211
+ # if the node is already set-up, no action is needed
1212
+ continue
1213
+ LOGGER .info ("Node %s discovered on MDNS" , node_id )
1214
+ # setup the node
1215
+ await self ._setup_node (node_id )
1210
1216
1211
1217
async def _on_mdns_commissionable_node_state (
1212
1218
self , name : str , state_change : ServiceStateChange
0 commit comments