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
..
__init__.py Add bind_hass to components (#8502) 2017-07-16 10:14:46 -07:00
acer_projector.py
android_ip_webcam.py Android webcam better error handling / pump library 0.4 (#6518) 2017-03-10 23:10:35 +01:00
anel_pwrctrl.py Update docstrings (#7405) 2017-05-02 22:47:20 +02:00
arduino.py
arest.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
bbb_gpio.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
broadlink.py Persistent notification import (#8507) 2017-07-16 21:39:38 +02:00
command_line.py
demo.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
digital_ocean.py Use 'hass.data' instead of global (#8245) 2017-06-30 08:46:03 +02:00
digitalloggers.py Update docstrings (#7405) 2017-05-02 22:47:20 +02:00
dlink.py Switch pyW215 to pypi (#8445) 2017-07-11 22:44:01 +02:00
edimax.py Revise power and energy units and property names. (#6212) 2017-03-19 22:02:11 +01:00
enocean.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
flux.py Properly slugify switch.flux update service name (#8545) 2017-07-23 23:53:03 -07:00
fritzdect.py make attributes in the fritzdect module easier to process (#8436) 2017-07-22 20:34:58 +02:00
hdmi_cec.py Update docstrings (#7405) 2017-05-02 22:47:20 +02:00
hikvisioncam.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
homematic.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
hook.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
insteon_local.py Update docstrings (#7405) 2017-05-02 22:47:20 +02:00
insteon_plm.py Eliminate needless async_add_job invocation of async_add_devices (#6864) 2017-04-03 00:01:53 -07:00
isy994.py
kankun.py Update docstrings (#7405) 2017-05-02 22:47:20 +02:00
knx.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
litejet.py Fix automations listening to HOMEASSISTANT_START (#6936) 2017-04-05 23:23:02 -07:00
lutron_caseta.py Update docstrings (#7405) 2017-05-02 22:47:20 +02:00
mfi.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
mochad.py Add mochad light component (#8476) 2017-08-03 10:51:01 +02:00
modbus.py Modbus fixes to work with pymodbus 1.3.1 (#8365) 2017-07-06 22:30:23 -07:00
mqtt.py mqtt switch: add voluptuous for availability topic (#8797) 2017-08-03 07:18:18 +02:00
mysensors.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
mystrom.py myStrom WiFi bulbs (#7161) 2017-04-18 09:03:56 -07:00
neato.py Fix pylint 1.7.2 no-else-return issues (#8361) 2017-07-05 23:30:01 -07:00
netio.py Fix more deprecation warnings (#7778) 2017-05-26 13:12:17 -07:00
orvibo.py Update docstrings (#7420) 2017-05-03 10:11:39 +02:00
pilight.py
pulseaudio_loopback.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
qwikswitch.py
rachio.py Use upstream RachioPy, fix manual run switches (#8286) 2017-07-08 11:34:34 +02:00
raspihats.py Add raspihats switch (#7665) 2017-06-04 23:56:21 -07:00
rest.py Allow put as method (#8004) 2017-06-12 22:27:25 -07:00
rflink.py Correct spelling of aliases, deprecate old config options. (#8348) 2017-07-06 15:59:54 +02:00
rfxtrx.py Add hass to rfxtrx object (#6844) 2017-05-04 23:50:53 -07:00
rpi_gpio.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
rpi_pfio.py Support for the PiFace Digital I/O module (#7494) 2017-05-09 22:36:33 -07:00
rpi_rf.py Bugfix rpi_rf cleanup (#6513) 2017-03-10 14:56:13 +01:00
scsgate.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
services.yaml
tellduslive.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
tellstick.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
template.py Minor cleanup - Define 'CONF_ICON_TEMPLATE' constant centrally (#7910) 2017-06-05 17:33:57 +02:00
thinkingcleaner.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
tplink.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
transmission.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
velbus.py Velbus (#8076) 2017-07-26 14:03:29 +02:00
vera.py Update docstrings (#7405) 2017-05-02 22:47:20 +02:00
verisure.py verisure component names (#8251) 2017-06-30 08:53:14 +02:00
volvooncall.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
wake_on_lan.py Stopping the logfile spam by piping STDERR to /dev/null (#8081) 2017-06-18 11:44:41 +02:00
wemo.py Fix pylint 1.7.2 no-else-return issues (#8361) 2017-07-05 23:30:01 -07:00
wink.py Support for Wink Switch and Light groups also fix fan speed selection (#8501) 2017-07-20 00:27:39 +02:00
xiaomi.py Device support for different new sensors of the xiaomi aqara gateway (#8577) 2017-07-21 10:13:42 +02:00
zha.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
zigbee.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
zoneminder.py
zwave.py Update docstrings (#7405) 2017-05-02 22:47:20 +02:00