aiobosest.helpers package

Submodules

aiobosest.helpers.base module

class aiobosest.helpers.base.BaseHelper(key_name=None, is_updated=None)[source]

Bases: object

BaseHelper class for all the API methods available on Bose SoundTouch.

Parameters
  • key_name – The XML Element name. e.g. ‘volume’

  • is_updated – asyncio.Event() is set when an update happens

async get()[source]

Stub for get method

async set()[source]

Stub for set method

set_update()[source]

Set the is_updated event

async xml_parse(data)[source]

Parse the XML data taking into consideration if it’s coming from WebSocket or not.

Parameters

data – string data to be parsed

Returns

An XMLElement relative to the key_name

aiobosest.helpers.key module

class aiobosest.helpers.key.Key(connection, is_updated=None)[source]

Bases: aiobosest.helpers.base.BaseHelper

Helper class for the /key API method.

Parameters
  • connection – Connection class

  • is_updated – asyncio.Event() is set when an update happens

state

Button state, should match KEY_STATE

value

Button value, should match KEY_VALUE

async parse(data)[source]

Parse the XML into class properties.

Parameters

data – string data to be parsed

async press(button)[source]

Implements buttons being pressed and released.

Parameters

button – Button to be pressed, should match KEY_VALUE

Raises

aiobosest.errors.KeyNotFoundError – When button is not defined in KEY_VALUE

aiobosest.helpers.now_playing module

class aiobosest.helpers.now_playing.NowPlaying(connection, is_updated=None)[source]

Bases: aiobosest.helpers.base.BaseHelper

Helper class for the /now_playing API method.

Parameters
  • connection – Connection class

  • is_updated – asyncio.Event() is set when an update happens

source

System source e.g. STANDBY or AUX

itemName

Item name playing

track

self explaining

artist

self explaining

album

self explaining

art

URL of the art image

artImageStatus

Image Status from ART_STATUS

time_total

Total time when available

time_elapsed

Elapsed time when available

playStatus

Play status from PLAY_STATUS

shuffleSetting

Is Shuffle ON

repeatSetting

Is Repeat ON

streamType

Stream Type

trackID

Track ID

async get()[source]

Get /now_playing data using REST API.

async parse(data)[source]

Parse the XML into class properties.

Parameters

data – string data to be parsed

aiobosest.helpers.presets module

class aiobosest.helpers.presets.PresetItem[source]

Bases: object

Defines a Preset

id

Preset ID

source

SourceItem:

type

Source location type

location

uri or item number to locate the source

sourceAccount

source account

isPresetable

if this is preseatable or not

itemName

Item name

class aiobosest.helpers.presets.Presets(connection, is_updated=None)[source]

Bases: aiobosest.helpers.base.BaseHelper

Helper class for the /presets API method.

Parameters
  • connection – Connection class

  • is_updated – asyncio.Event() is set when an update happens

presets

PresetItem: list

async get()[source]

Get /presets data using REST API.

async parse(data)[source]

Parse the XML into class properties.

Parameters

data – string data to be parsed

set_sources(sources)[source]

aiobosest.helpers.sources module

class aiobosest.helpers.sources.SourceItem[source]

Bases: object

Defines a SourceItem

source

Source

sourceAccount

Account used on the source

status

Source status

isLocal

If is local on the system

name

Name or account used on the source

class aiobosest.helpers.sources.Sources(connection, is_updated=None)[source]

Bases: aiobosest.helpers.base.BaseHelper

Helper class for the /sources API method.

Parameters
  • connection – Connection class

  • is_updated – asyncio.Event() is set when an update happens

sources

SourceItem: list

async get()[source]

Get /sources data using REST API.

async parse(data)[source]

Parse the XML into class properties.

Parameters

data – string data to be parsed

aiobosest.helpers.volume module

class aiobosest.helpers.volume.Volume(connection, is_updated=None)[source]

Bases: aiobosest.helpers.base.BaseHelper

Helper class for the /volume API method.

Parameters
  • connection – Connection class

  • is_updated – asyncio.Event() is set when an update happens

targetvolume

Target volume when setting

actualvolume

Actual volume

muteenabled

Is mute enabled?

async get()[source]

Get /volume data using REST API.

async parse(data)[source]

Parse the XML into class properties.

Parameters

data – string data to be parsed

async set(volume)[source]

Set the volume.

Parameters

volume – Volume to set

Module contents

class aiobosest.helpers.Key(connection, is_updated=None)[source]

Bases: aiobosest.helpers.base.BaseHelper

Helper class for the /key API method.

Parameters
  • connection – Connection class

  • is_updated – asyncio.Event() is set when an update happens

state

Button state, should match KEY_STATE

value

Button value, should match KEY_VALUE

async parse(data)[source]

Parse the XML into class properties.

Parameters

data – string data to be parsed

async press(button)[source]

Implements buttons being pressed and released.

Parameters

button – Button to be pressed, should match KEY_VALUE

Raises

aiobosest.errors.KeyNotFoundError – When button is not defined in KEY_VALUE

class aiobosest.helpers.NowPlaying(connection, is_updated=None)[source]

Bases: aiobosest.helpers.base.BaseHelper

Helper class for the /now_playing API method.

Parameters
  • connection – Connection class

  • is_updated – asyncio.Event() is set when an update happens

source

System source e.g. STANDBY or AUX

itemName

Item name playing

track

self explaining

artist

self explaining

album

self explaining

art

URL of the art image

artImageStatus

Image Status from ART_STATUS

time_total

Total time when available

time_elapsed

Elapsed time when available

playStatus

Play status from PLAY_STATUS

shuffleSetting

Is Shuffle ON

repeatSetting

Is Repeat ON

streamType

Stream Type

trackID

Track ID

async get()[source]

Get /now_playing data using REST API.

async parse(data)[source]

Parse the XML into class properties.

Parameters

data – string data to be parsed

class aiobosest.helpers.Presets(connection, is_updated=None)[source]

Bases: aiobosest.helpers.base.BaseHelper

Helper class for the /presets API method.

Parameters
  • connection – Connection class

  • is_updated – asyncio.Event() is set when an update happens

presets

PresetItem: list

async get()[source]

Get /presets data using REST API.

async parse(data)[source]

Parse the XML into class properties.

Parameters

data – string data to be parsed

set_sources(sources)[source]
class aiobosest.helpers.Sources(connection, is_updated=None)[source]

Bases: aiobosest.helpers.base.BaseHelper

Helper class for the /sources API method.

Parameters
  • connection – Connection class

  • is_updated – asyncio.Event() is set when an update happens

sources

SourceItem: list

async get()[source]

Get /sources data using REST API.

async parse(data)[source]

Parse the XML into class properties.

Parameters

data – string data to be parsed

class aiobosest.helpers.Volume(connection, is_updated=None)[source]

Bases: aiobosest.helpers.base.BaseHelper

Helper class for the /volume API method.

Parameters
  • connection – Connection class

  • is_updated – asyncio.Event() is set when an update happens

targetvolume

Target volume when setting

actualvolume

Actual volume

muteenabled

Is mute enabled?

async get()[source]

Get /volume data using REST API.

async parse(data)[source]

Parse the XML into class properties.

Parameters

data – string data to be parsed

async set(volume)[source]

Set the volume.

Parameters

volume – Volume to set