1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Use the ESPHome object_id to suggest the entity id (#95852)

This commit is contained in:
J. Nick Koston
2023-07-10 01:02:34 -10:00
committed by GitHub
parent 87f284c7e9
commit 7dc03ef301
16 changed files with 232 additions and 196 deletions

View File

@@ -34,14 +34,14 @@ async def test_switch_generic_entity(
user_service=user_service,
states=states,
)
state = hass.states.get("switch.test_my_switch")
state = hass.states.get("switch.test_myswitch")
assert state is not None
assert state.state == STATE_ON
await hass.services.async_call(
SWITCH_DOMAIN,
SERVICE_TURN_ON,
{ATTR_ENTITY_ID: "switch.test_my_switch"},
{ATTR_ENTITY_ID: "switch.test_myswitch"},
blocking=True,
)
mock_client.switch_command.assert_has_calls([call(1, True)])
@@ -49,7 +49,7 @@ async def test_switch_generic_entity(
await hass.services.async_call(
SWITCH_DOMAIN,
SERVICE_TURN_OFF,
{ATTR_ENTITY_ID: "switch.test_my_switch"},
{ATTR_ENTITY_ID: "switch.test_myswitch"},
blocking=True,
)
mock_client.switch_command.assert_has_calls([call(1, False)])