Merge branch 'feature/disable-audio-track' of https://github.com/samuelspagl/ha_samsung_soundbar into feature/disable-audio-track

This commit is contained in:
samuelspagl 2024-10-14 21:29:39 +02:00
commit e8cc95876e
1 changed files with 6 additions and 2 deletions

View File

@ -373,11 +373,15 @@ class SoundbarDevice:
@property
def media_duration(self) -> int | None:
return self.device.status.attributes.get("totalTime").value
attr = self.device.status.attributes.get("totalTime", None)
if attr:
return attr.value
@property
def media_position(self) -> int | None:
return self.device.status.attributes.get("elapsedTime").value
attr = self.device.status.attributes.get("elapsedTime", None)
if attr:
return attr.value
async def media_play(self):
await self.device.play(True)