Commit Graph

403 Commits (31709b92ac980a491359c931a12bf4b414b49d76)

Author SHA1 Message Date
GitHub Action fc539da42b [ci skip] Translation update 2021-11-14 00:12:48 +00:00
Maciej Bieniek 8b6b4d7f8a
Fix favorite RPM max value in Xiaomi Miio (#59631) 2021-11-13 12:59:48 +01:00
GitHub Action f00effaba2 [ci skip] Translation update 2021-11-13 00:11:56 +00:00
GitHub Action 3f2b1fa952 [ci skip] Translation update 2021-11-12 00:12:35 +00:00
GitHub Action 34bc1298aa [ci skip] Translation update 2021-11-11 00:15:23 +00:00
GitHub Action 86b12af3dc [ci skip] Translation update 2021-11-10 00:17:39 +00:00
Kevin Hellemun 20b93132dd
Support generic xiaomi_miio vacuums (#59317)
* Support generic xiaomi_miio vacuums

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Fix lint

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Remove warning log

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>
2021-11-08 23:13:00 +01:00
GitHub Action e35b83081e [ci skip] Translation update 2021-11-08 00:12:31 +00:00
Maciej Bieniek c85db9a39d
Remove illuminance sensor (#59305) 2021-11-07 23:17:15 +01:00
GitHub Action 332a571bb4 [ci skip] Translation update 2021-11-07 00:12:38 +00:00
GitHub Action c8d8513a1a [ci skip] Translation update 2021-11-05 00:13:45 +00:00
Kevin Hellemun 7945facf1e
Fix mop attribute for unified mop and water box in Xiaomi Miio (#58990)
Co-authored-by: Teemu R. <tpr@iki.fi>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-11-04 17:00:25 +01:00
Teemu R f578eee81d
Remove use_time sensor from mjjsq humidifers (#59066) 2021-11-04 14:25:07 +01:00
Teemu R ea657e6656
Accept all roborock vacuum models for xiaomi_miio (#59018) 2021-11-04 14:14:31 +01:00
GitHub Action c9c95165e4 [ci skip] Translation update 2021-11-04 00:12:21 +00:00
Teemu R 96c03aec06
Fix timedelta-based sensors for xiaomi_miio (#58995) 2021-11-03 17:28:11 +01:00
Kevin Hellemun 9d7786f887
Add ROCKROBO_S6_PURE to supported vacuums for xiaomi_miio (#58901) 2021-11-02 09:54:28 +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
Kevin Hellemun 51873573d3
Add ROCKROBO_S4_MAX to supported xiaomi vacuums (#58826) 2021-11-01 13:29:00 +01:00
Kevin Hellemun a3332410dc
Add ROCKROBO_E2 to supported vacuums for xiaomi_miio (#58817)
e1adea55f3/miio/vacuum.py (L129)
2021-11-01 00:29:57 +01:00
Marc Mueller 4c68662612
Use assignment expressions 34 (#58823) 2021-10-31 19:01:16 +01:00
Kevin Hellemun e38f3e447c
Add ROCKROBO_S4 to xiaomi_miio vaccum models (#58682) 2021-10-31 09:36:37 -05:00
Marc Mueller b1d49b3b66
Use assignment expressions 29 (#58713) 2021-10-30 16:31:43 +02:00
epenet 335fdf96ba
Use DeviceInfo in xiaomi-miio (#58642) 2021-10-29 00:37:55 +02:00
Kevin Hellemun 05353f8e13
Add ROCKROBO_S5_MAX to xiaomi_miio vacuum models (#58591)
* Add ROCKROBO_S5_MAX to xiaomi_miio vacuum models.

https://github.com/home-assistant/core/issues/58550

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* disable pylint for todo

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Minor refactor

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>
2021-10-28 21:06:04 +02:00
Paulus Schoutsen e1e864d2b6
Get the registry using the callback method (#58542) 2021-10-27 15:58:14 -07:00
GitHub Action e75e40f26e [ci skip] Translation update 2021-10-27 00:11:52 +00:00
GitHub Action 30fb619095 [ci skip] Translation update 2021-10-24 00:12:57 +00:00
epenet a3d1159a13
Use DeviceInfo on components with via_device (R-X) (#58213)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-10-22 12:52:33 +02:00
GitHub Action f9d985553c [ci skip] Translation update 2021-10-22 00:14:10 +00:00
GitHub Action 4634b65924 [ci skip] Translation update 2021-10-21 00:12:43 +00:00
GitHub Action 3855bb43ec [ci skip] Translation update 2021-10-19 00:12:08 +00:00
Marc Mueller 1e98761f30
Use assignment expressions 15 (#57961) 2021-10-18 14:01:23 +02:00
GitHub Action a1176cc79a [ci skip] Translation update 2021-10-18 00:11:59 +00:00
Maciej Bieniek 6fb0609f0c
Add use time sensor for air purifiers (#57775) 2021-10-17 07:39:25 +02:00
Maciej Bieniek 276345e20a
Decrease `timeout` and `update_interval` in Xiaomi Miio integration (#57339)
* Decrease timeout and update_interval

* Improve UPDATE_INTERVAL const

* Update values after testing
2021-10-17 03:13:12 +02:00
GitHub Action c76e15149c [ci skip] Translation update 2021-10-17 00:12:27 +00:00
GitHub Action 34fee4ba60 [ci skip] Translation update 2021-10-16 00:12:06 +00:00
Maciej Bieniek b0ff28ceb4
Add entity category to Xiaomi Miio (#57719) 2021-10-14 17:31:25 -07:00
starkillerOG e34aed743c
Xiaomi Miio appropriatly raise ConfigEntryAuthFailed/ConfigEntryNotReady (#54696)
* Add reties to cloud login

* push to version 0.4 of micloud

* distinguish between authentication error and socket errors

* raise from error

* Update homeassistant/components/xiaomi_miio/gateway.py

Co-authored-by: Franck Nijhof <git@frenck.dev>

* move ConfigEntryNotReady to connect function

* remove unused import

* also add ConfigEntryNotReady for device

* catch exceptions in config flow

* fixes

* bring tests back to 100%

* add missing catch exception

* add test

* fix black

* Update homeassistant/components/xiaomi_miio/device.py

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

* Update homeassistant/components/xiaomi_miio/gateway.py

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

* Update tests/components/xiaomi_miio/test_config_flow.py

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

* fix tests

* define specific exceptions

* fix styling

* fix tests

* use proper DeviceException

* Revert "use proper DeviceException"

This reverts commit 0bd16135387cd6d9e563cd62ac147d0a25c577f3.

* use appropriate side-effect

* remove unused returns

* Update homeassistant/components/xiaomi_miio/const.py

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

* remove unused returns

Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Teemu R. <tpr@iki.fi>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-15 01:25:44 +02:00
Robert Hillis 488a636aec
Clean up unused loggers (#57662) 2021-10-14 10:03:38 -07:00
Jan Bouwhuis c470a03a4e
Add a use_time sensor for Xiaomi_miio humidifiers (#57560)
Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>
2021-10-13 13:36:02 +02:00
Kevin Hellemun 30154763f8
Add xiaomi vacuum -9999 fix back (#57473) 2021-10-11 13:11:45 +02:00
Maciej Bieniek 6ef70c85ee
Add -9999 error fix back in Xiaomi Miio (#57399) 2021-10-09 23:42:20 +02:00
Kevin Hellemun dc5e4392ae
Refactor Xiaomi vacuum to sensors (#54990)
* Refactor Xiaomi vacuum with sensors.

This is the first step into refactoring xiaomi vacuum attributes into sensors.
What is missing are some switches and binary sensors etc.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Use generic sensor for Xiaomi vacuum sensors.

By using HA coordinator, the generic Xiaomi sensor class can be used with these
coordinators to get the status sensors from vacuum. This also means now that
sensors are available as soon as HA starts, which is a nice plus.

Now the only reason to create a subclass of the generic sensors is when custom
value parsing needs to be done.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Working vacuum sensors via 1 coordinator.

Vacuum needs a custom coordinator to ensure that it fetches all the needed data
and puts it in a dict. From this dict the sensors will then get their data
accordingly.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Remove vacuum setup method in sensor

Sensor is generic enough that vacuum does not require its own setup method.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Don't auto register generic sensors.

Let the user decide which sensor is useful for them and enable them.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Remove converted attributes from xiaomi vacuum.

The attributes that have been converted so far should be removed from the vacuum
attributes list.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Fetch data from vacuum sequentially.

It seems some vacuums do not like parallel requests. The requests that came
before are ignored.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Refactor vacuum sensors to its own container.

By moving vacuum sensors to its own container, there is no more key collisions.
This in turns means that there is need for the split hack to ensure key names
are correct.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* fixup! fix bad rebase.

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Fix sensor naming and default registration.

Use proper names for sensors, no need to include from which device status it
came.

Registration of the sensor by default has been parameterised. If the param is
not set, the sensor is not registered.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Make vacuum platform also use coordinator for its data.

By using the coordinator for data in vacuum platfrom, removes the cases where
request gets ignored during the case where the requests are done concurrently by
separate platforms.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Add binary sensor for vacuum

Add binary sensor for waterbox, mop, and water shortage.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Added proper icons to sensors.

https://github.com/home-assistant/core/issues/51361

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Refactor sensors to use dataclass.

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Make vacuum use coordinator for its data.

This commit also insures that the binary sensors are only registered for devices
that include a mop.

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Apply suggestions from code review

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

* Minor refactoring

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Update data from coordinator after running command.

This is is to have a faster status change when executing a command like changing
fan speeds. If a manual refresh is not triggered. Worst case scenario it will
take 10s for the new fan speed to be reported in HA.

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Refresh within coroutine is ok.

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Move logging to _handle_coordinator_update

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Use internal state attribute.

Signed-off-by: Kevin Hellemun <17928966+OGKevin@users.noreply.github.com>

* Fix vacuum typing

* Fix tests constants

* Fix vacuum inconsistent return values

* Fix vacuum state update

* Fix vacuum tests

* Remove impossible cases

* Parametrize custom services test

* Move goto test

* Move clean segment test

* Move clean single segment test

* Test service pause

* Include vacuum in coverage

* Delint

* Fix vacuum sensor dict collision.

This also prevents collision for unique id. As the key is used to construct
unique ids.

* Use f strings as dict keys

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-07 18:30:17 +02:00
Maciej Bieniek a238cce37c
Update led brightness select state only if valid data is available, Xiaomi Miio integration (#57197)
* Update state if there is valid data

* Add comment
2021-10-07 17:44:25 +02:00
GitHub Action f42c2f5170 [ci skip] Translation update 2021-10-02 12:59:05 +00:00
Maciej Bieniek 4cdbd3c576
Fix `Unable to serialize to JSON` error in Xiaomi Miio (#56929) 2021-10-02 09:05:49 +02:00
Marc Mueller d51487f82a
Import Callable from collections.abc (3) (#56777) 2021-09-29 16:19:06 +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 ea189f930a
Use attrs in Xiaomi Miio humidifier platform (#56371)
* Use attrs in humidifier platform

* Cleanup min/max humidity attrs
2021-09-19 17:04:33 +02:00
Maciej Bieniek 41bf1eb610
Fetch the data a second time when -9999 error occurs in Xiaomi Miio integration (#56288) 2021-09-16 09:19:41 -07:00
Jaroslav Hanslík a4a6bf8a85
New icon names based on MDI 6.1.95 (#56085) 2021-09-11 12:34:31 -07: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 9093819671
Fix target humidity step for Xiaomi MJJSQ humidifiers (#55858) 2021-09-06 13:36:18 -07:00
Maciej Bieniek 9ee0d8fefe
Fix xiaomi miio Air Quality Monitor initialization (#55773) 2021-09-06 15:30:03 +02:00
Maciej Bieniek 753285eae7
Fix a lazy preset mode update for Xiaomi Miio fans (#55837) 2021-09-06 12:33:34 +02:00
GitHub Action 19dcb19d07 [ci skip] Translation update 2021-09-04 00:13:17 +00:00
Teemu R aef4a69cd0
xiaomi_miio: bump python-miio dependency (#55549) 2021-09-02 00:18:12 +02:00
Maciej Bieniek 08a0377dcb
Add support for Xiaomi Miio Air Purifier 3C (#55484) 2021-08-31 16:44:13 +02:00
Maciej Bieniek ea8702b0df
Address late review for Xiaomi Miio number platform (#55275) 2021-08-27 21:41:15 -05:00
GitHub Action b0c52220bc [ci skip] Translation update 2021-08-28 00:11:00 +00:00
GitHub Action 65d14909ee [ci skip] Translation update 2021-08-27 00:14:42 +00: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 8d3ccad38e
Convert number value to int in Xiaomi Miio (#55145) 2021-08-24 15:19:01 +02:00
Maciej Bieniek ca245f8e93
Fix min value for Xiaomi Miio volume entity (#55139) 2021-08-24 14:40:14 +02:00
Maciej Bieniek 0c68a54dea
Fix TypeError in Xiaomi Miio fan platform (#55091) 2021-08-23 22:51:29 +02:00
GitHub Action 305475a635 [ci skip] Translation update 2021-08-23 00:12:20 +00: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
GitHub Action fc6d45a63b [ci skip] Translation update 2021-08-20 00:16:03 +00: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
GitHub Action 0100ffcb8c [ci skip] Translation update 2021-08-18 00:13:44 +00:00
GitHub Action 1661de5c19 [ci skip] Translation update 2021-08-17 00:12:45 +00:00
Maciej Bieniek 8c4a2dc6d2
Add `water level` and `water tank detached` sensors for Xiaomi Miio humidifiers (#54625)
* Add water level and water tank detached sensors

* Use elif

* Use DEVICE_CLASS_CONNECTIVITY for water tank sensor

* Improve docstring

* Change the water tank sensor icon

* Fix typo
2021-08-16 09:13:45 +02:00
GitHub Action d091068092 [ci skip] Translation update 2021-08-16 00:11:52 +00:00
Nikolaos Stamatopoulos 61412db119
Fix typo in xiaomi_miio cloud_login_error string (#54661)
* fix(xiaomi_miio): Fix typo in cloud_login_error string

* fixup! fix(xiaomi_miio): Fix typo in cloud_login_error string

Restore translation files
2021-08-15 22:56:30 +02:00
Maciej Bieniek ebaae8d2bf
Add sensor platform for Xiaomi Miio fans (#54564) 2021-08-15 13:49:29 +02:00
Erik Montnemery 87e7a8fb5f
Move temperature conversions to sensor base class - new integrations (#54623)
* Move temperature conversions to sensor base class

* Tweaks

* Update pvpc_hourly_pricing

* Fix flipr sensor

* Fix ezviz and youless sensor
2021-08-15 08:51:43 +02:00
Teemu R 102789672a
Bump python-miio to 0.5.7 (#54601) 2021-08-14 08:38:42 +02:00
GitHub Action b71a0c5d4b [ci skip] Translation update 2021-08-13 00:17:12 +00:00
GitHub Action 0626542a14 [ci skip] Translation update 2021-08-12 00:14:10 +00:00
Erik Montnemery ae507aeed1
Move temperature conversions to sensor base class (8/8) (#54483)
* Move temperature conversions to entity base class (8/8)

* Fix wallbox sensor

* Fix tests
2021-08-11 21:17:16 +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
Maciej Bieniek 4459d8674a
Add `binary_sensor` platform for Xiaomi Miio integration (#54096) 2021-08-09 23:56:33 +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
Maciej Bieniek aaddeb0bcd
Add missing `motor_speed` sensor for Xiaomi Miio humidifier CA1 and CB1 (#54264)
* Add motor_speed sensor for CA1 and CB1

* Remove value limits
2021-08-08 15:21:55 +02:00
GitHub Action af565ea6bd [ci skip] Translation update 2021-08-08 00:11:15 +00:00
GitHub Action 98bcdc2cf5 [ci skip] Translation update 2021-08-07 00:10:12 +00:00
GitHub Action 64c9f9e1cb [ci skip] Translation update 2021-08-06 00:15:04 +00:00
GitHub Action ba93bda3ad [ci skip] Translation update 2021-08-05 00:34:46 +00:00
Jan Bouwhuis 1f9331f9db
Remove Xiaomi_miio select option validation (#53936) 2021-08-04 14:00:18 +02:00
Jan Bouwhuis 1054419498
Remove Xiaomi_miio number value validation (#53934) 2021-08-04 12:50:08 +02:00
Maciej Bieniek 3b212b9109
Use `NumberEntityDescription` for Xiaomi Miio (#53911) 2021-08-04 12:03:18 +02:00