Fix export of additional information
This commit is contained in:
parent
cf80dfdb07
commit
d4b3d10525
|
@ -1,34 +1,19 @@
|
||||||
import logging
|
import logging
|
||||||
from typing import Mapping, Any
|
from typing import Any, Mapping
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (DEVICE_CLASS_SPEAKER,
|
||||||
DEVICE_CLASS_SPEAKER,
|
MediaPlayerEntity)
|
||||||
MediaPlayerEntity,
|
|
||||||
)
|
|
||||||
from homeassistant.components.media_player.const import (
|
from homeassistant.components.media_player.const import (
|
||||||
SUPPORT_PAUSE,
|
SUPPORT_PAUSE, SUPPORT_PLAY, SUPPORT_SELECT_SOUND_MODE,
|
||||||
SUPPORT_PLAY,
|
SUPPORT_SELECT_SOURCE, SUPPORT_STOP, SUPPORT_TURN_OFF, SUPPORT_TURN_ON,
|
||||||
SUPPORT_SELECT_SOUND_MODE,
|
SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET, SUPPORT_VOLUME_STEP)
|
||||||
SUPPORT_SELECT_SOURCE,
|
|
||||||
SUPPORT_STOP,
|
|
||||||
SUPPORT_TURN_OFF,
|
|
||||||
SUPPORT_TURN_ON,
|
|
||||||
SUPPORT_VOLUME_MUTE,
|
|
||||||
SUPPORT_VOLUME_SET,
|
|
||||||
SUPPORT_VOLUME_STEP,
|
|
||||||
)
|
|
||||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
from homeassistant.helpers.entity import DeviceInfo, generate_entity_id
|
from homeassistant.helpers.entity import DeviceInfo, generate_entity_id
|
||||||
|
|
||||||
from .models import DeviceConfig
|
|
||||||
from .api_extension.SoundbarDevice import SoundbarDevice
|
from .api_extension.SoundbarDevice import SoundbarDevice
|
||||||
from .const import (
|
from .const import (CONF_ENTRY_API_KEY, CONF_ENTRY_DEVICE_ID,
|
||||||
CONF_ENTRY_API_KEY,
|
CONF_ENTRY_DEVICE_NAME, CONF_ENTRY_MAX_VOLUME, DOMAIN)
|
||||||
CONF_ENTRY_DEVICE_ID,
|
from .models import DeviceConfig
|
||||||
CONF_ENTRY_DEVICE_NAME,
|
|
||||||
CONF_ENTRY_MAX_VOLUME,
|
|
||||||
DOMAIN,
|
|
||||||
)
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -193,4 +178,4 @@ class SmartThingsSoundbarMediaPlayer(MediaPlayerEntity):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def extra_state_attributes(self) -> Mapping[str, Any] | None:
|
def extra_state_attributes(self) -> Mapping[str, Any] | None:
|
||||||
return self.device.retrieve_data
|
return {"device_information": self.device.retrieve_data}
|
||||||
|
|
Loading…
Reference in New Issue