mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Remove ESPHome legacy entity naming (#123436)
* Remove ESPHome legacy entity naming * Update test entity_ids to use sanitized name instead of object_id
This commit is contained in:
@@ -53,7 +53,7 @@ async def test_camera_single_image(
|
||||
user_service=user_service,
|
||||
states=states,
|
||||
)
|
||||
state = hass.states.get("camera.test_mycamera")
|
||||
state = hass.states.get("camera.test_my_camera")
|
||||
assert state is not None
|
||||
assert state.state == STATE_IDLE
|
||||
|
||||
@@ -63,9 +63,9 @@ async def test_camera_single_image(
|
||||
mock_client.request_single_image = _mock_camera_image
|
||||
|
||||
client = await hass_client()
|
||||
resp = await client.get("/api/camera_proxy/camera.test_mycamera")
|
||||
resp = await client.get("/api/camera_proxy/camera.test_my_camera")
|
||||
await hass.async_block_till_done()
|
||||
state = hass.states.get("camera.test_mycamera")
|
||||
state = hass.states.get("camera.test_my_camera")
|
||||
assert state is not None
|
||||
assert state.state == STATE_IDLE
|
||||
|
||||
@@ -101,15 +101,15 @@ async def test_camera_single_image_unavailable_before_requested(
|
||||
user_service=user_service,
|
||||
states=states,
|
||||
)
|
||||
state = hass.states.get("camera.test_mycamera")
|
||||
state = hass.states.get("camera.test_my_camera")
|
||||
assert state is not None
|
||||
assert state.state == STATE_IDLE
|
||||
await mock_device.mock_disconnect(False)
|
||||
|
||||
client = await hass_client()
|
||||
resp = await client.get("/api/camera_proxy/camera.test_mycamera")
|
||||
resp = await client.get("/api/camera_proxy/camera.test_my_camera")
|
||||
await hass.async_block_till_done()
|
||||
state = hass.states.get("camera.test_mycamera")
|
||||
state = hass.states.get("camera.test_my_camera")
|
||||
assert state is not None
|
||||
assert state.state == STATE_UNAVAILABLE
|
||||
|
||||
@@ -142,7 +142,7 @@ async def test_camera_single_image_unavailable_during_request(
|
||||
user_service=user_service,
|
||||
states=states,
|
||||
)
|
||||
state = hass.states.get("camera.test_mycamera")
|
||||
state = hass.states.get("camera.test_my_camera")
|
||||
assert state is not None
|
||||
assert state.state == STATE_IDLE
|
||||
|
||||
@@ -152,9 +152,9 @@ async def test_camera_single_image_unavailable_during_request(
|
||||
mock_client.request_single_image = _mock_camera_image
|
||||
|
||||
client = await hass_client()
|
||||
resp = await client.get("/api/camera_proxy/camera.test_mycamera")
|
||||
resp = await client.get("/api/camera_proxy/camera.test_my_camera")
|
||||
await hass.async_block_till_done()
|
||||
state = hass.states.get("camera.test_mycamera")
|
||||
state = hass.states.get("camera.test_my_camera")
|
||||
assert state is not None
|
||||
assert state.state == STATE_UNAVAILABLE
|
||||
|
||||
@@ -187,7 +187,7 @@ async def test_camera_stream(
|
||||
user_service=user_service,
|
||||
states=states,
|
||||
)
|
||||
state = hass.states.get("camera.test_mycamera")
|
||||
state = hass.states.get("camera.test_my_camera")
|
||||
assert state is not None
|
||||
assert state.state == STATE_IDLE
|
||||
remaining_responses = 3
|
||||
@@ -203,9 +203,9 @@ async def test_camera_stream(
|
||||
mock_client.request_single_image = _mock_camera_image
|
||||
|
||||
client = await hass_client()
|
||||
resp = await client.get("/api/camera_proxy_stream/camera.test_mycamera")
|
||||
resp = await client.get("/api/camera_proxy_stream/camera.test_my_camera")
|
||||
await hass.async_block_till_done()
|
||||
state = hass.states.get("camera.test_mycamera")
|
||||
state = hass.states.get("camera.test_my_camera")
|
||||
assert state is not None
|
||||
assert state.state == STATE_IDLE
|
||||
|
||||
@@ -247,16 +247,16 @@ async def test_camera_stream_unavailable(
|
||||
user_service=user_service,
|
||||
states=states,
|
||||
)
|
||||
state = hass.states.get("camera.test_mycamera")
|
||||
state = hass.states.get("camera.test_my_camera")
|
||||
assert state is not None
|
||||
assert state.state == STATE_IDLE
|
||||
|
||||
await mock_device.mock_disconnect(False)
|
||||
|
||||
client = await hass_client()
|
||||
await client.get("/api/camera_proxy_stream/camera.test_mycamera")
|
||||
await client.get("/api/camera_proxy_stream/camera.test_my_camera")
|
||||
await hass.async_block_till_done()
|
||||
state = hass.states.get("camera.test_mycamera")
|
||||
state = hass.states.get("camera.test_my_camera")
|
||||
assert state is not None
|
||||
assert state.state == STATE_UNAVAILABLE
|
||||
|
||||
@@ -287,7 +287,7 @@ async def test_camera_stream_with_disconnection(
|
||||
user_service=user_service,
|
||||
states=states,
|
||||
)
|
||||
state = hass.states.get("camera.test_mycamera")
|
||||
state = hass.states.get("camera.test_my_camera")
|
||||
assert state is not None
|
||||
assert state.state == STATE_IDLE
|
||||
remaining_responses = 3
|
||||
@@ -305,8 +305,8 @@ async def test_camera_stream_with_disconnection(
|
||||
mock_client.request_single_image = _mock_camera_image
|
||||
|
||||
client = await hass_client()
|
||||
await client.get("/api/camera_proxy_stream/camera.test_mycamera")
|
||||
await client.get("/api/camera_proxy_stream/camera.test_my_camera")
|
||||
await hass.async_block_till_done()
|
||||
state = hass.states.get("camera.test_mycamera")
|
||||
state = hass.states.get("camera.test_my_camera")
|
||||
assert state is not None
|
||||
assert state.state == STATE_UNAVAILABLE
|
||||
|
||||
Reference in New Issue
Block a user