-
Notifications
You must be signed in to change notification settings - Fork 47
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 basic support for lock pro #241
Conversation
Looks like the third last number in the lock/unlock command (i.e 0f4e0101000
Maybe we should use 6: OpenAPI? |
I removed python 3.10 since it doesn't support StrEnum and fixed the lint issues. This needs test coverage before merging as well |
Added active mode test case. Any idea how can I grab some passive mode data? I ran discover in a loop for a while but only ever got active mode data from the lock. |
You can pull it out of diagnostics in Home Assistant from a local Bluetooth adapter or an esphome remote proxy |
Hmm weird, from my esphome bluetooth proxy it's still active mode data. Any idea? |
I have the EU lock and logged my bluetooth traffic. COMMAND_UNLOCK_WITHOUT_UNLATCH should be 0f4e01010001a0 |
What does your yaml look like? |
Should be good now. Didn't know I need to trim the |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #241 +/- ##
==========================================
+ Coverage 58.59% 58.78% +0.18%
==========================================
Files 34 35 +1
Lines 1495 1531 +36
==========================================
+ Hits 876 900 +24
- Misses 619 631 +12 ☔ View full report in Codecov by Sentry. |
I think this is close to ready to merge. Do you have a Home Assistant PR to match up to this? I'll try to take a look tomorrow, but it might not be until Tuesday that I come back to this as I have a busy day tomorrow and its super late here. |
Thank you so much for the work @szclsya, tested it with EU Lock Pro and it works well! Tested unlocking, locking, status and night latch unlocking! I think model detection can be improved by detecting Lock or Lock Pro automatically. Probably by using the same enum ( That would allow a lock construction like this:
|
@ynsgnr Good idea! Updated. |
@bdraco I have a Home Assistant patch working locally now. Will send a pull request after this pull request is merged. |
It would be super helpful for review purposes if you linked the branch, or opened a draft PR to HA core so I can look at the whole change. |
@bdraco See Home Assistant PR at home-assistant/core#119326 |
@bdraco gentle reminder to take a look at the PR, just wanted to remind 😇 |
Haven't forgotten. Just haven't had any free time to look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @szclsya
Please be sure to name future branches something besides Thanks |
released as 0.48.0 Please bump the library in a separate PR from home-assistant/core#119326 and than merge in dev to home-assistant/core#119326 once the bump PR is merged |
Roger that. Sorry for the inconvenience. |
Note that since I've only tried manually creating
SwitchbotLock
interface, theadv_parser
part and the model name is mostly made up for now.Also since we only need to change some constants to make it work, I just added a enum inside the
SwitchbotLock
to differentiate between the two models.