Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic support for Xiaomi Mi Smart Electric Rice Cooker #287

Merged
merged 35 commits into from
Apr 19, 2018

Conversation

syssi
Copy link
Collaborator

@syssi syssi commented Mar 29, 2018

Closes: #282

miio/cooker.py Outdated
MODEL_NORMAL5]


class OperationMode(enum.Enum):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined name 'enum'

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

miio/cooker.py Outdated
@@ -0,0 +1,199 @@
import logging
from collections import defaultdict
from .device import Device, DeviceException

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'.device.DeviceException' imported but unused

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 71.06% when pulling a59ae33 on syssi:feature/xiaomi-cooker into 056954c on rytilahti:master.

@coveralls
Copy link

coveralls commented Mar 29, 2018

Coverage Status

Coverage decreased (-1.0%) to 72.143% when pulling 7d272fa on syssi:feature/xiaomi-cooker into 76a2dd2 on rytilahti:master.

miio/cooker.py Outdated
MODEL_NORMAL_GROUP1 = [MODEL_NORMAL2, MODEL_NORMAL5]
MODEL_NRRMAL_GROUP2 = [MODEL_NORMAL3, MODEL_NORMAL4]

class OperationMode(enum.Enum):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expected 2 blank lines, found 1

miio/cooker.py Outdated
operate at full load to boil rice: ['running', '0001', '06000000ff', '031e0b23', '29', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010006015c64']
high temperature gelatinization: ['running', '0001', '07000000ff', '031e0b23', '22', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010007015d64']
temperature gelatinization: ['running', '0001', '0a000000ff', '031e0b23', '2', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff01000a015559']
meal is ready: ['autokeepwarm', '0001', '1000000000', '031e0b23031e', '1', '750', '60', '0207', '05040f', '00030017', '0100', 'ffffffffffff011effff01000000535d']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (189 > 100 characters)

miio/cooker.py Outdated
operate at full load to boil rice: ['running', '0001', '04000000ff', '031e0b23', '35', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010004026460']
operate at full load to boil rice: ['running', '0001', '06000000ff', '031e0b23', '29', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010006015c64']
high temperature gelatinization: ['running', '0001', '07000000ff', '031e0b23', '22', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010007015d64']
temperature gelatinization: ['running', '0001', '0a000000ff', '031e0b23', '2', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff01000a015559']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (189 > 100 characters)

miio/cooker.py Outdated
operate at full load to boil rice: ['running', '0001', '03000000ff', '031e0b23', '39', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010003055332']
operate at full load to boil rice: ['running', '0001', '04000000ff', '031e0b23', '35', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010004026460']
operate at full load to boil rice: ['running', '0001', '06000000ff', '031e0b23', '29', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010006015c64']
high temperature gelatinization: ['running', '0001', '07000000ff', '031e0b23', '22', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010007015d64']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (189 > 100 characters)

miio/cooker.py Outdated
absorb water at moderate temp: ['running', '0001', '02000000ff', '031e0b23', '48', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010002013f29']
operate at full load to boil rice: ['running', '0001', '03000000ff', '031e0b23', '39', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010003055332']
operate at full load to boil rice: ['running', '0001', '04000000ff', '031e0b23', '35', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010004026460']
operate at full load to boil rice: ['running', '0001', '06000000ff', '031e0b23', '29', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010006015c64']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (189 > 100 characters)

miio/cooker.py Outdated
absorb water at moderate temp: ['running', '0001', '02000000ff', '031e0b23', '54', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010002013e23']
absorb water at moderate temp: ['running', '0001', '02000000ff', '031e0b23', '48', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010002013f29']
operate at full load to boil rice: ['running', '0001', '03000000ff', '031e0b23', '39', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010003055332']
operate at full load to boil rice: ['running', '0001', '04000000ff', '031e0b23', '35', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010004026460']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (189 > 100 characters)

miio/cooker.py Outdated
quickly preheat: ['running', '0001', '00000000ff', '031e0b23', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']
absorb water at moderate temp: ['running', '0001', '02000000ff', '031e0b23', '54', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010002013e23']
absorb water at moderate temp: ['running', '0001', '02000000ff', '031e0b23', '48', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010002013f29']
operate at full load to boil rice: ['running', '0001', '03000000ff', '031e0b23', '39', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010003055332']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (189 > 100 characters)

miio/cooker.py Outdated
idle: ['waiting', '0001', 'null', '29', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']
quickly preheat: ['running', '0001', '00000000ff', '031e0b23', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']
absorb water at moderate temp: ['running', '0001', '02000000ff', '031e0b23', '54', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010002013e23']
absorb water at moderate temp: ['running', '0001', '02000000ff', '031e0b23', '48', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010002013f29']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (189 > 100 characters)

miio/cooker.py Outdated
"""
idle: ['waiting', '0001', 'null', '29', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']
quickly preheat: ['running', '0001', '00000000ff', '031e0b23', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']
absorb water at moderate temp: ['running', '0001', '02000000ff', '031e0b23', '54', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010002013e23']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (189 > 100 characters)

miio/cooker.py Outdated
def stage(self) -> str:
"""
idle: ['waiting', '0001', 'null', '29', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']
quickly preheat: ['running', '0001', '00000000ff', '031e0b23', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (189 > 100 characters)

miio/cooker.py Outdated
@property
def stage(self) -> str:
"""
idle: ['waiting', '0001', 'null', '29', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (189 > 100 characters)

operate at full load to boil rice: ['running', '0001', '06000000ff', '031e0b23', '29', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010006015c64']
high temperature gelatinization: ['running', '0001', '07000000ff', '031e0b23', '22', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010007015d64']
temperature gelatinization: ['running', '0001', '0a000000ff', '031e0b23', '2', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff01000a015559']
meal is ready: ['autokeepwarm', '0001', '1000000000', '031e0b23031e', '1', '750', '60', '0207', '05040f', '00030017', '0100', 'ffffffffffff011effff01000000535d']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (199 > 100 characters)

operate at full load to boil rice: ['running', '0001', '04000000ff', '031e0b23', '35', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010004026460']
operate at full load to boil rice: ['running', '0001', '06000000ff', '031e0b23', '29', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010006015c64']
high temperature gelatinization: ['running', '0001', '07000000ff', '031e0b23', '22', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010007015d64']
temperature gelatinization: ['running', '0001', '0a000000ff', '031e0b23', '2', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff01000a015559']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (199 > 100 characters)

operate at full load to boil rice: ['running', '0001', '03000000ff', '031e0b23', '39', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010003055332']
operate at full load to boil rice: ['running', '0001', '04000000ff', '031e0b23', '35', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010004026460']
operate at full load to boil rice: ['running', '0001', '06000000ff', '031e0b23', '29', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010006015c64']
high temperature gelatinization: ['running', '0001', '07000000ff', '031e0b23', '22', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010007015d64']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (199 > 100 characters)

absorb water at moderate temp: ['running', '0001', '02000000ff', '031e0b23', '48', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010002013f29']
operate at full load to boil rice: ['running', '0001', '03000000ff', '031e0b23', '39', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010003055332']
operate at full load to boil rice: ['running', '0001', '04000000ff', '031e0b23', '35', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010004026460']
operate at full load to boil rice: ['running', '0001', '06000000ff', '031e0b23', '29', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010006015c64']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (199 > 100 characters)

absorb water at moderate temp: ['running', '0001', '02000000ff', '031e0b23', '54', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010002013e23']
absorb water at moderate temp: ['running', '0001', '02000000ff', '031e0b23', '48', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010002013f29']
operate at full load to boil rice: ['running', '0001', '03000000ff', '031e0b23', '39', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010003055332']
operate at full load to boil rice: ['running', '0001', '04000000ff', '031e0b23', '35', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010004026460']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (199 > 100 characters)

idle: ['waiting', '0001', 'null', '29', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']
quickly preheat: ['running', '0001', '00000000ff', '031e0b23', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']
absorb water at moderate temp: ['running', '0001', '02000000ff', '031e0b23', '54', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010002013e23']
absorb water at moderate temp: ['running', '0001', '02000000ff', '031e0b23', '48', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010002013f29']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (199 > 100 characters)

miio/cooker.py Outdated
func , menu , stage , temp , t_func, t_precook, t_cook, setting, delay , version , favorite, custom
idle: ['waiting', '0001', 'null', '29', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']
quickly preheat: ['running', '0001', '00000000ff', '031e0b23', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']
absorb water at moderate temp: ['running', '0001', '02000000ff', '031e0b23', '54', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010002013e23']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (199 > 100 characters)

miio/cooker.py Outdated
"""
func , menu , stage , temp , t_func, t_precook, t_cook, setting, delay , version , favorite, custom
idle: ['waiting', '0001', 'null', '29', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']
quickly preheat: ['running', '0001', '00000000ff', '031e0b23', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (199 > 100 characters)

miio/cooker.py Outdated
def stage(self) -> str:
"""
func , menu , stage , temp , t_func, t_precook, t_cook, setting, delay , version , favorite, custom
idle: ['waiting', '0001', 'null', '29', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (199 > 100 characters)

miio/cooker.py Outdated
@property
def stage(self) -> str:
"""
func , menu , stage , temp , t_func, t_precook, t_cook, setting, delay , version , favorite, custom

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (184 > 100 characters)

func , menu , stage , temp , t_func, t_precook, t_cook, setting, delay , version , favorite, custom
idle: ['waiting', '0001', 'null', '29', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']
quickly preheat: ['running', '0001', '00000000ff', '031e0b23', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']
absorb water at moderate temp: ['running', '0001', '02000000ff', '031e0b23', '54', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010002013e23']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (199 > 100 characters)


func , menu , stage , temp , t_func, t_precook, t_cook, setting, delay , version , favorite, custom
idle: ['waiting', '0001', 'null', '29', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']
quickly preheat: ['running', '0001', '00000000ff', '031e0b23', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (199 > 100 characters)

'custom': '13281323ffff011effff010000001617'}

func , menu , stage , temp , t_func, t_precook, t_cook, setting, delay , version , favorite, custom
idle: ['waiting', '0001', 'null', '29', '60', '-1', '60', '0607', '05040f', '00030017', '0100', 'ffffffffffff011effff010000001d1f']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (199 > 100 characters)

'favorite': '0100',
'custom': '13281323ffff011effff010000001617'}

func , menu , stage , temp , t_func, t_precook, t_cook, setting, delay , version , favorite, custom

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (184 > 100 characters)

@syssi syssi force-pushed the feature/xiaomi-cooker branch from e941fb0 to 5fad578 Compare March 31, 2018 16:28
miio/cooker.py Outdated
s = "<TemperatureHistory temperatures=%s>" % self.data
return s

class CookerCustomizations:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expected 2 blank lines, found 1

@syssi syssi changed the title WIP: First draft of the Xiaomi Cooker support Support for Xiaomi Mi Smart Electric Rice Cooker Mar 31, 2018
@syssi syssi force-pushed the feature/xiaomi-cooker branch from 5b5cc97 to a2b0412 Compare March 31, 2018 21:27
Copy link
Owner

@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general. Consider the amount of classes and LOC, I'm wondering if this should be split into multiple files (and if we should start adding some structure into the source dir in these cases); miio/vacuum/ for vacuum, miio/cooker/ for cooker etc. What do you think?

miio/cooker.py Outdated
MODEL_NORMAL_GROUP1 = [MODEL_NORMAL2, MODEL_NORMAL5]
MODEL_NRRMAL_GROUP2 = [MODEL_NORMAL3, MODEL_NORMAL4]

COOKING_STAGE_NAME = [
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please merge this and cooking state descriptions into a dict.

miio/cooker.py Outdated
self.data = [int(data[i:i + 2], 16) for i in range(0, len(data), 2)]

@property
def temperatures(self) -> list[int]:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to from typing import List and use List here (and elsewhere).

Cancel = 'Отмена'


class TemperatureHistory:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doctstrings would be nice for this class, too. What does this dow and how can I use it? It's a container of temperatures recorded every X time interval? Is there a limit how many historical values are available?

ResumeP = 'resumep'
Start = 'start'
StartP = 'startp'
Cancel = 'Отмена'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks weird. What does it mean that they are potential candidates? Is it necessary that these are included?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are possible values of the property "func". A few are internal states of the android app probably. I've just collected all occurrences of string comparisons.

miio/cooker.py Outdated
"""
Example values:

ffffffffffff011effff010000001d1f,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have some sort of short description for the bytes / how to interpret these.

if len(value) == 2 and value.isdigit():
return int(value)

return None
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exception instead of returning None here too? (and below also, for error cases)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the cooker isn't cooking it returns the room temperature here (property: "temp").

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, what are the values otherwise? Those hex-encoded ones? Should this be printing a warning when used and the temperature is not available, and point out what to do instead of it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Discussed at discord.

@command(
default_output=format_output("Cooking stopped"),
)
def stop_outdated_firmware(self):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to check if outdated stop is necessary, and just expose the stop command?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible but ugly. I've to compare a lot of firmware versions and model types. It was to complicated to implement at the first step.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, then let it be like that for now.

MODEL_NORMAL3 = 'chunmi.cooker.normal4'
MODEL_NORMAL5 = 'chunmi.cooker.normal5'

MODEL_PRESSURE = [MODEL_PRESSURE1, MODEL_PRESSURE2]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If MODEL_PRESSURE{1,2} are used nowehere else than here, better just simply use them instead of exposing a global variable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These consts are important in future for all the edge-cases.

miio/cooker.py Outdated
MODEL_NORMAL5]

MODEL_NORMAL_GROUP1 = [MODEL_NORMAL2, MODEL_NORMAL5]
MODEL_NRRMAL_GROUP2 = [MODEL_NORMAL3, MODEL_NORMAL4]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in nrrmal. MODEL_NORMAL1 does not belong to any group? Are these global variables necessary?

@@ -0,0 +1,195 @@
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe miio/data/cooker_profiles.json to keep it from polluting the main source dir?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To add, the setup.py and/or manifest file will require also an update, otherwise the json file won't be added when generating a package.

@syssi syssi changed the title Support for Xiaomi Mi Smart Electric Rice Cooker WIP: Support for Xiaomi Mi Smart Electric Rice Cooker Apr 2, 2018
miio/cooker.py Outdated

import click

from .click_common import command, format_output, EnumType

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'.click_common.EnumType' imported but unused

@syssi syssi changed the title WIP: Support for Xiaomi Mi Smart Electric Rice Cooker Basic support for Xiaomi Mi Smart Electric Rice Cooker Apr 19, 2018
@syssi syssi merged commit e8b6489 into rytilahti:master Apr 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants