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
get()[source]

Stub for get method

set()[source]

Stub for set method

set_update()[source]

Set the is_updated event

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

parse(data)[source]

Parse the XML into class properties.

Parameters:data – string data to be parsed
press(button)[source]

Implements buttons being pressed and released.

Parameters:button – Button to be pressed, should match KEY_VALUE
Raises:KeyNotFound – 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

get()[source]

Get /now_playing data using REST API.

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?

get()[source]

Get /volume data using REST API.

parse(data)[source]

Parse the XML into class properties.

Parameters:data – string data to be parsed
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

parse(data)[source]

Parse the XML into class properties.

Parameters:data – string data to be parsed
press(button)[source]

Implements buttons being pressed and released.

Parameters:button – Button to be pressed, should match KEY_VALUE
Raises:KeyNotFound – 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

get()[source]

Get /now_playing data using REST API.

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?

get()[source]

Get /volume data using REST API.

parse(data)[source]

Parse the XML into class properties.

Parameters:data – string data to be parsed
set(volume)[source]

Set the volume.

Parameters:volume – Volume to set