api.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # api.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro).
  2. # This copyright was auto-generated on Tue Sep 7 21:35:52 UTC 2021
  3. """Implementation of Open GoPro API version 2.0"""
  4. from __future__ import annotations
  5. from typing import Final
  6. from open_gopro.domain.communicator_interface import GoProHttp, GoProWirelessInterface
  7. from .ble_commands import BleAsyncResponses, BleCommands
  8. from .ble_settings import BleSettings
  9. from .ble_statuses import BleStatuses
  10. from .http_commands import HttpCommands
  11. from .http_settings import HttpSettings
  12. class WirelessApi:
  13. """Implementation of Open GoPro API version 2.0 for Wireless interface (Wifi and BLE)
  14. Attributes:
  15. version (Final[str]): The API version that this object implements
  16. Args:
  17. communicator (GoProWirelessInterface): used to communicate via BLE and Wifi
  18. """
  19. version: Final[str] = "2.0"
  20. def __init__(self, communicator: GoProWirelessInterface) -> None:
  21. self._communicator = communicator
  22. self.ble_command = BleCommands(communicator)
  23. self.ble_setting = BleSettings(communicator)
  24. self.ble_status = BleStatuses(communicator)
  25. BleAsyncResponses.add_parsers()
  26. self.http_command = HttpCommands(communicator)
  27. self.http_setting = HttpSettings(communicator)
  28. class WiredApi:
  29. """Implementation of Open GoPro API version 2.0 for Wired interface (USB)
  30. Attributes:
  31. version (Final[str]): The API version that this object implements
  32. Args:
  33. communicator (GoProHttp): used to communicate via BLE and Wifi
  34. """
  35. version: Final[str] = "2.0"
  36. def __init__(self, communicator: GoProHttp) -> None:
  37. self._communicator = communicator
  38. self.http_command = HttpCommands(communicator)
  39. self.http_setting = HttpSettings(communicator)