Revert "Remove ESPHome legacy entity naming" (#123453)

This commit is contained in:
Franck Nijhof 2024-08-10 18:38:20 +02:00 committed by GitHub
parent ef2ddbf86d
commit 0558c85b5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 322 additions and 275 deletions

View file

@ -39,14 +39,14 @@ async def test_generic_text_entity(
user_service=user_service,
states=states,
)
state = hass.states.get("text.test_my_text")
state = hass.states.get("text.test_mytext")
assert state is not None
assert state.state == "hello world"
await hass.services.async_call(
TEXT_DOMAIN,
SERVICE_SET_VALUE,
{ATTR_ENTITY_ID: "text.test_my_text", ATTR_VALUE: "goodbye"},
{ATTR_ENTITY_ID: "text.test_mytext", ATTR_VALUE: "goodbye"},
blocking=True,
)
mock_client.text_command.assert_has_calls([call(1, "goodbye")])
@ -79,7 +79,7 @@ async def test_generic_text_entity_no_state(
user_service=user_service,
states=states,
)
state = hass.states.get("text.test_my_text")
state = hass.states.get("text.test_mytext")
assert state is not None
assert state.state == STATE_UNKNOWN
@ -110,6 +110,6 @@ async def test_generic_text_entity_missing_state(
user_service=user_service,
states=states,
)
state = hass.states.get("text.test_my_text")
state = hass.states.get("text.test_mytext")
assert state is not None
assert state.state == STATE_UNKNOWN