-
-
Notifications
You must be signed in to change notification settings - Fork 556
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
Implement push server for xioami miio gateways #1288
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1288 +/- ##
==========================================
- Coverage 84.18% 82.98% -1.21%
==========================================
Files 135 136 +1
Lines 13348 13739 +391
Branches 1485 3266 +1781
==========================================
+ Hits 11237 11401 +164
- Misses 1900 2119 +219
- Partials 211 219 +8
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
I think this is ready for merging.
This will allow for motion sensors, door sensors, buttons, cubes etc to be added to HomeAssistant as devices that will get instant pushes when an event happens. |
@rytilahti could you revieuw this and merge? |
HomeAssistant Pull Request is here: home-assistant/core#64726 |
Home Assistant documentation PR is here: home-assistant/home-assistant.io#21309 |
@rytilahti this is now fully tested and the HomeAssistant PRs to implement this new code are also finished. |
I just found a way to get the "encrypted token":
It works for the tokens of both my 2 gateways. |
@rytilahti could you revieuw this? |
Hi @starkillerOG, sorry for the silence, I've been really busy and this PR is not a small one. I'll write some feedback to you asap to get this moving onward! |
@rytilahti gentile reminder if you could have a look at this PR since a lot of users are waiting for this. |
@rytilahti Could you have a look at this PR? |
@rytilahti could you please have a look and merge? |
@rytilahti I have moved the push_server.py directly under miio and genaralized it a bit. I am really bad at writing tests, sorry... |
@rytilahti I think I processed all your feedback of the first round or commented on it. |
@rytilahti Could you have a second look for feedback? |
Any updates here? I'm looking forward to this functionality! |
@wormi4ok it is ready from my end, just waiting on @rytilahti. |
@starkillerOG, would you be open for a call on the homeassistant discord or elsewhere to discuss about this PR? I feel that having a synchronous discussion would be so much more efficient than communicating through github comments :-) |
@rytilahti yea sure tomorrow around 20:00 (UTC+2) good for you? |
New split out PR can be found here: #1446 |
with many thanks to @bskaplou to figuring out how most of this stuff worked.
This is based on his work in PR: #709
Tested to work with magnet door sensor
lumi.sensor_magnet.aq2
To do:
implement other models where pushes are knownability to register external callback on subdevice for HomeAssistant porpuseimplement pushes for gateway alarm (triggering)Do some more code cleanupDiscussion about retrieving the encrypted_token:#699 (comment)
Test script: