Skip to content

Commit

Permalink
🐛 v2.8.3 (#233)
Browse files Browse the repository at this point in the history
Signed-off-by: Ludy87 <[email protected]>
  • Loading branch information
Ludy87 authored Jul 12, 2023
1 parent e1f3442 commit 98e566a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion custom_components/xplora_watch/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"pydub",
"marshmallow-enum"
],
"version": "v2.8.2"
"version": "v2.8.3"
}
12 changes: 8 additions & 4 deletions custom_components/xplora_watch/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,21 @@ async def async_read_message(self, targets: list[str] | None = None, **kwargs):

async def _fetch_chat_voice(self, watch_id: str, msg_id: str) -> None:
voice: dict[str, any] = await self._coordinator.controller.get_chat_voice(watch_id, msg_id)
encoded_base64_string_to_mp3_file(self._hass, voice, msg_id)
if voice:
encoded_base64_string_to_mp3_file(self._hass, voice, msg_id)

async def _fetch_chat_short_video(self, watch_id: str, msg_id: str) -> None:
video: dict[str, any] = await self._coordinator.controller.get_short_video(watch_id, msg_id)
encoded_base64_string_to_file(self._hass, video, msg_id, "mp4", "video")
if video:
encoded_base64_string_to_file(self._hass, video, msg_id, "mp4", "video")
thumb: dict[str, any] = await self._coordinator.controller.get_short_video_cover(watch_id, msg_id)
encoded_base64_string_to_file(self._hass, thumb.get("fetchChatShortVideoCover"), msg_id, "jpeg", "video/thumb")
if thumb:
encoded_base64_string_to_file(self._hass, thumb.get("fetchChatShortVideoCover"), msg_id, "jpeg", "video/thumb")

async def _fetch_chat_image(self, watch, msg_id):
image = await self._coordinator.controller.get_chat_image(watch, msg_id)
encoded_base64_string_to_file(self._hass, image, msg_id, "jpeg", "image")
if image:
encoded_base64_string_to_file(self._hass, image, msg_id, "jpeg", "image")


class XploraShutdownService(XploraService):
Expand Down

0 comments on commit 98e566a

Please sign in to comment.