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 ecobee services to create and delete vacations #26923

Merged

Conversation

@marthoc
Copy link
Contributor

commented Sep 26, 2019

Description:

Adds two new services to the ecobee integration: create_vacation and delete_vacation.

Related issue (if applicable): N/A

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

Example entry for configuration.yaml (if applicable):

N/A

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.
  • I have followed the development checklist

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

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
marthoc added 2 commits Sep 25, 2019
Fixes
@project-bot project-bot bot added this to Needs review in Dev Sep 26, 2019
@marthoc marthoc referenced this pull request Sep 26, 2019
2 of 2 tasks complete
marthoc added 2 commits Sep 26, 2019
@marthoc marthoc referenced this pull request Sep 26, 2019
homeassistant/components/ecobee/climate.py Outdated Show resolved Hide resolved
homeassistant/components/ecobee/climate.py Outdated Show resolved Hide resolved
homeassistant/components/ecobee/climate.py Outdated Show resolved Hide resolved
homeassistant/components/ecobee/climate.py Outdated Show resolved Hide resolved
Dev automation moved this from Needs review to Review in progress Sep 26, 2019
@MartinHjelmare MartinHjelmare changed the title ecobee: Add services to create and delete vacations Add ecobee services to create and delete vacations Sep 26, 2019
marthoc added 2 commits Sep 26, 2019
@marthoc marthoc changed the title Add ecobee services to create and delete vacations ecobee: Add services to create and delete vacations Sep 26, 2019
@MartinHjelmare MartinHjelmare changed the title ecobee: Add services to create and delete vacations Add ecobee services to create and delete vacations Sep 26, 2019
@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Sep 26, 2019

Please keep the title starting with Add:
Add ecobee services to create and delete vacations

marthoc added 3 commits Sep 26, 2019
start_date, start_time, end_date, and end_time must be specified together.
Copy link
Member

left a comment

Looks good!

Dev automation moved this from Review in progress to Reviewer approved Sep 26, 2019
@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Sep 26, 2019

We should document the new services, right?

@arsaboo

This comment has been minimized.

Copy link
Contributor

commented Sep 26, 2019

@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Sep 26, 2019

Can be merged when build passes.

@marthoc

This comment has been minimized.

Copy link
Contributor Author

commented Sep 26, 2019

Looks like we are good to go! 👍

@MartinHjelmare MartinHjelmare merged commit c194f4a into home-assistant:dev Sep 26, 2019
11 checks passed
11 checks passed
CI Build #20190926.28 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch Coverage not affected when comparing 81dc473...88ad6aa
Details
codecov/project 94.18% (target 90%)
Details
Dev automation moved this from Reviewer approved to Done Sep 26, 2019
vol.Required(ATTR_VACATION_NAME): cv.string,
vol.Required(ATTR_COOL_TEMP): vol.Coerce(float),
vol.Required(ATTR_HEAT_TEMP): vol.Coerce(float),
vol.Inclusive(ATTR_START_DATE, "dtgroup", msg=DTGROUP_INCLUSIVE_MSG): cv.string,

This comment has been minimized.

Copy link
@MartinHjelmare

MartinHjelmare Sep 26, 2019

Member

Maybe we should have validated the date and time as date and time? Future improvement possible. Sorry for missing this.

This comment has been minimized.

Copy link
@marthoc

marthoc Sep 26, 2019

Author Contributor

I had thought of that - but it's really a string that gets passed to the ecobee API so we wouldn't necessarily want to convert it to a datetime object - and in any event if it's not in a valid format, then the vacation won't get created by the API.

This comment has been minimized.

Copy link
@MartinHjelmare

MartinHjelmare Sep 26, 2019

Member

It would just be for validation. We like to validate as early as possible, ie in the service schema.

This comment has been minimized.

Copy link
@marthoc

marthoc Sep 26, 2019

Author Contributor

Would this validate or transform?

vol.Inclusive(ATTR_START_DATE, "dtgroup", msg=DTGROUP_INCLUSIVE_MSG): cv.date,
vol.Inclusive(ATTR_START_TIME, "dtgroup", msg=DTGROUP_INCLUSIVE_MSG): cv.time,
vol.Inclusive(ATTR_END_DATE, "dtgroup", msg=DTGROUP_INCLUSIVE_MSG): cv.date,
vol.Inclusive(ATTR_END_TIME, "dtgroup", msg=DTGROUP_INCLUSIVE_MSG): cv.time,

I'm happy to open a PR now to patch this.

This comment has been minimized.

Copy link
@MartinHjelmare

MartinHjelmare Sep 26, 2019

Member

It would transform, so we'd need to transform back to string with another validator after the first one. Combine with vol.All.

@marthoc marthoc deleted the marthoc:add-ecobee-vacation-services branch Sep 26, 2019
KJonline added a commit to KJonline/home-assistant that referenced this pull request Sep 26, 2019
* dev: (87 commits)
  Add ecobee services to create and delete vacations (home-assistant#26923)
  Centralize rainbird config and add binary sensor platform (home-assistant#26393)
  Add config flow to transmission (home-assistant#26434)
  Add Plex config options support (home-assistant#26870)
  Bump pyobihai, add unique ID and availability (home-assistant#26922)
  Add mysensors codeowner (home-assistant#26917)
  [ci skip] Translation update
  Add MySensors ACK (home-assistant#26894)
  Remove lamps and groups from ha when removed from Hue (home-assistant#26881)
  Add config flow to ecobee (home-assistant#26634)
  deCONZ - Increase bridge discovery robustness in config flow (home-assistant#26911)
  Add call direction sensor for Obihai (home-assistant#26867)
  Bumped version to 0.99.3
  HM-CC-TC was not recognized (home-assistant#26623)
  Add google_assistant alarm_control_panel (home-assistant#26249)
  deCONZ - Improve ssdp discovery by storing uuid in config entry (home-assistant#26882)
  Fix missing whitespace around arithmetic operator (home-assistant#26908)
  Fix bed_activity history chart of the Xiaomi Aqara vibration sensor (home-assistant#26875)
  Add voltage attribute to Xiaomi Aqara devices (home-assistant#26876)
  Bump ndms2-client to 0.0.9 (home-assistant#26899)
  ...
@marthoc marthoc referenced this pull request Sep 27, 2019
8 of 9 tasks complete
@lock lock bot locked and limited conversation to collaborators Sep 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
5 participants
You can’t perform that action at this time.