Issue-85: support multiple object instances#86
Conversation
|
@Guzz-T Looks good on the first glance. I need to test this very well as you probably understand as this is quite a big change. So give me and the others some time to do that. |
|
@Guzz-T I finally found the time to change my setup so that it uses your PR. I'll let this run for a week or so in order to see if I run into problems. So far it looks good, thanks for your efforts! |
|
@Guzz-T Please rebase your PR, the checks should succeed after that! |
|
Done. (Github added a merge instead of a rebase :( ). |
I'm no expert in that matter either, so don't worry about it 😅 |
|
Now the linter should finally be satisfied |
|
Seems like a massive change / break to the API. If it doesn't break anything and was tested by you, it's fine with me, although I don't fully understand why the change to the read functions is needed. |
|
Sure. Let me digress a little. The issue can be divided into two aspects: "The luxtronik read/write interface owns (second aspect) the read data as class variables (first aspect)" First aspect:Problem: Solution: The implementation I prefer and in my opinion better would be that the interface only returns the read data instead of storing it. And so we come to the ... Second aspect:There is probably more room for discussion about this part. In terms of object-oriented programming, the read data does not belong in a read/write interface. For this, the (class) variables have to be removed and the read/write functions have to be adjusted accordingly (return value for read, parameter for write). But to maintain this change completely would break the API. So i prepared everything so far for an intermediate version, so that users still have time to switch to the new implementation while the old one is still supported. Currently the interface:
To come back to your question: To-Do's after the next release:
|
|
Okay, thank you for the detailed explanation. Makes sense to me. On the other hand I'm wondering whether we shouldn't just introduce those other breaking changes as well with the next release instead of releasing "intermediate" versions that break some aspects, but not all, with more yet to come. |
|
That would be my individual release strategy. If you don't mind that this pull request already breaks the API, I can adapt the code accordingly. |
|
Seems like we all agree then. Then let's break some more of the API. @Guzz-T will you create follow-up commits here in this pull request, or will there be another one? |
|
I will add them here. |
|
@Guzz-T Thank you for all of your effort, very good code with code quality. Is this pull request considered to be done, or should we continue with reviews? |
|
Update: |
49f3dc2 to
9bda921
Compare
…xtronik controller
9bda921 to
5cabeac
Compare
|
|
I am a bit late to the party, but I don't like one of the changes introduced in the PR. It is good, that For me, an instance of |
|
I don't think there are advantages to store the read data inside the class instance:
Adding a timestamp shouldn't be a problem. The time required to instantiate a class should be negligible compared to the reading time. |
|
Since this is an already merged PR: Could we discuss any potential changes (or thing we don't like) in separate issues? For instance, if you want to have the feature "timestamp for last reading" let's create an issue for that and discuss it over there. This PR has been merged 2-3 months ago, and for now it's set. |
fixes #85
Branch tested with home-assistant 2022.9.7 and a master/slave AIT-heatpump setup. Therefore i added a second renamed "luxtronik" integration (see https://github.com/Guzz-T/luxtronik/tree/try/second-integration-for-slave-heatpump).
Pull-Request should not contain any breaking changes. The diff in
calculations(and ...) seems pretty hard, but I just had to change the indentation (= use 'hide withspaces').