mirror of https://github.com/home-assistant/core
Bump aioslimproto to 3.0.0 (#113046)
This commit is contained in:
parent
6d440e36ad
commit
e87e0d2d41
|
@ -6,5 +6,5 @@
|
|||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/slimproto",
|
||||
"iot_class": "local_push",
|
||||
"requirements": ["aioslimproto==2.3.3"]
|
||||
"requirements": ["aioslimproto==3.0.0"]
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import asyncio
|
|||
from typing import Any
|
||||
|
||||
from aioslimproto.client import PlayerState, SlimClient
|
||||
from aioslimproto.const import EventType, SlimEvent
|
||||
from aioslimproto.models import EventType, SlimEvent
|
||||
from aioslimproto.server import SlimServer
|
||||
|
||||
from homeassistant.components import media_source
|
||||
|
@ -145,9 +145,23 @@ class SlimProtoPlayer(MediaPlayerEntity):
|
|||
def update_attributes(self) -> None:
|
||||
"""Handle player updates."""
|
||||
self._attr_volume_level = self.player.volume_level / 100
|
||||
self._attr_is_volume_muted = self.player.muted
|
||||
self._attr_media_position = self.player.elapsed_seconds
|
||||
self._attr_media_position_updated_at = utcnow()
|
||||
self._attr_media_content_id = self.player.current_url
|
||||
if (current_media := self.player.current_media) and (
|
||||
metadata := current_media.metadata
|
||||
):
|
||||
self._attr_media_content_id = metadata.get("item_id", current_media.url)
|
||||
self._attr_media_artist = metadata.get("artist")
|
||||
self._attr_media_album_name = metadata.get("album")
|
||||
self._attr_media_title = metadata.get("title")
|
||||
self._attr_media_image_url = metadata.get("image_url")
|
||||
else:
|
||||
self._attr_media_content_id = current_media.url if current_media else None
|
||||
self._attr_media_artist = None
|
||||
self._attr_media_album_name = None
|
||||
self._attr_media_title = None
|
||||
self._attr_media_image_url = None
|
||||
self._attr_media_content_type = "music"
|
||||
|
||||
async def async_media_play(self) -> None:
|
||||
|
|
|
@ -371,7 +371,7 @@ aioshelly==8.1.1
|
|||
aioskybell==22.7.0
|
||||
|
||||
# homeassistant.components.slimproto
|
||||
aioslimproto==2.3.3
|
||||
aioslimproto==3.0.0
|
||||
|
||||
# homeassistant.components.steamist
|
||||
aiosteamist==0.3.2
|
||||
|
|
|
@ -344,7 +344,7 @@ aioshelly==8.1.1
|
|||
aioskybell==22.7.0
|
||||
|
||||
# homeassistant.components.slimproto
|
||||
aioslimproto==2.3.3
|
||||
aioslimproto==3.0.0
|
||||
|
||||
# homeassistant.components.steamist
|
||||
aiosteamist==0.3.2
|
||||
|
|
Loading…
Reference in New Issue