Files
core/homeassistant/components
Eugenio Panadero 96f8c37dcd Xiaomi vacuum as platform of new vacuum component derived from ToggleEntity, and services (#8623)
* Xiaomi vacuum as component with switch, sensors and services

- Conversion from switch platform to async component.
- Add services proposed in #8416 to the new component, with shorter names.
- Add sensors for the vacuum robot as a selectable list from `battery`, `state`, `error`, `fanspeed`, `clean_time` and `clean_area` (the state attributes of the switch). The sensors don't poll, but listen to a signal to update the state, the switch fires this signal when updating.
- Assign default icons to sensors and the switch (`mdi:google-circles-group` looks like the robot!)

* path change in requirements_all (from switch platform to component)

* copy pasting is a bad habit

* services to the components services.yaml, modify .coveragerc

* review: use with multiple hosts, fix calls to async_add_devices, fix ranges for services

* `icon_for_battery_level` util method

* Xiaomi vacuum as platform of new component vacuum

- Created new component `vacuum` from a ToggleEntity.
- Add services `turn_on`, `turn_off`, `cleaning_play_pause`, `stop`, `return_to_base`, `locate`, `set_fanspeed` and `send_command`.
- Remove the main switch for the xiaomi vacuum (the toggable main entity is the switch).
- Add `support flags` for the common services
- Assign default icons to sensors and the switch (`mdi:google-circles-group` looks like the robot!)
- Move services descriptions to a yaml file for the new component.
- Update requirements_all.
- Update coveragerc.

* fix coveragerc

* fix battery icon helper to use more icons

* remove sensors, create properties and support flags for custom UI

* cleaning

* updated state_attrs for filtering in UI, renamed platform to simply `xiaomi`

* fix platform rename

* change fanspeed and expose `fanspeed_list` to use speed steps

* minor fixes

- Rename service `start_pause`
- Add 'Error' attribute only if `got_error`.
- Minor changes

* rename state attrs

* rename state attrs

* review changes: cut fan__speed, style changes, remove logging, and more

* add ATTR_COMMAND = 'command' to const

* pop entity_id from service data

* remove property accessor for vacuum object

* lint fix

* fix extra attrs names

* module level functions for calling the services

* params as optional keyword for `send_command`

* params as optional keyword for `send_command`, remove debug logs

* explicit parameters for `set_fan_speed` and `send_command`

* Demo platform for the vacuum component

* vacuum tests for the Demo platform

* some fixes

* don't omit vacuum

* vacuum tests for the Xiaomi platform

* fix test

* fix

* fix xiaomi test

* fix coveragerc

* test send command

* fix coveragerc

* fix string formatting

* The coverage is to low. It need 93% or more
2017-08-04 15:27:10 +02:00
..
2017-07-28 20:53:15 -07:00
2017-07-26 14:03:29 +02:00
2017-08-03 23:46:57 -07:00
2017-06-08 15:53:12 +02:00
2017-08-03 10:51:01 +02:00
2017-07-16 10:14:46 -07:00
2017-07-31 20:52:39 -07:00
2017-08-04 12:11:33 +02:00
2017-07-06 22:20:49 -07:00
2017-07-31 20:37:33 -07:00
2017-07-23 23:35:49 -07:00
2017-08-01 22:53:36 -07:00
2017-07-23 23:46:35 -07:00
2017-07-21 21:38:53 -07:00
2017-07-16 21:39:38 +02:00
2017-07-16 21:39:38 +02:00
2017-04-29 22:04:49 -07:00
2017-05-12 20:30:07 -07:00
2017-04-29 22:04:49 -07:00
2017-06-29 11:44:35 +02:00
2017-05-06 00:34:40 +02:00
2017-07-18 15:11:17 -07:00
2017-08-01 22:41:51 -07:00
2017-05-11 22:48:03 +02:00
2017-07-07 16:59:41 -07:00
2017-05-04 07:48:43 +02:00
2017-05-02 22:47:20 +02:00
2017-04-29 22:04:49 -07:00
2017-04-29 22:04:49 -07:00
2017-08-03 23:46:57 -07:00
2017-04-29 22:04:49 -07:00
2017-07-21 21:38:53 -07:00
2017-04-29 22:04:49 -07:00
2017-04-29 22:04:49 -07:00
2017-05-04 13:14:14 -07:00
2017-06-05 08:39:31 -07:00
2017-04-29 22:04:49 -07:00
2017-04-29 22:04:49 -07:00
2017-04-29 22:04:49 -07:00
2017-06-11 22:19:10 -07:00
2017-08-03 10:51:01 +02:00
2017-04-29 22:04:49 -07:00
2017-04-29 22:04:49 -07:00
2017-04-29 22:04:49 -07:00
2017-05-02 22:47:20 +02:00
2017-04-29 22:04:49 -07:00
2017-04-29 22:04:49 -07:00
2017-07-16 21:39:38 +02:00
2017-04-29 22:04:49 -07:00
2017-07-16 10:14:46 -07:00
2017-04-29 22:04:49 -07:00
2017-04-29 22:04:49 -07:00
2017-06-21 00:32:04 +02:00
2017-04-29 22:04:49 -07:00
2017-07-21 21:38:53 -07:00
2017-07-02 12:54:59 -07:00
2017-04-29 22:04:49 -07:00
…
2017-07-16 21:39:38 +02:00
2017-07-26 14:03:29 +02:00
2017-07-10 12:11:16 +02:00
2017-07-04 06:26:55 +02:00
2017-04-29 22:04:49 -07:00
2017-04-29 22:04:49 -07:00
2017-07-31 20:54:07 -07:00
…
2017-06-15 21:25:19 +02:00
2017-04-29 22:04:49 -07:00
2017-07-16 10:14:46 -07:00