Patrick Schurig c2eccd96e5 sunspec: add a failing test that sets up a Fronius connection
The existing suite only exercises free functions and the plugin JSON, so it
cannot see whether a thing class is dispatched at all. A thing class missing
from the dispatch in setupThing() falls into the final Q_ASSERT_X: in a debug
build the process dies, in a release build the assert is compiled out and
setupThing() returns without ever calling info->finish(), leaving the pairing
stuck with no message.

Split the tests into two suites. The logic one keeps its former scope and its
single dependency on libnymea-sunspec. The new one instantiates the plugin
behind the real ThingManager of libnymea-core and a faked HardwareManager, so
the dispatch of setupThing(), postSetupThing() and thingRemoved() is covered.
No network access takes place: the faked monitor is never reachable, so the
plugin never attempts a Modbus connection.

The four new cases fail: froniusConnection is not dispatched yet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 16:18:41 +02:00
..

SunSpec

Connect nymea to SunSpec devices over Modbus TCP

Supported Things

  • SunSpec Inverter
    • Model ID 101 & 111 Single phase inverter
    • Model ID 102 & 112 Split phase inverter
    • Model ID 103 & 113 Three phase inverter
  • SunSpec Meter
    • Model ID 201 & 211 Single phase meter
    • Model ID 202 & 212 Split phase meter
    • Model ID 203 & 213 Three phase meter
  • SunSpec Storage
    • Model ID 124

Tested connections

  • SolarEdge (with custom battery)

Requirements

  • The package 'nymea-plugin-sunspec' must be installed.
  • The SunSpec device must support SunSpec over modbus TCP

More

https://sunspec.org