{"action":"created","issue":{"url":"https://api.github.com/repos/home-assistant/home-assistant/issues/8623","repository_url":"https://api.github.com/repos/home-assistant/home-assistant","labels_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/8623/labels{/name}","comments_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/8623/comments","events_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/8623/events","html_url":"https://github.com/home-assistant/home-assistant/pull/8623","id":244950404,"number":8623,"title":"Xiaomi vacuum as platform of new `vacuum` component derived from ToggleEntity, and services","user":{"login":"azogue","id":9748301,"avatar_url":"https://avatars3.githubusercontent.com/u/9748301?v=4","gravatar_id":"","url":"https://api.github.com/users/azogue","html_url":"https://github.com/azogue","followers_url":"https://api.github.com/users/azogue/followers","following_url":"https://api.github.com/users/azogue/following{/other_user}","gists_url":"https://api.github.com/users/azogue/gists{/gist_id}","starred_url":"https://api.github.com/users/azogue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azogue/subscriptions","organizations_url":"https://api.github.com/users/azogue/orgs","repos_url":"https://api.github.com/users/azogue/repos","events_url":"https://api.github.com/users/azogue/events{/privacy}","received_events_url":"https://api.github.com/users/azogue/received_events","type":"User","site_admin":false},"labels":[{"id":457646398,"url":"https://api.github.com/repos/home-assistant/home-assistant/labels/breaking%20change","name":"breaking change","color":"d93f0b","default":false},{"id":527871105,"url":"https://api.github.com/repos/home-assistant/home-assistant/labels/cla-signed","name":"cla-signed","color":"008000","default":false},{"id":653400742,"url":"https://api.github.com/repos/home-assistant/home-assistant/labels/component:%20xiaomi_vacuum","name":"component: xiaomi_vacuum","color":"ededed","default":false},{"id":451931292,"url":"https://api.github.com/repos/home-assistant/home-assistant/labels/core","name":"core","color":"c5def5","default":false},{"id":514133636,"url":"https://api.github.com/repos/home-assistant/home-assistant/labels/platform","name":"platform","color":"0e8a16","default":false},{"id":653400741,"url":"https://api.github.com/repos/home-assistant/home-assistant/labels/platform:%20sensor.xiaomi_vacuum","name":"platform: sensor.xiaomi_vacuum","color":"ededed","default":false},{"id":620066187,"url":"https://api.github.com/repos/home-assistant/home-assistant/labels/platform:%20switch.xiaomi_vacuum","name":"platform: switch.xiaomi_vacuum","color":"ededed","default":false},{"id":514133651,"url":"https://api.github.com/repos/home-assistant/home-assistant/labels/requirement","name":"requirement","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":37,"created_at":"2017-07-24T01:15:02Z","updated_at":"2017-07-27T16:56:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/home-assistant/home-assistant/pulls/8623","html_url":"https://github.com/home-assistant/home-assistant/pull/8623","diff_url":"https://github.com/home-assistant/home-assistant/pull/8623.diff","patch_url":"https://github.com/home-assistant/home-assistant/pull/8623.patch"},"body":"## Description:\r\n\r\nConversion for the **Xiaomi Vacuum cleaner robot** from a platform switch to a **`vacuum` platform** (NEW COMPONENT for botvacs), as a toggle entity, sensors and services.\r\n\r\nProposal to the conversation maintained [here](https://github.com/home-assistant/home-assistant/pull/8416#issuecomment-317087533), to better integrate in Home Assistant the fantastic work done by @rytilahti to control this awesome cleaning robot.\r\n\r\nChanges:\r\n- Conversion from switch platform to async component (**BREAKING-CHANGE**)\r\n- Add services proposed in #8416 by @bramkragten to the new component, with shorter names.\r\n- 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 main switch). The sensors don't poll, but listen to a signal to update the state; the main switch fires this signal when updating its state.\r\n- Assign default icons to sensors and to the switch (`mdi:google-circles-group` looks like the robot!)\r\n\r\n**UPDATED**:\r\n- Common services are: `turn_on`, `turn_off`, `cleaning_play_pause`, `stop`, `return_to_base`, `locate`, `set_fanspeed` and `send_command`.\r\n- The other services (for remote control the robot) are implemented as platform dependent, so they start with `xiaomi_`: `'xiaomi_remote_control_move`, `xiaomi_remote_control_move_step`, `xiaomi_remote_control_start` and `xiaomi_remote_control_stop`.\r\n- ~The associated sensors are also optional, so it's an each platform-decision, along with the map-cameras (in the neato vacuum)~\r\n- `SUPPORT_*` flags for each service to render a custom UI. This way, there is no need to implement all common services for each botvac.\r\n\r\n\r\n**Pull request in [home-assistant.github.io](https://github.com/home-assistant/home-assistant.github.io) with documentation (if applicable):** home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>\r\n\r\n## Example entry for `configuration.yaml` (if applicable):\r\n```yaml\r\nvacuum:\r\n- platform: xiaomi\r\n  name: Vacuum cleaner\r\n  host: !secret xiaomi_vacuum_robot_ip\r\n  token: !secret xiaomi_vacuum_robot_token\r\n```\r\n\r\n## Checklist:\r\n\r\nIf user exposed functionality or configuration variables are added/changed:\r\n  - [ ] Documentation added/updated in [home-assistant.github.io](https://github.com/home-assistant/home-assistant.github.io)\r\n\r\nIf the code communicates with devices, web services, or third-party tools:\r\n  - [x] Local tests with `tox` run successfully. **Your PR cannot be merged unless tests pass**\r\n  - [x] New dependencies are only imported inside functions that use them ([example][ex-import]).\r\n  - [x] New dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.\r\n  - [x] New files were added to `.coveragerc`.\r\n\r\n[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L54"},"comment":{"url":"https://api.github.com/repos/home-assistant/home-assistant/issues/comments/318422663","html_url":"https://github.com/home-assistant/home-assistant/pull/8623#issuecomment-318422663","issue_url":"https://api.github.com/repos/home-assistant/home-assistant/issues/8623","id":318422663,"user":{"login":"olskar","id":18314560,"avatar_url":"https://avatars2.githubusercontent.com/u/18314560?v=4","gravatar_id":"","url":"https://api.github.com/users/olskar","html_url":"https://github.com/olskar","followers_url":"https://api.github.com/users/olskar/followers","following_url":"https://api.github.com/users/olskar/following{/other_user}","gists_url":"https://api.github.com/users/olskar/gists{/gist_id}","starred_url":"https://api.github.com/users/olskar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olskar/subscriptions","organizations_url":"https://api.github.com/users/olskar/orgs","repos_url":"https://api.github.com/users/olskar/repos","events_url":"https://api.github.com/users/olskar/events{/privacy}","received_events_url":"https://api.github.com/users/olskar/received_events","type":"User","site_admin":false},"created_at":"2017-07-27T16:56:53Z","updated_at":"2017-07-27T16:56:53Z","body":"So nice looking! Cant wait to see this merged, my floors needs cleaning :) "}}
{"actor":{"display_login":"olskar"}}