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

Constant generalization #294

Merged
merged 6 commits into from
Mar 28, 2023
Merged

Constant generalization #294

merged 6 commits into from
Mar 28, 2023

Conversation

chrysn
Copy link
Owner

@chrysn chrysn commented Nov 21, 2022

Possible solution for #175, see there for the moment.

@chrysn
Copy link
Owner Author

chrysn commented Nov 21, 2022

One aspect that'll need addressing is whether properties derived from ACK_TIMEOUT should be recalculated. It'd make sense, but as long as I'm using the class itself as a value, I can't do that just with @propertys.

@Jc2k
Copy link

Jc2k commented Dec 1, 2022

@roysjosh have you had a chance to look at this?

@chrysn from my pov, we can work with this. The only thing is we'd have have to have a TransportTuning instance rather than using the class (there is no hard coded ACK_TIMEOUT for us because the sleep interval is a runtime setting from the device, so we'd have to have a TransportTuning per connection). But because aiocoap isn't using mypy that shouldn't matter to aiocaop. If you are planning on adding typing I guess that could bite us down the line.

@chrysn
Copy link
Owner Author

chrysn commented Dec 1, 2022 via email

@roysjosh
Copy link
Contributor

roysjosh commented Dec 5, 2022

I agree that this is a usable solution for the problem at hand. I'm not half the python programmer @Jc2k is so I'll just smile and nod at the second paragraph :)

@Jc2k
Copy link

Jc2k commented Dec 5, 2022

I have put together a PoC of this in HA HomeKit, but haven't had time to flesh it out yet. I'm still happy with your approach @chrysn.

chrysn added 3 commits March 26, 2023 03:19
This is breaking wildcard imports of the numbers, because we can't make
them raise-as-deprecated when used through a wildcard import. That's a
sufficiently small breakage that it should be OK for a minor release.
@chrysn chrysn marked this pull request as ready for review March 28, 2023 12:29
@chrysn
Copy link
Owner Author

chrysn commented Mar 28, 2023

I'm merging this with a few new changes (as announced: Using properties, instanciating it for every message).

There is a slight incompatibility in the change as the now deprecated globals are not available through wildcard imports any more, but these are sufficiently frowned upon in libraries anyway that I doubt you'd run into any trouble (and besides, it's not like there's any good reason to access them from the outside).

I expect to have a release with those in rather soon, but there are several fixes I'm spooling up for this, so not Right Now.

@chrysn chrysn merged commit 61a73ff into master Mar 28, 2023
@chrysn chrysn deleted the constant-generalization branch March 28, 2023 12:35
@chrysn
Copy link
Owner Author

chrysn commented Apr 2, 2023

Release 0.4.7 is out and contains these changes.

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

Successfully merging this pull request may close these issues.

3 participants