Update device.py#59
Closed
svh1985 wants to merge 1 commit into
Closed
Conversation
Added support for door sensor Nuki 2.0
pschmitt
requested changes
Aug 2, 2020
Owner
pschmitt
left a comment
There was a problem hiding this comment.
Thanks for your PR. Please see my comment.
| def state_name(self): | ||
| return self._json.get("stateName") | ||
|
|
||
| @property |
Owner
There was a problem hiding this comment.
ATM the device class is not the right place for this. It was meant as a base class that hosts all the common attributes. You mentioned this is for Niki 2.0 devices only. It would make more sense to create a new NukiV2 that inherits from NukiLock or even better: an intermediate class NukiBaseLock and a NukiV1 and NukiV2 that both inherit from it.
Contributor
There was a problem hiding this comment.
Yes, seems to be good idea, how i can help/improve you to build code ?
Owner
There was a problem hiding this comment.
I'm not sure what you mean. What helps most is PRs :)
Owner
|
Closing as #61 has been merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added support for the magnetic door sensor which comes with Nuki 2.0:
https://developer.nuki.io/page/nuki-bridge-http-api-1-11/4/#heading--doorsensor-states
Ran a test against my bridge:
Output door closed:
Output door opened: