diff --git a/homeassistant/components/lcn/entity.py b/homeassistant/components/lcn/entity.py index 24897287449..a1940fc7ac3 100644 --- a/homeassistant/components/lcn/entity.py +++ b/homeassistant/components/lcn/entity.py @@ -23,6 +23,7 @@ class LcnEntity(Entity): """Parent class for all entities associated with the LCN component.""" _attr_should_poll = False + _attr_has_entity_name = True device_connection: DeviceConnectionType def __init__( diff --git a/tests/components/lcn/snapshots/test_binary_sensor.ambr b/tests/components/lcn/snapshots/test_binary_sensor.ambr index 383c9038d78..e3f7c9ab404 100644 --- a/tests/components/lcn/snapshots/test_binary_sensor.ambr +++ b/tests/components/lcn/snapshots/test_binary_sensor.ambr @@ -1,5 +1,5 @@ # serializer version: 1 -# name: test_setup_lcn_binary_sensor[binary_sensor.binary_sensor1-entry] +# name: test_setup_lcn_binary_sensor[binary_sensor.testmodule_binary_sensor1-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -12,8 +12,8 @@ 'disabled_by': None, 'domain': 'binary_sensor', 'entity_category': None, - 'entity_id': 'binary_sensor.binary_sensor1', - 'has_entity_name': False, + 'entity_id': 'binary_sensor.testmodule_binary_sensor1', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -33,20 +33,20 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_binary_sensor[binary_sensor.binary_sensor1-state] +# name: test_setup_lcn_binary_sensor[binary_sensor.testmodule_binary_sensor1-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Binary_Sensor1', + 'friendly_name': 'TestModule Binary_Sensor1', }), 'context': , - 'entity_id': 'binary_sensor.binary_sensor1', + 'entity_id': 'binary_sensor.testmodule_binary_sensor1', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_setup_lcn_binary_sensor[binary_sensor.sensor_keylock-entry] +# name: test_setup_lcn_binary_sensor[binary_sensor.testmodule_sensor_keylock-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -59,8 +59,8 @@ 'disabled_by': None, 'domain': 'binary_sensor', 'entity_category': None, - 'entity_id': 'binary_sensor.sensor_keylock', - 'has_entity_name': False, + 'entity_id': 'binary_sensor.testmodule_sensor_keylock', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -80,20 +80,20 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_binary_sensor[binary_sensor.sensor_keylock-state] +# name: test_setup_lcn_binary_sensor[binary_sensor.testmodule_sensor_keylock-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Sensor_KeyLock', + 'friendly_name': 'TestModule Sensor_KeyLock', }), 'context': , - 'entity_id': 'binary_sensor.sensor_keylock', + 'entity_id': 'binary_sensor.testmodule_sensor_keylock', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_setup_lcn_binary_sensor[binary_sensor.sensor_lockregulator1-entry] +# name: test_setup_lcn_binary_sensor[binary_sensor.testmodule_sensor_lockregulator1-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -106,8 +106,8 @@ 'disabled_by': None, 'domain': 'binary_sensor', 'entity_category': None, - 'entity_id': 'binary_sensor.sensor_lockregulator1', - 'has_entity_name': False, + 'entity_id': 'binary_sensor.testmodule_sensor_lockregulator1', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -127,13 +127,13 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_binary_sensor[binary_sensor.sensor_lockregulator1-state] +# name: test_setup_lcn_binary_sensor[binary_sensor.testmodule_sensor_lockregulator1-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Sensor_LockRegulator1', + 'friendly_name': 'TestModule Sensor_LockRegulator1', }), 'context': , - 'entity_id': 'binary_sensor.sensor_lockregulator1', + 'entity_id': 'binary_sensor.testmodule_sensor_lockregulator1', 'last_changed': , 'last_reported': , 'last_updated': , diff --git a/tests/components/lcn/snapshots/test_climate.ambr b/tests/components/lcn/snapshots/test_climate.ambr index bd371c02492..7393a9a8421 100644 --- a/tests/components/lcn/snapshots/test_climate.ambr +++ b/tests/components/lcn/snapshots/test_climate.ambr @@ -1,5 +1,5 @@ # serializer version: 1 -# name: test_setup_lcn_climate[climate.climate1-entry] +# name: test_setup_lcn_climate[climate.testmodule_climate1-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -19,8 +19,8 @@ 'disabled_by': None, 'domain': 'climate', 'entity_category': None, - 'entity_id': 'climate.climate1', - 'has_entity_name': False, + 'entity_id': 'climate.testmodule_climate1', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -40,11 +40,11 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_climate[climate.climate1-state] +# name: test_setup_lcn_climate[climate.testmodule_climate1-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'current_temperature': None, - 'friendly_name': 'Climate1', + 'friendly_name': 'TestModule Climate1', 'hvac_modes': list([ , , @@ -55,7 +55,7 @@ 'temperature': None, }), 'context': , - 'entity_id': 'climate.climate1', + 'entity_id': 'climate.testmodule_climate1', 'last_changed': , 'last_reported': , 'last_updated': , diff --git a/tests/components/lcn/snapshots/test_cover.ambr b/tests/components/lcn/snapshots/test_cover.ambr index 4d1356e3c92..722261f1432 100644 --- a/tests/components/lcn/snapshots/test_cover.ambr +++ b/tests/components/lcn/snapshots/test_cover.ambr @@ -1,5 +1,5 @@ # serializer version: 1 -# name: test_setup_lcn_cover[cover.cover_outputs-entry] +# name: test_setup_lcn_cover[cover.testmodule_cover_outputs-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -12,8 +12,8 @@ 'disabled_by': None, 'domain': 'cover', 'entity_category': None, - 'entity_id': 'cover.cover_outputs', - 'has_entity_name': False, + 'entity_id': 'cover.testmodule_cover_outputs', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -33,22 +33,22 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_cover[cover.cover_outputs-state] +# name: test_setup_lcn_cover[cover.testmodule_cover_outputs-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'assumed_state': True, - 'friendly_name': 'Cover_Outputs', + 'friendly_name': 'TestModule Cover_Outputs', 'supported_features': , }), 'context': , - 'entity_id': 'cover.cover_outputs', + 'entity_id': 'cover.testmodule_cover_outputs', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'open', }) # --- -# name: test_setup_lcn_cover[cover.cover_relays-entry] +# name: test_setup_lcn_cover[cover.testmodule_cover_relays-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -61,8 +61,8 @@ 'disabled_by': None, 'domain': 'cover', 'entity_category': None, - 'entity_id': 'cover.cover_relays', - 'has_entity_name': False, + 'entity_id': 'cover.testmodule_cover_relays', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -82,22 +82,22 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_cover[cover.cover_relays-state] +# name: test_setup_lcn_cover[cover.testmodule_cover_relays-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'assumed_state': True, - 'friendly_name': 'Cover_Relays', + 'friendly_name': 'TestModule Cover_Relays', 'supported_features': , }), 'context': , - 'entity_id': 'cover.cover_relays', + 'entity_id': 'cover.testmodule_cover_relays', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'open', }) # --- -# name: test_setup_lcn_cover[cover.cover_relays_bs4-entry] +# name: test_setup_lcn_cover[cover.testmodule_cover_relays_bs4-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -110,8 +110,8 @@ 'disabled_by': None, 'domain': 'cover', 'entity_category': None, - 'entity_id': 'cover.cover_relays_bs4', - 'has_entity_name': False, + 'entity_id': 'cover.testmodule_cover_relays_bs4', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -131,22 +131,22 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_cover[cover.cover_relays_bs4-state] +# name: test_setup_lcn_cover[cover.testmodule_cover_relays_bs4-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'assumed_state': True, - 'friendly_name': 'Cover_Relays_BS4', + 'friendly_name': 'TestModule Cover_Relays_BS4', 'supported_features': , }), 'context': , - 'entity_id': 'cover.cover_relays_bs4', + 'entity_id': 'cover.testmodule_cover_relays_bs4', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'open', }) # --- -# name: test_setup_lcn_cover[cover.cover_relays_module-entry] +# name: test_setup_lcn_cover[cover.testmodule_cover_relays_module-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -159,8 +159,8 @@ 'disabled_by': None, 'domain': 'cover', 'entity_category': None, - 'entity_id': 'cover.cover_relays_module', - 'has_entity_name': False, + 'entity_id': 'cover.testmodule_cover_relays_module', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -180,15 +180,15 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_cover[cover.cover_relays_module-state] +# name: test_setup_lcn_cover[cover.testmodule_cover_relays_module-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'assumed_state': True, - 'friendly_name': 'Cover_Relays_Module', + 'friendly_name': 'TestModule Cover_Relays_Module', 'supported_features': , }), 'context': , - 'entity_id': 'cover.cover_relays_module', + 'entity_id': 'cover.testmodule_cover_relays_module', 'last_changed': , 'last_reported': , 'last_updated': , diff --git a/tests/components/lcn/snapshots/test_light.ambr b/tests/components/lcn/snapshots/test_light.ambr index 5bfd00fb0d7..0a9086d1efb 100644 --- a/tests/components/lcn/snapshots/test_light.ambr +++ b/tests/components/lcn/snapshots/test_light.ambr @@ -1,5 +1,5 @@ # serializer version: 1 -# name: test_setup_lcn_light[light.light_output1-entry] +# name: test_setup_lcn_light[light.testmodule_light_output1-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -16,8 +16,8 @@ 'disabled_by': None, 'domain': 'light', 'entity_category': None, - 'entity_id': 'light.light_output1', - 'has_entity_name': False, + 'entity_id': 'light.testmodule_light_output1', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -37,26 +37,26 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_light[light.light_output1-state] +# name: test_setup_lcn_light[light.testmodule_light_output1-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'brightness': None, 'color_mode': None, - 'friendly_name': 'Light_Output1', + 'friendly_name': 'TestModule Light_Output1', 'supported_color_modes': list([ , ]), 'supported_features': , }), 'context': , - 'entity_id': 'light.light_output1', + 'entity_id': 'light.testmodule_light_output1', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'off', }) # --- -# name: test_setup_lcn_light[light.light_output2-entry] +# name: test_setup_lcn_light[light.testmodule_light_output2-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -73,8 +73,8 @@ 'disabled_by': None, 'domain': 'light', 'entity_category': None, - 'entity_id': 'light.light_output2', - 'has_entity_name': False, + 'entity_id': 'light.testmodule_light_output2', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -94,25 +94,25 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_light[light.light_output2-state] +# name: test_setup_lcn_light[light.testmodule_light_output2-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'color_mode': None, - 'friendly_name': 'Light_Output2', + 'friendly_name': 'TestModule Light_Output2', 'supported_color_modes': list([ , ]), 'supported_features': , }), 'context': , - 'entity_id': 'light.light_output2', + 'entity_id': 'light.testmodule_light_output2', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'off', }) # --- -# name: test_setup_lcn_light[light.light_relay1-entry] +# name: test_setup_lcn_light[light.testmodule_light_relay1-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -129,8 +129,8 @@ 'disabled_by': None, 'domain': 'light', 'entity_category': None, - 'entity_id': 'light.light_relay1', - 'has_entity_name': False, + 'entity_id': 'light.testmodule_light_relay1', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -150,18 +150,18 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_light[light.light_relay1-state] +# name: test_setup_lcn_light[light.testmodule_light_relay1-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'color_mode': None, - 'friendly_name': 'Light_Relay1', + 'friendly_name': 'TestModule Light_Relay1', 'supported_color_modes': list([ , ]), 'supported_features': , }), 'context': , - 'entity_id': 'light.light_relay1', + 'entity_id': 'light.testmodule_light_relay1', 'last_changed': , 'last_reported': , 'last_updated': , diff --git a/tests/components/lcn/snapshots/test_scene.ambr b/tests/components/lcn/snapshots/test_scene.ambr index 6dac4868437..9196e7d8ae0 100644 --- a/tests/components/lcn/snapshots/test_scene.ambr +++ b/tests/components/lcn/snapshots/test_scene.ambr @@ -1,5 +1,5 @@ # serializer version: 1 -# name: test_setup_lcn_scene[scene.romantic-entry] +# name: test_setup_lcn_scene[scene.testmodule_romantic-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -12,8 +12,8 @@ 'disabled_by': None, 'domain': 'scene', 'entity_category': None, - 'entity_id': 'scene.romantic', - 'has_entity_name': False, + 'entity_id': 'scene.testmodule_romantic', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -33,20 +33,20 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_scene[scene.romantic-state] +# name: test_setup_lcn_scene[scene.testmodule_romantic-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Romantic', + 'friendly_name': 'TestModule Romantic', }), 'context': , - 'entity_id': 'scene.romantic', + 'entity_id': 'scene.testmodule_romantic', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_setup_lcn_scene[scene.romantic_transition-entry] +# name: test_setup_lcn_scene[scene.testmodule_romantic_transition-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -59,8 +59,8 @@ 'disabled_by': None, 'domain': 'scene', 'entity_category': None, - 'entity_id': 'scene.romantic_transition', - 'has_entity_name': False, + 'entity_id': 'scene.testmodule_romantic_transition', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -80,13 +80,13 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_scene[scene.romantic_transition-state] +# name: test_setup_lcn_scene[scene.testmodule_romantic_transition-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Romantic Transition', + 'friendly_name': 'TestModule Romantic Transition', }), 'context': , - 'entity_id': 'scene.romantic_transition', + 'entity_id': 'scene.testmodule_romantic_transition', 'last_changed': , 'last_reported': , 'last_updated': , diff --git a/tests/components/lcn/snapshots/test_sensor.ambr b/tests/components/lcn/snapshots/test_sensor.ambr index 1e172dda7e9..60586a45058 100644 --- a/tests/components/lcn/snapshots/test_sensor.ambr +++ b/tests/components/lcn/snapshots/test_sensor.ambr @@ -1,5 +1,5 @@ # serializer version: 1 -# name: test_setup_lcn_sensor[sensor.sensor_led6-entry] +# name: test_setup_lcn_sensor[sensor.testmodule_sensor_led6-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -12,8 +12,8 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.sensor_led6', - 'has_entity_name': False, + 'entity_id': 'sensor.testmodule_sensor_led6', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -33,20 +33,20 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_sensor[sensor.sensor_led6-state] +# name: test_setup_lcn_sensor[sensor.testmodule_sensor_led6-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Sensor_Led6', + 'friendly_name': 'TestModule Sensor_Led6', }), 'context': , - 'entity_id': 'sensor.sensor_led6', + 'entity_id': 'sensor.testmodule_sensor_led6', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_setup_lcn_sensor[sensor.sensor_logicop1-entry] +# name: test_setup_lcn_sensor[sensor.testmodule_sensor_logicop1-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -59,8 +59,8 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.sensor_logicop1', - 'has_entity_name': False, + 'entity_id': 'sensor.testmodule_sensor_logicop1', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -80,20 +80,20 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_sensor[sensor.sensor_logicop1-state] +# name: test_setup_lcn_sensor[sensor.testmodule_sensor_logicop1-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Sensor_LogicOp1', + 'friendly_name': 'TestModule Sensor_LogicOp1', }), 'context': , - 'entity_id': 'sensor.sensor_logicop1', + 'entity_id': 'sensor.testmodule_sensor_logicop1', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_setup_lcn_sensor[sensor.sensor_setpoint1-entry] +# name: test_setup_lcn_sensor[sensor.testmodule_sensor_setpoint1-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -106,8 +106,8 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.sensor_setpoint1', - 'has_entity_name': False, + 'entity_id': 'sensor.testmodule_sensor_setpoint1', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -127,22 +127,22 @@ 'unit_of_measurement': , }) # --- -# name: test_setup_lcn_sensor[sensor.sensor_setpoint1-state] +# name: test_setup_lcn_sensor[sensor.testmodule_sensor_setpoint1-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'temperature', - 'friendly_name': 'Sensor_Setpoint1', + 'friendly_name': 'TestModule Sensor_Setpoint1', 'unit_of_measurement': , }), 'context': , - 'entity_id': 'sensor.sensor_setpoint1', + 'entity_id': 'sensor.testmodule_sensor_setpoint1', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_setup_lcn_sensor[sensor.sensor_var1-entry] +# name: test_setup_lcn_sensor[sensor.testmodule_sensor_var1-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -155,8 +155,8 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.sensor_var1', - 'has_entity_name': False, + 'entity_id': 'sensor.testmodule_sensor_var1', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -176,15 +176,15 @@ 'unit_of_measurement': , }) # --- -# name: test_setup_lcn_sensor[sensor.sensor_var1-state] +# name: test_setup_lcn_sensor[sensor.testmodule_sensor_var1-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'temperature', - 'friendly_name': 'Sensor_Var1', + 'friendly_name': 'TestModule Sensor_Var1', 'unit_of_measurement': , }), 'context': , - 'entity_id': 'sensor.sensor_var1', + 'entity_id': 'sensor.testmodule_sensor_var1', 'last_changed': , 'last_reported': , 'last_updated': , diff --git a/tests/components/lcn/snapshots/test_switch.ambr b/tests/components/lcn/snapshots/test_switch.ambr index 7ba943a671f..b37dd3303db 100644 --- a/tests/components/lcn/snapshots/test_switch.ambr +++ b/tests/components/lcn/snapshots/test_switch.ambr @@ -1,5 +1,5 @@ # serializer version: 1 -# name: test_setup_lcn_switch[switch.switch_group5-entry] +# name: test_setup_lcn_switch[switch.testgroup_switch_group5-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -12,8 +12,8 @@ 'disabled_by': None, 'domain': 'switch', 'entity_category': None, - 'entity_id': 'switch.switch_group5', - 'has_entity_name': False, + 'entity_id': 'switch.testgroup_switch_group5', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -33,20 +33,20 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_switch[switch.switch_group5-state] +# name: test_setup_lcn_switch[switch.testgroup_switch_group5-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Switch_Group5', + 'friendly_name': 'TestGroup Switch_Group5', }), 'context': , - 'entity_id': 'switch.switch_group5', + 'entity_id': 'switch.testgroup_switch_group5', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'off', }) # --- -# name: test_setup_lcn_switch[switch.switch_keylock1-entry] +# name: test_setup_lcn_switch[switch.testmodule_switch_keylock1-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -59,8 +59,8 @@ 'disabled_by': None, 'domain': 'switch', 'entity_category': None, - 'entity_id': 'switch.switch_keylock1', - 'has_entity_name': False, + 'entity_id': 'switch.testmodule_switch_keylock1', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -80,20 +80,20 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_switch[switch.switch_keylock1-state] +# name: test_setup_lcn_switch[switch.testmodule_switch_keylock1-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Switch_KeyLock1', + 'friendly_name': 'TestModule Switch_KeyLock1', }), 'context': , - 'entity_id': 'switch.switch_keylock1', + 'entity_id': 'switch.testmodule_switch_keylock1', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'off', }) # --- -# name: test_setup_lcn_switch[switch.switch_output1-entry] +# name: test_setup_lcn_switch[switch.testmodule_switch_output1-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -106,8 +106,8 @@ 'disabled_by': None, 'domain': 'switch', 'entity_category': None, - 'entity_id': 'switch.switch_output1', - 'has_entity_name': False, + 'entity_id': 'switch.testmodule_switch_output1', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -127,20 +127,20 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_switch[switch.switch_output1-state] +# name: test_setup_lcn_switch[switch.testmodule_switch_output1-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Switch_Output1', + 'friendly_name': 'TestModule Switch_Output1', }), 'context': , - 'entity_id': 'switch.switch_output1', + 'entity_id': 'switch.testmodule_switch_output1', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'off', }) # --- -# name: test_setup_lcn_switch[switch.switch_output2-entry] +# name: test_setup_lcn_switch[switch.testmodule_switch_output2-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -153,8 +153,8 @@ 'disabled_by': None, 'domain': 'switch', 'entity_category': None, - 'entity_id': 'switch.switch_output2', - 'has_entity_name': False, + 'entity_id': 'switch.testmodule_switch_output2', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -174,20 +174,20 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_switch[switch.switch_output2-state] +# name: test_setup_lcn_switch[switch.testmodule_switch_output2-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Switch_Output2', + 'friendly_name': 'TestModule Switch_Output2', }), 'context': , - 'entity_id': 'switch.switch_output2', + 'entity_id': 'switch.testmodule_switch_output2', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'off', }) # --- -# name: test_setup_lcn_switch[switch.switch_regulator1-entry] +# name: test_setup_lcn_switch[switch.testmodule_switch_regulator1-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -200,8 +200,8 @@ 'disabled_by': None, 'domain': 'switch', 'entity_category': None, - 'entity_id': 'switch.switch_regulator1', - 'has_entity_name': False, + 'entity_id': 'switch.testmodule_switch_regulator1', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -221,20 +221,20 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_switch[switch.switch_regulator1-state] +# name: test_setup_lcn_switch[switch.testmodule_switch_regulator1-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Switch_Regulator1', + 'friendly_name': 'TestModule Switch_Regulator1', }), 'context': , - 'entity_id': 'switch.switch_regulator1', + 'entity_id': 'switch.testmodule_switch_regulator1', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'off', }) # --- -# name: test_setup_lcn_switch[switch.switch_relay1-entry] +# name: test_setup_lcn_switch[switch.testmodule_switch_relay1-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -247,8 +247,8 @@ 'disabled_by': None, 'domain': 'switch', 'entity_category': None, - 'entity_id': 'switch.switch_relay1', - 'has_entity_name': False, + 'entity_id': 'switch.testmodule_switch_relay1', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -268,20 +268,20 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_switch[switch.switch_relay1-state] +# name: test_setup_lcn_switch[switch.testmodule_switch_relay1-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Switch_Relay1', + 'friendly_name': 'TestModule Switch_Relay1', }), 'context': , - 'entity_id': 'switch.switch_relay1', + 'entity_id': 'switch.testmodule_switch_relay1', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'off', }) # --- -# name: test_setup_lcn_switch[switch.switch_relay2-entry] +# name: test_setup_lcn_switch[switch.testmodule_switch_relay2-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -294,8 +294,8 @@ 'disabled_by': None, 'domain': 'switch', 'entity_category': None, - 'entity_id': 'switch.switch_relay2', - 'has_entity_name': False, + 'entity_id': 'switch.testmodule_switch_relay2', + 'has_entity_name': True, 'hidden_by': None, 'icon': None, 'id': , @@ -315,13 +315,13 @@ 'unit_of_measurement': None, }) # --- -# name: test_setup_lcn_switch[switch.switch_relay2-state] +# name: test_setup_lcn_switch[switch.testmodule_switch_relay2-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Switch_Relay2', + 'friendly_name': 'TestModule Switch_Relay2', }), 'context': , - 'entity_id': 'switch.switch_relay2', + 'entity_id': 'switch.testmodule_switch_relay2', 'last_changed': , 'last_reported': , 'last_updated': , diff --git a/tests/components/lcn/test_binary_sensor.py b/tests/components/lcn/test_binary_sensor.py index 7d636f546c4..7e828dbc588 100644 --- a/tests/components/lcn/test_binary_sensor.py +++ b/tests/components/lcn/test_binary_sensor.py @@ -22,9 +22,9 @@ from .conftest import MockConfigEntry, init_integration from tests.common import snapshot_platform -BINARY_SENSOR_LOCKREGULATOR1 = "binary_sensor.sensor_lockregulator1" -BINARY_SENSOR_SENSOR1 = "binary_sensor.binary_sensor1" -BINARY_SENSOR_KEYLOCK = "binary_sensor.sensor_keylock" +BINARY_SENSOR_LOCKREGULATOR1 = "binary_sensor.testmodule_sensor_lockregulator1" +BINARY_SENSOR_SENSOR1 = "binary_sensor.testmodule_binary_sensor1" +BINARY_SENSOR_KEYLOCK = "binary_sensor.testmodule_sensor_keylock" async def test_setup_lcn_binary_sensor( @@ -140,7 +140,11 @@ async def test_unload_config_entry(hass: HomeAssistant, entry: MockConfigEntry) @pytest.mark.parametrize( - "entity_id", ["binary_sensor.sensor_lockregulator1", "binary_sensor.sensor_keylock"] + "entity_id", + [ + "binary_sensor.testmodule_sensor_lockregulator1", + "binary_sensor.testmodule_sensor_keylock", + ], ) async def test_create_issue( hass: HomeAssistant, diff --git a/tests/components/lcn/test_climate.py b/tests/components/lcn/test_climate.py index 7bac7cc9e81..ceb6f9524d1 100644 --- a/tests/components/lcn/test_climate.py +++ b/tests/components/lcn/test_climate.py @@ -52,7 +52,7 @@ async def test_set_hvac_mode_heat(hass: HomeAssistant, entry: MockConfigEntry) - await init_integration(hass, entry) with patch.object(MockModuleConnection, "lock_regulator") as lock_regulator: - state = hass.states.get("climate.climate1") + state = hass.states.get("climate.testmodule_climate1") state.state = HVACMode.OFF # command failed @@ -61,13 +61,16 @@ async def test_set_hvac_mode_heat(hass: HomeAssistant, entry: MockConfigEntry) - await hass.services.async_call( DOMAIN_CLIMATE, SERVICE_SET_HVAC_MODE, - {ATTR_ENTITY_ID: "climate.climate1", ATTR_HVAC_MODE: HVACMode.HEAT}, + { + ATTR_ENTITY_ID: "climate.testmodule_climate1", + ATTR_HVAC_MODE: HVACMode.HEAT, + }, blocking=True, ) lock_regulator.assert_awaited_with(0, False) - state = hass.states.get("climate.climate1") + state = hass.states.get("climate.testmodule_climate1") assert state is not None assert state.state != HVACMode.HEAT @@ -78,13 +81,16 @@ async def test_set_hvac_mode_heat(hass: HomeAssistant, entry: MockConfigEntry) - await hass.services.async_call( DOMAIN_CLIMATE, SERVICE_SET_HVAC_MODE, - {ATTR_ENTITY_ID: "climate.climate1", ATTR_HVAC_MODE: HVACMode.HEAT}, + { + ATTR_ENTITY_ID: "climate.testmodule_climate1", + ATTR_HVAC_MODE: HVACMode.HEAT, + }, blocking=True, ) lock_regulator.assert_awaited_with(0, False) - state = hass.states.get("climate.climate1") + state = hass.states.get("climate.testmodule_climate1") assert state is not None assert state.state == HVACMode.HEAT @@ -94,7 +100,7 @@ async def test_set_hvac_mode_off(hass: HomeAssistant, entry: MockConfigEntry) -> await init_integration(hass, entry) with patch.object(MockModuleConnection, "lock_regulator") as lock_regulator: - state = hass.states.get("climate.climate1") + state = hass.states.get("climate.testmodule_climate1") state.state = HVACMode.HEAT # command failed @@ -103,13 +109,16 @@ async def test_set_hvac_mode_off(hass: HomeAssistant, entry: MockConfigEntry) -> await hass.services.async_call( DOMAIN_CLIMATE, SERVICE_SET_HVAC_MODE, - {ATTR_ENTITY_ID: "climate.climate1", ATTR_HVAC_MODE: HVACMode.OFF}, + { + ATTR_ENTITY_ID: "climate.testmodule_climate1", + ATTR_HVAC_MODE: HVACMode.OFF, + }, blocking=True, ) lock_regulator.assert_awaited_with(0, True, -1) - state = hass.states.get("climate.climate1") + state = hass.states.get("climate.testmodule_climate1") assert state is not None assert state.state != HVACMode.OFF @@ -120,13 +129,16 @@ async def test_set_hvac_mode_off(hass: HomeAssistant, entry: MockConfigEntry) -> await hass.services.async_call( DOMAIN_CLIMATE, SERVICE_SET_HVAC_MODE, - {ATTR_ENTITY_ID: "climate.climate1", ATTR_HVAC_MODE: HVACMode.OFF}, + { + ATTR_ENTITY_ID: "climate.testmodule_climate1", + ATTR_HVAC_MODE: HVACMode.OFF, + }, blocking=True, ) lock_regulator.assert_awaited_with(0, True, -1) - state = hass.states.get("climate.climate1") + state = hass.states.get("climate.testmodule_climate1") assert state is not None assert state.state == HVACMode.OFF @@ -136,7 +148,7 @@ async def test_set_temperature(hass: HomeAssistant, entry: MockConfigEntry) -> N await init_integration(hass, entry) with patch.object(MockModuleConnection, "var_abs") as var_abs: - state = hass.states.get("climate.climate1") + state = hass.states.get("climate.testmodule_climate1") state.state = HVACMode.HEAT # wrong temperature set via service call with high/low attributes @@ -147,7 +159,7 @@ async def test_set_temperature(hass: HomeAssistant, entry: MockConfigEntry) -> N DOMAIN_CLIMATE, SERVICE_SET_TEMPERATURE, { - ATTR_ENTITY_ID: "climate.climate1", + ATTR_ENTITY_ID: "climate.testmodule_climate1", ATTR_TARGET_TEMP_LOW: 24.5, ATTR_TARGET_TEMP_HIGH: 25.5, }, @@ -163,13 +175,13 @@ async def test_set_temperature(hass: HomeAssistant, entry: MockConfigEntry) -> N await hass.services.async_call( DOMAIN_CLIMATE, SERVICE_SET_TEMPERATURE, - {ATTR_ENTITY_ID: "climate.climate1", ATTR_TEMPERATURE: 25.5}, + {ATTR_ENTITY_ID: "climate.testmodule_climate1", ATTR_TEMPERATURE: 25.5}, blocking=True, ) var_abs.assert_awaited_with(Var.R1VARSETPOINT, 25.5, VarUnit.CELSIUS) - state = hass.states.get("climate.climate1") + state = hass.states.get("climate.testmodule_climate1") assert state is not None assert state.attributes[ATTR_TEMPERATURE] != 25.5 @@ -180,13 +192,13 @@ async def test_set_temperature(hass: HomeAssistant, entry: MockConfigEntry) -> N await hass.services.async_call( DOMAIN_CLIMATE, SERVICE_SET_TEMPERATURE, - {ATTR_ENTITY_ID: "climate.climate1", ATTR_TEMPERATURE: 25.5}, + {ATTR_ENTITY_ID: "climate.testmodule_climate1", ATTR_TEMPERATURE: 25.5}, blocking=True, ) var_abs.assert_awaited_with(Var.R1VARSETPOINT, 25.5, VarUnit.CELSIUS) - state = hass.states.get("climate.climate1") + state = hass.states.get("climate.testmodule_climate1") assert state is not None assert state.attributes[ATTR_TEMPERATURE] == 25.5 @@ -207,7 +219,7 @@ async def test_pushed_current_temperature_status_change( await device_connection.async_process_input(inp) await hass.async_block_till_done() - state = hass.states.get("climate.climate1") + state = hass.states.get("climate.testmodule_climate1") assert state is not None assert state.state == HVACMode.HEAT assert state.attributes[ATTR_CURRENT_TEMPERATURE] == 25.5 @@ -230,7 +242,7 @@ async def test_pushed_setpoint_status_change( await device_connection.async_process_input(inp) await hass.async_block_till_done() - state = hass.states.get("climate.climate1") + state = hass.states.get("climate.testmodule_climate1") assert state is not None assert state.state == HVACMode.HEAT assert state.attributes[ATTR_CURRENT_TEMPERATURE] is None @@ -253,7 +265,7 @@ async def test_pushed_lock_status_change( await device_connection.async_process_input(inp) await hass.async_block_till_done() - state = hass.states.get("climate.climate1") + state = hass.states.get("climate.testmodule_climate1") assert state is not None assert state.state == HVACMode.OFF assert state.attributes[ATTR_CURRENT_TEMPERATURE] is None @@ -272,7 +284,7 @@ async def test_pushed_wrong_input( await device_connection.async_process_input(Unknown("input")) await hass.async_block_till_done() - state = hass.states.get("climate.climate1") + state = hass.states.get("climate.testmodule_climate1") assert state.attributes[ATTR_CURRENT_TEMPERATURE] is None assert state.attributes[ATTR_TEMPERATURE] is None @@ -285,5 +297,5 @@ async def test_unload_config_entry( await init_integration(hass, entry) await hass.config_entries.async_unload(entry.entry_id) - state = hass.states.get("climate.climate1") + state = hass.states.get("climate.testmodule_climate1") assert state.state == STATE_UNAVAILABLE diff --git a/tests/components/lcn/test_cover.py b/tests/components/lcn/test_cover.py index f2dd71757c9..1ac4ea6f664 100644 --- a/tests/components/lcn/test_cover.py +++ b/tests/components/lcn/test_cover.py @@ -36,10 +36,10 @@ from .conftest import MockConfigEntry, MockModuleConnection, init_integration from tests.common import snapshot_platform -COVER_OUTPUTS = "cover.cover_outputs" -COVER_RELAYS = "cover.cover_relays" -COVER_RELAYS_BS4 = "cover.cover_relays_bs4" -COVER_RELAYS_MODULE = "cover.cover_relays_MODULE" +COVER_OUTPUTS = "cover.testmodule_cover_outputs" +COVER_RELAYS = "cover.testmodule_cover_relays" +COVER_RELAYS_BS4 = "cover.testmodule_cover_relays_bs4" +COVER_RELAYS_MODULE = "cover.testmodule_cover_relays_module" async def test_setup_lcn_cover( diff --git a/tests/components/lcn/test_init.py b/tests/components/lcn/test_init.py index da967782539..5634449bf22 100644 --- a/tests/components/lcn/test_init.py +++ b/tests/components/lcn/test_init.py @@ -178,8 +178,8 @@ async def test_migrate_2_1(hass: HomeAssistant, snapshot: SnapshotAssertion) -> @pytest.mark.parametrize( ("entity_id", "replace"), [ - ("climate.climate1", ("-r1varsetpoint", "-var1.r1varsetpoint")), - ("scene.romantic", ("-00", "-0.0")), + ("climate.testmodule_climate1", ("-r1varsetpoint", "-var1.r1varsetpoint")), + ("scene.testmodule_romantic", ("-00", "-0.0")), ], ) @patch("homeassistant.components.lcn.PchkConnectionManager", MockPchkConnectionManager) diff --git a/tests/components/lcn/test_light.py b/tests/components/lcn/test_light.py index 4251d997724..00c2341631e 100644 --- a/tests/components/lcn/test_light.py +++ b/tests/components/lcn/test_light.py @@ -29,9 +29,9 @@ from .conftest import MockConfigEntry, MockModuleConnection, init_integration from tests.common import snapshot_platform -LIGHT_OUTPUT1 = "light.light_output1" -LIGHT_OUTPUT2 = "light.light_output2" -LIGHT_RELAY1 = "light.light_relay1" +LIGHT_OUTPUT1 = "light.testmodule_light_output1" +LIGHT_OUTPUT2 = "light.testmodule_light_output2" +LIGHT_RELAY1 = "light.testmodule_light_relay1" async def test_setup_lcn_light( diff --git a/tests/components/lcn/test_scene.py b/tests/components/lcn/test_scene.py index 27e7864df41..aaf17f292c1 100644 --- a/tests/components/lcn/test_scene.py +++ b/tests/components/lcn/test_scene.py @@ -43,11 +43,11 @@ async def test_scene_activate( await hass.services.async_call( DOMAIN_SCENE, SERVICE_TURN_ON, - {ATTR_ENTITY_ID: "scene.romantic"}, + {ATTR_ENTITY_ID: "scene.testmodule_romantic"}, blocking=True, ) - state = hass.states.get("scene.romantic") + state = hass.states.get("scene.testmodule_romantic") assert state is not None activate_scene.assert_awaited_with( @@ -60,5 +60,5 @@ async def test_unload_config_entry(hass: HomeAssistant, entry: MockConfigEntry) await init_integration(hass, entry) await hass.config_entries.async_unload(entry.entry_id) - state = hass.states.get("scene.romantic") + state = hass.states.get("scene.testmodule_romantic") assert state.state == STATE_UNAVAILABLE diff --git a/tests/components/lcn/test_sensor.py b/tests/components/lcn/test_sensor.py index 18335f4b073..85f5b62bf91 100644 --- a/tests/components/lcn/test_sensor.py +++ b/tests/components/lcn/test_sensor.py @@ -16,10 +16,10 @@ from .conftest import MockConfigEntry, init_integration from tests.common import snapshot_platform -SENSOR_VAR1 = "sensor.sensor_var1" -SENSOR_SETPOINT1 = "sensor.sensor_setpoint1" -SENSOR_LED6 = "sensor.sensor_led6" -SENSOR_LOGICOP1 = "sensor.sensor_logicop1" +SENSOR_VAR1 = "sensor.testmodule_sensor_var1" +SENSOR_SETPOINT1 = "sensor.testmodule_sensor_setpoint1" +SENSOR_LED6 = "sensor.testmodule_sensor_led6" +SENSOR_LOGICOP1 = "sensor.testmodule_sensor_logicop1" async def test_setup_lcn_sensor( diff --git a/tests/components/lcn/test_switch.py b/tests/components/lcn/test_switch.py index 15b156aac43..0c0067c8875 100644 --- a/tests/components/lcn/test_switch.py +++ b/tests/components/lcn/test_switch.py @@ -30,12 +30,12 @@ from .conftest import MockConfigEntry, MockModuleConnection, init_integration from tests.common import snapshot_platform -SWITCH_OUTPUT1 = "switch.switch_output1" -SWITCH_OUTPUT2 = "switch.switch_output2" -SWITCH_RELAY1 = "switch.switch_relay1" -SWITCH_RELAY2 = "switch.switch_relay2" -SWITCH_REGULATOR1 = "switch.switch_regulator1" -SWITCH_KEYLOCKK1 = "switch.switch_keylock1" +SWITCH_OUTPUT1 = "switch.testmodule_switch_output1" +SWITCH_OUTPUT2 = "switch.testmodule_switch_output2" +SWITCH_RELAY1 = "switch.testmodule_switch_relay1" +SWITCH_RELAY2 = "switch.testmodule_switch_relay2" +SWITCH_REGULATOR1 = "switch.testmodule_switch_regulator1" +SWITCH_KEYLOCKK1 = "switch.testmodule_switch_keylock1" async def test_setup_lcn_switch(