Skip to content

Commit

Permalink
Merge branch 'release/2022.8.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Aug 10, 2022
2 parents 2638899 + 9d2bf9a commit 8ff3281
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
8 changes: 2 additions & 6 deletions custom_components/xiaomi_miio_cooker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down Expand Up @@ -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] = {}

Expand Down Expand Up @@ -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
Expand All @@ -130,7 +128,6 @@ def setup(hass, config):

def update(event_time):
"""Update device status."""
from miio.cooker import OperationMode

try:
state = cooker.status()
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions custom_components/xiaomi_miio_cooker/manifest.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
3 changes: 1 addition & 2 deletions hacs.json
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 8ff3281

Please sign in to comment.