Closed cmroche closed 4 months ago
Hell @cmroche , I have been working on making this library fully type hinted. I was about to make a PR for your review then I saw these changes. Can you let me know if this PR is ready to be merged so I can rebase and update my work. Also we need to add support for new Gree Wifi modules running firmware 1.2.1. These use GCM encoding and I think we can incorporate this into the library in the encrypt/decrypt methods (also a new key is used). So my plan was to work on the same only after finishing the type hints.
Hell @cmroche , I have been working on making this library fully type hinted. I was about to make a PR for your review then I saw these changes. Can you let me know if this PR is ready to be merged so I can rebase and update my work. Also we need to add support for new Gree Wifi modules running firmware 1.2.1. These use GCM encoding and I think we can incorporate this into the library in the encrypt/decrypt methods (also a new key is used). So my plan was to work on the same only after finishing the type hints.
Awesome. Been working slowly to add typehints, so will be greatly appreciated.
Attention: Patch coverage is 92.89100%
with 15 lines
in your changes missing coverage. Please review.
Project coverage is 94.93%. Comparing base (
20bd108
) to head (70a6de9
).
Files | Patch % | Lines |
---|---|---|
greeclimate/network.py | 93.06% | 7 Missing :warning: |
greeclimate/device.py | 89.65% | 6 Missing :warning: |
greeclimate/deviceinfo.py | 94.11% | 1 Missing :warning: |
greeclimate/taskable.py | 95.65% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:tada: This PR is included in version 2.0.0 :tada:
The release is available on:
v2.0.0
Your semantic-release bot :package::rocket:
Hell @cmroche , I have been working on making this library fully type hinted. I was about to make a PR for your review then I saw these changes. Can you let me know if this PR is ready to be merged so I can rebase and update my work. Also we need to add support for new Gree Wifi modules running firmware 1.2.1. These use GCM encoding and I think we can incorporate this into the library in the encrypt/decrypt methods (also a new key is used). So my plan was to work on the same only after finishing the type hints.
I am done with the big rework. Next I will look at the GCM encryption this week but changes will be much smaller if you want to still work on the type hinting, perhaps I could get you to test it for me once it's ready as I do not have one of these devices.
Replaced the old send then receive approach to networking with asyncio.DatagramProtocol based classes
This removed a lot of duplicate network code as discovery was already using this approach, and allows handling on device responses when they are received as opposed to waiting on them explicitly.
BREAKING CHANGE: While interfaces are unchanged, you can no longer expect a device response is already received when
push_state_update
orbind
have returned.Responses will come through their appropriate handlers once they have been received.