Migrate Velbus to have Entity name (#135520)

This commit is contained in:
Maikel Punie 2025-01-14 11:30:10 +01:00 committed by GitHub
parent e3f03c9da1
commit 959cea45b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 180 additions and 172 deletions

View File

@ -24,6 +24,7 @@ from .const import DOMAIN
class VelbusEntity(Entity): class VelbusEntity(Entity):
"""Representation of a Velbus entity.""" """Representation of a Velbus entity."""
_attr_has_entity_name = True
_attr_should_poll: bool = False _attr_should_poll: bool = False
def __init__(self, channel: VelbusChannel) -> None: def __init__(self, channel: VelbusChannel) -> None:

View File

@ -19,7 +19,7 @@ rules:
docs-removal-instructions: done docs-removal-instructions: done
entity-event-setup: done entity-event-setup: done
entity-unique-id: done entity-unique-id: done
has-entity-name: todo has-entity-name: done
runtime-data: done runtime-data: done
test-before-configure: done test-before-configure: done
test-before-setup: done test-before-setup: done

View File

@ -114,7 +114,7 @@ def mock_button() -> AsyncMock:
channel.get_channel_number.return_value = 1 channel.get_channel_number.return_value = 1
channel.get_module_type_name.return_value = "VMB4RYLD" channel.get_module_type_name.return_value = "VMB4RYLD"
channel.get_module_type.return_value = 99 channel.get_module_type.return_value = 99
channel.get_full_name.return_value = "Channel full name" channel.get_full_name.return_value = "Bedroom kid 1"
channel.get_module_sw_version.return_value = "1.0.0" channel.get_module_sw_version.return_value = "1.0.0"
channel.get_module_serial.return_value = "a1b2c3d4e5f6" channel.get_module_serial.return_value = "a1b2c3d4e5f6"
channel.is_sub_device.return_value = False channel.is_sub_device.return_value = False
@ -132,7 +132,7 @@ def mock_temperature() -> AsyncMock:
channel.get_module_address.return_value = 88 channel.get_module_address.return_value = 88
channel.get_channel_number.return_value = 3 channel.get_channel_number.return_value = 3
channel.get_module_type_name.return_value = "VMB4GPO" channel.get_module_type_name.return_value = "VMB4GPO"
channel.get_full_name.return_value = "Channel full name" channel.get_full_name.return_value = "Living room"
channel.get_module_sw_version.return_value = "3.0.0" channel.get_module_sw_version.return_value = "3.0.0"
channel.get_module_serial.return_value = "asdfghjk" channel.get_module_serial.return_value = "asdfghjk"
channel.get_module_type.return_value = 1 channel.get_module_type.return_value = 1
@ -160,7 +160,7 @@ def mock_relay() -> AsyncMock:
channel.get_module_address.return_value = 88 channel.get_module_address.return_value = 88
channel.get_channel_number.return_value = 55 channel.get_channel_number.return_value = 55
channel.get_module_type_name.return_value = "VMB4RYNO" channel.get_module_type_name.return_value = "VMB4RYNO"
channel.get_full_name.return_value = "Full relay name" channel.get_full_name.return_value = "Living room"
channel.get_module_sw_version.return_value = "1.0.1" channel.get_module_sw_version.return_value = "1.0.1"
channel.get_module_serial.return_value = "qwerty123" channel.get_module_serial.return_value = "qwerty123"
channel.get_module_type.return_value = 2 channel.get_module_type.return_value = 2
@ -179,7 +179,7 @@ def mock_select() -> AsyncMock:
channel.get_channel_number.return_value = 33 channel.get_channel_number.return_value = 33
channel.get_module_type_name.return_value = "VMB4RYNO" channel.get_module_type_name.return_value = "VMB4RYNO"
channel.get_module_type.return_value = 3 channel.get_module_type.return_value = 3
channel.get_full_name.return_value = "Full module name" channel.get_full_name.return_value = "Kitchen"
channel.get_module_sw_version.return_value = "1.1.1" channel.get_module_sw_version.return_value = "1.1.1"
channel.get_module_serial.return_value = "qwerty1234567" channel.get_module_serial.return_value = "qwerty1234567"
channel.is_sub_device.return_value = False channel.is_sub_device.return_value = False
@ -198,7 +198,7 @@ def mock_buttoncounter() -> AsyncMock:
channel.get_channel_number.return_value = 2 channel.get_channel_number.return_value = 2
channel.get_module_type_name.return_value = "VMB7IN" channel.get_module_type_name.return_value = "VMB7IN"
channel.get_module_type.return_value = 4 channel.get_module_type.return_value = 4
channel.get_full_name.return_value = "Channel full name" channel.get_full_name.return_value = "Input"
channel.get_module_sw_version.return_value = "1.0.0" channel.get_module_sw_version.return_value = "1.0.0"
channel.get_module_serial.return_value = "a1b2c3d4e5f6" channel.get_module_serial.return_value = "a1b2c3d4e5f6"
channel.is_sub_device.return_value = True channel.is_sub_device.return_value = True
@ -221,7 +221,7 @@ def mock_sensornumber() -> AsyncMock:
channel.get_channel_number.return_value = 3 channel.get_channel_number.return_value = 3
channel.get_module_type_name.return_value = "VMB7IN" channel.get_module_type_name.return_value = "VMB7IN"
channel.get_module_type.return_value = 8 channel.get_module_type.return_value = 8
channel.get_full_name.return_value = "Channel full name" channel.get_full_name.return_value = "Input"
channel.get_module_sw_version.return_value = "1.0.0" channel.get_module_sw_version.return_value = "1.0.0"
channel.get_module_serial.return_value = "a1b2c3d4e5f6" channel.get_module_serial.return_value = "a1b2c3d4e5f6"
channel.is_sub_device.return_value = False channel.is_sub_device.return_value = False
@ -242,7 +242,7 @@ def mock_lightsensor() -> AsyncMock:
channel.get_channel_number.return_value = 4 channel.get_channel_number.return_value = 4
channel.get_module_type_name.return_value = "VMB7IN" channel.get_module_type_name.return_value = "VMB7IN"
channel.get_module_type.return_value = 8 channel.get_module_type.return_value = 8
channel.get_full_name.return_value = "Channel full name" channel.get_full_name.return_value = "Input"
channel.get_module_sw_version.return_value = "1.0.0" channel.get_module_sw_version.return_value = "1.0.0"
channel.get_module_serial.return_value = "a1b2c3d4e5f6" channel.get_module_serial.return_value = "a1b2c3d4e5f6"
channel.is_sub_device.return_value = False channel.is_sub_device.return_value = False
@ -282,7 +282,7 @@ def mock_cover() -> AsyncMock:
channel.get_channel_number.return_value = 9 channel.get_channel_number.return_value = 9
channel.get_module_type_name.return_value = "VMB2BLE" channel.get_module_type_name.return_value = "VMB2BLE"
channel.get_module_type.return_value = 10 channel.get_module_type.return_value = 10
channel.get_full_name.return_value = "Full cover name" channel.get_full_name.return_value = "Basement"
channel.get_module_sw_version.return_value = "1.0.1" channel.get_module_sw_version.return_value = "1.0.1"
channel.get_module_serial.return_value = "1234" channel.get_module_serial.return_value = "1234"
channel.is_sub_device.return_value = True channel.is_sub_device.return_value = True
@ -305,7 +305,7 @@ def mock_cover_no_position() -> AsyncMock:
channel.get_channel_number.return_value = 11 channel.get_channel_number.return_value = 11
channel.get_module_type_name.return_value = "VMB2BLE" channel.get_module_type_name.return_value = "VMB2BLE"
channel.get_module_type.return_value = 10 channel.get_module_type.return_value = 10
channel.get_full_name.return_value = "Full cover name no position" channel.get_full_name.return_value = "Basement"
channel.get_module_sw_version.return_value = "1.0.1" channel.get_module_sw_version.return_value = "1.0.1"
channel.get_module_serial.return_value = "12345" channel.get_module_serial.return_value = "12345"
channel.is_sub_device.return_value = True channel.is_sub_device.return_value = True

View File

@ -1,5 +1,5 @@
# serializer version: 1 # serializer version: 1
# name: test_entities[binary_sensor.buttonon-entry] # name: test_entities[binary_sensor.bedroom_kid_1_buttonon-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({
}), }),
@ -11,8 +11,8 @@
'disabled_by': None, 'disabled_by': None,
'domain': 'binary_sensor', 'domain': 'binary_sensor',
'entity_category': None, 'entity_category': None,
'entity_id': 'binary_sensor.buttonon', 'entity_id': 'binary_sensor.bedroom_kid_1_buttonon',
'has_entity_name': False, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,
'icon': None, 'icon': None,
'id': <ANY>, 'id': <ANY>,
@ -32,13 +32,13 @@
'unit_of_measurement': None, 'unit_of_measurement': None,
}) })
# --- # ---
# name: test_entities[binary_sensor.buttonon-state] # name: test_entities[binary_sensor.bedroom_kid_1_buttonon-state]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'friendly_name': 'ButtonOn', 'friendly_name': 'Bedroom kid 1 ButtonOn',
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'binary_sensor.buttonon', 'entity_id': 'binary_sensor.bedroom_kid_1_buttonon',
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,

View File

@ -1,5 +1,5 @@
# serializer version: 1 # serializer version: 1
# name: test_entities[button.buttonon-entry] # name: test_entities[button.bedroom_kid_1_buttonon-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({
}), }),
@ -11,8 +11,8 @@
'disabled_by': None, 'disabled_by': None,
'domain': 'button', 'domain': 'button',
'entity_category': <EntityCategory.CONFIG: 'config'>, 'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'button.buttonon', 'entity_id': 'button.bedroom_kid_1_buttonon',
'has_entity_name': False, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,
'icon': None, 'icon': None,
'id': <ANY>, 'id': <ANY>,
@ -32,13 +32,13 @@
'unit_of_measurement': None, 'unit_of_measurement': None,
}) })
# --- # ---
# name: test_entities[button.buttonon-state] # name: test_entities[button.bedroom_kid_1_buttonon-state]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'friendly_name': 'ButtonOn', 'friendly_name': 'Bedroom kid 1 ButtonOn',
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'button.buttonon', 'entity_id': 'button.bedroom_kid_1_buttonon',
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,

View File

@ -1,5 +1,5 @@
# serializer version: 1 # serializer version: 1
# name: test_entities[climate.temperature-entry] # name: test_entities[climate.living_room_temperature-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({
}), }),
@ -24,8 +24,8 @@
'disabled_by': None, 'disabled_by': None,
'domain': 'climate', 'domain': 'climate',
'entity_category': None, 'entity_category': None,
'entity_id': 'climate.temperature', 'entity_id': 'climate.living_room_temperature',
'has_entity_name': False, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,
'icon': None, 'icon': None,
'id': <ANY>, 'id': <ANY>,
@ -45,11 +45,11 @@
'unit_of_measurement': None, 'unit_of_measurement': None,
}) })
# --- # ---
# name: test_entities[climate.temperature-state] # name: test_entities[climate.living_room_temperature-state]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'current_temperature': 20.0, 'current_temperature': 20.0,
'friendly_name': 'Temperature', 'friendly_name': 'Living room Temperature',
'hvac_modes': list([ 'hvac_modes': list([
<HVACMode.HEAT: 'heat'>, <HVACMode.HEAT: 'heat'>,
<HVACMode.COOL: 'cool'>, <HVACMode.COOL: 'cool'>,
@ -67,7 +67,7 @@
'temperature': 21.0, 'temperature': 21.0,
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'climate.temperature', 'entity_id': 'climate.living_room_temperature',
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,

View File

@ -1,5 +1,5 @@
# serializer version: 1 # serializer version: 1
# name: test_entities[cover.covername-entry] # name: test_entities[cover.basement_covername-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({
}), }),
@ -11,8 +11,8 @@
'disabled_by': None, 'disabled_by': None,
'domain': 'cover', 'domain': 'cover',
'entity_category': None, 'entity_category': None,
'entity_id': 'cover.covername', 'entity_id': 'cover.basement_covername',
'has_entity_name': False, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,
'icon': None, 'icon': None,
'id': <ANY>, 'id': <ANY>,
@ -32,22 +32,22 @@
'unit_of_measurement': None, 'unit_of_measurement': None,
}) })
# --- # ---
# name: test_entities[cover.covername-state] # name: test_entities[cover.basement_covername-state]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'current_position': 50, 'current_position': 50,
'friendly_name': 'CoverName', 'friendly_name': 'Basement CoverName',
'supported_features': <CoverEntityFeature: 15>, 'supported_features': <CoverEntityFeature: 15>,
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'cover.covername', 'entity_id': 'cover.basement_covername',
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,
'state': 'open', 'state': 'open',
}) })
# --- # ---
# name: test_entities[cover.covernamenopos-entry] # name: test_entities[cover.basement_covernamenopos-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({
}), }),
@ -59,8 +59,8 @@
'disabled_by': None, 'disabled_by': None,
'domain': 'cover', 'domain': 'cover',
'entity_category': None, 'entity_category': None,
'entity_id': 'cover.covernamenopos', 'entity_id': 'cover.basement_covernamenopos',
'has_entity_name': False, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,
'icon': None, 'icon': None,
'id': <ANY>, 'id': <ANY>,
@ -80,15 +80,15 @@
'unit_of_measurement': None, 'unit_of_measurement': None,
}) })
# --- # ---
# name: test_entities[cover.covernamenopos-state] # name: test_entities[cover.basement_covernamenopos-state]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'assumed_state': True, 'assumed_state': True,
'friendly_name': 'CoverNameNoPos', 'friendly_name': 'Basement CoverNameNoPos',
'supported_features': <CoverEntityFeature: 11>, 'supported_features': <CoverEntityFeature: 11>,
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'cover.covernamenopos', 'entity_id': 'cover.basement_covernamenopos',
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,

View File

@ -23,7 +23,7 @@
'manufacturer': 'Velleman', 'manufacturer': 'Velleman',
'model': 'VMB4RYLD', 'model': 'VMB4RYLD',
'model_id': '99', 'model_id': '99',
'name': 'Channel full name', 'name': 'Bedroom kid 1',
'name_by_user': None, 'name_by_user': None,
'primary_config_entry': <ANY>, 'primary_config_entry': <ANY>,
'serial_number': 'a1b2c3d4e5f6', 'serial_number': 'a1b2c3d4e5f6',
@ -53,7 +53,7 @@
'manufacturer': 'Velleman', 'manufacturer': 'Velleman',
'model': 'VMB2BLE', 'model': 'VMB2BLE',
'model_id': '10', 'model_id': '10',
'name': 'Full cover name', 'name': 'Basement',
'name_by_user': None, 'name_by_user': None,
'primary_config_entry': <ANY>, 'primary_config_entry': <ANY>,
'serial_number': '1234', 'serial_number': '1234',
@ -83,7 +83,7 @@
'manufacturer': 'Velleman', 'manufacturer': 'Velleman',
'model': 'VMB2BLE', 'model': 'VMB2BLE',
'model_id': '10', 'model_id': '10',
'name': 'Full cover name no position', 'name': 'Basement',
'name_by_user': None, 'name_by_user': None,
'primary_config_entry': <ANY>, 'primary_config_entry': <ANY>,
'serial_number': '12345', 'serial_number': '12345',
@ -143,7 +143,7 @@
'manufacturer': 'Velleman', 'manufacturer': 'Velleman',
'model': 'VMB7IN', 'model': 'VMB7IN',
'model_id': '4', 'model_id': '4',
'name': 'Channel full name', 'name': 'Input',
'name_by_user': None, 'name_by_user': None,
'primary_config_entry': <ANY>, 'primary_config_entry': <ANY>,
'serial_number': 'a1b2c3d4e5f6', 'serial_number': 'a1b2c3d4e5f6',
@ -173,7 +173,7 @@
'manufacturer': 'Velleman', 'manufacturer': 'Velleman',
'model': 'VMB4GPO', 'model': 'VMB4GPO',
'model_id': '1', 'model_id': '1',
'name': 'Channel full name', 'name': 'Living room',
'name_by_user': None, 'name_by_user': None,
'primary_config_entry': <ANY>, 'primary_config_entry': <ANY>,
'serial_number': 'asdfghjk', 'serial_number': 'asdfghjk',
@ -203,7 +203,7 @@
'manufacturer': 'Velleman', 'manufacturer': 'Velleman',
'model': 'VMB7IN', 'model': 'VMB7IN',
'model_id': '8', 'model_id': '8',
'name': 'Channel full name', 'name': 'Input',
'name_by_user': None, 'name_by_user': None,
'primary_config_entry': <ANY>, 'primary_config_entry': <ANY>,
'serial_number': 'a1b2c3d4e5f6', 'serial_number': 'a1b2c3d4e5f6',
@ -233,7 +233,7 @@
'manufacturer': 'Velleman', 'manufacturer': 'Velleman',
'model': 'VMB4RYNO', 'model': 'VMB4RYNO',
'model_id': '2', 'model_id': '2',
'name': 'Full relay name', 'name': 'Living room',
'name_by_user': None, 'name_by_user': None,
'primary_config_entry': <ANY>, 'primary_config_entry': <ANY>,
'serial_number': 'qwerty123', 'serial_number': 'qwerty123',

View File

@ -1,61 +1,5 @@
# serializer version: 1 # serializer version: 1
# name: test_entities[light.dimmer-entry] # name: test_entities[light.bedroom_kid_1_led_buttonon-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'supported_color_modes': list([
<ColorMode.BRIGHTNESS: 'brightness'>,
]),
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'light',
'entity_category': None,
'entity_id': 'light.dimmer',
'has_entity_name': False,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Dimmer',
'platform': 'velbus',
'previous_unique_id': None,
'supported_features': <LightEntityFeature: 32>,
'translation_key': None,
'unique_id': 'a1b2c3d4e5f6g7-10',
'unit_of_measurement': None,
})
# ---
# name: test_entities[light.dimmer-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'brightness': None,
'color_mode': None,
'friendly_name': 'Dimmer',
'supported_color_modes': list([
<ColorMode.BRIGHTNESS: 'brightness'>,
]),
'supported_features': <LightEntityFeature: 32>,
}),
'context': <ANY>,
'entity_id': 'light.dimmer',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_entities[light.led_buttonon-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({
}), }),
@ -71,8 +15,8 @@
'disabled_by': None, 'disabled_by': None,
'domain': 'light', 'domain': 'light',
'entity_category': <EntityCategory.CONFIG: 'config'>, 'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'light.led_buttonon', 'entity_id': 'light.bedroom_kid_1_led_buttonon',
'has_entity_name': False, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,
'icon': None, 'icon': None,
'id': <ANY>, 'id': <ANY>,
@ -92,18 +36,74 @@
'unit_of_measurement': None, 'unit_of_measurement': None,
}) })
# --- # ---
# name: test_entities[light.led_buttonon-state] # name: test_entities[light.bedroom_kid_1_led_buttonon-state]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'color_mode': None, 'color_mode': None,
'friendly_name': 'LED ButtonOn', 'friendly_name': 'Bedroom kid 1 LED ButtonOn',
'supported_color_modes': list([ 'supported_color_modes': list([
<ColorMode.ONOFF: 'onoff'>, <ColorMode.ONOFF: 'onoff'>,
]), ]),
'supported_features': <LightEntityFeature: 8>, 'supported_features': <LightEntityFeature: 8>,
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'light.led_buttonon', 'entity_id': 'light.bedroom_kid_1_led_buttonon',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_entities[light.dimmer_full_name_dimmer-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'supported_color_modes': list([
<ColorMode.BRIGHTNESS: 'brightness'>,
]),
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'light',
'entity_category': None,
'entity_id': 'light.dimmer_full_name_dimmer',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Dimmer',
'platform': 'velbus',
'previous_unique_id': None,
'supported_features': <LightEntityFeature: 32>,
'translation_key': None,
'unique_id': 'a1b2c3d4e5f6g7-10',
'unit_of_measurement': None,
})
# ---
# name: test_entities[light.dimmer_full_name_dimmer-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'brightness': None,
'color_mode': None,
'friendly_name': 'Dimmer full name Dimmer',
'supported_color_modes': list([
<ColorMode.BRIGHTNESS: 'brightness'>,
]),
'supported_features': <LightEntityFeature: 32>,
}),
'context': <ANY>,
'entity_id': 'light.dimmer_full_name_dimmer',
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,

View File

@ -1,5 +1,5 @@
# serializer version: 1 # serializer version: 1
# name: test_entities[select.select-entry] # name: test_entities[select.kitchen_select-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({
}), }),
@ -18,8 +18,8 @@
'disabled_by': None, 'disabled_by': None,
'domain': 'select', 'domain': 'select',
'entity_category': <EntityCategory.CONFIG: 'config'>, 'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'select.select', 'entity_id': 'select.kitchen_select',
'has_entity_name': False, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,
'icon': None, 'icon': None,
'id': <ANY>, 'id': <ANY>,
@ -39,10 +39,10 @@
'unit_of_measurement': None, 'unit_of_measurement': None,
}) })
# --- # ---
# name: test_entities[select.select-state] # name: test_entities[select.kitchen_select-state]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'friendly_name': 'select', 'friendly_name': 'Kitchen select',
'options': list([ 'options': list([
'none', 'none',
'summer', 'summer',
@ -51,7 +51,7 @@
]), ]),
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'select.select', 'entity_id': 'select.kitchen_select',
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,

View File

@ -1,5 +1,5 @@
# serializer version: 1 # serializer version: 1
# name: test_entities[sensor.buttoncounter-entry] # name: test_entities[sensor.input_buttoncounter-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({
}), }),
@ -13,8 +13,8 @@
'disabled_by': None, 'disabled_by': None,
'domain': 'sensor', 'domain': 'sensor',
'entity_category': None, 'entity_category': None,
'entity_id': 'sensor.buttoncounter', 'entity_id': 'sensor.input_buttoncounter',
'has_entity_name': False, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,
'icon': None, 'icon': None,
'id': <ANY>, 'id': <ANY>,
@ -34,23 +34,23 @@
'unit_of_measurement': 'W', 'unit_of_measurement': 'W',
}) })
# --- # ---
# name: test_entities[sensor.buttoncounter-state] # name: test_entities[sensor.input_buttoncounter-state]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'device_class': 'power', 'device_class': 'power',
'friendly_name': 'ButtonCounter', 'friendly_name': 'Input ButtonCounter',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>, 'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': 'W', 'unit_of_measurement': 'W',
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'sensor.buttoncounter', 'entity_id': 'sensor.input_buttoncounter',
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,
'state': '100.0', 'state': '100.0',
}) })
# --- # ---
# name: test_entities[sensor.buttoncounter_counter-entry] # name: test_entities[sensor.input_buttoncounter_counter-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({
}), }),
@ -64,8 +64,8 @@
'disabled_by': None, 'disabled_by': None,
'domain': 'sensor', 'domain': 'sensor',
'entity_category': None, 'entity_category': None,
'entity_id': 'sensor.buttoncounter_counter', 'entity_id': 'sensor.input_buttoncounter_counter',
'has_entity_name': False, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,
'icon': None, 'icon': None,
'id': <ANY>, 'id': <ANY>,
@ -85,24 +85,24 @@
'unit_of_measurement': 'kWh', 'unit_of_measurement': 'kWh',
}) })
# --- # ---
# name: test_entities[sensor.buttoncounter_counter-state] # name: test_entities[sensor.input_buttoncounter_counter-state]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'device_class': 'energy', 'device_class': 'energy',
'friendly_name': 'ButtonCounter-counter', 'friendly_name': 'Input ButtonCounter-counter',
'icon': 'mdi:counter', 'icon': 'mdi:counter',
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>, 'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
'unit_of_measurement': 'kWh', 'unit_of_measurement': 'kWh',
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'sensor.buttoncounter_counter', 'entity_id': 'sensor.input_buttoncounter_counter',
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,
'state': '100.0', 'state': '100.0',
}) })
# --- # ---
# name: test_entities[sensor.lightsensor-entry] # name: test_entities[sensor.input_lightsensor-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({
}), }),
@ -116,8 +116,8 @@
'disabled_by': None, 'disabled_by': None,
'domain': 'sensor', 'domain': 'sensor',
'entity_category': None, 'entity_category': None,
'entity_id': 'sensor.lightsensor', 'entity_id': 'sensor.input_lightsensor',
'has_entity_name': False, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,
'icon': None, 'icon': None,
'id': <ANY>, 'id': <ANY>,
@ -137,22 +137,22 @@
'unit_of_measurement': 'illuminance', 'unit_of_measurement': 'illuminance',
}) })
# --- # ---
# name: test_entities[sensor.lightsensor-state] # name: test_entities[sensor.input_lightsensor-state]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'friendly_name': 'LightSensor', 'friendly_name': 'Input LightSensor',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>, 'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': 'illuminance', 'unit_of_measurement': 'illuminance',
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'sensor.lightsensor', 'entity_id': 'sensor.input_lightsensor',
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,
'state': '250.0', 'state': '250.0',
}) })
# --- # ---
# name: test_entities[sensor.sensornumber-entry] # name: test_entities[sensor.input_sensornumber-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({
}), }),
@ -166,8 +166,8 @@
'disabled_by': None, 'disabled_by': None,
'domain': 'sensor', 'domain': 'sensor',
'entity_category': None, 'entity_category': None,
'entity_id': 'sensor.sensornumber', 'entity_id': 'sensor.input_sensornumber',
'has_entity_name': False, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,
'icon': None, 'icon': None,
'id': <ANY>, 'id': <ANY>,
@ -187,22 +187,22 @@
'unit_of_measurement': 'm', 'unit_of_measurement': 'm',
}) })
# --- # ---
# name: test_entities[sensor.sensornumber-state] # name: test_entities[sensor.input_sensornumber-state]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'friendly_name': 'SensorNumber', 'friendly_name': 'Input SensorNumber',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>, 'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': 'm', 'unit_of_measurement': 'm',
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'sensor.sensornumber', 'entity_id': 'sensor.input_sensornumber',
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,
'state': '10.0', 'state': '10.0',
}) })
# --- # ---
# name: test_entities[sensor.temperature-entry] # name: test_entities[sensor.living_room_temperature-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({
}), }),
@ -216,8 +216,8 @@
'disabled_by': None, 'disabled_by': None,
'domain': 'sensor', 'domain': 'sensor',
'entity_category': None, 'entity_category': None,
'entity_id': 'sensor.temperature', 'entity_id': 'sensor.living_room_temperature',
'has_entity_name': False, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,
'icon': None, 'icon': None,
'id': <ANY>, 'id': <ANY>,
@ -237,16 +237,16 @@
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>, 'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}) })
# --- # ---
# name: test_entities[sensor.temperature-state] # name: test_entities[sensor.living_room_temperature-state]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'device_class': 'temperature', 'device_class': 'temperature',
'friendly_name': 'Temperature', 'friendly_name': 'Living room Temperature',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>, 'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>, 'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'sensor.temperature', 'entity_id': 'sensor.living_room_temperature',
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,

View File

@ -1,5 +1,5 @@
# serializer version: 1 # serializer version: 1
# name: test_entities[switch.relayname-entry] # name: test_entities[switch.living_room_relayname-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({
}), }),
@ -11,8 +11,8 @@
'disabled_by': None, 'disabled_by': None,
'domain': 'switch', 'domain': 'switch',
'entity_category': None, 'entity_category': None,
'entity_id': 'switch.relayname', 'entity_id': 'switch.living_room_relayname',
'has_entity_name': False, 'has_entity_name': True,
'hidden_by': None, 'hidden_by': None,
'icon': None, 'icon': None,
'id': <ANY>, 'id': <ANY>,
@ -32,13 +32,13 @@
'unit_of_measurement': None, 'unit_of_measurement': None,
}) })
# --- # ---
# name: test_entities[switch.relayname-state] # name: test_entities[switch.living_room_relayname-state]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'friendly_name': 'RelayName', 'friendly_name': 'Living room RelayName',
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'switch.relayname', 'entity_id': 'switch.living_room_relayname',
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,

View File

@ -38,6 +38,9 @@ async def test_button_press(
"""Test button press.""" """Test button press."""
await init_integration(hass, config_entry) await init_integration(hass, config_entry)
await hass.services.async_call( await hass.services.async_call(
BUTTON_DOMAIN, SERVICE_PRESS, {ATTR_ENTITY_ID: "button.buttonon"}, blocking=True BUTTON_DOMAIN,
SERVICE_PRESS,
{ATTR_ENTITY_ID: "button.bedroom_kid_1_buttonon"},
blocking=True,
) )
mock_button.press.assert_called_once_with() mock_button.press.assert_called_once_with()

View File

@ -51,7 +51,7 @@ async def test_set_target_temperature(
await hass.services.async_call( await hass.services.async_call(
CLIMATE_DOMAIN, CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE, SERVICE_SET_TEMPERATURE,
{ATTR_ENTITY_ID: "climate.temperature", ATTR_TEMPERATURE: 29}, {ATTR_ENTITY_ID: "climate.living_room_temperature", ATTR_TEMPERATURE: 29},
blocking=True, blocking=True,
) )
mock_temperature.set_temp.assert_called_once_with(29) mock_temperature.set_temp.assert_called_once_with(29)
@ -78,7 +78,7 @@ async def test_set_preset_mode(
await hass.services.async_call( await hass.services.async_call(
CLIMATE_DOMAIN, CLIMATE_DOMAIN,
SERVICE_SET_PRESET_MODE, SERVICE_SET_PRESET_MODE,
{ATTR_ENTITY_ID: "climate.temperature", ATTR_PRESET_MODE: set_mode}, {ATTR_ENTITY_ID: "climate.living_room_temperature", ATTR_PRESET_MODE: set_mode},
blocking=True, blocking=True,
) )
mock_temperature.set_preset.assert_called_once_with(expected_mode) mock_temperature.set_preset.assert_called_once_with(expected_mode)
@ -102,7 +102,7 @@ async def test_set_hvac_mode(
await hass.services.async_call( await hass.services.async_call(
CLIMATE_DOMAIN, CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE, SERVICE_SET_HVAC_MODE,
{ATTR_ENTITY_ID: "climate.temperature", ATTR_HVAC_MODE: set_mode}, {ATTR_ENTITY_ID: "climate.living_room_temperature", ATTR_HVAC_MODE: set_mode},
blocking=True, blocking=True,
) )
mock_temperature.set_mode.assert_called_once_with(set_mode) mock_temperature.set_mode.assert_called_once_with(set_mode)
@ -119,7 +119,7 @@ async def test_set_hvac_mode_invalid(
await hass.services.async_call( await hass.services.async_call(
CLIMATE_DOMAIN, CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE, SERVICE_SET_HVAC_MODE,
{ATTR_ENTITY_ID: "climate.temperature", ATTR_HVAC_MODE: "auto"}, {ATTR_ENTITY_ID: "climate.living_room_temperature", ATTR_HVAC_MODE: "auto"},
blocking=True, blocking=True,
) )
mock_temperature.set_mode.assert_not_called() mock_temperature.set_mode.assert_not_called()

View File

@ -38,8 +38,8 @@ async def test_entities(
@pytest.mark.parametrize( @pytest.mark.parametrize(
("entity_id", "entity_num"), ("entity_id", "entity_num"),
[ [
("cover.covername", 0), ("cover.basement_covername", 0),
("cover.covernamenopos", 1), ("cover.basement_covernamenopos", 1),
], ],
) )
async def test_actions( async def test_actions(
@ -84,7 +84,7 @@ async def test_position(
await hass.services.async_call( await hass.services.async_call(
COVER_DOMAIN, COVER_DOMAIN,
SERVICE_SET_COVER_POSITION, SERVICE_SET_COVER_POSITION,
{ATTR_ENTITY_ID: "cover.covername", ATTR_POSITION: 25}, {ATTR_ENTITY_ID: "cover.basement_covername", ATTR_POSITION: 25},
blocking=True, blocking=True,
) )
mock_cover.set_position.assert_called_once_with(75) mock_cover.set_position.assert_called_once_with(75)

View File

@ -132,7 +132,7 @@ async def test_api_call(
await hass.services.async_call( await hass.services.async_call(
SWITCH_DOMAIN, SWITCH_DOMAIN,
SERVICE_TURN_ON, SERVICE_TURN_ON,
{ATTR_ENTITY_ID: "switch.relayname"}, {ATTR_ENTITY_ID: "switch.living_room_relayname"},
blocking=True, blocking=True,
) )

View File

@ -52,7 +52,7 @@ async def test_dimmer_actions(
await hass.services.async_call( await hass.services.async_call(
LIGHT_DOMAIN, LIGHT_DOMAIN,
SERVICE_TURN_OFF, SERVICE_TURN_OFF,
{ATTR_ENTITY_ID: "light.dimmer"}, {ATTR_ENTITY_ID: "light.dimmer_full_name_dimmer"},
blocking=True, blocking=True,
) )
mock_dimmer.set_dimmer_state.assert_called_once_with(0, 0) mock_dimmer.set_dimmer_state.assert_called_once_with(0, 0)
@ -60,7 +60,7 @@ async def test_dimmer_actions(
await hass.services.async_call( await hass.services.async_call(
LIGHT_DOMAIN, LIGHT_DOMAIN,
SERVICE_TURN_ON, SERVICE_TURN_ON,
{ATTR_ENTITY_ID: "light.dimmer", ATTR_TRANSITION: 1}, {ATTR_ENTITY_ID: "light.dimmer_full_name_dimmer", ATTR_TRANSITION: 1},
blocking=True, blocking=True,
) )
mock_dimmer.restore_dimmer_state.assert_called_once_with(1) mock_dimmer.restore_dimmer_state.assert_called_once_with(1)
@ -68,7 +68,11 @@ async def test_dimmer_actions(
await hass.services.async_call( await hass.services.async_call(
LIGHT_DOMAIN, LIGHT_DOMAIN,
SERVICE_TURN_ON, SERVICE_TURN_ON,
{ATTR_ENTITY_ID: "light.dimmer", ATTR_BRIGHTNESS: 0, ATTR_TRANSITION: 1}, {
ATTR_ENTITY_ID: "light.dimmer_full_name_dimmer",
ATTR_BRIGHTNESS: 0,
ATTR_TRANSITION: 1,
},
blocking=True, blocking=True,
) )
mock_dimmer.set_dimmer_state.assert_called_with(0, 1) mock_dimmer.set_dimmer_state.assert_called_with(0, 1)
@ -77,7 +81,7 @@ async def test_dimmer_actions(
await hass.services.async_call( await hass.services.async_call(
LIGHT_DOMAIN, LIGHT_DOMAIN,
SERVICE_TURN_ON, SERVICE_TURN_ON,
{ATTR_ENTITY_ID: "light.dimmer", ATTR_BRIGHTNESS: 33}, {ATTR_ENTITY_ID: "light.dimmer_full_name_dimmer", ATTR_BRIGHTNESS: 33},
blocking=True, blocking=True,
) )
mock_dimmer.set_dimmer_state.assert_called_with(12, 0) mock_dimmer.set_dimmer_state.assert_called_with(12, 0)
@ -96,7 +100,7 @@ async def test_led_actions(
await hass.services.async_call( await hass.services.async_call(
LIGHT_DOMAIN, LIGHT_DOMAIN,
SERVICE_TURN_OFF, SERVICE_TURN_OFF,
{ATTR_ENTITY_ID: "light.led_buttonon"}, {ATTR_ENTITY_ID: "light.bedroom_kid_1_led_buttonon"},
blocking=True, blocking=True,
) )
mock_button.set_led_state.assert_called_once_with("off") mock_button.set_led_state.assert_called_once_with("off")
@ -104,7 +108,7 @@ async def test_led_actions(
await hass.services.async_call( await hass.services.async_call(
LIGHT_DOMAIN, LIGHT_DOMAIN,
SERVICE_TURN_ON, SERVICE_TURN_ON,
{ATTR_ENTITY_ID: "light.led_buttonon"}, {ATTR_ENTITY_ID: "light.bedroom_kid_1_led_buttonon"},
blocking=True, blocking=True,
) )
mock_button.set_led_state.assert_called_with("on") mock_button.set_led_state.assert_called_with("on")
@ -113,7 +117,7 @@ async def test_led_actions(
await hass.services.async_call( await hass.services.async_call(
LIGHT_DOMAIN, LIGHT_DOMAIN,
SERVICE_TURN_ON, SERVICE_TURN_ON,
{ATTR_ENTITY_ID: "light.led_buttonon", ATTR_FLASH: FLASH_LONG}, {ATTR_ENTITY_ID: "light.bedroom_kid_1_led_buttonon", ATTR_FLASH: FLASH_LONG},
blocking=True, blocking=True,
) )
mock_button.set_led_state.assert_called_with("slow") mock_button.set_led_state.assert_called_with("slow")
@ -122,7 +126,7 @@ async def test_led_actions(
await hass.services.async_call( await hass.services.async_call(
LIGHT_DOMAIN, LIGHT_DOMAIN,
SERVICE_TURN_ON, SERVICE_TURN_ON,
{ATTR_ENTITY_ID: "light.led_buttonon", ATTR_FLASH: FLASH_SHORT}, {ATTR_ENTITY_ID: "light.bedroom_kid_1_led_buttonon", ATTR_FLASH: FLASH_SHORT},
blocking=True, blocking=True,
) )
mock_button.set_led_state.assert_called_with("fast") mock_button.set_led_state.assert_called_with("fast")
@ -131,7 +135,7 @@ async def test_led_actions(
await hass.services.async_call( await hass.services.async_call(
LIGHT_DOMAIN, LIGHT_DOMAIN,
SERVICE_TURN_ON, SERVICE_TURN_ON,
{ATTR_ENTITY_ID: "light.led_buttonon", ATTR_FLASH: FLASH_SHORT}, {ATTR_ENTITY_ID: "light.bedroom_kid_1_led_buttonon", ATTR_FLASH: FLASH_SHORT},
blocking=True, blocking=True,
) )
mock_button.set_led_state.assert_called_with("fast") mock_button.set_led_state.assert_called_with("fast")

View File

@ -46,7 +46,7 @@ async def test_select_program(
await hass.services.async_call( await hass.services.async_call(
SELECT_DOMAIN, SELECT_DOMAIN,
SERVICE_SELECT_OPTION, SERVICE_SELECT_OPTION,
{ATTR_ENTITY_ID: "select.select", ATTR_OPTION: set_program}, {ATTR_ENTITY_ID: "select.kitchen_select", ATTR_OPTION: set_program},
blocking=True, blocking=True,
) )
mock_select.set_selected_program.assert_called_once_with(set_program) mock_select.set_selected_program.assert_called_once_with(set_program)

View File

@ -43,7 +43,7 @@ async def test_switch_on_off(
await hass.services.async_call( await hass.services.async_call(
SWITCH_DOMAIN, SWITCH_DOMAIN,
SERVICE_TURN_OFF, SERVICE_TURN_OFF,
{ATTR_ENTITY_ID: "switch.relayname"}, {ATTR_ENTITY_ID: "switch.living_room_relayname"},
blocking=True, blocking=True,
) )
mock_relay.turn_off.assert_called_once_with() mock_relay.turn_off.assert_called_once_with()
@ -51,7 +51,7 @@ async def test_switch_on_off(
await hass.services.async_call( await hass.services.async_call(
SWITCH_DOMAIN, SWITCH_DOMAIN,
SERVICE_TURN_ON, SERVICE_TURN_ON,
{ATTR_ENTITY_ID: "switch.relayname"}, {ATTR_ENTITY_ID: "switch.living_room_relayname"},
blocking=True, blocking=True,
) )
mock_relay.turn_on.assert_called_once_with() mock_relay.turn_on.assert_called_once_with()