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

[dsmr] Add bridgeUID to thingUID during discovery #8446

Merged
merged 1 commit into from
Sep 11, 2020

Conversation

wborn
Copy link
Member

@wborn wborn commented Sep 10, 2020

Additional validation got added in OH3 to make sure that the bridgeUID is added to Things with bridges (openhab/openhab-core#1481).

The DSMRBridgeDiscoveryService did not add the bridgeUID so it would cause the following exceptions during discovery:

java.lang.IllegalArgumentException: Thing UID 'dsmr:device_v4:default' does not match bridge UID 'dsmr:dsmrBridge:22e5393c'
	at org.openhab.core.config.discovery.DiscoveryResultBuilder.validateThingUID(DiscoveryResultBuilder.java:166) ~[bundleFile:?]
	at org.openhab.core.config.discovery.DiscoveryResultBuilder.withBridge(DiscoveryResultBuilder.java:120) ~[bundleFile:?]
	at org.openhab.binding.dsmr.internal.discovery.DSMRDiscoveryService.meterDiscovered(DSMRDiscoveryService.java:81) ~[bundleFile:?]
	at org.openhab.binding.dsmr.internal.discovery.DSMRBridgeDiscoveryService.lambda$1(DSMRBridgeDiscoveryService.java:171) ~[bundleFile:?]
	at java.util.HashMap$Values.forEach(HashMap.java:976) ~[?:?]
	at org.openhab.binding.dsmr.internal.discovery.DSMRBridgeDiscoveryService.handleTelegramReceived(DSMRBridgeDiscoveryService.java:171) ~[bundleFile:?]
	at org.openhab.binding.dsmr.internal.device.DSMRTelegramListener.telegramReceived(DSMRTelegramListener.java:97) ~[bundleFile:?]
	at org.openhab.binding.dsmr.internal.device.p1telegram.P1TelegramParser.parse(P1TelegramParser.java:265) ~[bundleFile:?]
	at org.openhab.binding.dsmr.internal.device.SmartyDecrypter.parse(SmartyDecrypter.java:107) ~[bundleFile:?]
	at org.openhab.binding.dsmr.internal.device.DSMRTelegramListener.handleData(DSMRTelegramListener.java:74) ~[bundleFile:?]
	at org.openhab.binding.dsmr.internal.device.connector.DSMRBaseConnector.handleDataAvailable(DSMRBaseConnector.java:116) ~[bundleFile:?]
	at org.openhab.binding.dsmr.internal.device.connector.DSMRSerialConnector.handleDataAvailable(DSMRSerialConnector.java:317) ~[bundleFile:?]
	at org.openhab.binding.dsmr.internal.device.connector.DSMRSerialConnector.serialEvent(DSMRSerialConnector.java:276) [bundleFile:?]
	at org.openhab.core.io.transport.serial.rxtx.RxTxSerialPort$1.serialEvent(RxTxSerialPort.java:81) [bundleFile:?]
	at gnu.io.RXTXPort.sendEvent(RXTXPort.java:834) [bundleFile:5.2.1]
	at gnu.io.RXTXPort.eventLoop(Native Method) [bundleFile:5.2.1]
	at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:108) [bundleFile:5.2.1]

Signed-off-by: Wouter Born <github@maindrain.net>
Copy link
Member

@Hilbrand Hilbrand left a comment

Choose a reason for hiding this comment

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

LGTM. You probably found out using it? Maybe we should create an issue to check all other bindings?

@Hilbrand Hilbrand merged commit a67ea8f into openhab:2.5.x Sep 11, 2020
@Hilbrand Hilbrand added this to the 2.5.9 milestone Sep 11, 2020
@wborn wborn deleted the dsmr-discovery-bridgeuid branch September 11, 2020 08:49
@wborn
Copy link
Member Author

wborn commented Sep 11, 2020

Yes I'm testing OH3 and fixing the bugs I run into so it becomes a bit more stable. I'll have a look at the other add-ons next. We might have already caught some of these bugs if we could build add-ons for OH3 with tests enabled. Though that is currently not an option because the tests need to be migrated to JUnit 5. 😉

@Hilbrand
Copy link
Member

Ough. Can we already add JUnit 5 to 2.5? to start migration?

@wborn
Copy link
Member Author

wborn commented Sep 11, 2020

We'd have to upgrade several dependencies including bnd which may cause regressions in 2.5.x. It's probably less risky and easier to do this when the code has been ported to the master branch (which already has all JUnit 5 infrastructure in place).

CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this pull request Sep 12, 2020
Signed-off-by: Wouter Born <github@maindrain.net>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Sep 19, 2020
Signed-off-by: Wouter Born <github@maindrain.net>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Oct 8, 2020
Signed-off-by: Wouter Born <github@maindrain.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.

2 participants