@@ -353,34 +353,44 @@ async def test_device_is_active_coordinator(
353
353
assert not stale_coordinator .is_active_coordinator
354
354
355
355
356
- async def test_coordinator_info_uses_node_info (
357
- zha_gateway : Gateway ,
358
- ) -> None :
359
- """Test that the current coordinator uses strings from `node_info`."""
360
-
361
- current_coord_dev = zigpy_device (
362
- zha_gateway , ieee = "aa:bb:cc:dd:ee:ff:00:11" , nwk = 0x0000
363
- )
364
- current_coord_dev .node_desc = current_coord_dev .node_desc .replace (
365
- logical_type = zdo_t .LogicalType .Coordinator
366
- )
367
-
368
- app = current_coord_dev .application
369
- app .state .node_info .ieee = current_coord_dev .ieee
370
- app .state .node_info .model = "Real Coordinator Model"
371
- app .state .node_info .manufacturer = "Real Coordinator Manufacturer"
372
-
373
- current_coordinator = await join_zigpy_device (zha_gateway , current_coord_dev )
374
- assert current_coordinator .is_active_coordinator
375
-
376
- assert current_coordinator .model == "Real Coordinator Model"
377
- assert current_coordinator .manufacturer == "Real Coordinator Manufacturer"
378
-
379
-
380
- async def test_coordinator_info_generic_name (
356
+ @pytest .mark .parametrize (
357
+ # node_info is populated with manf and model strings
358
+ ("manf" , "model" , "expected_manf" , "expected_model" , "expected_name" ),
359
+ [
360
+ ("RealManf" , "RealModel" , "RealManf" , "RealModel" , "RealManf RealModel" ),
361
+ (
362
+ "RealManf" ,
363
+ None ,
364
+ "RealManf" ,
365
+ "Generic Zigbee Coordinator (EZSP)" ,
366
+ "RealManf Generic Zigbee Coordinator (EZSP)" ,
367
+ ),
368
+ (None , "RealModel" , "" , "RealModel" , " RealModel" ),
369
+ (
370
+ None ,
371
+ None ,
372
+ "" ,
373
+ "Generic Zigbee Coordinator (EZSP)" ,
374
+ " Generic Zigbee Coordinator (EZSP)" ,
375
+ ),
376
+ (
377
+ "Nabu Casa" ,
378
+ "Home Assistant Connect ZBT-2" ,
379
+ "Nabu Casa" ,
380
+ "Home Assistant Connect ZBT-2" ,
381
+ "Home Assistant Connect ZBT-2" ,
382
+ ),
383
+ ],
384
+ )
385
+ async def test_coordinator_info_names (
381
386
zha_gateway : Gateway ,
387
+ manf ,
388
+ model ,
389
+ expected_manf ,
390
+ expected_model ,
391
+ expected_name ,
382
392
) -> None :
383
- """Test that the current coordinator uses strings from `node_info` ."""
393
+ """Test that the current coordinator device is named correctly ."""
384
394
385
395
current_coord_dev = zigpy_device (
386
396
zha_gateway , ieee = "aa:bb:cc:dd:ee:ff:00:11" , nwk = 0x0000
@@ -391,14 +401,15 @@ async def test_coordinator_info_generic_name(
391
401
392
402
app = current_coord_dev .application
393
403
app .state .node_info .ieee = current_coord_dev .ieee
394
- app .state .node_info .model = None
395
- app .state .node_info .manufacturer = None
404
+ app .state .node_info .manufacturer = manf
405
+ app .state .node_info .model = model
396
406
397
407
current_coordinator = await join_zigpy_device (zha_gateway , current_coord_dev )
398
408
assert current_coordinator .is_active_coordinator
399
409
400
- assert current_coordinator .model == "Generic Zigbee Coordinator (EZSP)"
401
- assert current_coordinator .manufacturer == ""
410
+ assert current_coordinator .manufacturer == expected_manf
411
+ assert current_coordinator .model == expected_model
412
+ assert current_coordinator .name == expected_name
402
413
403
414
404
415
async def test_async_get_clusters (
0 commit comments