diff --git a/docs/mozart-api.yaml b/docs/mozart-api.yaml index 7fb8c2b..383ddfc 100644 --- a/docs/mozart-api.yaml +++ b/docs/mozart-api.yaml @@ -186,6 +186,21 @@ components: "gainDb": 1.0 } ``` + + SoundProfileAction: + ```json + { + "type": "soundProfile", + "soundProfile": { + "speakerId1": { + "directivity": "wide" + }, + "speakerId2": { + "directivity": "narrow" + } + } + } + ``` properties: buttonName: description: Name of the Button used for button-press types ('buttonShortPress') @@ -234,6 +249,17 @@ components: format: '[0-9]+' nullable: true type: string + soundProfile: + additionalProperties: + $ref: '#/components/schemas/ActionSoundProfile' + description: Only used for 'type=soundProfile' + example: + speakerId1: + directivity: directivity1 + speakerId2: + directivity: directivity1 + nullable: true + type: object source: $ref: '#/components/schemas/SourceTypeEnum' nullable: true @@ -279,6 +305,7 @@ components: - listeningMode - stand - sourceGain + - soundProfile type: string volumeLevel: description: The volume level to configure only used for 'type=volume' @@ -302,6 +329,12 @@ components: items: $ref: '#/components/schemas/Action' type: array + ActionSoundProfile: + properties: + directivity: + nullable: true + type: string + type: object AlarmId: format: uuid type: string @@ -483,6 +516,57 @@ components: - KeyPress - KeyRelease type: object + BeoShapeStatus: + description: Status + properties: + amplifierTilesConfigured: + description: Number of amplifier Shape titles currently configured + format: int32 + type: integer + amplifierTilesOnline: + description: Number of amplifier Shape tiles currently connected + format: int32 + type: integer + designId: + type: string + designName: + type: string + soundProfile: + properties: + activeDirectivity: + type: string + speakerId: + type: string + supportedDirectivity: + description: The supported Beosound Shape directivity. + Extracted from the provided design fetched from the + cloud. + items: + type: string + type: array + required: + - speakerId + - activeDirectivity + - supportedDirectivity + type: object + speakerTilesConfigured: + description: Number of speaker Shape titles currently configured + format: int32 + type: integer + state: + enum: + - notUsed + - updatingFirmware + - initializing + - errorHardwareConfig + - ready + type: string + required: + - state + - amplifierTilesOnline + - amplifierTilesConfigured + - speakerTilesConfigured + type: object BeolinkAvailableListener: properties: jid: @@ -630,11 +714,14 @@ components: properties: friendlyName: type: string + ipAddress: + $ref: '#/components/schemas/IpAddress' jid: $ref: '#/components/schemas/BeolinkPeerID' required: - jid - friendlyName + - ipAddress type: object BeolinkPeerID: description: Beolink peer ID @@ -645,6 +732,16 @@ components: example: 48985a4f-a4de-4b44-9757-c9a7407b8882 format: uuid type: string + BeolinkSelf: + properties: + friendlyName: + type: string + jid: + $ref: '#/components/schemas/BeolinkPeerID' + required: + - jid + - friendlyName + type: object BluetoothDevice: properties: address: @@ -738,6 +835,13 @@ components: contentUri: tv://netflix label: Netflix type: object + ContentItemWithId: + properties: + content: + $ref: '#/components/schemas/ContentItem' + id: + type: string + type: object Directivity: properties: value: @@ -863,6 +967,10 @@ components: - downloadFailed type: string type: object + IpAddress: + description: IP address + example: fe80::209:a7ff:fe78:f605 + type: string LatencyProfile: description: | The latency profile of this speaker group. @@ -905,11 +1013,11 @@ components: ListeningMode: allOf: - $ref: '#/components/schemas/ListeningModeProps' - required: - - features - - id - - name - - triggers + - required: + - features + - id + - name + - triggers ListeningModeFeatures: description: Sound features to apply properties: @@ -1110,8 +1218,13 @@ components: maximum: 100 minimum: 0 type: integer + connected: + type: boolean dbVersion: type: string + lastSeen: + format: date-time + type: string name: type: string serialNumber: @@ -1147,6 +1260,16 @@ components: metadata: $ref: '#/components/schemas/PlaybackContentMetadata' nullable: true + playlistSortBy: + description: Option to choose the order that a playlist is sorted + by + enum: + - name + - artist + - date + - album + nullable: true + type: string provider: $ref: '#/components/schemas/PlayQueueItemType' startNowFromPosition: @@ -1249,6 +1372,8 @@ components: description: e.g. 5.1 nullable: true type: string + isExplicit: + type: boolean organization: description: | This can be filled by gstreamer's GST_TAG_ORGANIZATION. Mozart can also fill this with netradio station name like "P3" and TV content like "Netflix". This is needed so it's possible to show who the provider is for the playing audio track/content. @@ -1279,6 +1404,10 @@ components: type: string sourceInternalId: type: string + tags: + items: + type: string + type: array title: type: string totalDuration: @@ -1351,6 +1480,17 @@ components: - storage type: string type: object + PowerlinkConnectionStateEnum: + description: Indicated the state of the connection with powerlink + nullable: true + properties: + value: + enum: + - disabled + - enabledPendingData + - enabledWithData + type: string + type: object Preset: allOf: - $ref: '#/components/schemas/SceneTriggerBaseProperties' @@ -2089,6 +2229,8 @@ components: type: boolean isPlayable: type: boolean + isSeekable: + type: boolean name: type: string type: @@ -3347,6 +3489,40 @@ components: eventType: type: string type: object + WebSocketEventPowerlinkConnectionState: + description: "Usage examples:\n\n\n\nUse the `get_powerlink_connection_state_notifications()` method\ + \ in the Python package to get notifications of this type.\n\n\n\n```python\n\ + import asyncio\n\nfrom mozart_api.mozart_client import MozartClient\n\ + \nasync def receive_powerlink_connection_state_notifications():\n\ + \ \"\"\"React on WebSocketEventPowerlinkConnectionState events.\"\ + \"\"\n\n def powerlink_connection_state_notifications(notification:\ + \ object):\n \"\"\"PowerlinkConnectionState notification handler.\"\ + \"\"\n print(notification)\n\n async with MozartClient(host=\"\ + 192.168.0.1\") as mozart_client:\n mozart_client.get_powerlink_connection_state_notifications(powerlink_connection_state_notifications)\n\ + \ await mozart_client.connect_notifications()\n\n #\ + \ Receive notifications\n while True:\n await asyncio.sleep(0)\n\ + \n \nasyncio.run(receive_powerlink_connection_state_notifications())\n\ + ```\n\n\n\nUse the AIOHTTP\ + \ library to get notifications of this type.\n\n\n\n```python\nimport asyncio\n\ + \nfrom aiohttp import ClientSession\n\n\nasync def receive_powerlink_connection_state_notifications():\n\ + \ \"\"\"React on WebSocketEventPowerlinkConnectionState events.\"\ + \"\"\n async with ClientSession() as session:\n async with\ + \ session.ws_connect(url=\"ws://192.168.0.1:9339/\") as websocket:\n\ + \ async for notification in websocket:\n \ + \ notification = notification.json()\n\n if notification[\"\ + eventType\"] == \"WebSocketEventPowerlinkConnectionState\":\n \ + \ print(notification[\"eventData\"])\n\n \ + \ \nasyncio.run(receive_powerlink_connection_state_notifications())\n\ + ```\n\n" + properties: + eventData: + $ref: '#/components/schemas/PowerlinkConnectionStateEnum' + eventType: + type: string + type: object WebSocketEventPucInstallRemoteIdStatus: description: "Usage examples:\n\n\n\nUse the `get_puc_install_remote_id_status_notifications()`\ @@ -3865,9 +4041,9 @@ info: - [Beosound Emerge](https://www.bang-olufsen.com/en/dk/speakers/beosound-emerge)\n\ - [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 3.4.1.8 of the Mozart\ - \ platform and API generation version 3.4.1.8.8.\n\n## Python API\n\nThe Python\ - \ package has been generated using the [OpenAPI Generator](https:/openapi-generator.tech/)\ + \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.0.\n\n## Python API\n\ + \nThe Python package has been generated using the [OpenAPI Generator](https:/openapi-generator.tech/)\ \ version 7.8.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\ \nAnother file, mozart_cli.py, has been made for using the Mozart API in a\ @@ -4404,7 +4580,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BeolinkPeer' + $ref: '#/components/schemas/BeolinkSelf' description: successful operation summary: Get information about this device tags: @@ -4481,6 +4657,64 @@ paths: required: false schema: type: string + /api/v1/content/active: + get: + description: |- + Use the `get-active-content` method in the Python package with one of: + ```mozart_client + await mozart_client.get_active_content() + ``` + ```mozart_api + await mozart_api.get_active_content() + ``` + ```content_api + await content_api.get_active_content() + ``` + operationId: get-active-content + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ContentItemWithId' + description: Successful request + '204': + description: No content active + summary: Get currently active content + tags: + - Content + - mozart + /api/v1/output/beosound-shape/status: + get: + description: |- + Use the `get-beosound-shape-status` method in the Python package with one of: + ```mozart_client + await mozart_client.get_beosound_shape_status() + ``` + ```mozart_api + await mozart_api.get_beosound_shape_status() + ``` + ```output_api + await output_api.get_beosound_shape_status() + ``` + operationId: get-beosound-shape-status + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BeoShapeStatus' + description: status returned + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorModel' + description: beosound-shape not found/supported + summary: Get status + tags: + - Output + - mozart /api/v1/overlay/play: post: description: |- diff --git a/mozart-api-3.4.1.8.yaml b/mozart-api-4.1.1.116.yaml similarity index 96% rename from mozart-api-3.4.1.8.yaml rename to mozart-api-4.1.1.116.yaml index d8d197f..0271214 100755 --- a/mozart-api-3.4.1.8.yaml +++ b/mozart-api-4.1.1.116.yaml @@ -57,7 +57,10 @@ components: {\n \"type\": \"stand\",\n \"standPosition\": {\n \"angle\":\ \ 7.5\n }\n}\n```\n\nGainAction:\n```json\n{\n \"type\": \"sourceGain\"\ ,\n \"source\": {\n \"value\": \"spotify\"\n },\n \"gainDb\"\ - : 1.0\n}\n```\n" + : 1.0\n}\n```\n\nSoundProfileAction:\n```json\n{\n \"type\": \"soundProfile\"\ + ,\n \"soundProfile\": {\n \"speakerId1\": {\n \"directivity\"\ + : \"wide\"\n },\n \"speakerId2\": {\n \"directivity\":\ + \ \"narrow\"\n }\n }\n}\n```\n" properties: buttonName: description: Name of the Button used for button-press types ('buttonShortPress') @@ -106,6 +109,17 @@ components: format: '[0-9]+' nullable: true type: string + soundProfile: + additionalProperties: + $ref: '#/components/schemas/ActionSoundProfile' + description: Only used for 'type=soundProfile' + example: + speakerId1: + directivity: directivity1 + speakerId2: + directivity: directivity1 + nullable: true + type: object source: $ref: '#/components/schemas/SourceTypeEnum' nullable: true @@ -151,6 +165,7 @@ components: - listeningMode - stand - sourceGain + - soundProfile type: string volumeLevel: description: The volume level to configure only used for 'type=volume' @@ -174,6 +189,12 @@ components: items: $ref: '#/components/schemas/Action' type: array + ActionSoundProfile: + properties: + directivity: + nullable: true + type: string + type: object AlarmId: format: uuid type: string @@ -356,6 +377,57 @@ components: - KeyPress - KeyRelease type: object + BeoShapeStatus: + description: Status + properties: + amplifierTilesConfigured: + description: Number of amplifier Shape titles currently configured + format: int32 + type: integer + amplifierTilesOnline: + description: Number of amplifier Shape tiles currently connected + format: int32 + type: integer + designId: + type: string + designName: + type: string + soundProfile: + properties: + activeDirectivity: + type: string + speakerId: + type: string + supportedDirectivity: + description: The supported Beosound Shape directivity. + Extracted from the provided design fetched from the + cloud. + items: + type: string + type: array + required: + - speakerId + - activeDirectivity + - supportedDirectivity + type: object + speakerTilesConfigured: + description: Number of speaker Shape titles currently configured + format: int32 + type: integer + state: + enum: + - notUsed + - updatingFirmware + - initializing + - errorHardwareConfig + - ready + type: string + required: + - state + - amplifierTilesOnline + - amplifierTilesConfigured + - speakerTilesConfigured + type: object BeolinkAvailableListener: properties: jid: @@ -506,11 +578,14 @@ components: properties: friendlyName: type: string + ipAddress: + $ref: '#/components/schemas/IpAddress' jid: $ref: '#/components/schemas/BeolinkPeerID' required: - jid - friendlyName + - ipAddress type: object BeolinkPeerID: description: Beolink peer ID @@ -521,6 +596,16 @@ components: example: 48985a4f-a4de-4b44-9757-c9a7407b8882 format: uuid type: string + BeolinkSelf: + properties: + friendlyName: + type: string + jid: + $ref: '#/components/schemas/BeolinkPeerID' + required: + - jid + - friendlyName + type: object BluetoothDevice: properties: address: @@ -614,6 +699,13 @@ components: contentUri: tv://netflix label: Netflix type: object + ContentItemWithId: + properties: + content: + $ref: '#/components/schemas/ContentItem' + id: + type: string + type: object Directivity: properties: value: @@ -744,6 +836,10 @@ components: - downloadFailed type: string type: object + IpAddress: + description: IP address + example: fe80::209:a7ff:fe78:f605 + type: string LatencyProfile: description: 'The latency profile of this speaker group. @@ -789,11 +885,11 @@ components: ListeningMode: allOf: - $ref: '#/components/schemas/ListeningModeProps' - required: - - features - - id - - name - - triggers + - required: + - features + - id + - name + - triggers ListeningModeFeatures: description: Sound features to apply properties: @@ -1020,8 +1116,13 @@ components: maximum: 100 minimum: 0 type: integer + connected: + type: boolean dbVersion: type: string + lastSeen: + format: date-time + type: string name: type: string serialNumber: @@ -1057,6 +1158,16 @@ components: metadata: $ref: '#/components/schemas/PlaybackContentMetadata' nullable: true + playlistSortBy: + description: Option to choose the order that a playlist is sorted + by + enum: + - name + - artist + - date + - album + nullable: true + type: string provider: $ref: '#/components/schemas/PlayQueueItemType' startNowFromPosition: @@ -1166,6 +1277,8 @@ components: description: e.g. 5.1 nullable: true type: string + isExplicit: + type: boolean organization: description: 'This can be filled by gstreamer''s GST_TAG_ORGANIZATION. Mozart can also fill this with netradio station name like @@ -1201,6 +1314,10 @@ components: type: string sourceInternalId: type: string + tags: + items: + type: string + type: array title: type: string totalDuration: @@ -1282,6 +1399,17 @@ components: - storage type: string type: object + PowerlinkConnectionStateEnum: + description: Indicated the state of the connection with powerlink + nullable: true + properties: + value: + enum: + - disabled + - enabledPendingData + - enabledWithData + type: string + type: object Preset: allOf: - $ref: '#/components/schemas/SceneTriggerBaseProperties' @@ -2061,6 +2189,8 @@ components: type: boolean isPlayable: type: boolean + isSeekable: + type: boolean name: type: string type: @@ -2860,6 +2990,13 @@ components: eventType: type: string type: object + WebSocketEventPowerlinkConnectionState: + properties: + eventData: + $ref: '#/components/schemas/PowerlinkConnectionStateEnum' + eventType: + type: string + type: object WebSocketEventPucInstallRemoteIdStatus: properties: eventData: @@ -3283,7 +3420,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BeolinkPeer' + $ref: '#/components/schemas/BeolinkSelf' description: successful operation summary: Get information about this device tags: @@ -3340,6 +3477,42 @@ paths: required: false schema: type: string + /api/v1/content/active: + get: + operationId: get-active-content + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ContentItemWithId' + description: Successful request + '204': + description: No content active + summary: Get currently active content + tags: + - Content + - mozart + /api/v1/output/beosound-shape/status: + get: + operationId: get-beosound-shape-status + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BeoShapeStatus' + description: status returned + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorModel' + description: beosound-shape not found/supported + summary: Get status + tags: + - Output + - mozart /api/v1/overlay/play: post: description: 'Play some audio as an overlay. This will duck currently diff --git a/python_client/PKG-INFO b/python_client/PKG-INFO index 526bc49..93ae9b7 100644 --- a/python_client/PKG-INFO +++ b/python_client/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: mozart_api -Version: 3.4.1.8.8 +Version: 4.1.1.116.0 Summary: Mozart platform API Home-page: https://pypi.org/project/mozart-api/ License: MIT diff --git a/python_client/mozart_api/__init__.py b/python_client/mozart_api/__init__.py index f7f3507..49084cf 100644 --- a/python_client/mozart_api/__init__.py +++ b/python_client/mozart_api/__init__.py @@ -15,13 +15,14 @@ """ # noqa: E501 -__version__ = "3.4.1.8.8" +__version__ = "4.1.1.116.0" # import apis into sdk package from mozart_api.api.beolink_api import BeolinkApi from mozart_api.api.bluetooth_api import BluetoothApi from mozart_api.api.content_api import ContentApi from mozart_api.api.deezer_api import DeezerApi +from mozart_api.api.output_api import OutputApi from mozart_api.api.overlay_api import OverlayApi from mozart_api.api.playback_api import PlaybackApi from mozart_api.api.power_api import PowerApi @@ -48,6 +49,7 @@ # import models into sdk package from mozart_api.models.action import Action +from mozart_api.models.action_sound_profile import ActionSoundProfile from mozart_api.models.alarm_timer_event_data import AlarmTimerEventData from mozart_api.models.alarm_triggered_info import AlarmTriggeredInfo from mozart_api.models.ambience import Ambience @@ -65,6 +67,8 @@ from mozart_api.models.bass_range import BassRange from mozart_api.models.battery_state import BatteryState from mozart_api.models.beo_remote_button import BeoRemoteButton +from mozart_api.models.beo_shape_status import BeoShapeStatus +from mozart_api.models.beo_shape_status_sound_profile import BeoShapeStatusSoundProfile from mozart_api.models.beolink_available_listener import BeolinkAvailableListener from mozart_api.models.beolink_experience import BeolinkExperience from mozart_api.models.beolink_experiences_result import BeolinkExperiencesResult @@ -73,6 +77,7 @@ from mozart_api.models.beolink_leader import BeolinkLeader from mozart_api.models.beolink_listener import BeolinkListener from mozart_api.models.beolink_peer import BeolinkPeer +from mozart_api.models.beolink_self import BeolinkSelf from mozart_api.models.bluetooth_device import BluetoothDevice from mozart_api.models.bluetooth_device_list import BluetoothDeviceList from mozart_api.models.button_event import ButtonEvent @@ -80,6 +85,7 @@ from mozart_api.models.compression_feature import CompressionFeature from mozart_api.models.compression_range import CompressionRange from mozart_api.models.content_item import ContentItem +from mozart_api.models.content_item_with_id import ContentItemWithId from mozart_api.models.directivity import Directivity from mozart_api.models.directivity_feature import DirectivityFeature from mozart_api.models.directivity_range import DirectivityRange @@ -126,6 +132,9 @@ from mozart_api.models.playback_state import PlaybackState from mozart_api.models.power_link_trigger import PowerLinkTrigger from mozart_api.models.power_state_enum import PowerStateEnum +from mozart_api.models.powerlink_connection_state_enum import ( + PowerlinkConnectionStateEnum, +) from mozart_api.models.preset import Preset from mozart_api.models.product_curtain_status import ProductCurtainStatus from mozart_api.models.product_friendly_name import ProductFriendlyName @@ -264,6 +273,9 @@ WebSocketEventPlaybackState, ) from mozart_api.models.web_socket_event_power_state import WebSocketEventPowerState +from mozart_api.models.web_socket_event_powerlink_connection_state import ( + WebSocketEventPowerlinkConnectionState, +) from mozart_api.models.web_socket_event_puc_install_remote_id_status import ( WebSocketEventPucInstallRemoteIdStatus, ) diff --git a/python_client/mozart_api/api/__init__.py b/python_client/mozart_api/api/__init__.py index dcd71e0..ada1ca7 100644 --- a/python_client/mozart_api/api/__init__.py +++ b/python_client/mozart_api/api/__init__.py @@ -5,6 +5,7 @@ from mozart_api.api.bluetooth_api import BluetoothApi from mozart_api.api.content_api import ContentApi from mozart_api.api.deezer_api import DeezerApi +from mozart_api.api.output_api import OutputApi from mozart_api.api.overlay_api import OverlayApi from mozart_api.api.playback_api import PlaybackApi from mozart_api.api.power_api import PowerApi diff --git a/python_client/mozart_api/api/beolink_api.py b/python_client/mozart_api/api/beolink_api.py index f650dcf..586c48f 100644 --- a/python_client/mozart_api/api/beolink_api.py +++ b/python_client/mozart_api/api/beolink_api.py @@ -40,6 +40,7 @@ from mozart_api.models.beolink_join_result import BeolinkJoinResult from mozart_api.models.beolink_listener import BeolinkListener from mozart_api.models.beolink_peer import BeolinkPeer +from mozart_api.models.beolink_self import BeolinkSelf from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse @@ -563,7 +564,7 @@ async def get_beolink_peers_with_http_info( ) @validate_arguments - async def get_beolink_self(self, **kwargs) -> BeolinkPeer: # noqa: E501 + async def get_beolink_self(self, **kwargs) -> BeolinkSelf: # noqa: E501 """Get information about this device # noqa: E501 Returns Beolink information like about this device. This can be useful if you want to expand _to_ this device. # noqa: E501 @@ -575,7 +576,7 @@ async def get_beolink_self(self, **kwargs) -> BeolinkPeer: # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: BeolinkPeer + :rtype: BeolinkSelf """ kwargs["_return_http_data_only"] = True if "_preload_content" in kwargs: @@ -611,7 +612,7 @@ async def get_beolink_self_with_http_info( :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(BeolinkPeer, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(BeolinkSelf, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() @@ -661,7 +662,7 @@ async def get_beolink_self_with_http_info( _auth_settings = [] # noqa: E501 _response_types_map = { - "200": "BeolinkPeer", + "200": "BeolinkSelf", } return await self.api_client.call_api( diff --git a/python_client/mozart_api/api/content_api.py b/python_client/mozart_api/api/content_api.py index efdbffe..05c07e6 100644 --- a/python_client/mozart_api/api/content_api.py +++ b/python_client/mozart_api/api/content_api.py @@ -36,6 +36,7 @@ from typing import Dict, Optional from mozart_api.models.content_item import ContentItem +from mozart_api.models.content_item_with_id import ContentItemWithId from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse @@ -54,6 +55,125 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_arguments + async def get_active_content(self, **kwargs) -> ContentItemWithId: # noqa: E501 + """Get currently active content # noqa: E501 + + + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ContentItemWithId + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_active_content_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_active_content_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_active_content_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get currently active content # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ContentItemWithId, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_active_content" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "ContentItemWithId", + "204": None, + } + + return await self.api_client.call_api( + "/api/v1/content/active", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), + ) + @validate_arguments async def get_content( self, diff --git a/python_client/mozart_api/api/mozart_api.py b/python_client/mozart_api/api/mozart_api.py index 7f0f267..255adda 100644 --- a/python_client/mozart_api/api/mozart_api.py +++ b/python_client/mozart_api/api/mozart_api.py @@ -37,13 +37,16 @@ from mozart_api.models.bass import Bass from mozart_api.models.battery_state import BatteryState +from mozart_api.models.beo_shape_status import BeoShapeStatus from mozart_api.models.beolink_available_listener import BeolinkAvailableListener from mozart_api.models.beolink_join_request import BeolinkJoinRequest from mozart_api.models.beolink_join_result import BeolinkJoinResult from mozart_api.models.beolink_listener import BeolinkListener from mozart_api.models.beolink_peer import BeolinkPeer +from mozart_api.models.beolink_self import BeolinkSelf from mozart_api.models.bluetooth_device_list import BluetoothDeviceList from mozart_api.models.content_item import ContentItem +from mozart_api.models.content_item_with_id import ContentItemWithId from mozart_api.models.directivity import Directivity from mozart_api.models.home_control_ixp import HomeControlIxp from mozart_api.models.home_control_uri import HomeControlUri @@ -492,6 +495,125 @@ async def add_to_queue_with_http_info( _request_auth=_params.get("_request_auth"), ) + @validate_arguments + async def get_active_content(self, **kwargs) -> ContentItemWithId: # noqa: E501 + """Get currently active content # noqa: E501 + + + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ContentItemWithId + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_active_content_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_active_content_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_active_content_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get currently active content # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ContentItemWithId, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_active_content" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "ContentItemWithId", + "204": None, + } + + return await self.api_client.call_api( + "/api/v1/content/active", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), + ) + @validate_arguments async def get_active_listening_mode( self, **kwargs @@ -1493,7 +1615,7 @@ async def get_beolink_peers_with_http_info( ) @validate_arguments - async def get_beolink_self(self, **kwargs) -> BeolinkPeer: # noqa: E501 + async def get_beolink_self(self, **kwargs) -> BeolinkSelf: # noqa: E501 """Get information about this device # noqa: E501 Returns Beolink information like about this device. This can be useful if you want to expand _to_ this device. # noqa: E501 @@ -1505,7 +1627,7 @@ async def get_beolink_self(self, **kwargs) -> BeolinkPeer: # noqa: E501 :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: BeolinkPeer + :rtype: BeolinkSelf """ kwargs["_return_http_data_only"] = True if "_preload_content" in kwargs: @@ -1541,7 +1663,7 @@ async def get_beolink_self_with_http_info( :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(BeolinkPeer, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(BeolinkSelf, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() @@ -1591,7 +1713,7 @@ async def get_beolink_self_with_http_info( _auth_settings = [] # noqa: E501 _response_types_map = { - "200": "BeolinkPeer", + "200": "BeolinkSelf", } return await self.api_client.call_api( @@ -1612,6 +1734,127 @@ async def get_beolink_self_with_http_info( _request_auth=_params.get("_request_auth"), ) + @validate_arguments + async def get_beosound_shape_status(self, **kwargs) -> BeoShapeStatus: # noqa: E501 + """Get status # noqa: E501 + + + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: BeoShapeStatus + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_beosound_shape_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_beosound_shape_status_with_http_info( + **kwargs + ) # noqa: E501 + + @validate_arguments + async def get_beosound_shape_status_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get status # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BeoShapeStatus, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_beosound_shape_status" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "BeoShapeStatus", + "404": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/output/beosound-shape/status", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), + ) + @validate_arguments async def get_bluetooth_devices_status( self, **kwargs diff --git a/python_client/mozart_api/api/output_api.py b/python_client/mozart_api/api/output_api.py new file mode 100644 index 0000000..0cf9894 --- /dev/null +++ b/python_client/mozart_api/api/output_api.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + + +try: + from pydantic.v1 import validate_arguments, ValidationError +except ImportError: + from pydantic import validate_arguments, ValidationError + +from typing import overload, Optional, Union, Awaitable + +from mozart_api.models.beo_shape_status import BeoShapeStatus + +from mozart_api.api_client import ApiClient +from mozart_api.api_response import ApiResponse +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class OutputApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_arguments + async def get_beosound_shape_status(self, **kwargs) -> BeoShapeStatus: # noqa: E501 + """Get status # noqa: E501 + + + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: BeoShapeStatus + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_beosound_shape_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_beosound_shape_status_with_http_info( + **kwargs + ) # noqa: E501 + + @validate_arguments + async def get_beosound_shape_status_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get status # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BeoShapeStatus, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_beosound_shape_status" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "BeoShapeStatus", + "404": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/output/beosound-shape/status", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), + ) diff --git a/python_client/mozart_api/api_client.py b/python_client/mozart_api/api_client.py index 0be724d..09898e6 100644 --- a/python_client/mozart_api/api_client.py +++ b/python_client/mozart_api/api_client.py @@ -82,7 +82,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = "OpenAPI-Generator/3.4.1.8.8/python" + self.user_agent = "OpenAPI-Generator/4.1.1.116.0/python" self.client_side_validation = configuration.client_side_validation async def __aenter__(self): diff --git a/python_client/mozart_api/configuration.py b/python_client/mozart_api/configuration.py index afe0f24..857eab5 100644 --- a/python_client/mozart_api/configuration.py +++ b/python_client/mozart_api/configuration.py @@ -381,7 +381,7 @@ def to_debug_report(self): "OS: {env}\n" "Python Version: {pyversion}\n" "Version of the API: 0.2.0\n" - "SDK Package Version: 3.4.1.8.8".format( + "SDK Package Version: 4.1.1.116.0".format( env=sys.platform, pyversion=sys.version ) ) diff --git a/python_client/mozart_api/models/__init__.py b/python_client/mozart_api/models/__init__.py index e5a7a61..10118d5 100644 --- a/python_client/mozart_api/models/__init__.py +++ b/python_client/mozart_api/models/__init__.py @@ -16,6 +16,7 @@ # import models into model package from mozart_api.models.action import Action +from mozart_api.models.action_sound_profile import ActionSoundProfile from mozart_api.models.alarm_timer_event_data import AlarmTimerEventData from mozart_api.models.alarm_triggered_info import AlarmTriggeredInfo from mozart_api.models.ambience import Ambience @@ -33,6 +34,8 @@ from mozart_api.models.bass_range import BassRange from mozart_api.models.battery_state import BatteryState from mozart_api.models.beo_remote_button import BeoRemoteButton +from mozart_api.models.beo_shape_status import BeoShapeStatus +from mozart_api.models.beo_shape_status_sound_profile import BeoShapeStatusSoundProfile from mozart_api.models.beolink_available_listener import BeolinkAvailableListener from mozart_api.models.beolink_experience import BeolinkExperience from mozart_api.models.beolink_experiences_result import BeolinkExperiencesResult @@ -41,6 +44,7 @@ from mozart_api.models.beolink_leader import BeolinkLeader from mozart_api.models.beolink_listener import BeolinkListener from mozart_api.models.beolink_peer import BeolinkPeer +from mozart_api.models.beolink_self import BeolinkSelf from mozart_api.models.bluetooth_device import BluetoothDevice from mozart_api.models.bluetooth_device_list import BluetoothDeviceList from mozart_api.models.button_event import ButtonEvent @@ -48,6 +52,7 @@ from mozart_api.models.compression_feature import CompressionFeature from mozart_api.models.compression_range import CompressionRange from mozart_api.models.content_item import ContentItem +from mozart_api.models.content_item_with_id import ContentItemWithId from mozart_api.models.directivity import Directivity from mozart_api.models.directivity_feature import DirectivityFeature from mozart_api.models.directivity_range import DirectivityRange @@ -94,6 +99,9 @@ from mozart_api.models.playback_state import PlaybackState from mozart_api.models.power_link_trigger import PowerLinkTrigger from mozart_api.models.power_state_enum import PowerStateEnum +from mozart_api.models.powerlink_connection_state_enum import ( + PowerlinkConnectionStateEnum, +) from mozart_api.models.preset import Preset from mozart_api.models.product_curtain_status import ProductCurtainStatus from mozart_api.models.product_friendly_name import ProductFriendlyName @@ -232,6 +240,9 @@ WebSocketEventPlaybackState, ) from mozart_api.models.web_socket_event_power_state import WebSocketEventPowerState +from mozart_api.models.web_socket_event_powerlink_connection_state import ( + WebSocketEventPowerlinkConnectionState, +) from mozart_api.models.web_socket_event_puc_install_remote_id_status import ( WebSocketEventPucInstallRemoteIdStatus, ) diff --git a/python_client/mozart_api/models/action.py b/python_client/mozart_api/models/action.py index 92dfdab..312fe7b 100644 --- a/python_client/mozart_api/models/action.py +++ b/python_client/mozart_api/models/action.py @@ -19,13 +19,14 @@ import json -from typing import Optional, Union +from typing import Dict, Optional, Union try: from pydantic.v1 import BaseModel, Field, StrictStr, confloat, conint, validator except ImportError: from pydantic import BaseModel, Field, StrictStr, confloat, conint, validator +from mozart_api.models.action_sound_profile import ActionSoundProfile from mozart_api.models.play_queue_item import PlayQueueItem from mozart_api.models.play_queue_settings import PlayQueueSettings from mozart_api.models.source_type_enum import SourceTypeEnum @@ -34,7 +35,7 @@ class Action(BaseModel): """ - An action object. Examples: RadioAction: ```json { \"type\": \"radio\", \"radioStationId\": \"8779112938791514\" } ``` ToneAction: ```json { \"type\": \"tone\", \"toneName\": \"alarm_2\" } ``` SourcePresetAction: ```json { \"type\": \"sourcePreset\", \"source\": { \"value\": \"spotify\" }, \"presetKey\": \"Preset3\" } ``` DeezerFlowAction: ```json { \"type\": \"deezerFlow\", \"deezerUserId\": \"1234\" } ``` ActivateSourceAction: ```json { \"type\": \"activateSource\", \"source\": { \"value\": \"spotify\" } } ``` PlayQueueAction: ``` { \"type\": \"playQueue\", \"queueItem\": { \"provider\": { \"value\": \"deezer\" }, \"startNowFromPosition\": 0, \"type\": \"playlist\", \"uri\": \"playlist:8074581462\" }, \"queueSettings\": { \"consume\": false, \"repeat\": \"none\", \"shuffle\": false } } ``` StandbyAction: ```json { \"type\": \"standby\" } ``` AllStandbyAction: ```json { \"type\": \"allStandby\" } ``` TouchToJoinAction: ```json { \"type\": \"touchToJoin\" } ``` ButtonShortPressAction: ```json { \"type\": \"buttonShortPress\", \"buttonName\": \"preset1\" } ``` FallbackAction: ```json { \"type\": \"fallback\" } ``` VolumeAction: ```json { \"type\": \"volume\", \"volumeLevel\": 25 } ``` StopAction: ```json { \"type\": \"stop\", \"stopDuration\": 1300 } ``` TriggerContentAction: ```json { \"contentId\": \"tv://netflix\", \"type\": \"triggerContent\" } ``` SpeakerGroupAction: ```json { \"type\": \"speakerGroup\", \"speakerGroupId\": \"00112233-4455-6677-8899-aabbccddeeff\" } ``` ListeningModeAction: ```json { \"type\": \"listeningMode\", \"listeningModeId\": 1234 } ``` StandAction: ```json { \"type\": \"stand\", \"standPosition\": { \"angle\": 7.5 } } ``` GainAction: ```json { \"type\": \"sourceGain\", \"source\": { \"value\": \"spotify\" }, \"gainDb\": 1.0 } ``` # noqa: E501 + An action object. Examples: RadioAction: ```json { \"type\": \"radio\", \"radioStationId\": \"8779112938791514\" } ``` ToneAction: ```json { \"type\": \"tone\", \"toneName\": \"alarm_2\" } ``` SourcePresetAction: ```json { \"type\": \"sourcePreset\", \"source\": { \"value\": \"spotify\" }, \"presetKey\": \"Preset3\" } ``` DeezerFlowAction: ```json { \"type\": \"deezerFlow\", \"deezerUserId\": \"1234\" } ``` ActivateSourceAction: ```json { \"type\": \"activateSource\", \"source\": { \"value\": \"spotify\" } } ``` PlayQueueAction: ``` { \"type\": \"playQueue\", \"queueItem\": { \"provider\": { \"value\": \"deezer\" }, \"startNowFromPosition\": 0, \"type\": \"playlist\", \"uri\": \"playlist:8074581462\" }, \"queueSettings\": { \"consume\": false, \"repeat\": \"none\", \"shuffle\": false } } ``` StandbyAction: ```json { \"type\": \"standby\" } ``` AllStandbyAction: ```json { \"type\": \"allStandby\" } ``` TouchToJoinAction: ```json { \"type\": \"touchToJoin\" } ``` ButtonShortPressAction: ```json { \"type\": \"buttonShortPress\", \"buttonName\": \"preset1\" } ``` FallbackAction: ```json { \"type\": \"fallback\" } ``` VolumeAction: ```json { \"type\": \"volume\", \"volumeLevel\": 25 } ``` StopAction: ```json { \"type\": \"stop\", \"stopDuration\": 1300 } ``` TriggerContentAction: ```json { \"contentId\": \"tv://netflix\", \"type\": \"triggerContent\" } ``` SpeakerGroupAction: ```json { \"type\": \"speakerGroup\", \"speakerGroupId\": \"00112233-4455-6677-8899-aabbccddeeff\" } ``` ListeningModeAction: ```json { \"type\": \"listeningMode\", \"listeningModeId\": 1234 } ``` StandAction: ```json { \"type\": \"stand\", \"standPosition\": { \"angle\": 7.5 } } ``` GainAction: ```json { \"type\": \"sourceGain\", \"source\": { \"value\": \"spotify\" }, \"gainDb\": 1.0 } ``` SoundProfileAction: ```json { \"type\": \"soundProfile\", \"soundProfile\": { \"speakerId1\": { \"directivity\": \"wide\" }, \"speakerId2\": { \"directivity\": \"narrow\" } } } ``` # noqa: E501 """ button_name: Optional[StrictStr] = Field( @@ -72,6 +73,11 @@ class Action(BaseModel): alias="radioStationId", description="Id of RadioStation only used for 'type=radio'", ) + sound_profile: Optional[Dict[str, ActionSoundProfile]] = Field( + default=None, + alias="soundProfile", + description="Only used for 'type=soundProfile'", + ) source: Optional[SourceTypeEnum] = None speaker_group_id: Optional[StrictStr] = Field(default=None, alias="speakerGroupId") stand_position: Optional[StandPosition] = Field(default=None, alias="standPosition") @@ -101,6 +107,7 @@ class Action(BaseModel): "queueItem", "queueSettings", "radioStationId", + "soundProfile", "source", "speakerGroupId", "standPosition", @@ -154,9 +161,10 @@ def type_validate_enum(cls, value): "listeningMode", "stand", "sourceGain", + "soundProfile", ): raise ValueError( - "must be one of enum values ('standby', 'tone', 'radio', 'sourcePreset', 'deezerFlow', 'activateSource', 'playQueue', 'buttonShortPress', 'allStandby', 'touchToJoin', 'fallback', 'volume', 'stop', 'triggerContent', 'speakerGroup', 'listeningMode', 'stand', 'sourceGain')" + "must be one of enum values ('standby', 'tone', 'radio', 'sourcePreset', 'deezerFlow', 'activateSource', 'playQueue', 'buttonShortPress', 'allStandby', 'touchToJoin', 'fallback', 'volume', 'stop', 'triggerContent', 'speakerGroup', 'listeningMode', 'stand', 'sourceGain', 'soundProfile')" ) return value @@ -188,6 +196,13 @@ def to_dict(self): # override the default output from pydantic by calling `to_dict()` of queue_settings if self.queue_settings: _dict["queueSettings"] = self.queue_settings.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in sound_profile (dict) + _field_dict = {} + if self.sound_profile: + for _key in self.sound_profile: + if self.sound_profile[_key]: + _field_dict[_key] = self.sound_profile[_key].to_dict() + _dict["soundProfile"] = _field_dict # override the default output from pydantic by calling `to_dict()` of source if self.source: _dict["source"] = self.source.to_dict() @@ -219,6 +234,11 @@ def to_dict(self): if self.radio_station_id is None and "radio_station_id" in self.__fields_set__: _dict["radioStationId"] = None + # set to None if sound_profile (nullable) is None + # and __fields_set__ contains the field + if self.sound_profile is None and "sound_profile" in self.__fields_set__: + _dict["soundProfile"] = None + # set to None if stop_duration (nullable) is None # and __fields_set__ contains the field if self.stop_duration is None and "stop_duration" in self.__fields_set__: @@ -264,6 +284,14 @@ def from_dict(cls, obj: dict) -> Action: else None ), "radio_station_id": obj.get("radioStationId"), + "sound_profile": ( + dict( + (_k, ActionSoundProfile.from_dict(_v)) + for _k, _v in obj.get("soundProfile").items() + ) + if obj.get("soundProfile") is not None + else None + ), "source": ( SourceTypeEnum.from_dict(obj.get("source")) if obj.get("source") is not None diff --git a/python_client/mozart_api/models/action_sound_profile.py b/python_client/mozart_api/models/action_sound_profile.py new file mode 100644 index 0000000..acdc72b --- /dev/null +++ b/python_client/mozart_api/models/action_sound_profile.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional + +try: + from pydantic.v1 import BaseModel, StrictStr +except ImportError: + from pydantic import BaseModel, StrictStr + + +class ActionSoundProfile(BaseModel): + """ + ActionSoundProfile + """ + + directivity: Optional[StrictStr] = None + __properties = ["directivity"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ActionSoundProfile: + """Create an instance of ActionSoundProfile from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + # set to None if directivity (nullable) is None + # and __fields_set__ contains the field + if self.directivity is None and "directivity" in self.__fields_set__: + _dict["directivity"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ActionSoundProfile: + """Create an instance of ActionSoundProfile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ActionSoundProfile.parse_obj(obj) + + _obj = ActionSoundProfile.parse_obj({"directivity": obj.get("directivity")}) + return _obj diff --git a/python_client/mozart_api/models/beo_shape_status.py b/python_client/mozart_api/models/beo_shape_status.py new file mode 100644 index 0000000..c2f1584 --- /dev/null +++ b/python_client/mozart_api/models/beo_shape_status.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional + +try: + from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, validator +except ImportError: + from pydantic import BaseModel, Field, StrictInt, StrictStr, validator + +from mozart_api.models.beo_shape_status_sound_profile import BeoShapeStatusSoundProfile + + +class BeoShapeStatus(BaseModel): + """ + Status # noqa: E501 + """ + + amplifier_tiles_configured: StrictInt = Field( + default=..., + alias="amplifierTilesConfigured", + description="Number of amplifier Shape titles currently configured", + ) + amplifier_tiles_online: StrictInt = Field( + default=..., + alias="amplifierTilesOnline", + description="Number of amplifier Shape tiles currently connected", + ) + design_id: Optional[StrictStr] = Field(default=None, alias="designId") + design_name: Optional[StrictStr] = Field(default=None, alias="designName") + sound_profile: Optional[BeoShapeStatusSoundProfile] = Field( + default=None, alias="soundProfile" + ) + speaker_tiles_configured: StrictInt = Field( + default=..., + alias="speakerTilesConfigured", + description="Number of speaker Shape titles currently configured", + ) + state: StrictStr = Field(...) + __properties = [ + "amplifierTilesConfigured", + "amplifierTilesOnline", + "designId", + "designName", + "soundProfile", + "speakerTilesConfigured", + "state", + ] + + @validator("state") + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in ( + "notUsed", + "updatingFirmware", + "initializing", + "errorHardwareConfig", + "ready", + ): + raise ValueError( + "must be one of enum values ('notUsed', 'updatingFirmware', 'initializing', 'errorHardwareConfig', 'ready')" + ) + return value + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> BeoShapeStatus: + """Create an instance of BeoShapeStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of sound_profile + if self.sound_profile: + _dict["soundProfile"] = self.sound_profile.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> BeoShapeStatus: + """Create an instance of BeoShapeStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BeoShapeStatus.parse_obj(obj) + + _obj = BeoShapeStatus.parse_obj( + { + "amplifier_tiles_configured": obj.get("amplifierTilesConfigured"), + "amplifier_tiles_online": obj.get("amplifierTilesOnline"), + "design_id": obj.get("designId"), + "design_name": obj.get("designName"), + "sound_profile": ( + BeoShapeStatusSoundProfile.from_dict(obj.get("soundProfile")) + if obj.get("soundProfile") is not None + else None + ), + "speaker_tiles_configured": obj.get("speakerTilesConfigured"), + "state": obj.get("state"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/beo_shape_status_sound_profile.py b/python_client/mozart_api/models/beo_shape_status_sound_profile.py new file mode 100644 index 0000000..8b4a427 --- /dev/null +++ b/python_client/mozart_api/models/beo_shape_status_sound_profile.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List + +try: + from pydantic.v1 import BaseModel, Field, StrictStr, conlist +except ImportError: + from pydantic import BaseModel, Field, StrictStr, conlist + + +class BeoShapeStatusSoundProfile(BaseModel): + """ + BeoShapeStatusSoundProfile + """ + + active_directivity: StrictStr = Field(default=..., alias="activeDirectivity") + speaker_id: StrictStr = Field(default=..., alias="speakerId") + supported_directivity: conlist(StrictStr) = Field( + default=..., + alias="supportedDirectivity", + description="The supported Beosound Shape directivity. Extracted from the provided design fetched from the cloud.", + ) + __properties = ["activeDirectivity", "speakerId", "supportedDirectivity"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> BeoShapeStatusSoundProfile: + """Create an instance of BeoShapeStatusSoundProfile from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> BeoShapeStatusSoundProfile: + """Create an instance of BeoShapeStatusSoundProfile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BeoShapeStatusSoundProfile.parse_obj(obj) + + _obj = BeoShapeStatusSoundProfile.parse_obj( + { + "active_directivity": obj.get("activeDirectivity"), + "speaker_id": obj.get("speakerId"), + "supported_directivity": obj.get("supportedDirectivity"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/beolink_peer.py b/python_client/mozart_api/models/beolink_peer.py index 19c7871..a788faf 100644 --- a/python_client/mozart_api/models/beolink_peer.py +++ b/python_client/mozart_api/models/beolink_peer.py @@ -31,8 +31,11 @@ class BeolinkPeer(BaseModel): """ friendly_name: StrictStr = Field(default=..., alias="friendlyName") + ip_address: StrictStr = Field( + default=..., alias="ipAddress", description="IP address" + ) jid: StrictStr = Field(default=..., description="Beolink peer ID") - __properties = ["friendlyName", "jid"] + __properties = ["friendlyName", "ipAddress", "jid"] class Config: """Pydantic configuration""" @@ -68,6 +71,10 @@ def from_dict(cls, obj: dict) -> BeolinkPeer: return BeolinkPeer.parse_obj(obj) _obj = BeolinkPeer.parse_obj( - {"friendly_name": obj.get("friendlyName"), "jid": obj.get("jid")} + { + "friendly_name": obj.get("friendlyName"), + "ip_address": obj.get("ipAddress"), + "jid": obj.get("jid"), + } ) return _obj diff --git a/python_client/mozart_api/models/beolink_self.py b/python_client/mozart_api/models/beolink_self.py new file mode 100644 index 0000000..2d2e9b5 --- /dev/null +++ b/python_client/mozart_api/models/beolink_self.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr + + +class BeolinkSelf(BaseModel): + """ + BeolinkSelf + """ + + friendly_name: StrictStr = Field(default=..., alias="friendlyName") + jid: StrictStr = Field(default=..., description="Beolink peer ID") + __properties = ["friendlyName", "jid"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> BeolinkSelf: + """Create an instance of BeolinkSelf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> BeolinkSelf: + """Create an instance of BeolinkSelf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BeolinkSelf.parse_obj(obj) + + _obj = BeolinkSelf.parse_obj( + {"friendly_name": obj.get("friendlyName"), "jid": obj.get("jid")} + ) + return _obj diff --git a/python_client/mozart_api/models/content_item_with_id.py b/python_client/mozart_api/models/content_item_with_id.py new file mode 100644 index 0000000..ec686fb --- /dev/null +++ b/python_client/mozart_api/models/content_item_with_id.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional + +try: + from pydantic.v1 import BaseModel, StrictStr +except ImportError: + from pydantic import BaseModel, StrictStr + +from mozart_api.models.content_item import ContentItem + + +class ContentItemWithId(BaseModel): + """ + ContentItemWithId + """ + + content: Optional[ContentItem] = None + id: Optional[StrictStr] = None + __properties = ["content", "id"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ContentItemWithId: + """Create an instance of ContentItemWithId from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of content + if self.content: + _dict["content"] = self.content.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ContentItemWithId: + """Create an instance of ContentItemWithId from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ContentItemWithId.parse_obj(obj) + + _obj = ContentItemWithId.parse_obj( + { + "content": ( + ContentItem.from_dict(obj.get("content")) + if obj.get("content") is not None + else None + ), + "id": obj.get("id"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/paired_remote.py b/python_client/mozart_api/models/paired_remote.py index 9617fcc..7423ad6 100644 --- a/python_client/mozart_api/models/paired_remote.py +++ b/python_client/mozart_api/models/paired_remote.py @@ -18,13 +18,29 @@ import re # noqa: F401 import json - +from datetime import datetime from typing import List, Optional try: - from pydantic.v1 import BaseModel, Field, StrictStr, conint, conlist, validator + from pydantic.v1 import ( + BaseModel, + Field, + StrictBool, + StrictStr, + conint, + conlist, + validator, + ) except ImportError: - from pydantic import BaseModel, Field, StrictStr, conint, conlist, validator + from pydantic import ( + BaseModel, + Field, + StrictBool, + StrictStr, + conint, + conlist, + validator, + ) class PairedRemote(BaseModel): @@ -37,7 +53,9 @@ class PairedRemote(BaseModel): battery_level: Optional[conint(strict=True, le=100, ge=0)] = Field( default=None, alias="batteryLevel" ) + connected: Optional[StrictBool] = None db_version: Optional[StrictStr] = Field(default=None, alias="dbVersion") + last_seen: Optional[datetime] = Field(default=None, alias="lastSeen") name: StrictStr = Field(...) serial_number: Optional[StrictStr] = Field(default=None, alias="serialNumber") updated: Optional[conlist(StrictStr)] = None @@ -45,7 +63,9 @@ class PairedRemote(BaseModel): "address", "appVersion", "batteryLevel", + "connected", "dbVersion", + "lastSeen", "name", "serialNumber", "updated", @@ -100,7 +120,9 @@ def from_dict(cls, obj: dict) -> PairedRemote: "address": obj.get("address"), "app_version": obj.get("appVersion"), "battery_level": obj.get("batteryLevel"), + "connected": obj.get("connected"), "db_version": obj.get("dbVersion"), + "last_seen": obj.get("lastSeen"), "name": obj.get("name"), "serial_number": obj.get("serialNumber"), "updated": obj.get("updated"), diff --git a/python_client/mozart_api/models/play_queue_item.py b/python_client/mozart_api/models/play_queue_item.py index edd19bc..ba05526 100644 --- a/python_client/mozart_api/models/play_queue_item.py +++ b/python_client/mozart_api/models/play_queue_item.py @@ -37,6 +37,11 @@ class PlayQueueItem(BaseModel): index: Optional[StrictInt] = None metadata: Optional[PlaybackContentMetadata] = None + playlist_sort_by: Optional[StrictStr] = Field( + default=None, + alias="playlistSortBy", + description="Option to choose the order that a playlist is sorted by", + ) provider: PlayQueueItemType = Field(...) start_now_from_position: Optional[StrictInt] = Field( default=None, @@ -51,12 +56,25 @@ class PlayQueueItem(BaseModel): __properties = [ "index", "metadata", + "playlistSortBy", "provider", "startNowFromPosition", "type", "uri", ] + @validator("playlist_sort_by") + def playlist_sort_by_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("name", "artist", "date", "album"): + raise ValueError( + "must be one of enum values ('name', 'artist', 'date', 'album')" + ) + return value + @validator("type") def type_validate_enum(cls, value): """Validates the enum""" @@ -92,6 +110,11 @@ def to_dict(self): # override the default output from pydantic by calling `to_dict()` of provider if self.provider: _dict["provider"] = self.provider.to_dict() + # set to None if playlist_sort_by (nullable) is None + # and __fields_set__ contains the field + if self.playlist_sort_by is None and "playlist_sort_by" in self.__fields_set__: + _dict["playlistSortBy"] = None + # set to None if start_now_from_position (nullable) is None # and __fields_set__ contains the field if ( @@ -119,6 +142,7 @@ def from_dict(cls, obj: dict) -> PlayQueueItem: if obj.get("metadata") is not None else None ), + "playlist_sort_by": obj.get("playlistSortBy"), "provider": ( PlayQueueItemType.from_dict(obj.get("provider")) if obj.get("provider") is not None diff --git a/python_client/mozart_api/models/playback_content_metadata.py b/python_client/mozart_api/models/playback_content_metadata.py index 09c8899..c22b742 100644 --- a/python_client/mozart_api/models/playback_content_metadata.py +++ b/python_client/mozart_api/models/playback_content_metadata.py @@ -22,9 +22,25 @@ from typing import List, Optional try: - from pydantic.v1 import BaseModel, Field, StrictInt, StrictStr, conlist, validator + from pydantic.v1 import ( + BaseModel, + Field, + StrictBool, + StrictInt, + StrictStr, + conlist, + validator, + ) except ImportError: - from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist, validator + from pydantic import ( + BaseModel, + Field, + StrictBool, + StrictInt, + StrictStr, + conlist, + validator, + ) from mozart_api.models.art import Art from mozart_api.models.beolink_leader import BeolinkLeader @@ -52,6 +68,7 @@ class PlaybackContentMetadata(BaseModel): input_channels: Optional[StrictStr] = Field( default=None, alias="inputChannels", description="e.g. 5.1" ) + is_explicit: Optional[StrictBool] = Field(default=None, alias="isExplicit") organization: Optional[StrictStr] = Field( default=None, description='This can be filled by gstreamer\'s GST_TAG_ORGANIZATION. Mozart can also fill this with netradio station name like "P3" and TV content like "Netflix". This is needed so it\'s possible to show who the provider is for the playing audio track/content. ', @@ -70,6 +87,7 @@ class PlaybackContentMetadata(BaseModel): source_internal_id: Optional[StrictStr] = Field( default=None, alias="sourceInternalId" ) + tags: Optional[conlist(StrictStr)] = None title: Optional[StrictStr] = None total_duration: Optional[StrictInt] = Field( default=None, @@ -94,6 +112,7 @@ class PlaybackContentMetadata(BaseModel): "id", "inputChannelProcessing", "inputChannels", + "isExplicit", "organization", "outputChannelProcessing", "outputChannels", @@ -103,6 +122,7 @@ class PlaybackContentMetadata(BaseModel): "samplerate", "source", "sourceInternalId", + "tags", "title", "totalDuration", "totalDurationSeconds", @@ -265,6 +285,7 @@ def from_dict(cls, obj: dict) -> PlaybackContentMetadata: "id": obj.get("id"), "input_channel_processing": obj.get("inputChannelProcessing"), "input_channels": obj.get("inputChannels"), + "is_explicit": obj.get("isExplicit"), "organization": obj.get("organization"), "output_channel_processing": obj.get("outputChannelProcessing"), "output_channels": obj.get("outputChannels"), @@ -278,6 +299,7 @@ def from_dict(cls, obj: dict) -> PlaybackContentMetadata: "samplerate": obj.get("samplerate"), "source": obj.get("source"), "source_internal_id": obj.get("sourceInternalId"), + "tags": obj.get("tags"), "title": obj.get("title"), "total_duration": obj.get("totalDuration"), "total_duration_seconds": obj.get("totalDurationSeconds"), diff --git a/python_client/mozart_api/models/powerlink_connection_state_enum.py b/python_client/mozart_api/models/powerlink_connection_state_enum.py new file mode 100644 index 0000000..342c84f --- /dev/null +++ b/python_client/mozart_api/models/powerlink_connection_state_enum.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional + +try: + from pydantic.v1 import BaseModel, StrictStr, validator +except ImportError: + from pydantic import BaseModel, StrictStr, validator + + +class PowerlinkConnectionStateEnum(BaseModel): + """ + Indicated the state of the connection with powerlink # noqa: E501 + """ + + value: Optional[StrictStr] = None + __properties = ["value"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("disabled", "enabledPendingData", "enabledWithData"): + raise ValueError( + "must be one of enum values ('disabled', 'enabledPendingData', 'enabledWithData')" + ) + return value + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> PowerlinkConnectionStateEnum: + """Create an instance of PowerlinkConnectionStateEnum from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> PowerlinkConnectionStateEnum: + """Create an instance of PowerlinkConnectionStateEnum from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return PowerlinkConnectionStateEnum.parse_obj(obj) + + _obj = PowerlinkConnectionStateEnum.parse_obj({"value": obj.get("value")}) + return _obj diff --git a/python_client/mozart_api/models/source.py b/python_client/mozart_api/models/source.py index 53f303d..e0710f2 100644 --- a/python_client/mozart_api/models/source.py +++ b/python_client/mozart_api/models/source.py @@ -44,6 +44,7 @@ class Source(BaseModel): default=None, alias="isMultiroomAvailable" ) is_playable: Optional[StrictBool] = Field(default=None, alias="isPlayable") + is_seekable: Optional[StrictBool] = Field(default=None, alias="isSeekable") name: Optional[StrictStr] = None type: Optional[SourceTypeEnum] = None __properties = [ @@ -51,6 +52,7 @@ class Source(BaseModel): "isEnabled", "isMultiroomAvailable", "isPlayable", + "isSeekable", "name", "type", ] @@ -97,6 +99,7 @@ def from_dict(cls, obj: dict) -> Source: "is_enabled": obj.get("isEnabled"), "is_multiroom_available": obj.get("isMultiroomAvailable"), "is_playable": obj.get("isPlayable"), + "is_seekable": obj.get("isSeekable"), "name": obj.get("name"), "type": ( SourceTypeEnum.from_dict(obj.get("type")) diff --git a/python_client/mozart_api/models/web_socket_event_powerlink_connection_state.py b/python_client/mozart_api/models/web_socket_event_powerlink_connection_state.py new file mode 100644 index 0000000..5c6b676 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_powerlink_connection_state.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional + +try: + from pydantic.v1 import BaseModel, Field, StrictStr +except ImportError: + from pydantic import BaseModel, Field, StrictStr + +from mozart_api.models.powerlink_connection_state_enum import ( + PowerlinkConnectionStateEnum, +) + + +class WebSocketEventPowerlinkConnectionState(BaseModel): + """ + WebSocketEventPowerlinkConnectionState + """ + + event_data: Optional[PowerlinkConnectionStateEnum] = Field( + default=None, alias="eventData" + ) + event_type: Optional[StrictStr] = Field(default=None, alias="eventType") + __properties = ["eventData", "eventType"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> WebSocketEventPowerlinkConnectionState: + """Create an instance of WebSocketEventPowerlinkConnectionState from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of event_data + if self.event_data: + _dict["eventData"] = self.event_data.to_dict() + # set to None if event_data (nullable) is None + # and __fields_set__ contains the field + if self.event_data is None and "event_data" in self.__fields_set__: + _dict["eventData"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> WebSocketEventPowerlinkConnectionState: + """Create an instance of WebSocketEventPowerlinkConnectionState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventPowerlinkConnectionState.parse_obj(obj) + + _obj = WebSocketEventPowerlinkConnectionState.parse_obj( + { + "event_data": ( + PowerlinkConnectionStateEnum.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None + ), + "event_type": obj.get("eventType"), + } + ) + return _obj diff --git a/python_client/mozart_api/mozart_client.py b/python_client/mozart_api/mozart_client.py index b853d1f..7b69457 100644 --- a/python_client/mozart_api/mozart_client.py +++ b/python_client/mozart_api/mozart_client.py @@ -51,6 +51,7 @@ "playback_source", "playback_state", "power_state", + "powerlink_connection_state", "puc_install_remote_id_status", "role", "room_compensation_current_measurement_event", @@ -554,6 +555,14 @@ def get_power_state_notifications(self, on_power_state_notification) -> None: on_power_state_notification ) + def get_powerlink_connection_state_notifications( + self, on_powerlink_connection_state_notification + ) -> None: + """Callback for WebSocketEventPowerlinkConnectionState notifications.""" + self._notification_callbacks["WebSocketEventPowerlinkConnectionState"] = ( + on_powerlink_connection_state_notification + ) + def get_puc_install_remote_id_status_notifications( self, on_puc_install_remote_id_status_notification ) -> None: diff --git a/python_client/pyproject.toml b/python_client/pyproject.toml index e6e5808..e0c33ed 100644 --- a/python_client/pyproject.toml +++ b/python_client/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "mozart_api" -version = "3.4.1.8.8" +version = "4.1.1.116.0" description = "Mozart platform API" authors = [ "BangOlufsen ",