From 3802807be7697c9546ab75e5165511103c39c0c4 Mon Sep 17 00:00:00 2001 From: Patrick Schurig Date: Sat, 1 Aug 2026 16:20:09 +0200 Subject: [PATCH] sunspec: dispatch froniusConnection in setupThing() setupThing() only knew about sunspecConnection and solarEdgeConnection, so a froniusConnection thing fell into the final Q_ASSERT_X. In a release build the assert is compiled out, setupThing() returns without calling info->finish(), and the pairing hangs until the setup times out - with no message at all. In a debug build nymead dies on the assert instead. Take the same branch as the two vendors that already work: createConnection() already reads the slave ID and picks the byte order for froniusConnection, so no new logic is needed. postSetupThing() and thingRemoved() are unchanged on purpose. The former only special cases solarEdgeConnection, for the battery search a Fronius must not run, and registers the refresh timer for every thing. The latter is keyed on m_sunSpecConnections, which createConnection() now populates for Fronius as well. Makes the four cases of tst_sunspecplugin pass. Co-Authored-By: Claude Opus 5 (1M context) --- sunspec/integrationpluginsunspec.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sunspec/integrationpluginsunspec.cpp b/sunspec/integrationpluginsunspec.cpp index 133cedd..6197a33 100644 --- a/sunspec/integrationpluginsunspec.cpp +++ b/sunspec/integrationpluginsunspec.cpp @@ -247,7 +247,8 @@ void IntegrationPluginSunSpec::setupThing(ThingSetupInfo *info) qCDebug(dcSunSpec()) << thing->params(); if (thing->thingClassId() == sunspecConnectionThingClassId || - thing->thingClassId() == solarEdgeConnectionThingClassId) { + thing->thingClassId() == solarEdgeConnectionThingClassId || + thing->thingClassId() == froniusConnectionThingClassId) { // Handle reconfigure if (m_sunSpecConnections.contains(thing->id())) {