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

Consolidate SimpliSafe property services #30567

Merged
merged 5 commits into from Jan 13, 2020

Conversation

bachya
Copy link
Contributor

@bachya bachya commented Jan 7, 2020

Breaking Change:

  1. All services related to changing SimpliSafe system properties (alarm volume, alarm duration, etc.) have been consolidated into a single set_system_properties service.
  2. The set_pin and remove_pin services can now only be called by admin users.

Description:

While experimenting with the various SimpliSafe property methods (set_chime_volume, etc.), I came to a realization: because SimpliSafe's cloud API anticipates receiving updated property values all at once, our method (sending properties one at a time) can result in failed updates if those calls happen too close together. This PR consolidates all of the relevant service calls into a single set_system_properties admin service (whose payload can include any/all system-related properties).

Additionally, commentary by @MartinHjelmare made me realize that like this new service, the other services provided by the integration – set_pin and remove_pin – are sensitive enough to require admin rights; this PR updates them to be admin services, as well.

Related issue (if applicable): N/A

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

Example entry for configuration.yaml (if applicable):

simplisafe:
  accounts:
    username: !secret ss_username
    password: !secret ss_password

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.

@bachya bachya self-assigned this Jan 7, 2020
@project-bot project-bot bot added this to Needs review in Dev Jan 7, 2020
@MartinHjelmare MartinHjelmare moved this from Needs review to Incoming in Dev Jan 8, 2020
@bachya bachya marked this pull request as ready for review January 8, 2020 02:18
@MartinHjelmare MartinHjelmare moved this from Incoming to Needs review in Dev Jan 9, 2020
@MartinHjelmare MartinHjelmare moved this from Needs review to By Code Owner in Dev Jan 9, 2020
homeassistant/components/simplisafe/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/simplisafe/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/simplisafe/services.yaml Outdated Show resolved Hide resolved
Dev automation moved this from By Code Owner to Review in progress Jan 9, 2020
@bachya
Copy link
Contributor Author

bachya commented Jan 13, 2020

@MartinHjelmare Anything else you'd like to see?

Dev automation moved this from Review in progress to Reviewer approved Jan 13, 2020
Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@bachya bachya merged commit b585feb into home-assistant:dev Jan 13, 2020
Dev automation moved this from Reviewer approved to Done Jan 13, 2020
@bachya bachya deleted the simplisafe-property-services branch January 13, 2020 04:32
@lock lock bot locked and limited conversation to collaborators Jan 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants