androidtvremote2 0.2.0__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {androidtvremote2-0.2.0/src/androidtvremote2.egg-info → androidtvremote2-0.2.2}/PKG-INFO +4 -2
  2. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/README.md +1 -0
  3. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/pyproject.toml +1 -1
  4. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/androidtvremote2/androidtv_remote.py +2 -1
  5. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/androidtvremote2/polo_pb2.py +3 -14
  6. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/androidtvremote2/remote.py +9 -4
  7. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/androidtvremote2/remotemessage_pb2.py +2 -13
  8. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2/src/androidtvremote2.egg-info}/PKG-INFO +4 -2
  9. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/LICENSE +0 -0
  10. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/setup.cfg +0 -0
  11. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/androidtvremote2/__init__.py +0 -0
  12. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/androidtvremote2/base.py +0 -0
  13. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/androidtvremote2/certificate_generator.py +0 -0
  14. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/androidtvremote2/const.py +0 -0
  15. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/androidtvremote2/exceptions.py +0 -0
  16. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/androidtvremote2/pairing.py +0 -0
  17. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/androidtvremote2/polo_pb2.pyi +0 -0
  18. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/androidtvremote2/remotemessage_pb2.pyi +0 -0
  19. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/androidtvremote2.egg-info/SOURCES.txt +0 -0
  20. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/androidtvremote2.egg-info/dependency_links.txt +0 -0
  21. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/androidtvremote2.egg-info/requires.txt +0 -0
  22. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/androidtvremote2.egg-info/top_level.txt +0 -0
  23. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/src/demo.py +0 -0
  24. {androidtvremote2-0.2.0 → androidtvremote2-0.2.2}/tests/test_androidtv_remote.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: androidtvremote2
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: A Python library for interacting with Android TV using the Android TV Remote protocol v2
5
5
  Author-email: tronikos <tronikos@gmail.com>
6
6
  License: Apache-2.0
@@ -12,6 +12,7 @@ License-File: LICENSE
12
12
  Requires-Dist: aiofiles>=0.8
13
13
  Requires-Dist: cryptography>=3
14
14
  Requires-Dist: protobuf>=4.21
15
+ Dynamic: license-file
15
16
 
16
17
  # androidtvremote2
17
18
 
@@ -52,6 +53,7 @@ python -m grpc_tools.protoc src/androidtvremote2/*.proto --python_out=src/androi
52
53
 
53
54
  # Run pre-commit
54
55
  python -m pip install pre-commit
56
+ pre-commit autoupdate
55
57
  pre-commit install
56
58
  pre-commit run --all-files
57
59
 
@@ -37,6 +37,7 @@ python -m grpc_tools.protoc src/androidtvremote2/*.proto --python_out=src/androi
37
37
 
38
38
  # Run pre-commit
39
39
  python -m pip install pre-commit
40
+ pre-commit autoupdate
40
41
  pre-commit install
41
42
  pre-commit run --all-files
42
43
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "androidtvremote2"
3
- version = "0.2.0"
3
+ version = "0.2.2"
4
4
  license = {text = "Apache-2.0"}
5
5
  authors = [
6
6
  { name="tronikos", email="tronikos@gmail.com" },
@@ -384,7 +384,8 @@ class AndroidTVRemote:
384
384
  This does not block; it buffers the data and arranges for it to be sent out asynchronously.
385
385
 
386
386
  :param key_code: int (e.g. 26) or str (e.g. "KEYCODE_POWER" or just "POWER") from the enum
387
- RemoteKeyCode in remotemessage.proto.
387
+ RemoteKeyCode in remotemessage.proto or str prefixed with "text:" to pass
388
+ to send_text.
388
389
  :param direction: "SHORT" (default) or "START_LONG" or "END_LONG".
389
390
  :raises ValueError: if key_code in str or direction isn't known.
390
391
  :raises ConnectionClosed: if client is disconnected.
@@ -1,22 +1,11 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
- # NO CHECKED-IN PROTOBUF GENCODE
4
3
  # source: polo.proto
5
- # Protobuf Python Version: 5.29.0
6
4
  """Generated protocol buffer code."""
7
5
  from google.protobuf import descriptor as _descriptor
8
6
  from google.protobuf import descriptor_pool as _descriptor_pool
9
- from google.protobuf import runtime_version as _runtime_version
10
7
  from google.protobuf import symbol_database as _symbol_database
11
8
  from google.protobuf.internal import builder as _builder
12
- _runtime_version.ValidateProtobufRuntimeVersion(
13
- _runtime_version.Domain.PUBLIC,
14
- 5,
15
- 29,
16
- 0,
17
- '',
18
- 'polo.proto'
19
- )
20
9
  # @@protoc_insertion_point(imports)
21
10
 
22
11
  _sym_db = _symbol_database.Default()
@@ -29,9 +18,9 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\npolo.proto\x12\x
29
18
  _globals = globals()
30
19
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
20
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'polo_pb2', _globals)
32
- if not _descriptor._USE_C_DESCRIPTORS:
33
- _globals['DESCRIPTOR']._loaded_options = None
34
- _globals['DESCRIPTOR']._serialized_options = b'\n\035com.google.polo.wire.protobufB\tPoloProtoH\003'
21
+ if _descriptor._USE_C_DESCRIPTORS == False:
22
+ DESCRIPTOR._options = None
23
+ DESCRIPTOR._serialized_options = b'\n\035com.google.polo.wire.protobufB\tPoloProtoH\003'
35
24
  _globals['_OUTERMESSAGE']._serialized_start=35
36
25
  _globals['_OUTERMESSAGE']._serialized_end=628
37
26
  _globals['_OUTERMESSAGE_STATUS']._serialized_start=530
@@ -30,6 +30,8 @@ ERROR_SUGGESTION_MSG = (
30
30
  "On the Android TV device, go to Settings > Apps > See all apps > Show system apps. "
31
31
  "Then, select Android TV Remote Service > Storage > Clear data/storage."
32
32
  )
33
+ KEYCODE_PREFIX = "KEYCODE_"
34
+ TEXT_PREFIX = "text:"
33
35
 
34
36
 
35
37
  class Feature(IntFlag):
@@ -102,16 +104,19 @@ class RemoteProtocol(ProtobufProtocol):
102
104
 
103
105
  This does not block; it buffers the data and arranges for it to be sent out asynchronously.
104
106
 
105
- :param key_code: int (e.g. 26) or str (e.g. KEYCODE_POWER or just "POWER") from the enum
106
- RemoteKeyCode in remotemessage.proto.
107
+ :param key_code: int (e.g. 26) or str (e.g. "KEYCODE_POWER" or just "POWER") from the enum
108
+ RemoteKeyCode in remotemessage.proto or str prefixed with "text:" to pass
109
+ to send_text.
107
110
  :param direction: "SHORT" (default) or "START_LONG" or "END_LONG".
108
111
  :raises ValueError: if key_code in str or direction isn't known.
109
112
  """
110
113
  self._reset_idle_disconnect_task()
111
114
  msg = RemoteMessage()
112
115
  if isinstance(key_code, str):
113
- if not key_code.startswith("KEYCODE_"):
114
- key_code = "KEYCODE_" + key_code
116
+ if key_code.lower().startswith(TEXT_PREFIX):
117
+ return self.send_text(key_code[len(TEXT_PREFIX):])
118
+ if not key_code.startswith(KEYCODE_PREFIX):
119
+ key_code = KEYCODE_PREFIX + key_code
115
120
  key_code = RemoteKeyCode.Value(key_code)
116
121
  if isinstance(direction, str):
117
122
  direction = RemoteDirection.Value(direction)
@@ -1,22 +1,11 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
- # NO CHECKED-IN PROTOBUF GENCODE
4
3
  # source: remotemessage.proto
5
- # Protobuf Python Version: 5.29.0
6
4
  """Generated protocol buffer code."""
7
5
  from google.protobuf import descriptor as _descriptor
8
6
  from google.protobuf import descriptor_pool as _descriptor_pool
9
- from google.protobuf import runtime_version as _runtime_version
10
7
  from google.protobuf import symbol_database as _symbol_database
11
8
  from google.protobuf.internal import builder as _builder
12
- _runtime_version.ValidateProtobufRuntimeVersion(
13
- _runtime_version.Domain.PUBLIC,
14
- 5,
15
- 29,
16
- 0,
17
- '',
18
- 'remotemessage.proto'
19
- )
20
9
  # @@protoc_insertion_point(imports)
21
10
 
22
11
  _sym_db = _symbol_database.Default()
@@ -29,8 +18,8 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13remotemessage.
29
18
  _globals = globals()
30
19
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
20
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'remotemessage_pb2', _globals)
32
- if not _descriptor._USE_C_DESCRIPTORS:
33
- DESCRIPTOR._loaded_options = None
21
+ if _descriptor._USE_C_DESCRIPTORS == False:
22
+ DESCRIPTOR._options = None
34
23
  _globals['_REMOTEKEYCODE']._serialized_start=2791
35
24
  _globals['_REMOTEKEYCODE']._serialized_end=9934
36
25
  _globals['_REMOTEDIRECTION']._serialized_start=9936
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: androidtvremote2
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: A Python library for interacting with Android TV using the Android TV Remote protocol v2
5
5
  Author-email: tronikos <tronikos@gmail.com>
6
6
  License: Apache-2.0
@@ -12,6 +12,7 @@ License-File: LICENSE
12
12
  Requires-Dist: aiofiles>=0.8
13
13
  Requires-Dist: cryptography>=3
14
14
  Requires-Dist: protobuf>=4.21
15
+ Dynamic: license-file
15
16
 
16
17
  # androidtvremote2
17
18
 
@@ -52,6 +53,7 @@ python -m grpc_tools.protoc src/androidtvremote2/*.proto --python_out=src/androi
52
53
 
53
54
  # Run pre-commit
54
55
  python -m pip install pre-commit
56
+ pre-commit autoupdate
55
57
  pre-commit install
56
58
  pre-commit run --all-files
57
59