diff --git a/custom_components/divoom_pixoo/pixoo64/_pixoo.py b/custom_components/divoom_pixoo/pixoo64/_pixoo.py index 5cfcd78..269f6f3 100644 --- a/custom_components/divoom_pixoo/pixoo64/_pixoo.py +++ b/custom_components/divoom_pixoo/pixoo64/_pixoo.py @@ -347,6 +347,16 @@ def set_custom_page(self, index): if data['error_code'] != 0: self.__error(data) + def play_gif(self, gif_url): + response = requests.post(self.__url, json.dumps({ + 'Command': 'Device/PlayTFGif', + 'FileType': 2, + 'FileName': gif_url + }), timeout=self.timeout) + data = response.json() + if data['error_code'] != 0: + self.__error(data) + def set_face(self, face_id): self.set_clock(face_id) diff --git a/custom_components/divoom_pixoo/sensor.py b/custom_components/divoom_pixoo/sensor.py index 6bdf8a3..af3c5b7 100644 --- a/custom_components/divoom_pixoo/sensor.py +++ b/custom_components/divoom_pixoo/sensor.py @@ -144,6 +144,8 @@ def _render_page(self, page: dict): pixoo.set_visualizer(page['id']) elif page_type == "clock": pixoo.set_clock(page['id']) + elif page_type == "gif": + pixoo.play_gif(page['gif_url']) elif page_type in ["custom", "components"]: variables = page.get('variables', {}) rendered_variables = {}