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 13:27:10 +00:00
|
|
|
turn_on:
|
|
|
|
description: Start a new cleaning task.
|
|
|
|
|
|
|
|
fields:
|
|
|
|
entity_id:
|
|
|
|
description: Name of the botvac entity.
|
|
|
|
example: 'vacuum.xiaomi_vacuum_cleaner'
|
|
|
|
|
|
|
|
turn_off:
|
|
|
|
description: Stop the current cleaning task and return to home.
|
|
|
|
|
|
|
|
fields:
|
|
|
|
entity_id:
|
|
|
|
description: Name of the botvac entity.
|
|
|
|
example: 'vacuum.xiaomi_vacuum_cleaner'
|
|
|
|
|
|
|
|
stop:
|
|
|
|
description: Stop the current cleaning task.
|
|
|
|
|
|
|
|
fields:
|
|
|
|
entity_id:
|
|
|
|
description: Name of the botvac entity.
|
|
|
|
example: 'vacuum.xiaomi_vacuum_cleaner'
|
|
|
|
|
|
|
|
locate:
|
|
|
|
description: Locate the vacuum cleaner robot.
|
|
|
|
|
|
|
|
fields:
|
|
|
|
entity_id:
|
|
|
|
description: Name of the botvac entity.
|
|
|
|
example: 'vacuum.xiaomi_vacuum_cleaner'
|
|
|
|
|
|
|
|
start_pause:
|
|
|
|
description: Start, pause, or resume the cleaning task.
|
|
|
|
|
|
|
|
fields:
|
|
|
|
entity_id:
|
|
|
|
description: Name of the botvac entity.
|
|
|
|
example: 'vacuum.xiaomi_vacuum_cleaner'
|
|
|
|
|
|
|
|
return_to_base:
|
|
|
|
description: Tell the vacuum cleaner to return to its dock.
|
|
|
|
|
|
|
|
fields:
|
|
|
|
entity_id:
|
|
|
|
description: Name of the botvac entity.
|
|
|
|
example: 'vacuum.xiaomi_vacuum_cleaner'
|
|
|
|
|
2017-08-06 17:23:22 +00:00
|
|
|
clean_spot:
|
|
|
|
description: Tell the vacuum cleaner to do a spot clean-up.
|
|
|
|
|
|
|
|
fields:
|
|
|
|
entity_id:
|
|
|
|
description: Name of the botvac entity.
|
|
|
|
example: 'vacuum.xiaomi_vacuum_cleaner'
|
|
|
|
|
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 13:27:10 +00:00
|
|
|
send_command:
|
|
|
|
description: Send a raw command to the vacuum cleaner.
|
|
|
|
|
|
|
|
fields:
|
|
|
|
entity_id:
|
|
|
|
description: Name of the botvac entity.
|
|
|
|
example: 'vacuum.xiaomi_vacuum_cleaner'
|
|
|
|
|
|
|
|
command:
|
|
|
|
description: Command to execute.
|
|
|
|
example: 'set_dnd_timer'
|
|
|
|
|
|
|
|
params:
|
|
|
|
description: Parameters for the command.
|
|
|
|
example: '[22,0,6,0]'
|
|
|
|
|
|
|
|
set_fan_speed:
|
|
|
|
description: Set the fan speed of the vacuum cleaner.
|
|
|
|
|
|
|
|
fields:
|
|
|
|
entity_id:
|
|
|
|
description: Name of the botvac entity.
|
|
|
|
example: 'vacuum.xiaomi_vacuum_cleaner'
|
|
|
|
|
|
|
|
fan_speed:
|
|
|
|
description: Platform dependent vacuum cleaner fan speed, with speed steps, like 'medium', or by percentage, between 0 and 100.
|
|
|
|
example: 'low'
|
|
|
|
|
|
|
|
xiaomi_remote_control_start:
|
|
|
|
description: Start remote control of the vacuum cleaner. You can then move it with `remote_control_move`, when done call `remote_control_stop`.
|
|
|
|
|
|
|
|
fields:
|
|
|
|
entity_id:
|
|
|
|
description: Name of the botvac entity.
|
|
|
|
example: 'vacuum.xiaomi_vacuum_cleaner'
|
|
|
|
|
|
|
|
xiaomi_remote_control_stop:
|
|
|
|
description: Stop remote control mode of the vacuum cleaner.
|
|
|
|
|
|
|
|
fields:
|
|
|
|
entity_id:
|
|
|
|
description: Name of the botvac entity.
|
|
|
|
example: 'vacuum.xiaomi_vacuum_cleaner'
|
|
|
|
|
|
|
|
xiaomi_remote_control_move:
|
|
|
|
description: Remote control the vacuum cleaner, make sure you first set it in remote control mode with `remote_control_start`.
|
|
|
|
|
|
|
|
fields:
|
|
|
|
entity_id:
|
|
|
|
description: Name of the botvac entity.
|
|
|
|
example: 'vacuum.xiaomi_vacuum_cleaner'
|
|
|
|
|
|
|
|
velocity:
|
|
|
|
description: Speed, between -0.29 and 0.29.
|
|
|
|
example: '0.2'
|
|
|
|
|
|
|
|
rotation:
|
|
|
|
description: Rotation, between -179 degrees and 179 degrees.
|
|
|
|
example: '90'
|
|
|
|
|
|
|
|
duration:
|
|
|
|
description: Duration of the movement?
|
|
|
|
example: '1500'
|
|
|
|
|
|
|
|
xiaomi_remote_control_move_step:
|
|
|
|
description: Remote control the vacuum cleaner, only makes one move and then stops.
|
|
|
|
|
|
|
|
fields:
|
|
|
|
entity_id:
|
|
|
|
description: Name of the botvac entity.
|
|
|
|
example: 'vacuum.xiaomi_vacuum_cleaner'
|
|
|
|
|
|
|
|
velocity:
|
|
|
|
description: Speed, between -0.29 and 0.29.
|
|
|
|
example: '0.2'
|
|
|
|
|
|
|
|
rotation:
|
|
|
|
description: Rotation, between -179 degrees and 179 degrees.
|
|
|
|
example: '90'
|
|
|
|
|
|
|
|
duration:
|
|
|
|
description: Duration of the movement?
|
|
|
|
example: '1500'
|