-
Notifications
You must be signed in to change notification settings - Fork 780
Initial commit of Bluetooth binding and Bluetooth transport bundles #3531
Conversation
This is a rebased version of #551 Signed-off-by: Chris Jackson <[email protected]> Signed-off-by: Markus Rathgeb <[email protected]>
Signed-off-by: Markus Rathgeb <[email protected]>
Signed-off-by: Markus Rathgeb <[email protected]>
Signed-off-by: Markus Rathgeb <[email protected]>
Signed-off-by: Markus Rathgeb <[email protected]>
Signed-off-by: Markus Rathgeb <[email protected]>
Signed-off-by: Markus Rathgeb <[email protected]>
I agree - it would be good to get this merged.
I’m currently working on an alternative transport (i.e. not dbus) using the BlueGiga BLED112 dongle which should be usable universally. I’m not 100% how much work it is at the moment but I’ve written an interface to the dongle which is working and I think it’s doable without huge work. At the moment I’m trying to avoid changing the common transport bundle but if I succeed in getting this working then it will be much easier for me to look at this as I won’t need a linux machine.
One comment on this - the yeelight bundle I think conflicts with another bundle in OH2 for the wifi version. I refactored the bundle here to be yeelightblue - it might pay to think about that before this gets merged.
|
I created #3533 for the failed integration build. @cdjackson I don't care if the openHAB binding changes its name to yeelightwifi or we change the ESH binding to yeelightblue (perhaps Should I change yeelight to yeelightblue or yeelight-blue? |
I personally don’t mind. I used yeelightblue here, but yeelight-blue does look nicer ;).
|
We so far do not use any hyphens in binding ids, so I would clearly vote for yeelightblue. |
Related to: #3531 (comment) Signed-off-by: Markus Rathgeb <[email protected]>
renamed yeelight to yeelightblue |
Signed-off-by: Markus Rathgeb <[email protected]>
timerTask = null; | ||
} | ||
|
||
public float[] RGBtoHSB(int r, int g, int b, float[] hsbvals) { |
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.
I understand that the purpose of this PR is to apply only the most important changes, but I just want to mention that this method seems to me redundant, as it is already implemented in ESH - see HSBType.fromRGB()
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.
What do you think about create an issue to collect stuff that should be cleaned up?
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.
@svilenvul Or alternatively feel free to directly commit fixes/clean-ups on a personal branch in your fork and we could pull that into this PR before it is going to be merged.
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.
So, when do we want to create a CQ? Doesn't every change of the code base in this PR result in a delay of the initial CQ?
Wouldn't it be better to create a CQ for the initial code base and then allow us all the other changes (as long as they consists of <1k LOC) to be merged immediately without a CQ?
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.
I wanted to at least spend an hour this week to roughly go over the code to see if it is ok to create a CQ (and thus merge as is) or if we (I) should do any changes to it upfront. In the meantime, I think it is ok for @svilenvul to work on improvements in his own branch - those can then result in a follow-up PR once this one is merged, right?
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.
in a follow-up PR once this one is merged
Sure, I fully agree with that approach. 👍
I wanted to at least spend an hour this week to roughly go over the code to see if it is ok to create a CQ (and thus merge as is) or if we (I) should do any changes to it upfront.
Great 😉
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 for giving me green light to apply some changes, I have put this on my TODO list :)
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.
I have put this on my TODO list :)
Better refrain from it for the moment - I just had a call with Chris and I will write a small summary soon; we agreed on some substantial refactoring of the code :-/
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.
OK, I haven't read you comment below before :)
Having had a closer look at the code, I am not really too keen to merge it as is anymore. Especially the Yeelight binding shows that there are huge issues in the architecture:
Additionally, the Yeelight binding is in a bad shape:
I tried to refactor the binding, but ended up with hardly any code left in place. As the binding isn't much code anyhow, I would suggest to completely remove it from the PR, so that it does not accidentally serve as a template for others. For the other two transport bundles, I would create a CQ then, unless @cdjackson has again time for helping on that code, so that we could discuss potential refactorings wrt the BlueGiga dongle. |
I would suggest to hold off for a couple of weeks while I investigate some changes - I think Kai will write something on this later.
|
@cdjackson I tried to put our discussion in a diagram: The general scheme is that we should not think of the "BLE Binding" to be a single bundle, but rather a feature (i.e. a set of bundles, not all of which need to be installed).
This should all nicely fit into the current framework architecture (actually, the binding API had been designed specifically in a way to support that, so I think it is time to actually use it that way :-)). Chris, does that match our conversation? Do you have anything to add? |
Yes - I think that reflects our conversation. I have started already to implement this and would hope to have something in a week or so with any luck - we can discuss more then as I have a feeling there may be a few issues that might pop up ;)
|
If I am not mistaken, this is superseded by #3633 - unless anyone does not agree with the suggested refactoring of the architecture. |
The code base should be equal to: #551
IMHO the code itself needs further work.
BUT it should be enough to create a CQ and merge it, so further improvements could be done using a central place and code base.
We should ensure that someone is working (again) on that cleanup.