From 389f39b29919492cb2993644a0f5136c6f9ff87b Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Sun, 27 Mar 2022 14:20:58 +0200 Subject: [PATCH 1/4] Fix link to the token retrieval instructions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c2661c..66cf44d 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This is a custom component for home assistant to integrate the Xiaomi Mi Electric Rice Cooker V2. -Please follow the instructions on [Retrieving the Access Token](https://home-assistant.io/components/xiaomi/#retrieving-the-access-token) to get the API token to use in the configuration.yaml file. +Please follow the instructions on [Retrieving the Access Token](https://www.home-assistant.io/integrations/xiaomi_miio/#xiaomi-cloud-tokens-extractor) to get the API token to use in the configuration.yaml file. Credits: Thanks to [Rytilahti](https://github.com/rytilahti/python-miio) for all the work. From 39da1712f5f9f3f737476ba323658a20595c8f8b Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Thu, 2 Jun 2022 07:45:38 +0200 Subject: [PATCH 2/4] Remove iot class --- hacs.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hacs.json b/hacs.json index c6482bb..4a5860e 100644 --- a/hacs.json +++ b/hacs.json @@ -1,6 +1,5 @@ { "name": "Xiaomi Mi Electric Rice Cooker Integration", "content_in_root": false, - "render_readme": true, - "iot_class": "local_polling" + "render_readme": true } From 1debc31fc01634ba7f8f547869e1a12d028ff16e Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Wed, 10 Aug 2022 20:46:42 +0200 Subject: [PATCH 3/4] Bump python-miio and component version --- custom_components/xiaomi_miio_cooker/manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/xiaomi_miio_cooker/manifest.json b/custom_components/xiaomi_miio_cooker/manifest.json index aa0958f..63a266f 100644 --- a/custom_components/xiaomi_miio_cooker/manifest.json +++ b/custom_components/xiaomi_miio_cooker/manifest.json @@ -1,14 +1,14 @@ { "domain": "xiaomi_miio_cooker", "name": "Xiaomi Mi Electric Rice Cooker", - "version": "2022.3.3.0", + "version": "2022.8.0.0", "iot_class": "local_polling", "config_flow": false, "documentation": "https://github.com/syssi/xiaomi_cooker", "issue_tracker": "https://github.com/syssi/xiaomi_cooker/issues", "requirements": [ "construct==2.10.56", - "python-miio>=0.5.11" + "python-miio>=0.5.12" ], "dependencies": [], "codeowners": [ From 9d2bf9ad73b4bb5bd9c5fe330b48cb5d50ba0d22 Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Wed, 10 Aug 2022 20:46:57 +0200 Subject: [PATCH 4/4] Move imports to the top --- custom_components/xiaomi_miio_cooker/__init__.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/custom_components/xiaomi_miio_cooker/__init__.py b/custom_components/xiaomi_miio_cooker/__init__.py index c07d7b4..af22e4b 100644 --- a/custom_components/xiaomi_miio_cooker/__init__.py +++ b/custom_components/xiaomi_miio_cooker/__init__.py @@ -10,6 +10,8 @@ from homeassistant.helpers.entity import Entity from homeassistant.helpers.event import track_time_interval from homeassistant.util.dt import utcnow +from miio import Cooker, Device, DeviceException +from miio.cooker import OperationMode _LOGGER = logging.getLogger(__name__) @@ -78,8 +80,6 @@ # pylint: disable=unused-argument def setup(hass, config): """Set up the platform from config.""" - from miio import Device, DeviceException - if DOMAIN not in hass.data: hass.data[DOMAIN] = {} @@ -110,8 +110,6 @@ def setup(hass, config): raise PlatformNotReady if model in SUPPORTED_MODELS: - from miio import Cooker - cooker = Cooker(host, token) hass.data[DOMAIN][host] = cooker @@ -130,7 +128,6 @@ def setup(hass, config): def update(event_time): """Update device status.""" - from miio.cooker import OperationMode try: state = cooker.status() @@ -209,7 +206,6 @@ def extra_state_attributes(self): # async def _try_command(self, mask_error, func, *args, **kwargs): # """Call a device command handling error messages.""" -# from miio import DeviceException # try: # result = await # self.hass.async_add_job(