Skip to content

Commit ff00809

Browse files
committed
Remove invalid extra id values
The identifiers are a 2-tuple. This was somehow entered incorrectly. Here's an example of how they're crafted: https://github.com/home-assistant/core/blob/ef3fb50018fa1f009b3a8e70910fa89401c1d0b3/homeassistant/components/zha/entity.py#L90
1 parent dfc9516 commit ff00809

File tree

4 files changed

+16
-20
lines changed

4 files changed

+16
-20
lines changed

tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def add_mock_switch(
6464
device_entry = device_registry.async_get_or_create(
6565
name=mock_config_entry.title,
6666
config_entry_id=mock_config_entry.entry_id,
67-
identifiers={(ZHA_DOMAIN, f"mock-ieee:{object_id}", domain, object_id)},
67+
identifiers={(ZHA_DOMAIN, f"mock-ieee:{object_id}")},
6868
**(device_attrs or {}),
6969
)
7070
switch = entity_registry.async_get_or_create(

tests/snapshots/test_diagnostics.ambr

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
list([
1515
'zha',
1616
'mock-ieee:kitchen',
17-
'light',
18-
'kitchen',
1917
]),
2018
]),
2119
'labels': list([

tests/snapshots/test_init.ambr

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,6 @@
285285
tuple(
286286
'zha',
287287
'mock-ieee:kitchen',
288-
'light',
289-
'kitchen',
290288
),
291289
}),
292290
'is_new': False,

tests/snapshots/test_sensor.ambr

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@
299299
'suggested_object_id': None,
300300
'supported_features': 0,
301301
'translation_key': 'brightness',
302-
'unique_id': 'zha_mock-ieee:kitchen_light_kitchen_brightness',
302+
'unique_id': 'zha_mock-ieee:kitchen_brightness',
303303
'unit_of_measurement': '%',
304304
})
305305
# ---
@@ -350,7 +350,7 @@
350350
'suggested_object_id': None,
351351
'supported_features': 0,
352352
'translation_key': 'color',
353-
'unique_id': 'zha_mock-ieee:kitchen_light_kitchen_color',
353+
'unique_id': 'zha_mock-ieee:kitchen_color',
354354
'unit_of_measurement': None,
355355
})
356356
# ---
@@ -401,7 +401,7 @@
401401
'suggested_object_id': None,
402402
'supported_features': 0,
403403
'translation_key': 'duration',
404-
'unique_id': 'zha_mock-ieee:kitchen_light_kitchen_duration',
404+
'unique_id': 'zha_mock-ieee:kitchen_duration',
405405
'unit_of_measurement': <UnitOfTime.SECONDS: 's'>,
406406
})
407407
# ---
@@ -452,7 +452,7 @@
452452
'suggested_object_id': None,
453453
'supported_features': 0,
454454
'translation_key': 'effect',
455-
'unique_id': 'zha_mock-ieee:kitchen_light_kitchen_effect',
455+
'unique_id': 'zha_mock-ieee:kitchen_effect',
456456
'unit_of_measurement': None,
457457
})
458458
# ---
@@ -501,7 +501,7 @@
501501
'suggested_object_id': None,
502502
'supported_features': 0,
503503
'translation_key': 'notification',
504-
'unique_id': 'zha_mock-ieee:kitchen_light_kitchen_notification',
504+
'unique_id': 'zha_mock-ieee:kitchen_notification',
505505
'unit_of_measurement': None,
506506
})
507507
# ---
@@ -555,7 +555,7 @@
555555
'suggested_object_id': None,
556556
'supported_features': 0,
557557
'translation_key': 'brightness',
558-
'unique_id': 'zha_mock-ieee:kitchen_light_kitchen_brightness',
558+
'unique_id': 'zha_mock-ieee:kitchen_brightness',
559559
'unit_of_measurement': '%',
560560
})
561561
# ---
@@ -615,7 +615,7 @@
615615
'suggested_object_id': None,
616616
'supported_features': 0,
617617
'translation_key': 'color',
618-
'unique_id': 'zha_mock-ieee:kitchen_light_kitchen_color',
618+
'unique_id': 'zha_mock-ieee:kitchen_color',
619619
'unit_of_measurement': None,
620620
})
621621
# ---
@@ -675,7 +675,7 @@
675675
'suggested_object_id': None,
676676
'supported_features': 0,
677677
'translation_key': 'duration',
678-
'unique_id': 'zha_mock-ieee:kitchen_light_kitchen_duration',
678+
'unique_id': 'zha_mock-ieee:kitchen_duration',
679679
'unit_of_measurement': <UnitOfTime.SECONDS: 's'>,
680680
})
681681
# ---
@@ -735,7 +735,7 @@
735735
'suggested_object_id': None,
736736
'supported_features': 0,
737737
'translation_key': 'effect',
738-
'unique_id': 'zha_mock-ieee:kitchen_light_kitchen_effect',
738+
'unique_id': 'zha_mock-ieee:kitchen_effect',
739739
'unit_of_measurement': None,
740740
})
741741
# ---
@@ -793,7 +793,7 @@
793793
'suggested_object_id': None,
794794
'supported_features': 0,
795795
'translation_key': 'notification',
796-
'unique_id': 'zha_mock-ieee:kitchen_light_kitchen_notification',
796+
'unique_id': 'zha_mock-ieee:kitchen_notification',
797797
'unit_of_measurement': None,
798798
})
799799
# ---
@@ -847,7 +847,7 @@
847847
'suggested_object_id': None,
848848
'supported_features': 0,
849849
'translation_key': 'brightness',
850-
'unique_id': 'zha_mock-ieee:kitchen_light_kitchen_brightness',
850+
'unique_id': 'zha_mock-ieee:kitchen_brightness',
851851
'unit_of_measurement': '%',
852852
})
853853
# ---
@@ -898,7 +898,7 @@
898898
'suggested_object_id': None,
899899
'supported_features': 0,
900900
'translation_key': 'color',
901-
'unique_id': 'zha_mock-ieee:kitchen_light_kitchen_color',
901+
'unique_id': 'zha_mock-ieee:kitchen_color',
902902
'unit_of_measurement': None,
903903
})
904904
# ---
@@ -949,7 +949,7 @@
949949
'suggested_object_id': None,
950950
'supported_features': 0,
951951
'translation_key': 'duration',
952-
'unique_id': 'zha_mock-ieee:kitchen_light_kitchen_duration',
952+
'unique_id': 'zha_mock-ieee:kitchen_duration',
953953
'unit_of_measurement': <UnitOfTime.SECONDS: 's'>,
954954
})
955955
# ---
@@ -1000,7 +1000,7 @@
10001000
'suggested_object_id': None,
10011001
'supported_features': 0,
10021002
'translation_key': 'effect',
1003-
'unique_id': 'zha_mock-ieee:kitchen_light_kitchen_effect',
1003+
'unique_id': 'zha_mock-ieee:kitchen_effect',
10041004
'unit_of_measurement': None,
10051005
})
10061006
# ---
@@ -1049,7 +1049,7 @@
10491049
'suggested_object_id': None,
10501050
'supported_features': 0,
10511051
'translation_key': 'notification',
1052-
'unique_id': 'zha_mock-ieee:kitchen_light_kitchen_notification',
1052+
'unique_id': 'zha_mock-ieee:kitchen_notification',
10531053
'unit_of_measurement': None,
10541054
})
10551055
# ---

0 commit comments

Comments
 (0)