Skip to content

Commit

Permalink
🐛 v2.7.11 (#180)
Browse files Browse the repository at this point in the history
Signed-off-by: Ludy87 <[email protected]>
  • Loading branch information
Ludy87 authored Mar 5, 2023
1 parent e328eae commit 37742d5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions custom_components/xplora_watch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
coordinator = XploraDataUpdateCoordinator(hass, entry)
await coordinator.init()
await coordinator.async_config_entry_first_refresh()
wuids = coordinator.controller.getWatchUserIDs()
for wuid in wuids:
if not await coordinator.controller.isAdmin(wuid):
_LOGGER.warning(f"You are no admin for Watch {wuid}!")

hass.data.setdefault(DOMAIN, {})

Expand Down
2 changes: 1 addition & 1 deletion custom_components/xplora_watch/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"dataclasses-json",
"pydub"
],
"version": "v2.7.10"
"version": "v2.7.11"
}
6 changes: 3 additions & 3 deletions custom_components/xplora_watch/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ async def async_read_message(self, targets: list[str] | None = None, **kwargs):
await self._coordinator._async_update_data(new_data=old_state)

async def _fetch_chat_voice(self, watch_id: str, msg_id: str) -> None:
voice: Dict[str, Any] = await self._gql_handler.fetchChatVoice_a(watch_id, msg_id)
voice: Dict[str, Any] = await self._coordinator.controller._gql_handler.fetchChatVoice_a(watch_id, msg_id)
encoded_base64_string_to_mp3_file(self._hass, voice.get("fetchChatVoice"), msg_id)

async def _fetch_chat_short_video(self, watch_id: str, msg_id: str) -> None:
video: Dict[str, Any] = await self._gql_handler.fetchChatShortVideo_a(watch_id, msg_id)
video: Dict[str, Any] = await self._coordinator.controller._gql_handler.fetchChatShortVideo_a(watch_id, msg_id)
encoded_base64_string_to_file(self._hass, video.get("fetchChatShortVideo"), msg_id, "mp4", "video")
thumb: Dict[str, Any] = await self._gql_handler.fetchChatShortVideoCover_a(watch_id, msg_id)
thumb: Dict[str, Any] = await self._coordinator.controller._gql_handler.fetchChatShortVideoCover_a(watch_id, msg_id)
encoded_base64_string_to_file(self._hass, thumb.get("fetchChatShortVideoCover"), msg_id, "jpeg", "video/thumb")

async def _fetch_chat_image(self, watch, msg_id):
Expand Down

0 comments on commit 37742d5

Please sign in to comment.