Mark camera methods and properties as mandatory in pylint plugin (#145272)

This commit is contained in:
epenet 2025-05-20 13:30:22 +02:00 committed by GitHub
parent fb0cb7cad6
commit 64d6101fb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1008,18 +1008,22 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
TypeHintMatch( TypeHintMatch(
function_name="entity_picture", function_name="entity_picture",
return_type="str", return_type="str",
mandatory=True,
), ),
TypeHintMatch( TypeHintMatch(
function_name="supported_features", function_name="supported_features",
return_type="CameraEntityFeature", return_type="CameraEntityFeature",
mandatory=True,
), ),
TypeHintMatch( TypeHintMatch(
function_name="is_recording", function_name="is_recording",
return_type="bool", return_type="bool",
mandatory=True,
), ),
TypeHintMatch( TypeHintMatch(
function_name="is_streaming", function_name="is_streaming",
return_type="bool", return_type="bool",
mandatory=True,
), ),
TypeHintMatch( TypeHintMatch(
function_name="brand", function_name="brand",
@ -1028,6 +1032,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
TypeHintMatch( TypeHintMatch(
function_name="motion_detection_enabled", function_name="motion_detection_enabled",
return_type="bool", return_type="bool",
mandatory=True,
), ),
TypeHintMatch( TypeHintMatch(
function_name="model", function_name="model",
@ -1036,6 +1041,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
TypeHintMatch( TypeHintMatch(
function_name="frame_interval", function_name="frame_interval",
return_type="float", return_type="float",
mandatory=True,
), ),
TypeHintMatch( TypeHintMatch(
function_name="frontend_stream_type", function_name="frontend_stream_type",
@ -1044,6 +1050,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
TypeHintMatch( TypeHintMatch(
function_name="available", function_name="available",
return_type="bool", return_type="bool",
mandatory=True,
), ),
TypeHintMatch( TypeHintMatch(
function_name="async_create_stream", function_name="async_create_stream",
@ -1076,6 +1083,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
2: "float", 2: "float",
}, },
return_type="StreamResponse", return_type="StreamResponse",
mandatory=True,
), ),
TypeHintMatch( TypeHintMatch(
function_name="handle_async_mjpeg_stream", function_name="handle_async_mjpeg_stream",
@ -1087,26 +1095,31 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
TypeHintMatch( TypeHintMatch(
function_name="is_on", function_name="is_on",
return_type="bool", return_type="bool",
mandatory=True,
), ),
TypeHintMatch( TypeHintMatch(
function_name="turn_off", function_name="turn_off",
return_type=None, return_type=None,
has_async_counterpart=True, has_async_counterpart=True,
mandatory=True,
), ),
TypeHintMatch( TypeHintMatch(
function_name="turn_on", function_name="turn_on",
return_type=None, return_type=None,
has_async_counterpart=True, has_async_counterpart=True,
mandatory=True,
), ),
TypeHintMatch( TypeHintMatch(
function_name="enable_motion_detection", function_name="enable_motion_detection",
return_type=None, return_type=None,
has_async_counterpart=True, has_async_counterpart=True,
mandatory=True,
), ),
TypeHintMatch( TypeHintMatch(
function_name="disable_motion_detection", function_name="disable_motion_detection",
return_type=None, return_type=None,
has_async_counterpart=True, has_async_counterpart=True,
mandatory=True,
), ),
TypeHintMatch( TypeHintMatch(
function_name="async_handle_async_webrtc_offer", function_name="async_handle_async_webrtc_offer",
@ -1116,6 +1129,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
3: "WebRTCSendMessage", 3: "WebRTCSendMessage",
}, },
return_type=None, return_type=None,
mandatory=True,
), ),
TypeHintMatch( TypeHintMatch(
function_name="async_on_webrtc_candidate", function_name="async_on_webrtc_candidate",
@ -1124,6 +1138,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
2: "RTCIceCandidateInit", 2: "RTCIceCandidateInit",
}, },
return_type=None, return_type=None,
mandatory=True,
), ),
TypeHintMatch( TypeHintMatch(
function_name="close_webrtc_session", function_name="close_webrtc_session",
@ -1131,10 +1146,12 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
1: "str", 1: "str",
}, },
return_type=None, return_type=None,
mandatory=True,
), ),
TypeHintMatch( TypeHintMatch(
function_name="_async_get_webrtc_client_configuration", function_name="_async_get_webrtc_client_configuration",
return_type="WebRTCClientConfiguration", return_type="WebRTCClientConfiguration",
mandatory=True,
), ),
], ],
), ),