mirror of
https://github.com/elisspace/core.git
synced 2026-09-30 06:19:55 +00:00
Add entity name translations to prusalink entities (#90833)
This commit is contained in:
@@ -25,12 +25,12 @@ async def test_camera_no_job(
|
||||
) -> None:
|
||||
"""Test camera while no job active."""
|
||||
assert await async_setup_component(hass, "prusalink", {})
|
||||
state = hass.states.get("camera.mock_title_job_preview")
|
||||
state = hass.states.get("camera.mock_title_preview")
|
||||
assert state is not None
|
||||
assert state.state == "unavailable"
|
||||
|
||||
client = await hass_client()
|
||||
resp = await client.get("/api/camera_proxy/camera.mock_title_job_preview")
|
||||
resp = await client.get("/api/camera_proxy/camera.mock_title_preview")
|
||||
assert resp.status == 500
|
||||
|
||||
|
||||
@@ -43,19 +43,19 @@ async def test_camera_active_job(
|
||||
) -> None:
|
||||
"""Test camera while job active."""
|
||||
assert await async_setup_component(hass, "prusalink", {})
|
||||
state = hass.states.get("camera.mock_title_job_preview")
|
||||
state = hass.states.get("camera.mock_title_preview")
|
||||
assert state is not None
|
||||
assert state.state == "idle"
|
||||
|
||||
client = await hass_client()
|
||||
|
||||
with patch("pyprusalink.PrusaLink.get_large_thumbnail", return_value=b"hello"):
|
||||
resp = await client.get("/api/camera_proxy/camera.mock_title_job_preview")
|
||||
resp = await client.get("/api/camera_proxy/camera.mock_title_preview")
|
||||
assert resp.status == 200
|
||||
assert await resp.read() == b"hello"
|
||||
|
||||
# Make sure we hit cached value.
|
||||
with patch("pyprusalink.PrusaLink.get_large_thumbnail", side_effect=ValueError):
|
||||
resp = await client.get("/api/camera_proxy/camera.mock_title_job_preview")
|
||||
resp = await client.get("/api/camera_proxy/camera.mock_title_preview")
|
||||
assert resp.status == 200
|
||||
assert await resp.read() == b"hello"
|
||||
|
||||
@@ -49,7 +49,7 @@ async def test_sensors_no_job(hass: HomeAssistant, mock_config_entry, mock_api)
|
||||
"printing",
|
||||
]
|
||||
|
||||
state = hass.states.get("sensor.mock_title_heatbed")
|
||||
state = hass.states.get("sensor.mock_title_heatbed_temperature")
|
||||
assert state is not None
|
||||
assert state.state == "41.9"
|
||||
assert state.attributes[ATTR_UNIT_OF_MEASUREMENT] == UnitOfTemperature.CELSIUS
|
||||
|
||||
Reference in New Issue
Block a user