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

[modbus] Export thing handler interface for upcoming bundles #4077

Merged
merged 2 commits into from
Oct 7, 2018

Conversation

mrbig
Copy link

@mrbig mrbig commented Oct 2, 2018

This is a follow up to PR #4053

The modbus binding could easily be extended by other bundles to add device specific things and their handlers. There is already such a work in progress, see issue #3216

Fortunately @ssalonen did a nice work separating interfaces from actual implementations so exporting the base handler interfaces is quite straightforward.

This work is based on the zigbee and bluetooth package practices and work by @triller-telekom

I've split the ModbusBindingConstants class also in two: one that is public and could be used by other bundles and one that remains internal.

Exporting the thing handler interface and the required other interfaces
makes it possible to textend this binding by other bundles. Such an use
case is when custom handlers are written to specific devices.

Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
@mrbig mrbig force-pushed the 4053-modbus-public-handlers branch from dfa3d25 to 67c70a4 Compare October 2, 2018 22:37
Copy link
Contributor

@cweitkamp cweitkamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much. I was not aware of the current work on this. Thanks for the hint.

* @author Nagy Attila Gabor - Split the original ModbusBindingConstants in two
*/
@NonNullByDefault
public class ModbusBindingConstants {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we give this class (or the original ModbusBindingConstants class) a different name to make it clear for everyone that one of them is internal and the other one is public API? Wdyt?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree, I just could not come up with a good name. As I can see this separation is fairly new, I would like to ask you guys to propose a naming convention here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Off-the-cuff: ModbusBindingConstants and ModbusBindingConstantsInternal. 😉

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, renamed the class

…ternal

Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
@mrbig mrbig force-pushed the 4053-modbus-public-handlers branch from a7fca49 to 91a43f7 Compare October 5, 2018 13:25
Copy link
Contributor

@cweitkamp cweitkamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Lets merge this one after #4057 and #4067.

@cweitkamp cweitkamp added the awaiting other PR Depends on another PR label Oct 5, 2018
@mrbig
Copy link
Author

mrbig commented Oct 5, 2018

Thank you!

@cweitkamp cweitkamp removed the awaiting other PR Depends on another PR label Oct 7, 2018
@cweitkamp cweitkamp merged commit d80b08a into openhab:master Oct 7, 2018
@martinvw martinvw added this to the 2.4 milestone Dec 9, 2018
chaton78 pushed a commit to chaton78/openhab-addons that referenced this pull request Jan 1, 2019
…#4077)

* [modbus] Export thing handler interface for upcoming bundles

Exporting the thing handler interface and the required other interfaces
makes it possible to textend this binding by other bundles. Such an use
case is when custom handlers are written to specific devices.

* [modbus] Renamed internal constants class to ModbusBindingConstantsInternal

Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
Signed-off-by: Pascal Larin <plarin@gmail.com>
magx2 pushed a commit to magx2/openhab2-addons that referenced this pull request Mar 18, 2019
…#4077)

* [modbus] Export thing handler interface for upcoming bundles

Exporting the thing handler interface and the required other interfaces
makes it possible to textend this binding by other bundles. Such an use
case is when custom handlers are written to specific devices.

* [modbus] Renamed internal constants class to ModbusBindingConstantsInternal

Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
arjanmels pushed a commit to arjanmels/openhab2-addons that referenced this pull request Mar 24, 2019
…#4077)

* [modbus] Export thing handler interface for upcoming bundles

Exporting the thing handler interface and the required other interfaces
makes it possible to textend this binding by other bundles. Such an use
case is when custom handlers are written to specific devices.

* [modbus] Renamed internal constants class to ModbusBindingConstantsInternal

Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
Signed-off-by: Arjan Mels <arjan.mels@gmx.net>
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