From 6e84bc4ca39e94edf7b3dd80632b8baa267e5008 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 16 Jan 2024 13:23:14 +0100 Subject: [PATCH 1/2] Regenerate protobuf files --- pychromecast/authority_keys_pb2.py | 46 --- pychromecast/cast_channel_pb2.py | 98 ------- pychromecast/generated/authority_keys_pb2.py | 29 ++ pychromecast/generated/authority_keys_pb2.pyi | 19 ++ pychromecast/generated/cast_channel_pb2.py | 45 +++ pychromecast/generated/cast_channel_pb2.pyi | 103 +++++++ pychromecast/{ => generated}/logging_pb2.py | 190 ++----------- pychromecast/generated/logging_pb2.pyi | 267 ++++++++++++++++++ pychromecast/generated/readme.txt | 2 + pychromecast/socket_client.py | 10 +- 10 files changed, 499 insertions(+), 310 deletions(-) delete mode 100644 pychromecast/authority_keys_pb2.py delete mode 100644 pychromecast/cast_channel_pb2.py create mode 100644 pychromecast/generated/authority_keys_pb2.py create mode 100644 pychromecast/generated/authority_keys_pb2.pyi create mode 100644 pychromecast/generated/cast_channel_pb2.py create mode 100644 pychromecast/generated/cast_channel_pb2.pyi rename pychromecast/{ => generated}/logging_pb2.py (52%) create mode 100644 pychromecast/generated/logging_pb2.pyi create mode 100644 pychromecast/generated/readme.txt diff --git a/pychromecast/authority_keys_pb2.py b/pychromecast/authority_keys_pb2.py deleted file mode 100644 index da2b204db..000000000 --- a/pychromecast/authority_keys_pb2.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: authority_keys.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x61uthority_keys.proto\x12!extensions.api.cast_channel.proto\"\x83\x01\n\rAuthorityKeys\x12\x42\n\x04keys\x18\x01 \x03(\x0b\x32\x34.extensions.api.cast_channel.proto.AuthorityKeys.Key\x1a.\n\x03Key\x12\x13\n\x0b\x66ingerprint\x18\x01 \x02(\x0c\x12\x12\n\npublic_key\x18\x02 \x02(\x0c\x42\x02H\x03') - - - -_AUTHORITYKEYS = DESCRIPTOR.message_types_by_name['AuthorityKeys'] -_AUTHORITYKEYS_KEY = _AUTHORITYKEYS.nested_types_by_name['Key'] -AuthorityKeys = _reflection.GeneratedProtocolMessageType('AuthorityKeys', (_message.Message,), { - - 'Key' : _reflection.GeneratedProtocolMessageType('Key', (_message.Message,), { - 'DESCRIPTOR' : _AUTHORITYKEYS_KEY, - '__module__' : 'authority_keys_pb2' - # @@protoc_insertion_point(class_scope:extensions.api.cast_channel.proto.AuthorityKeys.Key) - }) - , - 'DESCRIPTOR' : _AUTHORITYKEYS, - '__module__' : 'authority_keys_pb2' - # @@protoc_insertion_point(class_scope:extensions.api.cast_channel.proto.AuthorityKeys) - }) -_sym_db.RegisterMessage(AuthorityKeys) -_sym_db.RegisterMessage(AuthorityKeys.Key) - -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'H\003' - _AUTHORITYKEYS._serialized_start=60 - _AUTHORITYKEYS._serialized_end=191 - _AUTHORITYKEYS_KEY._serialized_start=145 - _AUTHORITYKEYS_KEY._serialized_end=191 -# @@protoc_insertion_point(module_scope) diff --git a/pychromecast/cast_channel_pb2.py b/pychromecast/cast_channel_pb2.py deleted file mode 100644 index ba94ddec0..000000000 --- a/pychromecast/cast_channel_pb2.py +++ /dev/null @@ -1,98 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: cast_channel.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12\x63\x61st_channel.proto\x12\x1b\x65xtensions.api.cast_channel\"\xe3\x02\n\x0b\x43\x61stMessage\x12R\n\x10protocol_version\x18\x01 \x02(\x0e\x32\x38.extensions.api.cast_channel.CastMessage.ProtocolVersion\x12\x11\n\tsource_id\x18\x02 \x02(\t\x12\x16\n\x0e\x64\x65stination_id\x18\x03 \x02(\t\x12\x11\n\tnamespace\x18\x04 \x02(\t\x12J\n\x0cpayload_type\x18\x05 \x02(\x0e\x32\x34.extensions.api.cast_channel.CastMessage.PayloadType\x12\x14\n\x0cpayload_utf8\x18\x06 \x01(\t\x12\x16\n\x0epayload_binary\x18\x07 \x01(\x0c\"!\n\x0fProtocolVersion\x12\x0e\n\nCASTV2_1_0\x10\x00\"%\n\x0bPayloadType\x12\n\n\x06STRING\x10\x00\x12\n\n\x06\x42INARY\x10\x01\"\xce\x01\n\rAuthChallenge\x12]\n\x13signature_algorithm\x18\x01 \x01(\x0e\x32/.extensions.api.cast_channel.SignatureAlgorithm:\x0fRSASSA_PKCS1v15\x12\x14\n\x0csender_nonce\x18\x02 \x01(\x0c\x12H\n\x0ehash_algorithm\x18\x03 \x01(\x0e\x32*.extensions.api.cast_channel.HashAlgorithm:\x04SHA1\"\xb0\x02\n\x0c\x41uthResponse\x12\x11\n\tsignature\x18\x01 \x02(\x0c\x12\x1f\n\x17\x63lient_auth_certificate\x18\x02 \x02(\x0c\x12 \n\x18intermediate_certificate\x18\x03 \x03(\x0c\x12]\n\x13signature_algorithm\x18\x04 \x01(\x0e\x32/.extensions.api.cast_channel.SignatureAlgorithm:\x0fRSASSA_PKCS1v15\x12\x14\n\x0csender_nonce\x18\x05 \x01(\x0c\x12H\n\x0ehash_algorithm\x18\x06 \x01(\x0e\x32*.extensions.api.cast_channel.HashAlgorithm:\x04SHA1\x12\x0b\n\x03\x63rl\x18\x07 \x01(\x0c\"\xa3\x01\n\tAuthError\x12\x44\n\nerror_type\x18\x01 \x02(\x0e\x32\x30.extensions.api.cast_channel.AuthError.ErrorType\"P\n\tErrorType\x12\x12\n\x0eINTERNAL_ERROR\x10\x00\x12\n\n\x06NO_TLS\x10\x01\x12#\n\x1fSIGNATURE_ALGORITHM_UNAVAILABLE\x10\x02\"\xc6\x01\n\x11\x44\x65viceAuthMessage\x12=\n\tchallenge\x18\x01 \x01(\x0b\x32*.extensions.api.cast_channel.AuthChallenge\x12;\n\x08response\x18\x02 \x01(\x0b\x32).extensions.api.cast_channel.AuthResponse\x12\x35\n\x05\x65rror\x18\x03 \x01(\x0b\x32&.extensions.api.cast_channel.AuthError*J\n\x12SignatureAlgorithm\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x13\n\x0fRSASSA_PKCS1v15\x10\x01\x12\x0e\n\nRSASSA_PSS\x10\x02*%\n\rHashAlgorithm\x12\x08\n\x04SHA1\x10\x00\x12\n\n\x06SHA256\x10\x01\x42\x02H\x03') - -_SIGNATUREALGORITHM = DESCRIPTOR.enum_types_by_name['SignatureAlgorithm'] -SignatureAlgorithm = enum_type_wrapper.EnumTypeWrapper(_SIGNATUREALGORITHM) -_HASHALGORITHM = DESCRIPTOR.enum_types_by_name['HashAlgorithm'] -HashAlgorithm = enum_type_wrapper.EnumTypeWrapper(_HASHALGORITHM) -UNSPECIFIED = 0 -RSASSA_PKCS1v15 = 1 -RSASSA_PSS = 2 -SHA1 = 0 -SHA256 = 1 - - -_CASTMESSAGE = DESCRIPTOR.message_types_by_name['CastMessage'] -_AUTHCHALLENGE = DESCRIPTOR.message_types_by_name['AuthChallenge'] -_AUTHRESPONSE = DESCRIPTOR.message_types_by_name['AuthResponse'] -_AUTHERROR = DESCRIPTOR.message_types_by_name['AuthError'] -_DEVICEAUTHMESSAGE = DESCRIPTOR.message_types_by_name['DeviceAuthMessage'] -_CASTMESSAGE_PROTOCOLVERSION = _CASTMESSAGE.enum_types_by_name['ProtocolVersion'] -_CASTMESSAGE_PAYLOADTYPE = _CASTMESSAGE.enum_types_by_name['PayloadType'] -_AUTHERROR_ERRORTYPE = _AUTHERROR.enum_types_by_name['ErrorType'] -CastMessage = _reflection.GeneratedProtocolMessageType('CastMessage', (_message.Message,), { - 'DESCRIPTOR' : _CASTMESSAGE, - '__module__' : 'cast_channel_pb2' - # @@protoc_insertion_point(class_scope:extensions.api.cast_channel.CastMessage) - }) -_sym_db.RegisterMessage(CastMessage) - -AuthChallenge = _reflection.GeneratedProtocolMessageType('AuthChallenge', (_message.Message,), { - 'DESCRIPTOR' : _AUTHCHALLENGE, - '__module__' : 'cast_channel_pb2' - # @@protoc_insertion_point(class_scope:extensions.api.cast_channel.AuthChallenge) - }) -_sym_db.RegisterMessage(AuthChallenge) - -AuthResponse = _reflection.GeneratedProtocolMessageType('AuthResponse', (_message.Message,), { - 'DESCRIPTOR' : _AUTHRESPONSE, - '__module__' : 'cast_channel_pb2' - # @@protoc_insertion_point(class_scope:extensions.api.cast_channel.AuthResponse) - }) -_sym_db.RegisterMessage(AuthResponse) - -AuthError = _reflection.GeneratedProtocolMessageType('AuthError', (_message.Message,), { - 'DESCRIPTOR' : _AUTHERROR, - '__module__' : 'cast_channel_pb2' - # @@protoc_insertion_point(class_scope:extensions.api.cast_channel.AuthError) - }) -_sym_db.RegisterMessage(AuthError) - -DeviceAuthMessage = _reflection.GeneratedProtocolMessageType('DeviceAuthMessage', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEAUTHMESSAGE, - '__module__' : 'cast_channel_pb2' - # @@protoc_insertion_point(class_scope:extensions.api.cast_channel.DeviceAuthMessage) - }) -_sym_db.RegisterMessage(DeviceAuthMessage) - -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'H\003' - _SIGNATUREALGORITHM._serialized_start=1292 - _SIGNATUREALGORITHM._serialized_end=1366 - _HASHALGORITHM._serialized_start=1368 - _HASHALGORITHM._serialized_end=1405 - _CASTMESSAGE._serialized_start=52 - _CASTMESSAGE._serialized_end=407 - _CASTMESSAGE_PROTOCOLVERSION._serialized_start=335 - _CASTMESSAGE_PROTOCOLVERSION._serialized_end=368 - _CASTMESSAGE_PAYLOADTYPE._serialized_start=370 - _CASTMESSAGE_PAYLOADTYPE._serialized_end=407 - _AUTHCHALLENGE._serialized_start=410 - _AUTHCHALLENGE._serialized_end=616 - _AUTHRESPONSE._serialized_start=619 - _AUTHRESPONSE._serialized_end=923 - _AUTHERROR._serialized_start=926 - _AUTHERROR._serialized_end=1089 - _AUTHERROR_ERRORTYPE._serialized_start=1009 - _AUTHERROR_ERRORTYPE._serialized_end=1089 - _DEVICEAUTHMESSAGE._serialized_start=1092 - _DEVICEAUTHMESSAGE._serialized_end=1290 -# @@protoc_insertion_point(module_scope) diff --git a/pychromecast/generated/authority_keys_pb2.py b/pychromecast/generated/authority_keys_pb2.py new file mode 100644 index 000000000..a1997299e --- /dev/null +++ b/pychromecast/generated/authority_keys_pb2.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: authority_keys.proto +# Protobuf Python Version: 4.25.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x61uthority_keys.proto\x12!extensions.api.cast_channel.proto\"\x83\x01\n\rAuthorityKeys\x12\x42\n\x04keys\x18\x01 \x03(\x0b\x32\x34.extensions.api.cast_channel.proto.AuthorityKeys.Key\x1a.\n\x03Key\x12\x13\n\x0b\x66ingerprint\x18\x01 \x02(\x0c\x12\x12\n\npublic_key\x18\x02 \x02(\x0c\x42\x02H\x03') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'authority_keys_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'H\003' + _globals['_AUTHORITYKEYS']._serialized_start=60 + _globals['_AUTHORITYKEYS']._serialized_end=191 + _globals['_AUTHORITYKEYS_KEY']._serialized_start=145 + _globals['_AUTHORITYKEYS_KEY']._serialized_end=191 +# @@protoc_insertion_point(module_scope) diff --git a/pychromecast/generated/authority_keys_pb2.pyi b/pychromecast/generated/authority_keys_pb2.pyi new file mode 100644 index 000000000..c8e20493b --- /dev/null +++ b/pychromecast/generated/authority_keys_pb2.pyi @@ -0,0 +1,19 @@ +from google.protobuf.internal import containers as _containers +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class AuthorityKeys(_message.Message): + __slots__ = ("keys",) + class Key(_message.Message): + __slots__ = ("fingerprint", "public_key") + FINGERPRINT_FIELD_NUMBER: _ClassVar[int] + PUBLIC_KEY_FIELD_NUMBER: _ClassVar[int] + fingerprint: bytes + public_key: bytes + def __init__(self, fingerprint: _Optional[bytes] = ..., public_key: _Optional[bytes] = ...) -> None: ... + KEYS_FIELD_NUMBER: _ClassVar[int] + keys: _containers.RepeatedCompositeFieldContainer[AuthorityKeys.Key] + def __init__(self, keys: _Optional[_Iterable[_Union[AuthorityKeys.Key, _Mapping]]] = ...) -> None: ... diff --git a/pychromecast/generated/cast_channel_pb2.py b/pychromecast/generated/cast_channel_pb2.py new file mode 100644 index 000000000..60de82c64 --- /dev/null +++ b/pychromecast/generated/cast_channel_pb2.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: cast_channel.proto +# Protobuf Python Version: 4.25.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12\x63\x61st_channel.proto\x12\x1b\x65xtensions.api.cast_channel\"\xe3\x02\n\x0b\x43\x61stMessage\x12R\n\x10protocol_version\x18\x01 \x02(\x0e\x32\x38.extensions.api.cast_channel.CastMessage.ProtocolVersion\x12\x11\n\tsource_id\x18\x02 \x02(\t\x12\x16\n\x0e\x64\x65stination_id\x18\x03 \x02(\t\x12\x11\n\tnamespace\x18\x04 \x02(\t\x12J\n\x0cpayload_type\x18\x05 \x02(\x0e\x32\x34.extensions.api.cast_channel.CastMessage.PayloadType\x12\x14\n\x0cpayload_utf8\x18\x06 \x01(\t\x12\x16\n\x0epayload_binary\x18\x07 \x01(\x0c\"!\n\x0fProtocolVersion\x12\x0e\n\nCASTV2_1_0\x10\x00\"%\n\x0bPayloadType\x12\n\n\x06STRING\x10\x00\x12\n\n\x06\x42INARY\x10\x01\"\xce\x01\n\rAuthChallenge\x12]\n\x13signature_algorithm\x18\x01 \x01(\x0e\x32/.extensions.api.cast_channel.SignatureAlgorithm:\x0fRSASSA_PKCS1v15\x12\x14\n\x0csender_nonce\x18\x02 \x01(\x0c\x12H\n\x0ehash_algorithm\x18\x03 \x01(\x0e\x32*.extensions.api.cast_channel.HashAlgorithm:\x04SHA1\"\xb0\x02\n\x0c\x41uthResponse\x12\x11\n\tsignature\x18\x01 \x02(\x0c\x12\x1f\n\x17\x63lient_auth_certificate\x18\x02 \x02(\x0c\x12 \n\x18intermediate_certificate\x18\x03 \x03(\x0c\x12]\n\x13signature_algorithm\x18\x04 \x01(\x0e\x32/.extensions.api.cast_channel.SignatureAlgorithm:\x0fRSASSA_PKCS1v15\x12\x14\n\x0csender_nonce\x18\x05 \x01(\x0c\x12H\n\x0ehash_algorithm\x18\x06 \x01(\x0e\x32*.extensions.api.cast_channel.HashAlgorithm:\x04SHA1\x12\x0b\n\x03\x63rl\x18\x07 \x01(\x0c\"\xa3\x01\n\tAuthError\x12\x44\n\nerror_type\x18\x01 \x02(\x0e\x32\x30.extensions.api.cast_channel.AuthError.ErrorType\"P\n\tErrorType\x12\x12\n\x0eINTERNAL_ERROR\x10\x00\x12\n\n\x06NO_TLS\x10\x01\x12#\n\x1fSIGNATURE_ALGORITHM_UNAVAILABLE\x10\x02\"\xc6\x01\n\x11\x44\x65viceAuthMessage\x12=\n\tchallenge\x18\x01 \x01(\x0b\x32*.extensions.api.cast_channel.AuthChallenge\x12;\n\x08response\x18\x02 \x01(\x0b\x32).extensions.api.cast_channel.AuthResponse\x12\x35\n\x05\x65rror\x18\x03 \x01(\x0b\x32&.extensions.api.cast_channel.AuthError*J\n\x12SignatureAlgorithm\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x13\n\x0fRSASSA_PKCS1v15\x10\x01\x12\x0e\n\nRSASSA_PSS\x10\x02*%\n\rHashAlgorithm\x12\x08\n\x04SHA1\x10\x00\x12\n\n\x06SHA256\x10\x01\x42\x02H\x03') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'cast_channel_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'H\003' + _globals['_SIGNATUREALGORITHM']._serialized_start=1292 + _globals['_SIGNATUREALGORITHM']._serialized_end=1366 + _globals['_HASHALGORITHM']._serialized_start=1368 + _globals['_HASHALGORITHM']._serialized_end=1405 + _globals['_CASTMESSAGE']._serialized_start=52 + _globals['_CASTMESSAGE']._serialized_end=407 + _globals['_CASTMESSAGE_PROTOCOLVERSION']._serialized_start=335 + _globals['_CASTMESSAGE_PROTOCOLVERSION']._serialized_end=368 + _globals['_CASTMESSAGE_PAYLOADTYPE']._serialized_start=370 + _globals['_CASTMESSAGE_PAYLOADTYPE']._serialized_end=407 + _globals['_AUTHCHALLENGE']._serialized_start=410 + _globals['_AUTHCHALLENGE']._serialized_end=616 + _globals['_AUTHRESPONSE']._serialized_start=619 + _globals['_AUTHRESPONSE']._serialized_end=923 + _globals['_AUTHERROR']._serialized_start=926 + _globals['_AUTHERROR']._serialized_end=1089 + _globals['_AUTHERROR_ERRORTYPE']._serialized_start=1009 + _globals['_AUTHERROR_ERRORTYPE']._serialized_end=1089 + _globals['_DEVICEAUTHMESSAGE']._serialized_start=1092 + _globals['_DEVICEAUTHMESSAGE']._serialized_end=1290 +# @@protoc_insertion_point(module_scope) diff --git a/pychromecast/generated/cast_channel_pb2.pyi b/pychromecast/generated/cast_channel_pb2.pyi new file mode 100644 index 000000000..e8d1af5dc --- /dev/null +++ b/pychromecast/generated/cast_channel_pb2.pyi @@ -0,0 +1,103 @@ +from google.protobuf.internal import containers as _containers +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class SignatureAlgorithm(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + UNSPECIFIED: _ClassVar[SignatureAlgorithm] + RSASSA_PKCS1v15: _ClassVar[SignatureAlgorithm] + RSASSA_PSS: _ClassVar[SignatureAlgorithm] + +class HashAlgorithm(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + SHA1: _ClassVar[HashAlgorithm] + SHA256: _ClassVar[HashAlgorithm] +UNSPECIFIED: SignatureAlgorithm +RSASSA_PKCS1v15: SignatureAlgorithm +RSASSA_PSS: SignatureAlgorithm +SHA1: HashAlgorithm +SHA256: HashAlgorithm + +class CastMessage(_message.Message): + __slots__ = ("protocol_version", "source_id", "destination_id", "namespace", "payload_type", "payload_utf8", "payload_binary") + class ProtocolVersion(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + CASTV2_1_0: _ClassVar[CastMessage.ProtocolVersion] + CASTV2_1_0: CastMessage.ProtocolVersion + class PayloadType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + STRING: _ClassVar[CastMessage.PayloadType] + BINARY: _ClassVar[CastMessage.PayloadType] + STRING: CastMessage.PayloadType + BINARY: CastMessage.PayloadType + PROTOCOL_VERSION_FIELD_NUMBER: _ClassVar[int] + SOURCE_ID_FIELD_NUMBER: _ClassVar[int] + DESTINATION_ID_FIELD_NUMBER: _ClassVar[int] + NAMESPACE_FIELD_NUMBER: _ClassVar[int] + PAYLOAD_TYPE_FIELD_NUMBER: _ClassVar[int] + PAYLOAD_UTF8_FIELD_NUMBER: _ClassVar[int] + PAYLOAD_BINARY_FIELD_NUMBER: _ClassVar[int] + protocol_version: CastMessage.ProtocolVersion + source_id: str + destination_id: str + namespace: str + payload_type: CastMessage.PayloadType + payload_utf8: str + payload_binary: bytes + def __init__(self, protocol_version: _Optional[_Union[CastMessage.ProtocolVersion, str]] = ..., source_id: _Optional[str] = ..., destination_id: _Optional[str] = ..., namespace: _Optional[str] = ..., payload_type: _Optional[_Union[CastMessage.PayloadType, str]] = ..., payload_utf8: _Optional[str] = ..., payload_binary: _Optional[bytes] = ...) -> None: ... + +class AuthChallenge(_message.Message): + __slots__ = ("signature_algorithm", "sender_nonce", "hash_algorithm") + SIGNATURE_ALGORITHM_FIELD_NUMBER: _ClassVar[int] + SENDER_NONCE_FIELD_NUMBER: _ClassVar[int] + HASH_ALGORITHM_FIELD_NUMBER: _ClassVar[int] + signature_algorithm: SignatureAlgorithm + sender_nonce: bytes + hash_algorithm: HashAlgorithm + def __init__(self, signature_algorithm: _Optional[_Union[SignatureAlgorithm, str]] = ..., sender_nonce: _Optional[bytes] = ..., hash_algorithm: _Optional[_Union[HashAlgorithm, str]] = ...) -> None: ... + +class AuthResponse(_message.Message): + __slots__ = ("signature", "client_auth_certificate", "intermediate_certificate", "signature_algorithm", "sender_nonce", "hash_algorithm", "crl") + SIGNATURE_FIELD_NUMBER: _ClassVar[int] + CLIENT_AUTH_CERTIFICATE_FIELD_NUMBER: _ClassVar[int] + INTERMEDIATE_CERTIFICATE_FIELD_NUMBER: _ClassVar[int] + SIGNATURE_ALGORITHM_FIELD_NUMBER: _ClassVar[int] + SENDER_NONCE_FIELD_NUMBER: _ClassVar[int] + HASH_ALGORITHM_FIELD_NUMBER: _ClassVar[int] + CRL_FIELD_NUMBER: _ClassVar[int] + signature: bytes + client_auth_certificate: bytes + intermediate_certificate: _containers.RepeatedScalarFieldContainer[bytes] + signature_algorithm: SignatureAlgorithm + sender_nonce: bytes + hash_algorithm: HashAlgorithm + crl: bytes + def __init__(self, signature: _Optional[bytes] = ..., client_auth_certificate: _Optional[bytes] = ..., intermediate_certificate: _Optional[_Iterable[bytes]] = ..., signature_algorithm: _Optional[_Union[SignatureAlgorithm, str]] = ..., sender_nonce: _Optional[bytes] = ..., hash_algorithm: _Optional[_Union[HashAlgorithm, str]] = ..., crl: _Optional[bytes] = ...) -> None: ... + +class AuthError(_message.Message): + __slots__ = ("error_type",) + class ErrorType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + INTERNAL_ERROR: _ClassVar[AuthError.ErrorType] + NO_TLS: _ClassVar[AuthError.ErrorType] + SIGNATURE_ALGORITHM_UNAVAILABLE: _ClassVar[AuthError.ErrorType] + INTERNAL_ERROR: AuthError.ErrorType + NO_TLS: AuthError.ErrorType + SIGNATURE_ALGORITHM_UNAVAILABLE: AuthError.ErrorType + ERROR_TYPE_FIELD_NUMBER: _ClassVar[int] + error_type: AuthError.ErrorType + def __init__(self, error_type: _Optional[_Union[AuthError.ErrorType, str]] = ...) -> None: ... + +class DeviceAuthMessage(_message.Message): + __slots__ = ("challenge", "response", "error") + CHALLENGE_FIELD_NUMBER: _ClassVar[int] + RESPONSE_FIELD_NUMBER: _ClassVar[int] + ERROR_FIELD_NUMBER: _ClassVar[int] + challenge: AuthChallenge + response: AuthResponse + error: AuthError + def __init__(self, challenge: _Optional[_Union[AuthChallenge, _Mapping]] = ..., response: _Optional[_Union[AuthResponse, _Mapping]] = ..., error: _Optional[_Union[AuthError, _Mapping]] = ...) -> None: ... diff --git a/pychromecast/logging_pb2.py b/pychromecast/generated/logging_pb2.py similarity index 52% rename from pychromecast/logging_pb2.py rename to pychromecast/generated/logging_pb2.py index eef8ed259..6fa98cfba 100644 --- a/pychromecast/logging_pb2.py +++ b/pychromecast/generated/logging_pb2.py @@ -1,13 +1,12 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: logging.proto +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -17,163 +16,32 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rlogging.proto\x12!extensions.api.cast_channel.proto\"\xfd\x04\n\x0bSocketEvent\x12:\n\x04type\x18\x01 \x01(\x0e\x32,.extensions.api.cast_channel.proto.EventType\x12\x18\n\x10timestamp_micros\x18\x02 \x01(\x03\x12\x0f\n\x07\x64\x65tails\x18\x03 \x01(\t\x12\x18\n\x10net_return_value\x18\x04 \x01(\x05\x12\x19\n\x11message_namespace\x18\x05 \x01(\t\x12\x42\n\x0bready_state\x18\x06 \x01(\x0e\x32-.extensions.api.cast_channel.proto.ReadyState\x12L\n\x10\x63onnection_state\x18\x07 \x01(\x0e\x32\x32.extensions.api.cast_channel.proto.ConnectionState\x12@\n\nread_state\x18\x08 \x01(\x0e\x32,.extensions.api.cast_channel.proto.ReadState\x12\x42\n\x0bwrite_state\x18\t \x01(\x0e\x32-.extensions.api.cast_channel.proto.WriteState\x12\x42\n\x0b\x65rror_state\x18\n \x01(\x0e\x32-.extensions.api.cast_channel.proto.ErrorState\x12^\n\x1a\x63hallenge_reply_error_type\x18\x0b \x01(\x0e\x32:.extensions.api.cast_channel.proto.ChallengeReplyErrorType\x12\x16\n\x0enss_error_code\x18\x0c \x01(\x05\"\xf4\x01\n\x15\x41ggregatedSocketEvent\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x13\n\x0b\x65ndpoint_id\x18\x02 \x01(\x05\x12I\n\x11\x63hannel_auth_type\x18\x03 \x01(\x0e\x32..extensions.api.cast_channel.proto.ChannelAuth\x12\x44\n\x0csocket_event\x18\x04 \x03(\x0b\x32..extensions.api.cast_channel.proto.SocketEvent\x12\x12\n\nbytes_read\x18\x05 \x01(\x03\x12\x15\n\rbytes_written\x18\x06 \x01(\x03\"\xb1\x01\n\x03Log\x12Y\n\x17\x61ggregated_socket_event\x18\x01 \x03(\x0b\x32\x38.extensions.api.cast_channel.proto.AggregatedSocketEvent\x12,\n$num_evicted_aggregated_socket_events\x18\x02 \x01(\x05\x12!\n\x19num_evicted_socket_events\x18\x03 \x01(\x05*\xc0\x06\n\tEventType\x12\x16\n\x12\x45VENT_TYPE_UNKNOWN\x10\x00\x12\x17\n\x13\x43\x41ST_SOCKET_CREATED\x10\x01\x12\x17\n\x13READY_STATE_CHANGED\x10\x02\x12\x1c\n\x18\x43ONNECTION_STATE_CHANGED\x10\x03\x12\x16\n\x12READ_STATE_CHANGED\x10\x04\x12\x17\n\x13WRITE_STATE_CHANGED\x10\x05\x12\x17\n\x13\x45RROR_STATE_CHANGED\x10\x06\x12\x12\n\x0e\x43ONNECT_FAILED\x10\x07\x12\x16\n\x12TCP_SOCKET_CONNECT\x10\x08\x12\x1d\n\x19TCP_SOCKET_SET_KEEP_ALIVE\x10\t\x12\x18\n\x14SSL_CERT_WHITELISTED\x10\n\x12\x16\n\x12SSL_SOCKET_CONNECT\x10\x0b\x12\x15\n\x11SSL_INFO_OBTAINED\x10\x0c\x12\x1b\n\x17\x44\x45R_ENCODED_CERT_OBTAIN\x10\r\x12\x1c\n\x18RECEIVED_CHALLENGE_REPLY\x10\x0e\x12\x18\n\x14\x41UTH_CHALLENGE_REPLY\x10\x0f\x12\x15\n\x11\x43ONNECT_TIMED_OUT\x10\x10\x12\x17\n\x13SEND_MESSAGE_FAILED\x10\x11\x12\x14\n\x10MESSAGE_ENQUEUED\x10\x12\x12\x10\n\x0cSOCKET_WRITE\x10\x13\x12\x13\n\x0fMESSAGE_WRITTEN\x10\x14\x12\x0f\n\x0bSOCKET_READ\x10\x15\x12\x10\n\x0cMESSAGE_READ\x10\x16\x12\x11\n\rSOCKET_CLOSED\x10\x19\x12\x1f\n\x1bSSL_CERT_EXCESSIVE_LIFETIME\x10\x1a\x12\x1b\n\x17\x43HANNEL_POLICY_ENFORCED\x10\x1b\x12\x1f\n\x1bTCP_SOCKET_CONNECT_COMPLETE\x10\x1c\x12\x1f\n\x1bSSL_SOCKET_CONNECT_COMPLETE\x10\x1d\x12\x1d\n\x19SSL_SOCKET_CONNECT_FAILED\x10\x1e\x12\x1e\n\x1aSEND_AUTH_CHALLENGE_FAILED\x10\x1f\x12 \n\x1c\x41UTH_CHALLENGE_REPLY_INVALID\x10 \x12\x14\n\x10PING_WRITE_ERROR\x10!*(\n\x0b\x43hannelAuth\x12\x07\n\x03SSL\x10\x01\x12\x10\n\x0cSSL_VERIFIED\x10\x02*\x85\x01\n\nReadyState\x12\x14\n\x10READY_STATE_NONE\x10\x01\x12\x1a\n\x16READY_STATE_CONNECTING\x10\x02\x12\x14\n\x10READY_STATE_OPEN\x10\x03\x12\x17\n\x13READY_STATE_CLOSING\x10\x04\x12\x16\n\x12READY_STATE_CLOSED\x10\x05*\x8f\x03\n\x0f\x43onnectionState\x12\x16\n\x12\x43ONN_STATE_UNKNOWN\x10\x01\x12\x1a\n\x16\x43ONN_STATE_TCP_CONNECT\x10\x02\x12#\n\x1f\x43ONN_STATE_TCP_CONNECT_COMPLETE\x10\x03\x12\x1a\n\x16\x43ONN_STATE_SSL_CONNECT\x10\x04\x12#\n\x1f\x43ONN_STATE_SSL_CONNECT_COMPLETE\x10\x05\x12\"\n\x1e\x43ONN_STATE_AUTH_CHALLENGE_SEND\x10\x06\x12+\n\'CONN_STATE_AUTH_CHALLENGE_SEND_COMPLETE\x10\x07\x12,\n(CONN_STATE_AUTH_CHALLENGE_REPLY_COMPLETE\x10\x08\x12\x1c\n\x18\x43ONN_STATE_START_CONNECT\x10\t\x12\x17\n\x13\x43ONN_STATE_FINISHED\x10\x64\x12\x14\n\x10\x43ONN_STATE_ERROR\x10\x65\x12\x16\n\x12\x43ONN_STATE_TIMEOUT\x10\x66*\xa5\x01\n\tReadState\x12\x16\n\x12READ_STATE_UNKNOWN\x10\x01\x12\x13\n\x0fREAD_STATE_READ\x10\x02\x12\x1c\n\x18READ_STATE_READ_COMPLETE\x10\x03\x12\x1a\n\x16READ_STATE_DO_CALLBACK\x10\x04\x12\x1b\n\x17READ_STATE_HANDLE_ERROR\x10\x05\x12\x14\n\x10READ_STATE_ERROR\x10\x64*\xc4\x01\n\nWriteState\x12\x17\n\x13WRITE_STATE_UNKNOWN\x10\x01\x12\x15\n\x11WRITE_STATE_WRITE\x10\x02\x12\x1e\n\x1aWRITE_STATE_WRITE_COMPLETE\x10\x03\x12\x1b\n\x17WRITE_STATE_DO_CALLBACK\x10\x04\x12\x1c\n\x18WRITE_STATE_HANDLE_ERROR\x10\x05\x12\x15\n\x11WRITE_STATE_ERROR\x10\x64\x12\x14\n\x10WRITE_STATE_IDLE\x10\x65*\xdb\x02\n\nErrorState\x12\x16\n\x12\x43HANNEL_ERROR_NONE\x10\x01\x12\"\n\x1e\x43HANNEL_ERROR_CHANNEL_NOT_OPEN\x10\x02\x12&\n\"CHANNEL_ERROR_AUTHENTICATION_ERROR\x10\x03\x12\x1f\n\x1b\x43HANNEL_ERROR_CONNECT_ERROR\x10\x04\x12\x1e\n\x1a\x43HANNEL_ERROR_SOCKET_ERROR\x10\x05\x12!\n\x1d\x43HANNEL_ERROR_TRANSPORT_ERROR\x10\x06\x12!\n\x1d\x43HANNEL_ERROR_INVALID_MESSAGE\x10\x07\x12$\n CHANNEL_ERROR_INVALID_CHANNEL_ID\x10\x08\x12!\n\x1d\x43HANNEL_ERROR_CONNECT_TIMEOUT\x10\t\x12\x19\n\x15\x43HANNEL_ERROR_UNKNOWN\x10\n*\xb0\x06\n\x17\x43hallengeReplyErrorType\x12\x1e\n\x1a\x43HALLENGE_REPLY_ERROR_NONE\x10\x01\x12)\n%CHALLENGE_REPLY_ERROR_PEER_CERT_EMPTY\x10\x02\x12,\n(CHALLENGE_REPLY_ERROR_WRONG_PAYLOAD_TYPE\x10\x03\x12$\n CHALLENGE_REPLY_ERROR_NO_PAYLOAD\x10\x04\x12\x30\n,CHALLENGE_REPLY_ERROR_PAYLOAD_PARSING_FAILED\x10\x05\x12\'\n#CHALLENGE_REPLY_ERROR_MESSAGE_ERROR\x10\x06\x12%\n!CHALLENGE_REPLY_ERROR_NO_RESPONSE\x10\x07\x12/\n+CHALLENGE_REPLY_ERROR_FINGERPRINT_NOT_FOUND\x10\x08\x12-\n)CHALLENGE_REPLY_ERROR_CERT_PARSING_FAILED\x10\t\x12\x37\n3CHALLENGE_REPLY_ERROR_CERT_NOT_SIGNED_BY_TRUSTED_CA\x10\n\x12\x33\n/CHALLENGE_REPLY_ERROR_CANNOT_EXTRACT_PUBLIC_KEY\x10\x0b\x12/\n+CHALLENGE_REPLY_ERROR_SIGNED_BLOBS_MISMATCH\x10\x0c\x12;\n7CHALLENGE_REPLY_ERROR_TLS_CERT_VALIDITY_PERIOD_TOO_LONG\x10\r\x12=\n9CHALLENGE_REPLY_ERROR_TLS_CERT_VALID_START_DATE_IN_FUTURE\x10\x0e\x12*\n&CHALLENGE_REPLY_ERROR_TLS_CERT_EXPIRED\x10\x0f\x12%\n!CHALLENGE_REPLY_ERROR_CRL_INVALID\x10\x10\x12&\n\"CHALLENGE_REPLY_ERROR_CERT_REVOKED\x10\x11\x42\x02H\x03') -_EVENTTYPE = DESCRIPTOR.enum_types_by_name['EventType'] -EventType = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPE) -_CHANNELAUTH = DESCRIPTOR.enum_types_by_name['ChannelAuth'] -ChannelAuth = enum_type_wrapper.EnumTypeWrapper(_CHANNELAUTH) -_READYSTATE = DESCRIPTOR.enum_types_by_name['ReadyState'] -ReadyState = enum_type_wrapper.EnumTypeWrapper(_READYSTATE) -_CONNECTIONSTATE = DESCRIPTOR.enum_types_by_name['ConnectionState'] -ConnectionState = enum_type_wrapper.EnumTypeWrapper(_CONNECTIONSTATE) -_READSTATE = DESCRIPTOR.enum_types_by_name['ReadState'] -ReadState = enum_type_wrapper.EnumTypeWrapper(_READSTATE) -_WRITESTATE = DESCRIPTOR.enum_types_by_name['WriteState'] -WriteState = enum_type_wrapper.EnumTypeWrapper(_WRITESTATE) -_ERRORSTATE = DESCRIPTOR.enum_types_by_name['ErrorState'] -ErrorState = enum_type_wrapper.EnumTypeWrapper(_ERRORSTATE) -_CHALLENGEREPLYERRORTYPE = DESCRIPTOR.enum_types_by_name['ChallengeReplyErrorType'] -ChallengeReplyErrorType = enum_type_wrapper.EnumTypeWrapper(_CHALLENGEREPLYERRORTYPE) -EVENT_TYPE_UNKNOWN = 0 -CAST_SOCKET_CREATED = 1 -READY_STATE_CHANGED = 2 -CONNECTION_STATE_CHANGED = 3 -READ_STATE_CHANGED = 4 -WRITE_STATE_CHANGED = 5 -ERROR_STATE_CHANGED = 6 -CONNECT_FAILED = 7 -TCP_SOCKET_CONNECT = 8 -TCP_SOCKET_SET_KEEP_ALIVE = 9 -SSL_CERT_WHITELISTED = 10 -SSL_SOCKET_CONNECT = 11 -SSL_INFO_OBTAINED = 12 -DER_ENCODED_CERT_OBTAIN = 13 -RECEIVED_CHALLENGE_REPLY = 14 -AUTH_CHALLENGE_REPLY = 15 -CONNECT_TIMED_OUT = 16 -SEND_MESSAGE_FAILED = 17 -MESSAGE_ENQUEUED = 18 -SOCKET_WRITE = 19 -MESSAGE_WRITTEN = 20 -SOCKET_READ = 21 -MESSAGE_READ = 22 -SOCKET_CLOSED = 25 -SSL_CERT_EXCESSIVE_LIFETIME = 26 -CHANNEL_POLICY_ENFORCED = 27 -TCP_SOCKET_CONNECT_COMPLETE = 28 -SSL_SOCKET_CONNECT_COMPLETE = 29 -SSL_SOCKET_CONNECT_FAILED = 30 -SEND_AUTH_CHALLENGE_FAILED = 31 -AUTH_CHALLENGE_REPLY_INVALID = 32 -PING_WRITE_ERROR = 33 -SSL = 1 -SSL_VERIFIED = 2 -READY_STATE_NONE = 1 -READY_STATE_CONNECTING = 2 -READY_STATE_OPEN = 3 -READY_STATE_CLOSING = 4 -READY_STATE_CLOSED = 5 -CONN_STATE_UNKNOWN = 1 -CONN_STATE_TCP_CONNECT = 2 -CONN_STATE_TCP_CONNECT_COMPLETE = 3 -CONN_STATE_SSL_CONNECT = 4 -CONN_STATE_SSL_CONNECT_COMPLETE = 5 -CONN_STATE_AUTH_CHALLENGE_SEND = 6 -CONN_STATE_AUTH_CHALLENGE_SEND_COMPLETE = 7 -CONN_STATE_AUTH_CHALLENGE_REPLY_COMPLETE = 8 -CONN_STATE_START_CONNECT = 9 -CONN_STATE_FINISHED = 100 -CONN_STATE_ERROR = 101 -CONN_STATE_TIMEOUT = 102 -READ_STATE_UNKNOWN = 1 -READ_STATE_READ = 2 -READ_STATE_READ_COMPLETE = 3 -READ_STATE_DO_CALLBACK = 4 -READ_STATE_HANDLE_ERROR = 5 -READ_STATE_ERROR = 100 -WRITE_STATE_UNKNOWN = 1 -WRITE_STATE_WRITE = 2 -WRITE_STATE_WRITE_COMPLETE = 3 -WRITE_STATE_DO_CALLBACK = 4 -WRITE_STATE_HANDLE_ERROR = 5 -WRITE_STATE_ERROR = 100 -WRITE_STATE_IDLE = 101 -CHANNEL_ERROR_NONE = 1 -CHANNEL_ERROR_CHANNEL_NOT_OPEN = 2 -CHANNEL_ERROR_AUTHENTICATION_ERROR = 3 -CHANNEL_ERROR_CONNECT_ERROR = 4 -CHANNEL_ERROR_SOCKET_ERROR = 5 -CHANNEL_ERROR_TRANSPORT_ERROR = 6 -CHANNEL_ERROR_INVALID_MESSAGE = 7 -CHANNEL_ERROR_INVALID_CHANNEL_ID = 8 -CHANNEL_ERROR_CONNECT_TIMEOUT = 9 -CHANNEL_ERROR_UNKNOWN = 10 -CHALLENGE_REPLY_ERROR_NONE = 1 -CHALLENGE_REPLY_ERROR_PEER_CERT_EMPTY = 2 -CHALLENGE_REPLY_ERROR_WRONG_PAYLOAD_TYPE = 3 -CHALLENGE_REPLY_ERROR_NO_PAYLOAD = 4 -CHALLENGE_REPLY_ERROR_PAYLOAD_PARSING_FAILED = 5 -CHALLENGE_REPLY_ERROR_MESSAGE_ERROR = 6 -CHALLENGE_REPLY_ERROR_NO_RESPONSE = 7 -CHALLENGE_REPLY_ERROR_FINGERPRINT_NOT_FOUND = 8 -CHALLENGE_REPLY_ERROR_CERT_PARSING_FAILED = 9 -CHALLENGE_REPLY_ERROR_CERT_NOT_SIGNED_BY_TRUSTED_CA = 10 -CHALLENGE_REPLY_ERROR_CANNOT_EXTRACT_PUBLIC_KEY = 11 -CHALLENGE_REPLY_ERROR_SIGNED_BLOBS_MISMATCH = 12 -CHALLENGE_REPLY_ERROR_TLS_CERT_VALIDITY_PERIOD_TOO_LONG = 13 -CHALLENGE_REPLY_ERROR_TLS_CERT_VALID_START_DATE_IN_FUTURE = 14 -CHALLENGE_REPLY_ERROR_TLS_CERT_EXPIRED = 15 -CHALLENGE_REPLY_ERROR_CRL_INVALID = 16 -CHALLENGE_REPLY_ERROR_CERT_REVOKED = 17 - - -_SOCKETEVENT = DESCRIPTOR.message_types_by_name['SocketEvent'] -_AGGREGATEDSOCKETEVENT = DESCRIPTOR.message_types_by_name['AggregatedSocketEvent'] -_LOG = DESCRIPTOR.message_types_by_name['Log'] -SocketEvent = _reflection.GeneratedProtocolMessageType('SocketEvent', (_message.Message,), { - 'DESCRIPTOR' : _SOCKETEVENT, - '__module__' : 'logging_pb2' - # @@protoc_insertion_point(class_scope:extensions.api.cast_channel.proto.SocketEvent) - }) -_sym_db.RegisterMessage(SocketEvent) - -AggregatedSocketEvent = _reflection.GeneratedProtocolMessageType('AggregatedSocketEvent', (_message.Message,), { - 'DESCRIPTOR' : _AGGREGATEDSOCKETEVENT, - '__module__' : 'logging_pb2' - # @@protoc_insertion_point(class_scope:extensions.api.cast_channel.proto.AggregatedSocketEvent) - }) -_sym_db.RegisterMessage(AggregatedSocketEvent) - -Log = _reflection.GeneratedProtocolMessageType('Log', (_message.Message,), { - 'DESCRIPTOR' : _LOG, - '__module__' : 'logging_pb2' - # @@protoc_insertion_point(class_scope:extensions.api.cast_channel.proto.Log) - }) -_sym_db.RegisterMessage(Log) - +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'logging_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'H\003' - _EVENTTYPE._serialized_start=1120 - _EVENTTYPE._serialized_end=1952 - _CHANNELAUTH._serialized_start=1954 - _CHANNELAUTH._serialized_end=1994 - _READYSTATE._serialized_start=1997 - _READYSTATE._serialized_end=2130 - _CONNECTIONSTATE._serialized_start=2133 - _CONNECTIONSTATE._serialized_end=2532 - _READSTATE._serialized_start=2535 - _READSTATE._serialized_end=2700 - _WRITESTATE._serialized_start=2703 - _WRITESTATE._serialized_end=2899 - _ERRORSTATE._serialized_start=2902 - _ERRORSTATE._serialized_end=3249 - _CHALLENGEREPLYERRORTYPE._serialized_start=3252 - _CHALLENGEREPLYERRORTYPE._serialized_end=4068 - _SOCKETEVENT._serialized_start=53 - _SOCKETEVENT._serialized_end=690 - _AGGREGATEDSOCKETEVENT._serialized_start=693 - _AGGREGATEDSOCKETEVENT._serialized_end=937 - _LOG._serialized_start=940 - _LOG._serialized_end=1117 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'H\003' + _globals['_EVENTTYPE']._serialized_start=1120 + _globals['_EVENTTYPE']._serialized_end=1952 + _globals['_CHANNELAUTH']._serialized_start=1954 + _globals['_CHANNELAUTH']._serialized_end=1994 + _globals['_READYSTATE']._serialized_start=1997 + _globals['_READYSTATE']._serialized_end=2130 + _globals['_CONNECTIONSTATE']._serialized_start=2133 + _globals['_CONNECTIONSTATE']._serialized_end=2532 + _globals['_READSTATE']._serialized_start=2535 + _globals['_READSTATE']._serialized_end=2700 + _globals['_WRITESTATE']._serialized_start=2703 + _globals['_WRITESTATE']._serialized_end=2899 + _globals['_ERRORSTATE']._serialized_start=2902 + _globals['_ERRORSTATE']._serialized_end=3249 + _globals['_CHALLENGEREPLYERRORTYPE']._serialized_start=3252 + _globals['_CHALLENGEREPLYERRORTYPE']._serialized_end=4068 + _globals['_SOCKETEVENT']._serialized_start=53 + _globals['_SOCKETEVENT']._serialized_end=690 + _globals['_AGGREGATEDSOCKETEVENT']._serialized_start=693 + _globals['_AGGREGATEDSOCKETEVENT']._serialized_end=937 + _globals['_LOG']._serialized_start=940 + _globals['_LOG']._serialized_end=1117 # @@protoc_insertion_point(module_scope) diff --git a/pychromecast/generated/logging_pb2.pyi b/pychromecast/generated/logging_pb2.pyi new file mode 100644 index 000000000..43e256e28 --- /dev/null +++ b/pychromecast/generated/logging_pb2.pyi @@ -0,0 +1,267 @@ +from google.protobuf.internal import containers as _containers +from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union + +DESCRIPTOR: _descriptor.FileDescriptor + +class EventType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + EVENT_TYPE_UNKNOWN: _ClassVar[EventType] + CAST_SOCKET_CREATED: _ClassVar[EventType] + READY_STATE_CHANGED: _ClassVar[EventType] + CONNECTION_STATE_CHANGED: _ClassVar[EventType] + READ_STATE_CHANGED: _ClassVar[EventType] + WRITE_STATE_CHANGED: _ClassVar[EventType] + ERROR_STATE_CHANGED: _ClassVar[EventType] + CONNECT_FAILED: _ClassVar[EventType] + TCP_SOCKET_CONNECT: _ClassVar[EventType] + TCP_SOCKET_SET_KEEP_ALIVE: _ClassVar[EventType] + SSL_CERT_WHITELISTED: _ClassVar[EventType] + SSL_SOCKET_CONNECT: _ClassVar[EventType] + SSL_INFO_OBTAINED: _ClassVar[EventType] + DER_ENCODED_CERT_OBTAIN: _ClassVar[EventType] + RECEIVED_CHALLENGE_REPLY: _ClassVar[EventType] + AUTH_CHALLENGE_REPLY: _ClassVar[EventType] + CONNECT_TIMED_OUT: _ClassVar[EventType] + SEND_MESSAGE_FAILED: _ClassVar[EventType] + MESSAGE_ENQUEUED: _ClassVar[EventType] + SOCKET_WRITE: _ClassVar[EventType] + MESSAGE_WRITTEN: _ClassVar[EventType] + SOCKET_READ: _ClassVar[EventType] + MESSAGE_READ: _ClassVar[EventType] + SOCKET_CLOSED: _ClassVar[EventType] + SSL_CERT_EXCESSIVE_LIFETIME: _ClassVar[EventType] + CHANNEL_POLICY_ENFORCED: _ClassVar[EventType] + TCP_SOCKET_CONNECT_COMPLETE: _ClassVar[EventType] + SSL_SOCKET_CONNECT_COMPLETE: _ClassVar[EventType] + SSL_SOCKET_CONNECT_FAILED: _ClassVar[EventType] + SEND_AUTH_CHALLENGE_FAILED: _ClassVar[EventType] + AUTH_CHALLENGE_REPLY_INVALID: _ClassVar[EventType] + PING_WRITE_ERROR: _ClassVar[EventType] + +class ChannelAuth(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + SSL: _ClassVar[ChannelAuth] + SSL_VERIFIED: _ClassVar[ChannelAuth] + +class ReadyState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + READY_STATE_NONE: _ClassVar[ReadyState] + READY_STATE_CONNECTING: _ClassVar[ReadyState] + READY_STATE_OPEN: _ClassVar[ReadyState] + READY_STATE_CLOSING: _ClassVar[ReadyState] + READY_STATE_CLOSED: _ClassVar[ReadyState] + +class ConnectionState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + CONN_STATE_UNKNOWN: _ClassVar[ConnectionState] + CONN_STATE_TCP_CONNECT: _ClassVar[ConnectionState] + CONN_STATE_TCP_CONNECT_COMPLETE: _ClassVar[ConnectionState] + CONN_STATE_SSL_CONNECT: _ClassVar[ConnectionState] + CONN_STATE_SSL_CONNECT_COMPLETE: _ClassVar[ConnectionState] + CONN_STATE_AUTH_CHALLENGE_SEND: _ClassVar[ConnectionState] + CONN_STATE_AUTH_CHALLENGE_SEND_COMPLETE: _ClassVar[ConnectionState] + CONN_STATE_AUTH_CHALLENGE_REPLY_COMPLETE: _ClassVar[ConnectionState] + CONN_STATE_START_CONNECT: _ClassVar[ConnectionState] + CONN_STATE_FINISHED: _ClassVar[ConnectionState] + CONN_STATE_ERROR: _ClassVar[ConnectionState] + CONN_STATE_TIMEOUT: _ClassVar[ConnectionState] + +class ReadState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + READ_STATE_UNKNOWN: _ClassVar[ReadState] + READ_STATE_READ: _ClassVar[ReadState] + READ_STATE_READ_COMPLETE: _ClassVar[ReadState] + READ_STATE_DO_CALLBACK: _ClassVar[ReadState] + READ_STATE_HANDLE_ERROR: _ClassVar[ReadState] + READ_STATE_ERROR: _ClassVar[ReadState] + +class WriteState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + WRITE_STATE_UNKNOWN: _ClassVar[WriteState] + WRITE_STATE_WRITE: _ClassVar[WriteState] + WRITE_STATE_WRITE_COMPLETE: _ClassVar[WriteState] + WRITE_STATE_DO_CALLBACK: _ClassVar[WriteState] + WRITE_STATE_HANDLE_ERROR: _ClassVar[WriteState] + WRITE_STATE_ERROR: _ClassVar[WriteState] + WRITE_STATE_IDLE: _ClassVar[WriteState] + +class ErrorState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + CHANNEL_ERROR_NONE: _ClassVar[ErrorState] + CHANNEL_ERROR_CHANNEL_NOT_OPEN: _ClassVar[ErrorState] + CHANNEL_ERROR_AUTHENTICATION_ERROR: _ClassVar[ErrorState] + CHANNEL_ERROR_CONNECT_ERROR: _ClassVar[ErrorState] + CHANNEL_ERROR_SOCKET_ERROR: _ClassVar[ErrorState] + CHANNEL_ERROR_TRANSPORT_ERROR: _ClassVar[ErrorState] + CHANNEL_ERROR_INVALID_MESSAGE: _ClassVar[ErrorState] + CHANNEL_ERROR_INVALID_CHANNEL_ID: _ClassVar[ErrorState] + CHANNEL_ERROR_CONNECT_TIMEOUT: _ClassVar[ErrorState] + CHANNEL_ERROR_UNKNOWN: _ClassVar[ErrorState] + +class ChallengeReplyErrorType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + CHALLENGE_REPLY_ERROR_NONE: _ClassVar[ChallengeReplyErrorType] + CHALLENGE_REPLY_ERROR_PEER_CERT_EMPTY: _ClassVar[ChallengeReplyErrorType] + CHALLENGE_REPLY_ERROR_WRONG_PAYLOAD_TYPE: _ClassVar[ChallengeReplyErrorType] + CHALLENGE_REPLY_ERROR_NO_PAYLOAD: _ClassVar[ChallengeReplyErrorType] + CHALLENGE_REPLY_ERROR_PAYLOAD_PARSING_FAILED: _ClassVar[ChallengeReplyErrorType] + CHALLENGE_REPLY_ERROR_MESSAGE_ERROR: _ClassVar[ChallengeReplyErrorType] + CHALLENGE_REPLY_ERROR_NO_RESPONSE: _ClassVar[ChallengeReplyErrorType] + CHALLENGE_REPLY_ERROR_FINGERPRINT_NOT_FOUND: _ClassVar[ChallengeReplyErrorType] + CHALLENGE_REPLY_ERROR_CERT_PARSING_FAILED: _ClassVar[ChallengeReplyErrorType] + CHALLENGE_REPLY_ERROR_CERT_NOT_SIGNED_BY_TRUSTED_CA: _ClassVar[ChallengeReplyErrorType] + CHALLENGE_REPLY_ERROR_CANNOT_EXTRACT_PUBLIC_KEY: _ClassVar[ChallengeReplyErrorType] + CHALLENGE_REPLY_ERROR_SIGNED_BLOBS_MISMATCH: _ClassVar[ChallengeReplyErrorType] + CHALLENGE_REPLY_ERROR_TLS_CERT_VALIDITY_PERIOD_TOO_LONG: _ClassVar[ChallengeReplyErrorType] + CHALLENGE_REPLY_ERROR_TLS_CERT_VALID_START_DATE_IN_FUTURE: _ClassVar[ChallengeReplyErrorType] + CHALLENGE_REPLY_ERROR_TLS_CERT_EXPIRED: _ClassVar[ChallengeReplyErrorType] + CHALLENGE_REPLY_ERROR_CRL_INVALID: _ClassVar[ChallengeReplyErrorType] + CHALLENGE_REPLY_ERROR_CERT_REVOKED: _ClassVar[ChallengeReplyErrorType] +EVENT_TYPE_UNKNOWN: EventType +CAST_SOCKET_CREATED: EventType +READY_STATE_CHANGED: EventType +CONNECTION_STATE_CHANGED: EventType +READ_STATE_CHANGED: EventType +WRITE_STATE_CHANGED: EventType +ERROR_STATE_CHANGED: EventType +CONNECT_FAILED: EventType +TCP_SOCKET_CONNECT: EventType +TCP_SOCKET_SET_KEEP_ALIVE: EventType +SSL_CERT_WHITELISTED: EventType +SSL_SOCKET_CONNECT: EventType +SSL_INFO_OBTAINED: EventType +DER_ENCODED_CERT_OBTAIN: EventType +RECEIVED_CHALLENGE_REPLY: EventType +AUTH_CHALLENGE_REPLY: EventType +CONNECT_TIMED_OUT: EventType +SEND_MESSAGE_FAILED: EventType +MESSAGE_ENQUEUED: EventType +SOCKET_WRITE: EventType +MESSAGE_WRITTEN: EventType +SOCKET_READ: EventType +MESSAGE_READ: EventType +SOCKET_CLOSED: EventType +SSL_CERT_EXCESSIVE_LIFETIME: EventType +CHANNEL_POLICY_ENFORCED: EventType +TCP_SOCKET_CONNECT_COMPLETE: EventType +SSL_SOCKET_CONNECT_COMPLETE: EventType +SSL_SOCKET_CONNECT_FAILED: EventType +SEND_AUTH_CHALLENGE_FAILED: EventType +AUTH_CHALLENGE_REPLY_INVALID: EventType +PING_WRITE_ERROR: EventType +SSL: ChannelAuth +SSL_VERIFIED: ChannelAuth +READY_STATE_NONE: ReadyState +READY_STATE_CONNECTING: ReadyState +READY_STATE_OPEN: ReadyState +READY_STATE_CLOSING: ReadyState +READY_STATE_CLOSED: ReadyState +CONN_STATE_UNKNOWN: ConnectionState +CONN_STATE_TCP_CONNECT: ConnectionState +CONN_STATE_TCP_CONNECT_COMPLETE: ConnectionState +CONN_STATE_SSL_CONNECT: ConnectionState +CONN_STATE_SSL_CONNECT_COMPLETE: ConnectionState +CONN_STATE_AUTH_CHALLENGE_SEND: ConnectionState +CONN_STATE_AUTH_CHALLENGE_SEND_COMPLETE: ConnectionState +CONN_STATE_AUTH_CHALLENGE_REPLY_COMPLETE: ConnectionState +CONN_STATE_START_CONNECT: ConnectionState +CONN_STATE_FINISHED: ConnectionState +CONN_STATE_ERROR: ConnectionState +CONN_STATE_TIMEOUT: ConnectionState +READ_STATE_UNKNOWN: ReadState +READ_STATE_READ: ReadState +READ_STATE_READ_COMPLETE: ReadState +READ_STATE_DO_CALLBACK: ReadState +READ_STATE_HANDLE_ERROR: ReadState +READ_STATE_ERROR: ReadState +WRITE_STATE_UNKNOWN: WriteState +WRITE_STATE_WRITE: WriteState +WRITE_STATE_WRITE_COMPLETE: WriteState +WRITE_STATE_DO_CALLBACK: WriteState +WRITE_STATE_HANDLE_ERROR: WriteState +WRITE_STATE_ERROR: WriteState +WRITE_STATE_IDLE: WriteState +CHANNEL_ERROR_NONE: ErrorState +CHANNEL_ERROR_CHANNEL_NOT_OPEN: ErrorState +CHANNEL_ERROR_AUTHENTICATION_ERROR: ErrorState +CHANNEL_ERROR_CONNECT_ERROR: ErrorState +CHANNEL_ERROR_SOCKET_ERROR: ErrorState +CHANNEL_ERROR_TRANSPORT_ERROR: ErrorState +CHANNEL_ERROR_INVALID_MESSAGE: ErrorState +CHANNEL_ERROR_INVALID_CHANNEL_ID: ErrorState +CHANNEL_ERROR_CONNECT_TIMEOUT: ErrorState +CHANNEL_ERROR_UNKNOWN: ErrorState +CHALLENGE_REPLY_ERROR_NONE: ChallengeReplyErrorType +CHALLENGE_REPLY_ERROR_PEER_CERT_EMPTY: ChallengeReplyErrorType +CHALLENGE_REPLY_ERROR_WRONG_PAYLOAD_TYPE: ChallengeReplyErrorType +CHALLENGE_REPLY_ERROR_NO_PAYLOAD: ChallengeReplyErrorType +CHALLENGE_REPLY_ERROR_PAYLOAD_PARSING_FAILED: ChallengeReplyErrorType +CHALLENGE_REPLY_ERROR_MESSAGE_ERROR: ChallengeReplyErrorType +CHALLENGE_REPLY_ERROR_NO_RESPONSE: ChallengeReplyErrorType +CHALLENGE_REPLY_ERROR_FINGERPRINT_NOT_FOUND: ChallengeReplyErrorType +CHALLENGE_REPLY_ERROR_CERT_PARSING_FAILED: ChallengeReplyErrorType +CHALLENGE_REPLY_ERROR_CERT_NOT_SIGNED_BY_TRUSTED_CA: ChallengeReplyErrorType +CHALLENGE_REPLY_ERROR_CANNOT_EXTRACT_PUBLIC_KEY: ChallengeReplyErrorType +CHALLENGE_REPLY_ERROR_SIGNED_BLOBS_MISMATCH: ChallengeReplyErrorType +CHALLENGE_REPLY_ERROR_TLS_CERT_VALIDITY_PERIOD_TOO_LONG: ChallengeReplyErrorType +CHALLENGE_REPLY_ERROR_TLS_CERT_VALID_START_DATE_IN_FUTURE: ChallengeReplyErrorType +CHALLENGE_REPLY_ERROR_TLS_CERT_EXPIRED: ChallengeReplyErrorType +CHALLENGE_REPLY_ERROR_CRL_INVALID: ChallengeReplyErrorType +CHALLENGE_REPLY_ERROR_CERT_REVOKED: ChallengeReplyErrorType + +class SocketEvent(_message.Message): + __slots__ = ("type", "timestamp_micros", "details", "net_return_value", "message_namespace", "ready_state", "connection_state", "read_state", "write_state", "error_state", "challenge_reply_error_type", "nss_error_code") + TYPE_FIELD_NUMBER: _ClassVar[int] + TIMESTAMP_MICROS_FIELD_NUMBER: _ClassVar[int] + DETAILS_FIELD_NUMBER: _ClassVar[int] + NET_RETURN_VALUE_FIELD_NUMBER: _ClassVar[int] + MESSAGE_NAMESPACE_FIELD_NUMBER: _ClassVar[int] + READY_STATE_FIELD_NUMBER: _ClassVar[int] + CONNECTION_STATE_FIELD_NUMBER: _ClassVar[int] + READ_STATE_FIELD_NUMBER: _ClassVar[int] + WRITE_STATE_FIELD_NUMBER: _ClassVar[int] + ERROR_STATE_FIELD_NUMBER: _ClassVar[int] + CHALLENGE_REPLY_ERROR_TYPE_FIELD_NUMBER: _ClassVar[int] + NSS_ERROR_CODE_FIELD_NUMBER: _ClassVar[int] + type: EventType + timestamp_micros: int + details: str + net_return_value: int + message_namespace: str + ready_state: ReadyState + connection_state: ConnectionState + read_state: ReadState + write_state: WriteState + error_state: ErrorState + challenge_reply_error_type: ChallengeReplyErrorType + nss_error_code: int + def __init__(self, type: _Optional[_Union[EventType, str]] = ..., timestamp_micros: _Optional[int] = ..., details: _Optional[str] = ..., net_return_value: _Optional[int] = ..., message_namespace: _Optional[str] = ..., ready_state: _Optional[_Union[ReadyState, str]] = ..., connection_state: _Optional[_Union[ConnectionState, str]] = ..., read_state: _Optional[_Union[ReadState, str]] = ..., write_state: _Optional[_Union[WriteState, str]] = ..., error_state: _Optional[_Union[ErrorState, str]] = ..., challenge_reply_error_type: _Optional[_Union[ChallengeReplyErrorType, str]] = ..., nss_error_code: _Optional[int] = ...) -> None: ... + +class AggregatedSocketEvent(_message.Message): + __slots__ = ("id", "endpoint_id", "channel_auth_type", "socket_event", "bytes_read", "bytes_written") + ID_FIELD_NUMBER: _ClassVar[int] + ENDPOINT_ID_FIELD_NUMBER: _ClassVar[int] + CHANNEL_AUTH_TYPE_FIELD_NUMBER: _ClassVar[int] + SOCKET_EVENT_FIELD_NUMBER: _ClassVar[int] + BYTES_READ_FIELD_NUMBER: _ClassVar[int] + BYTES_WRITTEN_FIELD_NUMBER: _ClassVar[int] + id: int + endpoint_id: int + channel_auth_type: ChannelAuth + socket_event: _containers.RepeatedCompositeFieldContainer[SocketEvent] + bytes_read: int + bytes_written: int + def __init__(self, id: _Optional[int] = ..., endpoint_id: _Optional[int] = ..., channel_auth_type: _Optional[_Union[ChannelAuth, str]] = ..., socket_event: _Optional[_Iterable[_Union[SocketEvent, _Mapping]]] = ..., bytes_read: _Optional[int] = ..., bytes_written: _Optional[int] = ...) -> None: ... + +class Log(_message.Message): + __slots__ = ("aggregated_socket_event", "num_evicted_aggregated_socket_events", "num_evicted_socket_events") + AGGREGATED_SOCKET_EVENT_FIELD_NUMBER: _ClassVar[int] + NUM_EVICTED_AGGREGATED_SOCKET_EVENTS_FIELD_NUMBER: _ClassVar[int] + NUM_EVICTED_SOCKET_EVENTS_FIELD_NUMBER: _ClassVar[int] + aggregated_socket_event: _containers.RepeatedCompositeFieldContainer[AggregatedSocketEvent] + num_evicted_aggregated_socket_events: int + num_evicted_socket_events: int + def __init__(self, aggregated_socket_event: _Optional[_Iterable[_Union[AggregatedSocketEvent, _Mapping]]] = ..., num_evicted_aggregated_socket_events: _Optional[int] = ..., num_evicted_socket_events: _Optional[int] = ...) -> None: ... diff --git a/pychromecast/generated/readme.txt b/pychromecast/generated/readme.txt new file mode 100644 index 000000000..75a4dfdc1 --- /dev/null +++ b/pychromecast/generated/readme.txt @@ -0,0 +1,2 @@ +The files in this directory can be generated by calling +protoc -I=chromecast_protobuf/ --python_out=pychromecast/generated/ --pyi_out=pychromecast/generated/ chromecast_protobuf/authority_keys.proto chromecast_protobuf/cast_channel.proto chromecast_protobuf/logging.proto \ No newline at end of file diff --git a/pychromecast/socket_client.py b/pychromecast/socket_client.py index 539557737..befa28c21 100644 --- a/pychromecast/socket_client.py +++ b/pychromecast/socket_client.py @@ -20,7 +20,6 @@ from collections import defaultdict, namedtuple from struct import pack, unpack -from . import cast_channel_pb2 from .controllers import BaseController from .controllers.media import MediaController from .controllers.receiver import ReceiverController @@ -32,6 +31,7 @@ NotConnected, PyChromecastStopped, ) +from .generated import cast_channel_pb2 NS_CONNECTION = "urn:x-cast:com.google.cast.tp.connection" NS_HEARTBEAT = "urn:x-cast:com.google.cast.tp.heartbeat" @@ -852,7 +852,7 @@ def _read_message(self): # now read the payload payload = self._read_bytes_from_socket(read_len) - message = cast_channel_pb2.CastMessage() + message = cast_channel_pb2.CastMessage() # pylint: disable=no-member message.ParseFromString(payload) return message @@ -886,9 +886,9 @@ def send_message( if inc_session_id: data[SESSION_ID] = self.session_id - msg = cast_channel_pb2.CastMessage() + msg = cast_channel_pb2.CastMessage() # pylint: disable=no-member - msg.protocol_version = msg.CASTV2_1_0 # pylint: disable=no-member + msg.protocol_version = msg.CASTV2_1_0 msg.source_id = self.source_id msg.destination_id = destination_id msg.payload_type = ( @@ -901,7 +901,7 @@ def send_message( be_size = pack(">I", msg.ByteSize()) # Log all messages except heartbeat - if msg.namespace != NS_HEARTBEAT: # pylint: disable=no-member + if msg.namespace != NS_HEARTBEAT: self.logger.debug( "[%s(%s):%s] Sending: %s", self.fn or "", From 5f4ae3fb940fa5fe888dd869200a39377e574e49 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 16 Jan 2024 13:31:23 +0100 Subject: [PATCH 2/2] Bump required protobuf version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5f316604e..3249453f1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -protobuf>=3.19.1 +protobuf>=4.25.1 zeroconf>=0.25.1 casttube>=0.2.0