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

Update Sesame component to use Candy House's library using the V3 API #23621

Merged
merged 4 commits into from
May 8, 2019

Conversation

zanglang
Copy link
Contributor

@zanglang zanglang commented May 2, 2019

Breaking Change:

The Sesame smart lock's 1.0 API uses a username/password pair to authenticate, and may be deprecated in the future. The V3 API uses an API key, so it will require users to update their HA config.

Description:

Related issue (if applicable): fixes #19003

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

Example entry for configuration.yaml (if applicable):

lock:
  - platform: sesame
    api_key: !secret sesame_api_key

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 communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly (example).
  • New dependencies have been added to requirements in the manifest (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

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

@balloob balloob merged commit 0712626 into home-assistant:dev May 8, 2019
@zanglang zanglang deleted the pysesame2 branch May 8, 2019 17:08
if self._is_unlocked:
return STATE_UNLOCKED
return STATE_LOCKED
return STATE_LOCKED if self._is_locked else STATE_UNLOCKED
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't overwrite the state property. It's the responsibility of the base lock entity class.


@property
def device_state_attributes(self) -> dict:
"""Return the state attributes."""
attributes = {}
attributes[ATTR_DEVICE_ID] = self._device_id
attributes[ATTR_SERIAL_NO] = self._serial
Copy link
Member

Choose a reason for hiding this comment

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

We don't allow serial numbers and similar static info in state attributes. The state attributes should hold info that is mostly dynamic and related to the state of the entity.

@balloob balloob mentioned this pull request May 14, 2019
alandtse pushed a commit to alandtse/home-assistant that referenced this pull request Oct 12, 2019
…home-assistant#23621)

* Update Sesame component to use Candy House's library using the V3 API

* Updated requirements_all.txt

* Fix pylint warning

* Revert back to ATTR_DEVICE_ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sesame lock component is using an old API version and state goes out of sync
5 participants