Commit graph

57 commits

Author SHA1 Message Date
Igor Pakhomov
2ffb46dc93
Initial xiaomi_miio support for dmaker.airfresh.a1/t2017 (#66331)
* Initial support for dmaker.airfresh.a1/t2017

* fix typo
2022-02-11 23:28:22 +01:00
epenet
cb135bc889
Add basic type hints to xiaomi_miio (#62889)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-28 00:15:40 +01:00
Maciej Bieniek
43ccf1d967
Handle None values in Xiaomi Miio integration (#58880)
* Initial commit

* Improve _handle_coordinator_update()

* Fix entity_description define

* Improve sensor & binary_sensor platforms

* Log None value

* Use coordinator variable

* Improve log strings

* Filter attributes with None values

* Add hasattr condition

* Update homeassistant/components/xiaomi_miio/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-11-01 17:40:15 +01:00
Marc Mueller
1e98761f30
Use assignment expressions 15 (#57961) 2021-10-18 14:01:23 +02:00
Maciej Bieniek
4cdbd3c576
Fix Unable to serialize to JSON error in Xiaomi Miio (#56929) 2021-10-02 09:05:49 +02:00
Maciej Bieniek
0044fa9fb9
Add support for pedestal MIOT fans to Xiaomi Miio integration (#56555)
* Add initial support for Xiaomi Fan ZA5

* Add sensor, number and switch platform

* Addionizer switch

* Improve ionizer icon

* Fix parent of XiaomiFanMiot class

* Add another MIOT models

* Fix consts

* Add powersupply attached binary sensor

* Simplify async_create_miio_device_and_coordinator

* Simplify XiaomiGenericFan

* Fix XiaomiFanZA5 parent

* Remove pass

* Remove unused _available variable

* 1C doesn't support direction

* Suggested change

* Use elif

* Clean up oscillation angle

* Fix typo
2021-09-28 10:21:14 +02:00
Maciej Bieniek
bb6f97c4d3
Rework Xiaomi Miio fan platform (#55846) 2021-09-20 14:49:39 +02:00
Maciej Bieniek
86247c93fc
Fix available property for Xiaomi Miio fan platform (#55889)
* Fix available

* Suggested change
2021-09-07 11:34:41 +02:00
Maciej Bieniek
753285eae7
Fix a lazy preset mode update for Xiaomi Miio fans (#55837) 2021-09-06 12:33:34 +02:00
Maciej Bieniek
08a0377dcb
Add support for Xiaomi Miio Air Purifier 3C (#55484) 2021-08-31 16:44:13 +02:00
Maciej Bieniek
f942cb03a4
Fix AttributeError for non-MIOT Xiaomi Miio purifiers (#55271) 2021-08-26 09:29:25 -07:00
Maciej Bieniek
b97d131fb3
Add support for Xiaomi Miio pedestal fans (#55114)
Co-authored-by: Teemu R. <tpr@iki.fi>
2021-08-25 12:09:01 -05:00
Maciej Bieniek
06604728c5
Remove should poll property from Xiaomi Miio fan platform (#55201) 2021-08-25 15:25:46 +02:00
Maciej Bieniek
0c68a54dea
Fix TypeError in Xiaomi Miio fan platform (#55091) 2021-08-23 22:51:29 +02:00
Maciej Bieniek
4a6ca8a04e
Add number platform for Xiaomi Miio fan (#54977) 2021-08-21 19:09:42 +02:00
Teemu R
3048923dc2
Remove deprecated async_setup_platforms() for xiaomi_miio (#54930) 2021-08-20 11:13:58 -07:00
Maciej Bieniek
fe6c896754
Add switch platform for Xiaomi Miio fans (#54834) 2021-08-20 15:12:29 +02:00
SmaginPV
07c0fc9eba
Remove deprecated Xiaomi Miio fan speeds (#54182) 2021-08-18 15:53:17 +02:00
Maciej Bieniek
c937a235e1
Add select platform for Xiaomi Miio fans (#54702)
* Add select platform for Xiaomi Miio purifiers

* Add missing condition for AirFresh

* Suggested change

* Remove fan_set_led_brightness from services.yaml

* Remove zhimi.airpurifier.v3
2021-08-18 11:24:15 +02:00
Maciej Bieniek
ebaae8d2bf
Add sensor platform for Xiaomi Miio fans (#54564) 2021-08-15 13:49:29 +02:00
Jan Bouwhuis
5de1adacf7
Xiaomi miio add coordinator to fan platform (#54366)
* init coordinator for airpurifiers and airfresh

* Update fan entities with coordinator

* cache mode and fan_level at user update

* pylint define attributes in _init

* Update homeassistant/components/xiaomi_miio/fan.py

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>

* Update homeassistant/components/xiaomi_miio/fan.py

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>

* Update homeassistant/components/xiaomi_miio/fan.py

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>

* cleanup code

* Set hass.data[DATA_KEY] to enable

* rename to filtered_entities in service handler

* Update homeassistant/components/xiaomi_miio/fan.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* flake

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-08-10 14:55:11 +02:00
Jan Bouwhuis
d55c764048
Fix Xiaomi-miio turn fan on with speed, percentage or preset (#54353) 2021-08-09 14:43:59 -07:00
Jan Bouwhuis
0149095824
Fix xiaomi air fresh fan preset modes (#54342) 2021-08-09 20:57:36 +02:00
Jan Bouwhuis
781015fb19
Xiaomi_Miio Humidifier rework (#52366)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>
Co-authored-by: Teemu R. <tpr@iki.fi>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-07-28 10:52:43 +02:00
Jan Bouwhuis
9753500f5e
Disable speeds for first gen Xiaomi_miio air purifiers (#52772)
* Disable speeds for first gen air purifiers

* Remove test code line

* remove OPERATION_MODES_AIRPURIFIER list
2021-07-22 08:57:29 +02:00
Marc Mueller
7711ac901c
Fix issues after pylint update (#53205) 2021-07-19 20:22:13 -07:00
Daniel Hjelseth Høyer
fbad453c89
Pylint 2.9.3 (#52972)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2021-07-14 21:44:57 -07:00
Jan Bouwhuis
29bfb4b046
Xiaomi_miio fan percentage based speeds and preset_modes (#51791) 2021-06-23 11:30:42 +02:00
Maciej Bieniek
97559087b5
Allow some failures before setting Xiaomi Miio MIOT air purifiers unavailable (#50755) 2021-05-17 14:13:01 +02:00
starkillerOG
78dabc83ec
Add Xiaomi Miio zhimi.airpurifier.mc2 (#48840)
* add zhimi.airpurifier.mc2

* fix issort
2021-04-08 13:40:29 +02:00
billsq
55db855f91
Add support for Xiaomi Air Purifier Pro H (#47601) 2021-03-16 20:54:13 +01:00
Erik Montnemery
1fc8e32d86
Update integrations t-z to override extra_state_attributes() (#47760) 2021-03-11 20:16:26 +01:00
tkdrob
3baeed3684
Clean up constants (#47323) 2021-03-05 19:08:04 +01:00
Ville Skyttä
dc880118a4
Lint suppression cleanups (#47248)
* Unused pylint suppression cleanups

* Remove outdated pylint bug references

* Add flake8-noqa config and note to run it every now and then

* Add codes to noqa's

* Unused noqa cleanups
2021-03-02 09:02:04 +01:00
starkillerOG
7dc9071776
Add Xiaomi Miio fan config flow (#46866)
* Miio fan config flow

* fix styling and imports

* Update homeassistant/components/xiaomi_miio/fan.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/xiaomi_miio/fan.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/xiaomi_miio/fan.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/xiaomi_miio/fan.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/xiaomi_miio/fan.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* rename device -> entity

* fix indent

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-25 04:25:06 +01:00
J. Nick Koston
068d1b5eb8
Separate fan speeds into percentages and presets modes (#45407)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: John Carr <john.carr@unrouted.co.uk>
2021-01-27 17:44:36 -06:00
Anton Palgunov
d3f952f831
Add new air-humidifier device CA4 with miot protocol (#39398)
* Add new air-humidifier device CA4 with miot protocol

* Update homeassistant/components/xiaomi_miio/fan.py

Co-authored-by: Teemu R. <tpr@iki.fi>

* xiomi_miio fan Standard speed for fan, removed static attributes

* xiomi_miio fan Standard speed for fan, removed static attributes

* xiomi_miio fan unnessary elif

* added mode_mapping

* Changed mode_mapping to constant also move reverse to constant

* Removerd water_level

* Return to exclude breaking changes

Co-authored-by: Teemu R. <tpr@iki.fi>
2020-11-19 21:56:53 +01:00
Teemu R
bdb71c9159
Only log xiaomi_miio update exceptions once (#41226)
* xiaomi_miio: only log update exceptions once

Replaces #37695

* add som more missed exception logger cases + do not change the control flow as pointed out by @cgtobi

* Use patch&MagickMock from tests.async_mock

* Fix linting for alarm_control_panel

* update the test to verify that the warning on update is only logged when the device was previously available
2020-10-25 01:53:36 +02:00
Matthias Alphart
93a9a11065
Add config validator helper positive_float (#41640) 2020-10-11 22:04:49 +02:00
Ville Skyttä
b4bac0f7a0
Exception chaining and wrapping improvements (#39320)
* Remove unnecessary exception re-wraps

* Preserve exception chains on re-raise

We slap "from cause" to almost all possible cases here. In some cases it
could conceivably be better to do "from None" if we really want to hide
the cause. However those should be in the minority, and "from cause"
should be an improvement over the corresponding raise without a "from"
in all cases anyway.

The only case where we raise from None here is in plex, where the
exception for an original invalid SSL cert is not the root cause for
failure to validate a newly fetched one.

Follow local convention on exception variable names if there is a
consistent one, otherwise `err` to match with majority of codebase.

* Fix mistaken re-wrap in homematicip_cloud/hap.py

Missed the difference between HmipConnectionError and
HmipcConnectionError.

* Do not hide original error on plex new cert validation error

Original is not the cause for the new one, but showing old in the
traceback is useful nevertheless.
2020-08-28 13:50:32 +02:00
Alexander Hardwicke
368116d242
Give fan and remote components unique LED strings (#37605) 2020-07-08 15:29:51 -04:00
Andrey Kupreychik
912eb321d9
Add support for Mi AirPurifier 3 (#31729)
* Adding support for Mi AirPurifier 3

* Adding support for Mi AirPurifier 3H

* Enabled setting fan level for AirPurifier 3/3H

* Get rid of isinstance for MIOT AirPurifier

* Bumping xiaomi-miio dependency

* Fixed lint error

* Update manifest.json

* Fixed requirements files for 0.5.0.1

Co-authored-by: Piotr Król <Piotr@gorszyportal.pl>
2020-04-03 16:32:18 +02:00
Franck Nijhof
f5d4878992 Fix isort on a small set of misc files (#29803) 2019-12-10 09:25:42 +01:00
Bas Nijholt
c7b2c09a61 Sort imports according to PEP8 for xiaomi_miio (#29677) 2019-12-09 11:42:18 +01:00
Raman Gupta
040fd9c258 Update service domains for xiaomi_miio from base domains to xiaomi_miio domain (#29134)
* move service constants to const.py, move all custom xiaomi_miio services to xiaomi_miio domain

* update service names

* try to fix black error

* try black formatting again

* final black formatting attempt

* update service names to reflect platform

* fix typo
2019-12-02 11:49:39 -08:00
Tomasz
f8d3ea20b6 Move imports in xiaomi_miio (#27773)
* move imports in xiaomi_miio

* reorder imports with isort

* fix pylint error

* Rename imports
2019-11-08 18:32:44 +01:00
Sebastian Muszynski
5b96704c4a Use dict[key] for required config keys (#28304)
* Use dict[key] for required config keys

* Change CONF_NAME too because it has a default
2019-10-29 01:45:22 +01:00
Sebastian Muszynski
a0f764cf6d Remove blocking I/O from the event loop (#28305) 2019-10-29 01:44:26 +01:00
Sebastian Muszynski
5c01dd483f Add Xiaomi Air Humidifier CB1 (zhimi.humidifier.cb1) support (#27232) 2019-10-05 13:31:10 -07:00
Kevin Eifinger
04ead6f273 move ATTR_MODE to homeassistant.const (#27118) 2019-10-02 09:33:47 -07:00