Commit Graph

327 Commits (b34eb539144630043d52a3a4652f72849005c050)

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