core/tests
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
..
components Xiaomi vacuum as platform of new `vacuum` component derived from ToggleEntity, and services (#8623) 2017-08-04 15:27:10 +02:00
fixtures Add uk_transport component. (#8600) 2017-07-26 20:49:52 +01:00
helpers Add support for Prometheus (#8211) 2017-07-10 21:20:17 -07:00
mock Tests for zwave setup features (#7570) 2017-05-12 20:27:44 -07:00
resources Revised package util tests 2016-01-30 14:08:32 -05:00
scripts Group service / dynamic handling (#7971) 2017-06-16 00:52:28 +02:00
test_util Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
testing_config Add Kira component to sensor and remote platforms (#7479) 2017-05-12 21:12:47 -07:00
util Xiaomi vacuum as platform of new `vacuum` component derived from ToggleEntity, and services (#8623) 2017-08-04 15:27:10 +02:00
__init__.py async HTTP component (#3914) 2016-10-23 23:48:01 -07:00
common.py Add Intent component (#8434) 2017-07-21 21:38:53 -07:00
conftest.py Abort tests when instances leaked (#7623) 2017-05-18 00:19:40 +02:00
test_bootstrap.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_config.py Update persistent deps dir version in config.py (#8479) 2017-07-19 22:59:21 -07:00
test_core.py Fix pathlib resolve (#8311) 2017-07-03 07:24:08 +02:00
test_loader.py Expose all components on hass [Concept] (#8490) 2017-07-16 09:23:06 -07:00
test_main.py Migrate core from threads to async awesomeness (#3248) 2016-09-12 19:16:14 -07:00
test_remote.py Remove deprecated remote classes (#7011) 2017-04-10 09:04:19 -07:00
test_setup.py Fix check for running inside venv (#8481) 2017-07-15 07:25:02 -07:00