@bharper/atv-js 0.2.6 → 0.3.4

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 (283) hide show
  1. package/dist/index.d.ts +15 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +89 -9
  4. package/dist/index.js.map +1 -1
  5. package/dist/mdns.d.ts.map +1 -1
  6. package/dist/mdns.js +96 -11
  7. package/dist/mdns.js.map +1 -1
  8. package/examples/print-device-json.js +22 -0
  9. package/package.json +2 -3
  10. package/pyatv/.codecov.yml +38 -0
  11. package/pyatv/.github/FUNDING.yml +3 -0
  12. package/pyatv/.github/ISSUE_TEMPLATE/bug_report.yml +80 -0
  13. package/pyatv/.github/ISSUE_TEMPLATE/config.yml +1 -0
  14. package/pyatv/.github/ISSUE_TEMPLATE/feature_request.yml +22 -0
  15. package/pyatv/.github/ISSUE_TEMPLATE/implementation-proposal.yml +29 -0
  16. package/pyatv/.github/ISSUE_TEMPLATE/investigation.yml +16 -0
  17. package/pyatv/.github/ISSUE_TEMPLATE/minor-change.yml +10 -0
  18. package/pyatv/.github/ISSUE_TEMPLATE/question-or-idea.yml +11 -0
  19. package/pyatv/.github/dependabot.yml +26 -0
  20. package/pyatv/.github/workflows/codeql-analysis.yml +71 -0
  21. package/pyatv/.github/workflows/release.yml +160 -0
  22. package/pyatv/.github/workflows/tests.yml +104 -0
  23. package/pyatv/.gitpod.yml +23 -0
  24. package/pyatv/CHANGES.md +3708 -0
  25. package/pyatv/CODE_OF_CONDUCT.md +76 -0
  26. package/pyatv/CONTRIBUTING.md +72 -0
  27. package/pyatv/CONTRIBUTORS.md +3 -0
  28. package/pyatv/Dockerfile +15 -0
  29. package/pyatv/LICENSE.md +9 -0
  30. package/pyatv/MANIFEST.in +14 -0
  31. package/pyatv/README.md +111 -0
  32. package/pyatv/base_versions.txt +13 -0
  33. package/pyatv/chickn.yaml +75 -0
  34. package/pyatv/docs/404.html +24 -0
  35. package/pyatv/docs/CNAME +1 -0
  36. package/pyatv/docs/Gemfile +31 -0
  37. package/pyatv/docs/_config.yml +121 -0
  38. package/pyatv/docs/_includes/api +10 -0
  39. package/pyatv/docs/_includes/atvremote_scan +32 -0
  40. package/pyatv/docs/_includes/code +6 -0
  41. package/pyatv/docs/_includes/issue +14 -0
  42. package/pyatv/docs/_includes/pypi +5 -0
  43. package/pyatv/docs/_layouts/template.html +109 -0
  44. package/pyatv/docs/api/pyatv.conf.html +312 -0
  45. package/pyatv/docs/api/pyatv.const.html +974 -0
  46. package/pyatv/docs/api/pyatv.convert.html +106 -0
  47. package/pyatv/docs/api/pyatv.exceptions.html +489 -0
  48. package/pyatv/docs/api/pyatv.helpers.html +102 -0
  49. package/pyatv/docs/api/pyatv.html +120 -0
  50. package/pyatv/docs/api/pyatv.interface.html +2369 -0
  51. package/pyatv/docs/api/pyatv.settings.html +484 -0
  52. package/pyatv/docs/api/pyatv.storage.file_storage.html +102 -0
  53. package/pyatv/docs/api/pyatv.storage.html +186 -0
  54. package/pyatv/docs/api/pyatv.storage.memory_storage.html +83 -0
  55. package/pyatv/docs/assets/css/custom.css +19 -0
  56. package/pyatv/docs/assets/css/hljs.css +1 -0
  57. package/pyatv/docs/assets/css/normalize.css +349 -0
  58. package/pyatv/docs/assets/css/pdoc.css +287 -0
  59. package/pyatv/docs/assets/css/sanitize.css +566 -0
  60. package/pyatv/docs/assets/css/style.scss +9 -0
  61. package/pyatv/docs/assets/img/logo.svg +63 -0
  62. package/pyatv/docs/assets/js/highlight.9.12.0.min.js +3 -0
  63. package/pyatv/docs/assets/js/mermaid.8.9.2.min.js +32 -0
  64. package/pyatv/docs/assets/js/mermaid.min.js.map +1 -0
  65. package/pyatv/docs/development/apps.md +81 -0
  66. package/pyatv/docs/development/audio.md +42 -0
  67. package/pyatv/docs/development/control.md +56 -0
  68. package/pyatv/docs/development/development.md +15 -0
  69. package/pyatv/docs/development/device_info.md +36 -0
  70. package/pyatv/docs/development/examples.md +44 -0
  71. package/pyatv/docs/development/features.md +70 -0
  72. package/pyatv/docs/development/keyboard.md +51 -0
  73. package/pyatv/docs/development/listeners.md +144 -0
  74. package/pyatv/docs/development/logging.md +55 -0
  75. package/pyatv/docs/development/metadata.md +115 -0
  76. package/pyatv/docs/development/power_management.md +53 -0
  77. package/pyatv/docs/development/scan_pair_and_connect.md +331 -0
  78. package/pyatv/docs/development/services.md +9 -0
  79. package/pyatv/docs/development/storage.md +259 -0
  80. package/pyatv/docs/development/stream.md +241 -0
  81. package/pyatv/docs/development/testing.md +9 -0
  82. package/pyatv/docs/documentation/atvlog.md +64 -0
  83. package/pyatv/docs/documentation/atvproxy.md +244 -0
  84. package/pyatv/docs/documentation/atvremote.md +639 -0
  85. package/pyatv/docs/documentation/atvscript.md +275 -0
  86. package/pyatv/docs/documentation/concepts.md +168 -0
  87. package/pyatv/docs/documentation/documentation.md +130 -0
  88. package/pyatv/docs/documentation/getting_started.md +248 -0
  89. package/pyatv/docs/documentation/protocols.md +1959 -0
  90. package/pyatv/docs/documentation/supported_features.md +246 -0
  91. package/pyatv/docs/documentation/tutorial.md +1062 -0
  92. package/pyatv/docs/documentation/workspace.code-workspace +7 -0
  93. package/pyatv/docs/favicon.ico +0 -0
  94. package/pyatv/docs/index.md +109 -0
  95. package/pyatv/docs/internals/design.md +354 -0
  96. package/pyatv/docs/internals/documentation.md +84 -0
  97. package/pyatv/docs/internals/interfaces.md +95 -0
  98. package/pyatv/docs/internals/internals.md +157 -0
  99. package/pyatv/docs/internals/submit_pr.md +56 -0
  100. package/pyatv/docs/internals/testing.md +176 -0
  101. package/pyatv/docs/internals/tools.md +574 -0
  102. package/pyatv/docs/pdoc_templates/config.mako +46 -0
  103. package/pyatv/docs/pdoc_templates/html.mako +454 -0
  104. package/pyatv/docs/support/acknowledgements.md +87 -0
  105. package/pyatv/docs/support/faq.md +214 -0
  106. package/pyatv/docs/support/migration.md +138 -0
  107. package/pyatv/docs/support/scanning_issues.md +110 -0
  108. package/pyatv/docs/support/support.md +18 -0
  109. package/pyatv/docs/support/troubleshooting.md +83 -0
  110. package/pyatv/pyatv/protocols/mrp/protobuf/AudioFadeMessage.proto +13 -0
  111. package/pyatv/pyatv/protocols/mrp/protobuf/AudioFadeMessage_pb2.pyi +37 -0
  112. package/pyatv/pyatv/protocols/mrp/protobuf/AudioFadeResponseMessage.proto +11 -0
  113. package/pyatv/pyatv/protocols/mrp/protobuf/AudioFadeResponseMessage_pb2.pyi +32 -0
  114. package/pyatv/pyatv/protocols/mrp/protobuf/AudioFormatSettingsMessage.proto +5 -0
  115. package/pyatv/pyatv/protocols/mrp/protobuf/AudioFormatSettingsMessage_pb2.pyi +27 -0
  116. package/pyatv/pyatv/protocols/mrp/protobuf/ClientUpdatesConfigMessage.proto +16 -0
  117. package/pyatv/pyatv/protocols/mrp/protobuf/ClientUpdatesConfigMessage_pb2.pyi +44 -0
  118. package/pyatv/pyatv/protocols/mrp/protobuf/CommandInfo.proto +117 -0
  119. package/pyatv/pyatv/protocols/mrp/protobuf/CommandInfo_pb2.pyi +325 -0
  120. package/pyatv/pyatv/protocols/mrp/protobuf/CommandOptions.proto +36 -0
  121. package/pyatv/pyatv/protocols/mrp/protobuf/CommandOptions_pb2.pyi +115 -0
  122. package/pyatv/pyatv/protocols/mrp/protobuf/Common.proto +79 -0
  123. package/pyatv/pyatv/protocols/mrp/protobuf/Common_pb2.pyi +228 -0
  124. package/pyatv/pyatv/protocols/mrp/protobuf/ConfigureConnectionMessage.proto +11 -0
  125. package/pyatv/pyatv/protocols/mrp/protobuf/ConfigureConnectionMessage_pb2.pyi +32 -0
  126. package/pyatv/pyatv/protocols/mrp/protobuf/ContentItem.proto +27 -0
  127. package/pyatv/pyatv/protocols/mrp/protobuf/ContentItemMetadata.proto +213 -0
  128. package/pyatv/pyatv/protocols/mrp/protobuf/ContentItemMetadata_pb2.pyi +630 -0
  129. package/pyatv/pyatv/protocols/mrp/protobuf/ContentItem_pb2.pyi +94 -0
  130. package/pyatv/pyatv/protocols/mrp/protobuf/CryptoPairingMessage.proto +15 -0
  131. package/pyatv/pyatv/protocols/mrp/protobuf/CryptoPairingMessage_pb2.pyi +46 -0
  132. package/pyatv/pyatv/protocols/mrp/protobuf/DeviceInfoMessage.proto +69 -0
  133. package/pyatv/pyatv/protocols/mrp/protobuf/DeviceInfoMessage_pb2.pyi +226 -0
  134. package/pyatv/pyatv/protocols/mrp/protobuf/GenericMessage.proto +12 -0
  135. package/pyatv/pyatv/protocols/mrp/protobuf/GenericMessage_pb2.pyi +35 -0
  136. package/pyatv/pyatv/protocols/mrp/protobuf/GetKeyboardSessionMessage.proto +11 -0
  137. package/pyatv/pyatv/protocols/mrp/protobuf/GetKeyboardSessionMessage_pb2.pyi +26 -0
  138. package/pyatv/pyatv/protocols/mrp/protobuf/GetRemoteTextInputSessionMessage.proto +10 -0
  139. package/pyatv/pyatv/protocols/mrp/protobuf/GetRemoteTextInputSessionMessage_pb2.pyi +26 -0
  140. package/pyatv/pyatv/protocols/mrp/protobuf/GetVolumeMessage.proto +11 -0
  141. package/pyatv/pyatv/protocols/mrp/protobuf/GetVolumeMessage_pb2.pyi +32 -0
  142. package/pyatv/pyatv/protocols/mrp/protobuf/GetVolumeResultMessage.proto +11 -0
  143. package/pyatv/pyatv/protocols/mrp/protobuf/GetVolumeResultMessage_pb2.pyi +32 -0
  144. package/pyatv/pyatv/protocols/mrp/protobuf/KeyboardMessage.proto +88 -0
  145. package/pyatv/pyatv/protocols/mrp/protobuf/KeyboardMessage_pb2.pyi +261 -0
  146. package/pyatv/pyatv/protocols/mrp/protobuf/LanguageOption.proto +9 -0
  147. package/pyatv/pyatv/protocols/mrp/protobuf/LanguageOption_pb2.pyi +42 -0
  148. package/pyatv/pyatv/protocols/mrp/protobuf/ModifyOutputContextRequestMessage.proto +23 -0
  149. package/pyatv/pyatv/protocols/mrp/protobuf/ModifyOutputContextRequestMessage_pb2.pyi +86 -0
  150. package/pyatv/pyatv/protocols/mrp/protobuf/NotificationMessage.proto +12 -0
  151. package/pyatv/pyatv/protocols/mrp/protobuf/NotificationMessage_pb2.pyi +38 -0
  152. package/pyatv/pyatv/protocols/mrp/protobuf/NowPlayingClient.proto +12 -0
  153. package/pyatv/pyatv/protocols/mrp/protobuf/NowPlayingClient_pb2.pyi +49 -0
  154. package/pyatv/pyatv/protocols/mrp/protobuf/NowPlayingInfo.proto +24 -0
  155. package/pyatv/pyatv/protocols/mrp/protobuf/NowPlayingInfo_pb2.pyi +79 -0
  156. package/pyatv/pyatv/protocols/mrp/protobuf/NowPlayingPlayer.proto +11 -0
  157. package/pyatv/pyatv/protocols/mrp/protobuf/NowPlayingPlayer_pb2.pyi +45 -0
  158. package/pyatv/pyatv/protocols/mrp/protobuf/Origin.proto +17 -0
  159. package/pyatv/pyatv/protocols/mrp/protobuf/OriginClientPropertiesMessage.proto +11 -0
  160. package/pyatv/pyatv/protocols/mrp/protobuf/OriginClientPropertiesMessage_pb2.pyi +32 -0
  161. package/pyatv/pyatv/protocols/mrp/protobuf/Origin_pb2.pyi +63 -0
  162. package/pyatv/pyatv/protocols/mrp/protobuf/PlaybackQueue.proto +15 -0
  163. package/pyatv/pyatv/protocols/mrp/protobuf/PlaybackQueueCapabilities.proto +7 -0
  164. package/pyatv/pyatv/protocols/mrp/protobuf/PlaybackQueueCapabilities_pb2.pyi +33 -0
  165. package/pyatv/pyatv/protocols/mrp/protobuf/PlaybackQueueContext.proto +5 -0
  166. package/pyatv/pyatv/protocols/mrp/protobuf/PlaybackQueueContext_pb2.pyi +27 -0
  167. package/pyatv/pyatv/protocols/mrp/protobuf/PlaybackQueueRequestMessage.proto +29 -0
  168. package/pyatv/pyatv/protocols/mrp/protobuf/PlaybackQueueRequestMessage_pb2.pyi +87 -0
  169. package/pyatv/pyatv/protocols/mrp/protobuf/PlaybackQueue_pb2.pyi +53 -0
  170. package/pyatv/pyatv/protocols/mrp/protobuf/PlayerClientPropertiesMessage.proto +13 -0
  171. package/pyatv/pyatv/protocols/mrp/protobuf/PlayerClientPropertiesMessage_pb2.pyi +37 -0
  172. package/pyatv/pyatv/protocols/mrp/protobuf/PlayerPath.proto +11 -0
  173. package/pyatv/pyatv/protocols/mrp/protobuf/PlayerPath_pb2.pyi +39 -0
  174. package/pyatv/pyatv/protocols/mrp/protobuf/ProtocolMessage.proto +171 -0
  175. package/pyatv/pyatv/protocols/mrp/protobuf/ProtocolMessage_pb2.pyi +377 -0
  176. package/pyatv/pyatv/protocols/mrp/protobuf/RegisterForGameControllerEventsMessage.proto +18 -0
  177. package/pyatv/pyatv/protocols/mrp/protobuf/RegisterForGameControllerEventsMessage_pb2.pyi +54 -0
  178. package/pyatv/pyatv/protocols/mrp/protobuf/RegisterHIDDeviceMessage.proto +12 -0
  179. package/pyatv/pyatv/protocols/mrp/protobuf/RegisterHIDDeviceMessage_pb2.pyi +34 -0
  180. package/pyatv/pyatv/protocols/mrp/protobuf/RegisterHIDDeviceResultMessage.proto +12 -0
  181. package/pyatv/pyatv/protocols/mrp/protobuf/RegisterHIDDeviceResultMessage_pb2.pyi +35 -0
  182. package/pyatv/pyatv/protocols/mrp/protobuf/RegisterVoiceInputDeviceMessage.proto +12 -0
  183. package/pyatv/pyatv/protocols/mrp/protobuf/RegisterVoiceInputDeviceMessage_pb2.pyi +34 -0
  184. package/pyatv/pyatv/protocols/mrp/protobuf/RegisterVoiceInputDeviceResponseMessage.proto +12 -0
  185. package/pyatv/pyatv/protocols/mrp/protobuf/RegisterVoiceInputDeviceResponseMessage_pb2.pyi +35 -0
  186. package/pyatv/pyatv/protocols/mrp/protobuf/RemoteTextInputMessage.proto +13 -0
  187. package/pyatv/pyatv/protocols/mrp/protobuf/RemoteTextInputMessage_pb2.pyi +38 -0
  188. package/pyatv/pyatv/protocols/mrp/protobuf/RemoveClientMessage.proto +12 -0
  189. package/pyatv/pyatv/protocols/mrp/protobuf/RemoveClientMessage_pb2.pyi +34 -0
  190. package/pyatv/pyatv/protocols/mrp/protobuf/RemoveEndpointsMessage.proto +11 -0
  191. package/pyatv/pyatv/protocols/mrp/protobuf/RemoveEndpointsMessage_pb2.pyi +34 -0
  192. package/pyatv/pyatv/protocols/mrp/protobuf/RemoveOutputDevicesMessage.proto +12 -0
  193. package/pyatv/pyatv/protocols/mrp/protobuf/RemoveOutputDevicesMessage_pb2.pyi +38 -0
  194. package/pyatv/pyatv/protocols/mrp/protobuf/RemovePlayerMessage.proto +12 -0
  195. package/pyatv/pyatv/protocols/mrp/protobuf/RemovePlayerMessage_pb2.pyi +34 -0
  196. package/pyatv/pyatv/protocols/mrp/protobuf/SendButtonEventMessage.proto +13 -0
  197. package/pyatv/pyatv/protocols/mrp/protobuf/SendButtonEventMessage_pb2.pyi +38 -0
  198. package/pyatv/pyatv/protocols/mrp/protobuf/SendCommandMessage.proto +16 -0
  199. package/pyatv/pyatv/protocols/mrp/protobuf/SendCommandMessage_pb2.pyi +43 -0
  200. package/pyatv/pyatv/protocols/mrp/protobuf/SendCommandResultMessage.proto +100 -0
  201. package/pyatv/pyatv/protocols/mrp/protobuf/SendCommandResultMessage_pb2.pyi +286 -0
  202. package/pyatv/pyatv/protocols/mrp/protobuf/SendHIDEventMessage.proto +41 -0
  203. package/pyatv/pyatv/protocols/mrp/protobuf/SendHIDEventMessage_pb2.pyi +63 -0
  204. package/pyatv/pyatv/protocols/mrp/protobuf/SendPackedVirtualTouchEventMessage.proto +24 -0
  205. package/pyatv/pyatv/protocols/mrp/protobuf/SendPackedVirtualTouchEventMessage_pb2.pyi +64 -0
  206. package/pyatv/pyatv/protocols/mrp/protobuf/SendVoiceInputMessage.proto +38 -0
  207. package/pyatv/pyatv/protocols/mrp/protobuf/SendVoiceInputMessage_pb2.pyi +134 -0
  208. package/pyatv/pyatv/protocols/mrp/protobuf/SetArtworkMessage.proto +11 -0
  209. package/pyatv/pyatv/protocols/mrp/protobuf/SetArtworkMessage_pb2.pyi +32 -0
  210. package/pyatv/pyatv/protocols/mrp/protobuf/SetConnectionStateMessage.proto +18 -0
  211. package/pyatv/pyatv/protocols/mrp/protobuf/SetConnectionStateMessage_pb2.pyi +54 -0
  212. package/pyatv/pyatv/protocols/mrp/protobuf/SetDefaultSupportedCommandsMessage.proto +28 -0
  213. package/pyatv/pyatv/protocols/mrp/protobuf/SetDefaultSupportedCommandsMessage_pb2.pyi +74 -0
  214. package/pyatv/pyatv/protocols/mrp/protobuf/SetDiscoveryModeMessage.proto +12 -0
  215. package/pyatv/pyatv/protocols/mrp/protobuf/SetDiscoveryModeMessage_pb2.pyi +35 -0
  216. package/pyatv/pyatv/protocols/mrp/protobuf/SetHiliteModeMessage.proto +11 -0
  217. package/pyatv/pyatv/protocols/mrp/protobuf/SetHiliteModeMessage_pb2.pyi +32 -0
  218. package/pyatv/pyatv/protocols/mrp/protobuf/SetNowPlayingClientMessage.proto +12 -0
  219. package/pyatv/pyatv/protocols/mrp/protobuf/SetNowPlayingClientMessage_pb2.pyi +34 -0
  220. package/pyatv/pyatv/protocols/mrp/protobuf/SetNowPlayingPlayerMessage.proto +12 -0
  221. package/pyatv/pyatv/protocols/mrp/protobuf/SetNowPlayingPlayerMessage_pb2.pyi +34 -0
  222. package/pyatv/pyatv/protocols/mrp/protobuf/SetRecordingStateMessage.proto +17 -0
  223. package/pyatv/pyatv/protocols/mrp/protobuf/SetRecordingStateMessage_pb2.pyi +54 -0
  224. package/pyatv/pyatv/protocols/mrp/protobuf/SetStateMessage.proto +27 -0
  225. package/pyatv/pyatv/protocols/mrp/protobuf/SetStateMessage_pb2.pyi +72 -0
  226. package/pyatv/pyatv/protocols/mrp/protobuf/SetVolumeMessage.proto +12 -0
  227. package/pyatv/pyatv/protocols/mrp/protobuf/SetVolumeMessage_pb2.pyi +35 -0
  228. package/pyatv/pyatv/protocols/mrp/protobuf/SupportedCommands.proto +7 -0
  229. package/pyatv/pyatv/protocols/mrp/protobuf/SupportedCommands_pb2.pyi +30 -0
  230. package/pyatv/pyatv/protocols/mrp/protobuf/TextInputMessage.proto +23 -0
  231. package/pyatv/pyatv/protocols/mrp/protobuf/TextInputMessage_pb2.pyi +76 -0
  232. package/pyatv/pyatv/protocols/mrp/protobuf/TransactionKey.proto +6 -0
  233. package/pyatv/pyatv/protocols/mrp/protobuf/TransactionKey_pb2.pyi +30 -0
  234. package/pyatv/pyatv/protocols/mrp/protobuf/TransactionMessage.proto +15 -0
  235. package/pyatv/pyatv/protocols/mrp/protobuf/TransactionMessage_pb2.pyi +42 -0
  236. package/pyatv/pyatv/protocols/mrp/protobuf/TransactionPacket.proto +11 -0
  237. package/pyatv/pyatv/protocols/mrp/protobuf/TransactionPacket_pb2.pyi +41 -0
  238. package/pyatv/pyatv/protocols/mrp/protobuf/TransactionPackets.proto +7 -0
  239. package/pyatv/pyatv/protocols/mrp/protobuf/TransactionPackets_pb2.pyi +30 -0
  240. package/pyatv/pyatv/protocols/mrp/protobuf/UpdateClientMessage.proto +12 -0
  241. package/pyatv/pyatv/protocols/mrp/protobuf/UpdateClientMessage_pb2.pyi +34 -0
  242. package/pyatv/pyatv/protocols/mrp/protobuf/UpdateContentItemArtworkMessage.proto +14 -0
  243. package/pyatv/pyatv/protocols/mrp/protobuf/UpdateContentItemArtworkMessage_pb2.pyi +41 -0
  244. package/pyatv/pyatv/protocols/mrp/protobuf/UpdateContentItemMessage.proto +14 -0
  245. package/pyatv/pyatv/protocols/mrp/protobuf/UpdateContentItemMessage_pb2.pyi +41 -0
  246. package/pyatv/pyatv/protocols/mrp/protobuf/UpdateEndPointsMessage.proto +25 -0
  247. package/pyatv/pyatv/protocols/mrp/protobuf/UpdateEndPointsMessage_pb2.pyi +74 -0
  248. package/pyatv/pyatv/protocols/mrp/protobuf/UpdateOutputDeviceMessage.proto +88 -0
  249. package/pyatv/pyatv/protocols/mrp/protobuf/UpdateOutputDeviceMessage_pb2.pyi +277 -0
  250. package/pyatv/pyatv/protocols/mrp/protobuf/UpdatePlayerPath.proto +12 -0
  251. package/pyatv/pyatv/protocols/mrp/protobuf/UpdatePlayerPath_pb2.pyi +34 -0
  252. package/pyatv/pyatv/protocols/mrp/protobuf/VirtualTouchDeviceDescriptorMessage.proto +8 -0
  253. package/pyatv/pyatv/protocols/mrp/protobuf/VirtualTouchDeviceDescriptorMessage_pb2.pyi +36 -0
  254. package/pyatv/pyatv/protocols/mrp/protobuf/VoiceInputDeviceDescriptorMessage.proto +8 -0
  255. package/pyatv/pyatv/protocols/mrp/protobuf/VoiceInputDeviceDescriptorMessage_pb2.pyi +35 -0
  256. package/pyatv/pyatv/protocols/mrp/protobuf/VolumeControlAvailabilityMessage.proto +23 -0
  257. package/pyatv/pyatv/protocols/mrp/protobuf/VolumeControlAvailabilityMessage_pb2.pyi +71 -0
  258. package/pyatv/pyatv/protocols/mrp/protobuf/VolumeControlCapabilitiesDidChangeMessage.proto +14 -0
  259. package/pyatv/pyatv/protocols/mrp/protobuf/VolumeControlCapabilitiesDidChangeMessage_pb2.pyi +40 -0
  260. package/pyatv/pyatv/protocols/mrp/protobuf/VolumeDidChangeMessage.proto +13 -0
  261. package/pyatv/pyatv/protocols/mrp/protobuf/VolumeDidChangeMessage_pb2.pyi +38 -0
  262. package/pyatv/pyatv/protocols/mrp/protobuf/WakeDeviceMessage.proto +11 -0
  263. package/pyatv/pyatv/protocols/mrp/protobuf/WakeDeviceMessage_pb2.pyi +26 -0
  264. package/pyatv/pyatv/py.typed +0 -0
  265. package/pyatv/pylintrc +49 -0
  266. package/pyatv/pyproject.toml +74 -0
  267. package/pyatv/requirements/requirements.txt +14 -0
  268. package/pyatv/requirements/requirements_docs.txt +2 -0
  269. package/pyatv/requirements/requirements_test.txt +20 -0
  270. package/pyatv/scripts/build_docs.sh +17 -0
  271. package/pyatv/scripts/setup_dev_env.sh +83 -0
  272. package/pyatv/setup.cfg +14 -0
  273. package/pyatv/tests/data/README +23 -0
  274. package/pyatv/tests/data/audio_10_frames.wav +0 -0
  275. package/pyatv/tests/data/audio_1_packet_metadata.wav +0 -0
  276. package/pyatv/tests/data/audio_3_packets.wav +0 -0
  277. package/pyatv/tests/data/only_metadata.wav +0 -0
  278. package/pyatv/tests/data/only_title.wav +0 -0
  279. package/pyatv/tests/data/static_3sec.ogg +0 -0
  280. package/pyatv/tests/data/testfile.txt +1 -0
  281. package/pyatv/tests/support/pyatv.code-workspace +14 -0
  282. package/src/index.ts +122 -8
  283. package/src/mdns.ts +64 -11
@@ -0,0 +1,574 @@
1
+ ---
2
+ layout: template
3
+ title: Tools
4
+ permalink: /internals/tools
5
+ link_group: internals
6
+ ---
7
+ # :hammer: Table of Contents
8
+ {:.no_toc}
9
+ * TOC
10
+ {:toc}
11
+
12
+ # Tools
13
+
14
+ A few tools are shipped with pyatv that are only used internally or serving as help during
15
+ development. This page gives a brief introduction to them.
16
+
17
+ # chickn
18
+
19
+ Historically pyatv has always used [tox](https://tox.wiki/) as an automation tool to run tests, linters and
20
+ so on. It is a great piece of software but has proven to be a bit slow and complex for the use case of
21
+ pyatv. From this, a tool named `chickn` emerged (yes, [Not invented here](https://en.wikipedia.org/wiki/Not_invented_here)).
22
+ This was seen as an opportunity to learn more about simple command automation and has no goal whatsoever
23
+ to compete with `tox`. At this point `chickn` is only distributed with pyatv, but will hopefully move to
24
+ a separate project at some point.
25
+
26
+ ## The idea behind chickn
27
+
28
+ The idea behind `chickn` is very simple: allow shell commands to be run in sequence and parallel according
29
+ to a specification. The specification in this case is a `chickn.yml` file. Commands to be run are added as
30
+ steps inside a stage, which forms a pipeline. Stages are run sequentially and steps within a stage are run
31
+ in parallel.
32
+
33
+ For the sake of simplicity, only one pipeline is supported per file. There is no concept of tool versions
34
+ in `chickn` either, like which python version to use. It is up to the runner to make sure the expected
35
+ version is available, which is the normal case when running in a container (the way `chickn` is intended
36
+ to run).
37
+
38
+ ### Pipeline, stages and steps
39
+
40
+ Here's a simple example:
41
+
42
+ ```yaml
43
+ pipeline:
44
+ stage1:
45
+ - name: foobar
46
+ run: ls /
47
+ stage2:
48
+ - name: hello
49
+ run: echo helloe
50
+ - name: world
51
+ run: echo world
52
+ ```
53
+
54
+ This pipeline consists of two stages. First, all steps in `stage1` are run in parallel (only "foobar" in this case).
55
+ Once all steps have finished, the next stage is started and all steps within `stage2` are also run in
56
+ parallel. Each step needs a unique name, which can be used to run individual steps from the command line.
57
+
58
+ ### Variables
59
+
60
+ It is possible to define variables as inputs to a command, which can be altered from the command line. Here
61
+ is a simple example of using a variable
62
+
63
+ ```yaml
64
+ variables:
65
+ args: -k foobar
66
+
67
+ pipeline:
68
+ test:
69
+ - name: pytest
70
+ run: pytest {args}
71
+ ```
72
+
73
+ This would run the command `pytest -k foobar`, but the arguments can be easily be changed afterwards. Variables
74
+ cannot depend on other variables (they will not be resolved).
75
+
76
+ It is possible to specify variables as lists:
77
+
78
+ ```yaml
79
+ variables:
80
+ args:
81
+ - -k
82
+ - foobar
83
+
84
+ pipeline:
85
+ test:
86
+ - name: pytest
87
+ run: pytest {args}
88
+ ```
89
+
90
+ Internally, `chickn` will join all elements of the list with a space, i.e. `args=-k foobar` before
91
+ inserting the value into a command.
92
+
93
+ #### Special variables
94
+
95
+ These are "special" variables that are automatically set by `chickn`:
96
+
97
+ | Variable | Value |
98
+ | -------- | ----- |
99
+ | python_executable | Absolute path to python binary that runs `chickn`, e.g. */workspace/pyatv/bin/python*. |
100
+
101
+ ### Requirements
102
+
103
+ There is builtin support for installing python packages with pip (this is the only python specific feature
104
+ of `chickn`) like this:
105
+
106
+ ```yaml
107
+ # chickn.yml
108
+ dependencies:
109
+ files:
110
+ - requirements.txt
111
+
112
+ pipeline:
113
+ pre:
114
+ - name: clean
115
+ run: coverage erase
116
+
117
+ # requirements.txt
118
+ coverage==6.0.2
119
+ ```
120
+
121
+ It is not possible to specify individual packages, only requirement files containing packages. Installed
122
+ packages will be compared with expected versions and re-installed when needed. This speeds up installation
123
+ dramatically, but is also considered "optimistic" (if a package is installed but broken, that will not be
124
+ discovered). It's a tradeoff for speed.
125
+
126
+ *It is assumed that package versions are pinned to a specific version!*
127
+
128
+ ### Tags
129
+
130
+ Tags can be added to a step, making it possible to enable it when needed on the command line. A step
131
+ marked with at least one tag will never run unless one of its tags are provided on the command line!
132
+ This can be useful for steps that are not generally run during development, like packaging, but needed
133
+ during delivery or in CI.
134
+
135
+ ```yaml
136
+ pipeline:
137
+ stages:
138
+ - name: hello
139
+ run: echo helloe
140
+ tags: [test, dummy]
141
+ - name: world
142
+ run: echo world
143
+ ```
144
+
145
+ ## Using chickn
146
+
147
+ Currently, `chickn` lives in `scripts/chickn.py` and requires pyyaml to run (as it uses YAML as
148
+ configuration format). It must also run in a virtual environment (check can be disabled). To get
149
+ going, this is what you need to do:
150
+
151
+ ```shell
152
+ $ python -m venv venv
153
+ $ source venv/bin/activate # venv/scripts/activate.bat on Windows
154
+ $ pip install pyyaml
155
+ $ ./scripts/chickn.py
156
+ ```
157
+
158
+ This should run `chickn` and give you output similar to this:
159
+
160
+ ```raw
161
+ $ ./scripts/chickn.py
162
+ 2021-10-24 10:36:01 [INFO] Installing dependencies
163
+ 2021-10-24 10:36:02 [INFO] All packages are up-to-date
164
+ 2021-10-24 10:36:02 [INFO] Step install_deps finished in 0.52s
165
+ 2021-10-24 10:36:02 [INFO] Running pre with 1 steps
166
+ 2021-10-24 10:36:02 [INFO] Running step clean
167
+ 2021-10-24 10:36:02 [INFO] Step clean finished in 0.09s
168
+ 2021-10-24 10:36:02 [INFO] Running validate with 10 steps
169
+ 2021-10-24 10:36:02 [INFO] Running step pylint
170
+ 2021-10-24 10:36:02 [INFO] Running step protobuf
171
+ 2021-10-24 10:36:02 [INFO] Running step flake8
172
+ 2021-10-24 10:36:02 [INFO] Running step black
173
+ 2021-10-24 10:36:02 [INFO] Running step pydocstyle
174
+ 2021-10-24 10:36:02 [INFO] Running step isort
175
+ 2021-10-24 10:36:02 [INFO] Running step cs_docs
176
+ 2021-10-24 10:36:02 [INFO] Running step cs_code
177
+ 2021-10-24 10:36:02 [INFO] Running step typing
178
+ 2021-10-24 10:36:02 [INFO] Running step pytest
179
+ 2021-10-24 10:36:03 [INFO] Step protobuf finished in 0.66s
180
+ 2021-10-24 10:36:03 [INFO] Step cs_docs finished in 0.78s
181
+ 2021-10-24 10:36:03 [INFO] Step typing finished in 1.00s
182
+ 2021-10-24 10:36:03 [INFO] Step black finished in 1.10s
183
+ 2021-10-24 10:36:03 [INFO] Step cs_code finished in 1.39s
184
+ 2021-10-24 10:36:05 [INFO] Step isort finished in 2.55s
185
+ 2021-10-24 10:36:10 [INFO] Step flake8 finished in 7.97s
186
+ 2021-10-24 10:36:18 [INFO] Step pydocstyle finished in 15.86s
187
+ 2021-10-24 10:36:35 [INFO] Step pylint finished in 33.01s
188
+ 2021-10-24 10:36:36 [INFO] Step pytest finished in 33.91s
189
+ 2021-10-24 10:36:36 [INFO] Running post with 1 steps
190
+ 2021-10-24 10:36:36 [INFO] Running step report
191
+ 2021-10-24 10:36:41 [INFO] Step report finished in 5.01s
192
+ 2021-10-24 10:36:41 [INFO] Running package with 0 steps
193
+ 2021-10-24 10:36:41 [INFO] Finished in 39.64!
194
+ ```
195
+
196
+ There is very little error handling in `chickn`, so things will break whenever something
197
+ is a little bit off. Improvements will be made over time,
198
+
199
+ ### Running individual steps
200
+
201
+ To run one or more steps, pass their names as arguments:
202
+
203
+ ```raw
204
+ $ ./scripts/chickn.py -- protobuf isort
205
+ 2021-10-24 10:38:09 [INFO] Installing dependencies
206
+ 2021-10-24 10:38:09 [INFO] All packages are up-to-date
207
+ 2021-10-24 10:38:09 [INFO] Step install_deps finished in 0.47s
208
+ 2021-10-24 10:38:09 [INFO] Running pre with 0 steps
209
+ 2021-10-24 10:38:09 [INFO] Running validate with 2 steps
210
+ 2021-10-24 10:38:09 [INFO] Running step protobuf
211
+ 2021-10-24 10:38:09 [INFO] Running step isort
212
+ 2021-10-24 10:38:09 [INFO] Step protobuf finished in 0.19s
213
+ 2021-10-24 10:38:10 [INFO] Step isort finished in 0.65s
214
+ 2021-10-24 10:38:10 [INFO] Running post with 0 steps
215
+ 2021-10-24 10:38:10 [INFO] Running package with 0 steps
216
+ 2021-10-24 10:38:10 [INFO] Finished in 1.13!
217
+ ```
218
+
219
+ Make it a custom to use `--` as you might run into problems when using tags or variables
220
+ otherwise.
221
+
222
+ ### Overriding variables
223
+
224
+ One or more variables can be overridden like this:
225
+
226
+ ```raw
227
+ $ ./scripts/chickn.py -v myvar=123 -v another_var=456 -- protobuf isort
228
+ ```
229
+
230
+ ### Failing steps
231
+
232
+ If a step fails, all currently running steps will be cancelled while printing out stderr and
233
+ stdout of the failing step:
234
+
235
+ ```raw
236
+ $ ./scripts/chickn.py -t fixup
237
+ 2021-10-24 11:23:12 [INFO] Installing dependencies
238
+ 2021-10-24 11:23:13 [INFO] All packages are up-to-date
239
+ 2021-10-24 11:23:13 [INFO] Step install_deps finished in 1.37s
240
+ 2021-10-24 11:23:13 [INFO] Running pre with 2 steps
241
+ 2021-10-24 11:23:13 [INFO] Running step clean
242
+ 2021-10-24 11:23:13 [INFO] Running step fixup
243
+ 2021-10-24 11:23:13 [INFO] Step clean finished in 0.28s
244
+ 2021-10-24 11:23:17 [INFO] Step fixup finished in 3.96s
245
+ 2021-10-24 11:23:17 [INFO] Running validate with 10 steps
246
+ 2021-10-24 11:23:17 [INFO] Running step pylint
247
+ 2021-10-24 11:23:17 [INFO] Running step protobuf
248
+ 2021-10-24 11:23:17 [INFO] Running step flake8
249
+ 2021-10-24 11:23:17 [INFO] Running step black
250
+ 2021-10-24 11:23:17 [INFO] Running step pydocstyle
251
+ 2021-10-24 11:23:17 [INFO] Running step isort
252
+ 2021-10-24 11:23:17 [INFO] Running step cs_docs
253
+ 2021-10-24 11:23:17 [INFO] Running step cs_code
254
+ 2021-10-24 11:23:17 [INFO] Running step typing
255
+ 2021-10-24 11:23:17 [INFO] Running step pytest
256
+ 2021-10-24 11:23:18 [INFO] Step protobuf finished in 0.88s
257
+ 2021-10-24 11:23:18 [INFO] Step cs_docs finished in 1.21s
258
+ 2021-10-24 11:23:18 [INFO] Step black finished in 1.41s
259
+ 2021-10-24 11:23:19 [INFO] Step cs_code finished in 1.88s
260
+ 2021-10-24 11:23:20 [INFO] Step isort finished in 3.43s
261
+ 2021-10-24 11:23:21 [INFO] Step typing finished in 4.20s
262
+ 2021-10-24 11:23:27 [ERROR] At least one task failed
263
+ 2021-10-24 11:23:27 [ERROR] Task 'flake8' failed (InternalError): Command failed: flake8 --exclude=pyatv/protocols/mrp/protobuf pyatv scripts examples
264
+ [STDOUT]
265
+ pyatv/scripts/atvremote.py:355:5: F841 local variable 'test' is assigned to but never used
266
+
267
+
268
+ [STDERR]
269
+ None
270
+ 2021-10-24 11:23:27 [ERROR] Tasks failed: flake8
271
+ ```
272
+
273
+ ### Specifying tags
274
+
275
+ One or more tags can be set like this:
276
+
277
+ ```raw
278
+ $ ./scripts/chickn.py -t tag1 -t tag2 -- all
279
+ ```
280
+
281
+ ### Some other things
282
+
283
+ A few other useful things:
284
+
285
+ * Do not install any packages: `--no-install` (or `-n`)
286
+ * Force re-install of packages even if versions match: `--force-pip` (or `-f`)
287
+ * Allow running without venv: `--no-venv`
288
+ * List all avavilable steps: `--list` (or `-l`)
289
+
290
+ # Protobuf
291
+
292
+ This section describes how to work with [Google Protobuf](https://developers.google.com/protocol-buffers/) in pyatv. Protobuf is used by the `MRP` protocol only.
293
+
294
+ ## Definitions
295
+
296
+ All Protobuf definitions (`.proto` files) are located in `pyatv/mrp/protobuf`. Currently the generated files, including mypy hints (`.pyi`files) are checked in to the repository. Preferably only the `.proto` files should be checked in and in the future this might be the case.
297
+
298
+ ### Wrapper Code
299
+
300
+ To simplify working with Protobuf messages in code, an auto-generated wrapper is used. This wrapper is generated by `scripts/protobuf.py` and provides some convenience:
301
+
302
+ * Message constants are available at top level (`CLIENT_UPDATES_CONFIG_MESSAGE` vs `ProtocolMessage.CLIENT_UPDATES_CONFIG_MESSAGE`)
303
+ * Messages are more easily available (`SetArtworkMessage` vs `SetArtworkMessage_pb2.SetArtworkMessage`)
304
+ * Calling `inner()` will return the encapsulated message from a `ProtocolMessage`
305
+
306
+ The file is checked into the repository and located here:
307
+ {% include code file="mrp/protobuf/__init__.py" %}. See [Making Changes](#making-changes)
308
+ on how to generate this file.
309
+
310
+ You shall *not* modify this file manually. Instead modify the `.proto` files and re-generate
311
+ the wrapper code. If something is missing or wrong in the wrapper code, make changes
312
+ to `protobuf.py` instead.
313
+
314
+ ### Making Changes
315
+
316
+ If you add new `.proto` files or modify existing files, you need to re-generate the message files. This is done with `scripts/protobuf.py`:
317
+
318
+ ```shell
319
+ $ ./scripts/protobuf.py --download generate
320
+ Downloading https://github.com/protocolbuffers/protobuf/...
321
+ Extracting bin/protoc
322
+ Writing mypy to pyatv/mrp/protobuf/PlaybackQueueCapabilities_pb2.pyi
323
+ Writing mypy to pyatv/mrp/protobuf/DeviceInfoMessage_pb2.pyi
324
+ ...
325
+ ```
326
+ See [Protobuf Compiler](#protobuf-compiler) for more details.
327
+
328
+ ### Verifying Changes
329
+
330
+ It is possible to verify if current messages are up-to-date using `verify`:
331
+
332
+ ```shell
333
+ $ ./scripts/protobuf.py --download verify
334
+ Not downloading protoc (already exists)
335
+ Generated code is up-to-date!
336
+ ```
337
+
338
+ Running `./scripts/chickn.py protobuf` will ensure that this file is up-to-date. It is always run when checking in code.
339
+
340
+ See [Protobuf Compiler](#the-protobuf-compiler) for more details.
341
+
342
+ *NB: This only verifies that the wrapper code is up-to-date at the moment.*
343
+
344
+ ### Protobuf Compiler
345
+
346
+ A specific version of the protobuf compiler is used to generate the message to make sure they are always generated in the same way (version is hardcoded into `protobuf.by` and may be bumped when needed).
347
+
348
+ The flag `--download` will download and extract `protoc` into the `bin` directory. This works for Linux (x86_64), macOS and Windows (x64). If the file is already downloaded, `--download` does nothing.
349
+
350
+ `protobuf.py` will verify that the downloaded version matches the version hardcoded into the script before generating messages. If there is a mismatch, just add `--force` to make the script re-download the compiler again.
351
+
352
+
353
+ # Fake Device
354
+
355
+ A fake device is used in the functional tests to verify that pyatv works as expected. It is however convenient to have a fake device that you can interact with using `atvremote`. The script `scripts/fake_device.py` is supposed to fill this gap until proper support is built into pyatv (see [#334](https://github.com/postlund/pyatv/issues/334) and [#518](https://github.com/postlund/pyatv/issues/518)).
356
+
357
+ *Beware that command line flags and options might change at any time due to new features. This script is only meant as development aid.*
358
+
359
+ ## Features
360
+
361
+ This is the current feature set:
362
+
363
+ * All protocols are supported - amount of functionality varies
364
+ * Protocols are found when scanning, e.g. supports Zeroconf
365
+ * Device reports idle state (nothing playing) by default
366
+ * Commands sent to it are mostly just logged to console
367
+ * A "demo" mode is included, which cycles between example video, example music and nothing playing every three seconds
368
+
369
+ No attempts have been made to integrate this with the real Remote app in iOS, which means that it probably doesn't work. At least basic support for this would be nice.
370
+
371
+ **Feel free to improve this script and the protocols implemented by fake device!**
372
+
373
+ ## Example Usage
374
+
375
+ By default, the device will broadcast `127.0.0.1` as IP address in Zeroconf, so it is only usable on localhost. You can change this with `--local-ip`. It is also possible to enable debug logs with `--debug`. No protocol is selected by default, so you need to specify at least one for the script to run (but you may specify as many as you like). Valid flags are `--mrp`, `--mrp` and `--airplay`.
376
+
377
+ ### Single Protocol
378
+
379
+ Start an `MRP` fake device:
380
+
381
+ ```shell
382
+ $ ./scripts/fake_device.py --mrp
383
+ Press ENTER to quit
384
+ ```
385
+
386
+ Run `atvremote` from another terminal:
387
+
388
+ ```shell
389
+ $ atvremote scan
390
+ Scan Results
391
+ ========================================
392
+ Name: FakeATV
393
+ Model/SW: Unknown Model tvOS 13.x build 17K499
394
+ Address: 127.0.0.1
395
+ MAC: 40:CB:C0:12:34:56
396
+ Identifiers:
397
+ - 6D797FD3-3538-427E-A47B-A32FC6CF3A69
398
+ Services:
399
+ - Protocol: MRP, Port: 32781, Credentials: None
400
+
401
+ $ atvremote -n FakeATV playing
402
+ Media type: Unknown
403
+ Device state: Idle
404
+ Repeat: Off
405
+ Shuffle: Off
406
+
407
+ $ atvremote -n FakeATV --protocol mrp pair
408
+ Enter PIN on screen: 1111
409
+ Pairing seems to have succeeded, yey!
410
+ You may now use these credentials: e734ea6c2b6257de7...
411
+ ```
412
+
413
+ ### Multiple Protocols
414
+
415
+ It is possible to use multiple protocols:
416
+
417
+ ```shell
418
+ $ ./scripts/fake_device.py --mrp --dmap --airplay
419
+ Press ENTER to quit
420
+ ```
421
+
422
+ And then scan for them:
423
+
424
+ ```shell
425
+ $ atvremote scan
426
+ Scan Results
427
+ ========================================
428
+ Name: FakeATV
429
+ Model/SW: 3 tvOS 13.x build 17K499
430
+ Address: 127.0.0.1
431
+ MAC: 40:CB:C0:12:34:56
432
+ Identifiers:
433
+ - fakedev
434
+ - 6D797FD3-3538-427E-A47B-A32FC6CF3A69
435
+ - 00:01:02:03:04:05
436
+ Services:
437
+ - Protocol: DMAP, Port: 40747, Credentials: 12345678-6789-1111-2222-012345678911
438
+ - Protocol: MRP, Port: 40521, Credentials: None
439
+ - Protocol: AirPlay, Port: 54472, Credentials: None
440
+ ```
441
+
442
+ To interact with a particular protocol:
443
+
444
+ ```shell
445
+ $ atvremote --id fakedev --protocol dmap playing
446
+ Media type: Unknown
447
+ Device state: Idle
448
+ Repeat: Off
449
+ Shuffle: Off
450
+ ```
451
+
452
+ ### Demo Mode
453
+
454
+ There is a "demo mode" that changes between various things that are playing that can be enabled with `--demo`:
455
+
456
+ ```shell
457
+ $ atvremote -n FakeATV playing
458
+ Media type: Music
459
+ Device state: Paused
460
+ Title: music
461
+ Artist: artist
462
+ Album: album
463
+ Genre: genre
464
+ Position: 22/49s (44.9%)
465
+ Repeat: Off
466
+ Shuffle: Off
467
+
468
+ $ atvremote -n FakeATV playing
469
+ Media type: Unknown
470
+ Device state: Idle
471
+ Repeat: Off
472
+ Shuffle: Off
473
+ ```
474
+
475
+ ### Push Updates
476
+
477
+ Only `MRP` supports push update (`DMAP` get stuck in a loop):
478
+
479
+ ```shell
480
+ $ atvremote -n FakeATV push_updates
481
+ Press ENTER to stop
482
+ Media type: Unknown
483
+ Device state: Idle
484
+ Repeat: Off
485
+ Shuffle: Off
486
+ --------------------
487
+ Media type: Video
488
+ Device state: Paused
489
+ Title: dummy
490
+ Position: 3/123s (2.4%)
491
+ Repeat: Off
492
+ Shuffle: Off
493
+ --------------------
494
+ Media type: Music
495
+ Device state: Paused
496
+ Title: music
497
+ Artist: artist
498
+ Album: album
499
+ Genre: genre
500
+ Position: 22/49s (44.9%)
501
+ Repeat: Off
502
+ Shuffle: Off
503
+ --------------------
504
+ Media type: Unknown
505
+ Device state: Idle
506
+ Repeat: Off
507
+ Shuffle: Off
508
+ --------------------
509
+ ```
510
+
511
+ ### Play Media with AirPlay
512
+
513
+ There is very limited support for `AirPlay`. It is possible to "play" something, but it is just reported as "finished playing", so nothing really happens. But it is possible to call `play_url`:
514
+
515
+ ```shell
516
+ $ atvremote --id fakedev --airplay-credentials 75FBEEC773CFC563:8F06696F2542D70DF59286C761695C485F815BE3D152849E1361282D46AB1493 play_url=http://test
517
+ ```
518
+
519
+ ## Pairing
520
+
521
+ Some level of support for pairing is supported. Each section describes the limitations.
522
+
523
+ ### MRP
524
+
525
+ More or less full support for pairing is supported. Credentials and PIN code are however hardcoded, so the process will always look the same:
526
+
527
+ ```shell
528
+ $ atvremote --id fakedev --protocol mrp pair
529
+ Enter PIN on screen: 1111
530
+ Pairing seems to have succeeded, yey!
531
+ You may now use these credentials: e734ea6c2b6257de72355e472aa05a4c487e6b463c029ed306df2f01b5636b58:b7e8e084ca1a31dee7dd5fd0ddb1c4cacdc99f5aa0b27f178ecc34bd369c7ad2:35443739374644332d333533382d343237452d413437422d413332464336434633413639:62386265346261642d393338662d343765652d613735632d346238396666393134626430
532
+
533
+ $ atvremote --id fakedev --protocol mrp --mrp-credentials e734ea6c2b6257de72355e472aa05a4c487e6b463c029ed306df2f01b5636b58:b7e8e084ca1a31dee7dd5fd0ddb1c4cacdc99f5aa0b27f178ecc34bd369c7ad2:35443739374644332d333533382d343237452d413437422d413332464336434633413639:62386265346261642d393338662d343765652d613735632d346238396666393134626430 playing
534
+ Media type: Unknown
535
+ Device state: Idle
536
+ Repeat: Off
537
+ Shuffle: Off
538
+ ```
539
+
540
+ ### DMAP
541
+
542
+ It is possible to initiate the pairing process with `DMAP`, but since verification is usually done on the Apple TV (PIN code is entered on the Apple TV), it is not possible to finish it. Should be easy to fix.
543
+
544
+ ### AirPlay
545
+
546
+ Pairing is supported, but only with a specific set of credentials. This is because `AirPlay` lacks generic pairing support and just use a static pairing sequence. But it can be done like this:
547
+
548
+ ```shell
549
+ $ atvremote --id fakedev --airplay-credentials 75FBEEC773CFC563:8F06696F2542D70DF59286C761695C485F815BE3D152849E1361282D46AB1493 --protocol airplay pair
550
+ Enter PIN on screen: 2271
551
+ Pairing seems to have succeeded, yey!
552
+ You may now use these credentials: 75FBEEC773CFC563:8F06696F2542D70DF59286C761695C485F815BE3D152849E1361282D46AB1493
553
+ ```
554
+
555
+ ### RAOP
556
+
557
+ Streaming files and most other feature should work to some extent. Encryption is not supported.
558
+
559
+ ## State Support
560
+
561
+ Partial support for maintaining device state is implemented, but not for everything. Here is a simple example:
562
+
563
+ ```shell
564
+ $ atvremote -n FakeMRP power_state
565
+ PowerState.On
566
+ $ atvremote -n FakeMRP turn_off
567
+ $ atvremote -n FakeMRP power_state
568
+ PowerState.Off
569
+ $ atvremote -n FakeMRP turn_on
570
+ $ atvremote -n FakeMRP power_state
571
+ PowerState.On
572
+ ```
573
+
574
+ What is currently playing is currently configured per protocol but should be consolidated in the future (the same thing should be configured once and reported the same over all protocols).
@@ -0,0 +1,46 @@
1
+ <%!
2
+ # Template configuration. Copy over in your template directory
3
+ # (used with --template-dir) and adapt as required.
4
+ html_lang = 'en'
5
+ show_inherited_members = False
6
+ extract_module_toc_into_sidebar = True
7
+ list_class_variables_in_index = True
8
+ sort_identifiers = True
9
+ show_type_annotations = True
10
+
11
+ # Show collapsed source code block next to each item.
12
+ # Disabling this can improve rendering speed of large modules.
13
+ show_source_code = False
14
+
15
+ # If set, format links to objects in online source code repository
16
+ # according to this template. Supported keywords for interpolation
17
+ # are: commit, path, start_line, end_line.
18
+ git_link_template = 'https://github.com/postlund/pyatv/blob/master/{path}#L{start_line}-L{end_line}'
19
+ #git_link_template = 'https://gitlab.com/USER/PROJECT/blob/{commit}/{path}#L{start_line}-L{end_line}'
20
+ #git_link_template = 'https://bitbucket.org/USER/PROJECT/src/{commit}/{path}#lines-{start_line}:{end_line}'
21
+ #git_link_template = 'https://CGIT_HOSTNAME/PROJECT/tree/{path}?id={commit}#n{start-line}'
22
+ #git_link_template = None
23
+
24
+ # A prefix to use for every HTML hyperlink in the generated documentation.
25
+ # No prefix results in all links being relative.
26
+ link_prefix = ''
27
+
28
+ # Enable syntax highlighting for code/source blocks by including Highlight.js
29
+ syntax_highlighting = True
30
+
31
+ # Set the style keyword such as 'atom-one-light' or 'github-gist'
32
+ # Options: https://github.com/highlightjs/highlight.js/tree/master/src/styles
33
+ # Demo: https://highlightjs.org/static/demo/
34
+ hljs_style = 'github'
35
+
36
+ # If set, insert Google Analytics tracking code. Value is GA
37
+ # tracking id (UA-XXXXXX-Y).
38
+ google_analytics = ''
39
+
40
+ # If set, render LaTeX math syntax within \(...\) (inline equations),
41
+ # or within \[...\] or $$...$$ or `.. math::` (block equations)
42
+ # as nicely-formatted math formulas using MathJax.
43
+ # Note: in Python docstrings, either all backslashes need to be escaped (\\)
44
+ # or you need to use raw r-strings.
45
+ latex_math = False
46
+ %>