-
-
Notifications
You must be signed in to change notification settings - Fork 32k
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
Add Xiaomi Mi Air Dehumidifier #28690
Conversation
Hey there @rytilahti, @syssi, mind taking a look at this pull request as its been labeled with a integration ( |
@stkang please format your code with |
Can't wait to see this supported by HA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some suggestions please take a look :)
ATTR_COMPRESSOR_STATUS = 'compressor_status' | ||
ATTR_DEFROST_STATUS = 'defrost_status' | ||
ATTR_FAN_ST = 'fan_st' | ||
ATTR_ALARM = 'alarm' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could move these constants or even more into a separate file e.g. const.py
and import them into this file.
self._skip_update = False | ||
return | ||
|
||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only wrap one statement where an exception could occur with a try-catch statement
@property | ||
def temperature_unit(self): | ||
"""Return the unit of measurement which this thermostat uses.""" | ||
return TEMP_CELSIUS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this model only support measuring the temperature in celsius?
ATTR_DEFROST_STATUS: 'defrost_status', | ||
ATTR_FAN_ST: 'fan_st', | ||
ATTR_ALARM: 'alarm', | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like 1-1 mapping to me. What purpose does this have?
async def async_setup_platform(hass, config, async_add_entities, | ||
discovery_info=None): | ||
"""Set up the miio fan device from config.""" | ||
from miio import Device, DeviceException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move all imports to the top of the file, see #27284 for more details.
@property | ||
def min_humidity(self): | ||
"""Return the minimum humidity.""" | ||
return 40 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about other models? Do the support a different min/max humidity?
@stkang Could you care about the review of @springstan? I would like to see this device supported. |
I have used the py file to create a custom component, it works great. |
@syssi @sasukebinbin @springstan I can't build a development environment for HA. However, this code works. This code is based on the existing miio_fan. If you really need this component, please fix the above CI error and make a new Pull Request. |
@stkang you should not build your dev environment on top of your existing home assistant instance. Instead you should set up a fresh development environment like it is mentionend in the developer documentation. |
This PR seems to have gone stale. Closing it. |
Description:
Add Device Xiaomi Mi Air Dehumidifier
Related issue (if applicable):
fixes #
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>
Example entry for
configuration.yaml
(if applicable):Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest
.requirements_all.txt
by runningpython3 -m script.gen_requirements_all
..coveragerc
.If the code does not interact with devices: