Remove deprecated supported features warning in Camera (#132640)

This commit is contained in:
epenet
2024-12-09 08:24:09 +01:00
committed by GitHub
parent 206cac6811
commit 644b07d084
2 changed files with 5 additions and 41 deletions

View File

@@ -826,26 +826,6 @@ def test_deprecated_state_constants(
import_and_test_deprecated_constant_enum(caplog, module, enum, "STATE_", "2025.10")
def test_deprecated_supported_features_ints(caplog: pytest.LogCaptureFixture) -> None:
"""Test deprecated supported features ints."""
class MockCamera(camera.Camera):
@property
def supported_features(self) -> int:
"""Return supported features."""
return 1
entity = MockCamera()
assert entity.supported_features_compat is camera.CameraEntityFeature(1)
assert "MockCamera" in caplog.text
assert "is using deprecated supported features values" in caplog.text
assert "Instead it should use" in caplog.text
assert "CameraEntityFeature.ON_OFF" in caplog.text
caplog.clear()
assert entity.supported_features_compat is camera.CameraEntityFeature(1)
assert "is using deprecated supported features values" not in caplog.text
@pytest.mark.usefixtures("mock_camera")
async def test_entity_picture_url_changes_on_token_update(hass: HomeAssistant) -> None:
"""Test the token is rotated and entity entity picture cache is cleared."""