Commit Graph

346 Commits (bb1203c61d956e2fe3dd03641dcfe38a0bc9b89c)

Author SHA1 Message Date
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