Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add template vacuum support #22904

Merged
merged 17 commits into from Jun 28, 2019

Conversation

@luukd
Copy link
Contributor

commented Apr 8, 2019

Description:

Add support for template vacuum cleaners. This PR resolves the review comments in this old PR: #17215

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#9496

Example entry for configuration.yaml (if applicable):

vacuum:
  platform: template
  vacuums:
    my_template_vacuum:
      friendly_name: Template vacuum
      value_template: "{{ states('input_select.vacuum_state') }}"
      battery_level_template: "{{ states('input_number.vacuum_battery_level') | int }}"
      fan_speed_template: "{{ states('input_select.vacuum_fan_speed') }}"
      start:
        service: script.start_vacuum
      pause:
        service: script.pause_vacuum
      stop:
        service: script.stop_vacuum
      return_to_base:
        service: script.return_to_base
      clean_spot:
        service: script.clean_spot
      locate:
        service: script.locate_vacuum
      set_fan_speed:
        service: script.set_fan_speed
      fan_speeds:
        - Low
        - Medium
        - High

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

luukd added some commits Oct 3, 2018

@github-actions

This comment has been minimized.

Copy link

commented Apr 8, 2019

Hey there @PhracturedBlue, mind taking a look at this pull request as its been labeled with a integration (template) you are listed as a codeowner for? Thanks!

@codecov

This comment was marked as outdated.

Copy link

commented Apr 8, 2019

Codecov Report

Merging #22904 into dev will decrease coverage by 0.42%.
The diff coverage is 98.41%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev   #22904      +/-   ##
==========================================
- Coverage   94.29%   93.86%   -0.43%     
==========================================
  Files         458      449       -9     
  Lines       37203    36763     -440     
==========================================
- Hits        35079    34507     -572     
- Misses       2124     2256     +132
Impacted Files Coverage Δ
homeassistant/components/template/vacuum.py 98.41% <98.41%> (ø)
homeassistant/components/mqtt/fan.py 74.33% <0%> (-23.64%) ⬇️
homeassistant/components/mqtt/light/schema_json.py 73.06% <0%> (-20.65%) ⬇️
homeassistant/bootstrap.py 58.08% <0%> (-16.33%) ⬇️
homeassistant/components/mqtt/lock.py 91.83% <0%> (-8.17%) ⬇️
homeassistant/components/axis/device.py 93.02% <0%> (-6.98%) ⬇️
homeassistant/components/hassio/ingress.py 71.3% <0%> (-6.75%) ⬇️
homeassistant/components/deconz/config_flow.py 97.77% <0%> (-2.23%) ⬇️
homeassistant/components/mqtt/vacuum.py 92.46% <0%> (-2.05%) ⬇️
homeassistant/components/hue/bridge.py 73.07% <0%> (-1%) ⬇️
... and 178 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b0660a...01ad9e6. Read the comment docs.

@luukd luukd force-pushed the luukd:template_vacuum branch from 53d08fc to 94f5ec0 Apr 18, 2019

@luukd luukd force-pushed the luukd:template_vacuum branch from 94f5ec0 to 7dfa5df Apr 21, 2019

@luukd luukd referenced this pull request May 21, 2019
2 of 2 tasks complete
@pergolafabio

This comment has been minimized.

Copy link

commented Jun 19, 2019

is it also possible to add a new attribute "zones" ?

some vacuum cleaners, can do zone control by coordinates, like roborock
if we can use zones, we can call this zone later in "google assistant" with start/stop trait

@luukd

This comment has been minimized.

Copy link
Contributor Author

commented Jun 20, 2019

is it also possible to add a new attribute "zones" ?

some vacuum cleaners, can do zone control by coordinates, like roborock
if we can use zones, we can call this zone later in "google assistant" with start/stop trait

@pergolafabio I think that's possible, but I'll leave that feature to someone else to contribute in a new PR after this one is merged 😉

@MartinHjelmare
Copy link
Member

left a comment

Looks good!

@cgarwood cgarwood merged commit 468b0e8 into home-assistant:dev Jun 28, 2019

13 checks passed

build Workflow: build
Details
ci/circleci: pre-install-all-requirements Your tests passed on CircleCI!
Details
ci/circleci: pre-test 3.5.5 Your tests passed on CircleCI!
Details
ci/circleci: pre-test 3.6 Your tests passed on CircleCI!
Details
ci/circleci: pre-test 3.7 Your tests passed on CircleCI!
Details
ci/circleci: pylint Your tests passed on CircleCI!
Details
ci/circleci: static-check Your tests passed on CircleCI!
Details
ci/circleci: test 3.5.5 Your tests passed on CircleCI!
Details
ci/circleci: test 3.6 Your tests passed on CircleCI!
Details
ci/circleci: test 3.7 Your tests passed on CircleCI!
Details
cla-bot Everyone involved has signed the CLA
codecov/patch 98.41% of diff hit (target 94.29%)
Details
codecov/project 93.86% (target 90%)
Details
@balloob balloob referenced this pull request Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.