Skip to content

Commit

Permalink
Use aiohttp >= 3.11.0
Browse files Browse the repository at this point in the history
Fix devices not being able to reconnect if using aiohttp 3.11.0 and above
Convert check_device_connection to use gather instead of tasks
Simplify WebSocket timeouts
Add __all__ attribute to __init__.py files
Fix and improve typing
  • Loading branch information
mj23000 committed Dec 10, 2024
1 parent 3160e11 commit bd93129
Show file tree
Hide file tree
Showing 9 changed files with 506 additions and 49 deletions.
2 changes: 1 addition & 1 deletion docs/mozart-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5520,7 +5520,7 @@ info:
- [Beosound Level](https://www.bang-olufsen.com/en/dk/speakers/beosound-level)\n\
- [Beosound Theatre](https://www.bang-olufsen.com/en/dk/soundbars/beosound-theatre)\n\
\n\nThis API documentation has been generated for version 4.1.1.116 of the\
\ Mozart platform and API generation version 4.1.1.116.3.\n\n## Python API\n\
\ Mozart platform and API generation version 4.1.1.116.4.\n\n## Python API\n\
\nThe Python package has been generated using the [OpenAPI Generator](https:/openapi-generator.tech/)\
\ version 7.10.0. On top of the generated API, a helper file, mozart_client.py,\
\ has been made that makes the API more pythonic. We recommend using this.\n\
Expand Down
4 changes: 2 additions & 2 deletions python_client/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: mozart_api
Version: 4.1.1.116.3
Version: 4.1.1.116.4
Summary: Mozart platform API
Home-page: https://pypi.org/project/mozart-api/
License: MIT
Expand All @@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Multimedia
Requires-Dist: aenum (>=3.1.11)
Requires-Dist: aioconsole (>=0.4.1)
Requires-Dist: aiohttp (>=3.8.3,<4)
Requires-Dist: aiohttp (>=3.11.0)
Requires-Dist: inflection (>=0.5.1)
Requires-Dist: pydantic (>=1.10)
Requires-Dist: python-dateutil (>=2.8.2)
Expand Down
244 changes: 238 additions & 6 deletions python_client/mozart_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
Do not edit the class manually.
""" # noqa: E501

__version__ = "4.1.1.116.3"
__version__ = "4.1.1.116.4"

# import manually created api client
from mozart_api.mozart_client import (
BaseWebSocketResponse,
MozartClient,
WebSocketEventType,
)
from mozart_api.mozart_client import BaseWebSocketResponse
from mozart_api.mozart_client import MozartClient
from mozart_api.mozart_client import WebSocketEventType

# import apis into sdk package
from mozart_api.api.beolink_api import BeolinkApi
Expand Down Expand Up @@ -316,3 +314,237 @@
from mozart_api.models.web_socket_event_wisa_out_state import WebSocketEventWisaOutState
from mozart_api.models.websocket_notification_tag import WebsocketNotificationTag
from mozart_api.models.wisa_out_state import WisaOutState

__all__ = [
"BaseWebSocketResponse",
"MozartClient",
"WebSocketEventType",
"BeolinkApi",
"BluetoothApi",
"ContentApi",
"DeezerApi",
"OutputApi",
"OverlayApi",
"PlaybackApi",
"PowerApi",
"ProductApi",
"RemoteApi",
"ScenesApi",
"SettingsApi",
"SoftwareUpdateApi",
"SoundApi",
"SpeakerGroupApi",
"StandApi",
"MozartApi",
"ApiResponse",
"ApiClient",
"Configuration",
"OpenApiException",
"ApiTypeError",
"ApiValueError",
"ApiKeyError",
"ApiAttributeError",
"ApiException",
"Action",
"ActionSoundProfile",
"AlarmTimerEventData",
"AlarmTriggeredInfo",
"Ambience",
"AmbienceFeature",
"AmbienceRange",
"Art",
"Balance",
"BalanceFeature",
"BalanceRange",
"Bass",
"BassFeature",
"BassManagement",
"BassManagementFeature",
"BassManagementRange",
"BassRange",
"BatteryState",
"BeoRemoteButton",
"BeoShapeStatus",
"BeoShapeStatusSoundProfile",
"BeolinkAvailableListener",
"BeolinkExperience",
"BeolinkExperiencesResult",
"BeolinkJoinRequest",
"BeolinkJoinResult",
"BeolinkLeader",
"BeolinkListener",
"BeolinkPeer",
"BeolinkSelf",
"BluetoothDevice",
"BluetoothDeviceList",
"ButtonEvent",
"Compression",
"CompressionFeature",
"CompressionRange",
"ContentItem",
"ContentItemWithId",
"Directivity",
"DirectivityFeature",
"DirectivityRange",
"ErrorModel",
"Fader",
"FaderFeature",
"FaderRange",
"HdmiInput",
"HdmiVideoFormat",
"HomeControlIxp",
"HomeControlUri",
"InstallRecordIdState",
"LatencyProfile",
"LgeTvSoundSettings",
"ListeningMode",
"ListeningModeFeatures",
"ListeningModeProps",
"ListeningModeRef",
"ListeningModeTrigger",
"Loudness",
"MicrophoneState",
"MicrophonesState",
"OverlayPlayRequest",
"OverlayPlayRequestCommon",
"OverlayPlayRequestFromUsb",
"OverlayPlayRequestFromUsbFromUsb",
"OverlayPlayRequestTextToSpeech",
"OverlayPlayRequestTextToSpeechTextToSpeech",
"OverlayPlayRequestUri",
"PairedRemote",
"PairedRemoteResponse",
"PlayQueueItem",
"PlayQueueItemType",
"PlayQueueSettings",
"PlaybackContentMetadata",
"PlaybackError",
"PlaybackProgress",
"PlaybackState",
"PowerLinkTrigger",
"PowerStateEnum",
"PowerlinkConnectionStateEnum",
"Preset",
"ProductCurtainStatus",
"ProductFriendlyName",
"ProductState",
"RemoteMenuItem",
"RemoteMenuItemProperties",
"RemoteUIKeyState",
"RenderingState",
"RoomCompensation",
"RoomCompensationCurrentMeasurement",
"RoomCompensationDebug",
"RoomCompensationEnabled",
"RoomCompensationErrorDetails",
"RoomCompensationFeature",
"RoomCompensationInfo",
"RoomCompensationMeasurementError",
"RoomCompensationProperties",
"RoomCompensationRange",
"RoomCompensationResponse",
"RoomCompensationResult",
"RoomCompensationState",
"RoomCompensationStateValue",
"RoomCompensationType",
"RoomCompensationVersion",
"Scene",
"SceneClassification",
"SceneMatch",
"SceneProperties",
"SceneTriggerBaseProperties",
"SoftwareUpdateState",
"SoftwareUpdateStatus",
"SoundAdjustments",
"SoundFeatureSet",
"SoundSettings",
"SoundToneTouch",
"Source",
"SourceArray",
"SourceTypeEnum",
"SpatialEnvelopment",
"SpatialEnvelopmentFeature",
"SpatialEnvelopmentRange",
"SpatialHeight",
"SpatialHeightFeature",
"SpatialHeightRange",
"SpatialProcessing",
"SpatialProcessingFeature",
"SpatialProcessingRange",
"SpatialSurround",
"SpatialSurroundFeature",
"SpatialSurroundRange",
"SpatialWidth",
"SpatialWidthFeature",
"SpatialWidthRange",
"SpeakerGroup",
"SpeakerGroupMember",
"SpeakerGroupMemberLocation",
"SpeakerGroupOverview",
"SpeakerLinkMemberStatus",
"SpeakerLinkStatus",
"SpeakerRoleEnum",
"SpeechEnhance",
"SpeechEnhanceFeature",
"SpeechEnhanceRange",
"StandConnected",
"StandMovement",
"StandPosition",
"ToneTouch",
"ToneTouchType",
"ToneTouchTypeRange",
"ToneTouchXFeature",
"ToneTouchYFeature",
"Treble",
"TrebleFeature",
"TrebleRange",
"TvInfoEventData",
"TvIntegrationTypes",
"TvProperties",
"TvSoundSettings",
"TvState",
"Uri",
"UserFlow",
"VideoPixelFormat",
"VideoTimings",
"VolumeLevel",
"VolumeMute",
"VolumeSettings",
"VolumeState",
"WebSocketEventActiveHdmiInputSignal",
"WebSocketEventActiveListeningMode",
"WebSocketEventActiveSpeakerGroup",
"WebSocketEventAlarmTimer",
"WebSocketEventAlarmTriggered",
"WebSocketEventBattery",
"WebSocketEventBeoRemoteButton",
"WebSocketEventBeolinkExperiencesResult",
"WebSocketEventBeolinkJoinResult",
"WebSocketEventButton",
"WebSocketEventCurtains",
"WebSocketEventHdmiVideoFormatSignal",
"WebSocketEventNotification",
"WebSocketEventPlaybackError",
"WebSocketEventPlaybackMetadata",
"WebSocketEventPlaybackProgress",
"WebSocketEventPlaybackSource",
"WebSocketEventPlaybackState",
"WebSocketEventPowerState",
"WebSocketEventPowerlinkConnectionState",
"WebSocketEventPucInstallRemoteIdStatus",
"WebSocketEventRole",
"WebSocketEventRoomCompensationCurrentMeasurementEvent",
"WebSocketEventRoomCompensationState",
"WebSocketEventSoftwareUpdateState",
"WebSocketEventSoundSettings",
"WebSocketEventSourceChange",
"WebSocketEventSpeakerGroupChanged",
"WebSocketEventSpeakerLinkStatusChanged",
"WebSocketEventStandConnected",
"WebSocketEventStandPosition",
"WebSocketEventTvInfo",
"WebSocketEventVolume",
"WebSocketEventWisaOutState",
"WebsocketNotificationTag",
"WisaOutState",
]
21 changes: 21 additions & 0 deletions python_client/mozart_api/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,24 @@
from mozart_api.api.speaker_group_api import SpeakerGroupApi
from mozart_api.api.stand_api import StandApi
from mozart_api.api.mozart_api import MozartApi


__all__ = [
"BeolinkApi",
"BluetoothApi",
"ContentApi",
"DeezerApi",
"OutputApi",
"OverlayApi",
"PlaybackApi",
"PowerApi",
"ProductApi",
"RemoteApi",
"ScenesApi",
"SettingsApi",
"SoftwareUpdateApi",
"SoundApi",
"SpeakerGroupApi",
"StandApi",
"MozartApi",
]
2 changes: 1 addition & 1 deletion python_client/mozart_api/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = "OpenAPI-Generator/4.1.1.116.3/python"
self.user_agent = "OpenAPI-Generator/4.1.1.116.4/python"
self.client_side_validation = configuration.client_side_validation

async def __aenter__(self):
Expand Down
2 changes: 1 addition & 1 deletion python_client/mozart_api/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def to_debug_report(self):
"OS: {env}\n"
"Python Version: {pyversion}\n"
"Version of the API: 0.2.0\n"
"SDK Package Version: 4.1.1.116.3".format(
"SDK Package Version: 4.1.1.116.4".format(
env=sys.platform, pyversion=sys.version
)
)
Expand Down
Loading

0 comments on commit bd93129

Please sign in to comment.