Files
core/homeassistant/components/switch
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-05-02 22:47:20 +02:00
2016-10-11 00:56:57 -07:00
2017-05-02 09:18:47 -07:00
2017-05-02 22:47:20 +02:00
2017-07-11 22:44:01 +02:00
2017-05-02 09:18:47 -07:00
2017-05-02 22:47:20 +02:00
2017-05-02 09:18:47 -07:00
2017-05-02 22:47:20 +02:00
2017-05-02 22:47:20 +02:00
2017-05-02 09:18:47 -07:00
2017-05-02 22:47:20 +02:00
2017-08-03 10:51:01 +02:00
2017-04-18 09:03:56 -07:00
2017-05-26 13:12:17 -07:00
2017-05-03 10:11:39 +02:00
2017-01-17 23:40:34 +01:00
2017-06-04 23:56:21 -07:00
2017-06-12 22:27:25 -07:00
2017-05-04 23:50:53 -07:00
2017-03-10 14:56:13 +01:00
2017-05-02 09:18:47 -07:00
2017-05-02 09:18:47 -07:00
2017-05-02 09:18:47 -07:00
2017-05-02 09:18:47 -07:00
2017-05-02 09:18:47 -07:00
2017-05-02 09:18:47 -07:00
2017-07-26 14:03:29 +02:00
2017-05-02 22:47:20 +02:00
2017-06-30 08:53:14 +02:00
2017-05-02 09:18:47 -07:00
2017-05-02 09:18:47 -07:00
2017-05-02 09:18:47 -07:00
2016-10-29 13:10:42 -07:00
2017-05-02 22:47:20 +02:00