From 40ac3b2c8e8593358f6b14df4a1a87266bb9a42a Mon Sep 17 00:00:00 2001 From: Patrick Schurig Date: Tue, 25 Aug 2026 10:37:59 +0200 Subject: [PATCH] =?UTF-8?q?test(fixtures):=20dump=20r=C3=A9el=20LoadConfig?= =?UTF-8?q?=20+=20sch=C3=A9ma=20introspect=C3=A9=20de=20hems=20.75?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Préalable §0 du lot 1 : la charge utile réelle fait foi pour le modèle Dart. - loadconfig_hems75.json : NymeaEnergy.GetLoadConfig sur 192.168.1.75 (nymea 1.15.2, experience NymeaEnergy 0.8). Conserve volontairement les charges utiles VIDES des mécanismes inutilisés (sgReady:{}, powerLevels:[], needs à défaut) — sérialisation par méta-objet côté plugin. - loadconfig_schema_hems75.json : JSONRPC.Introspect du schéma SetLoadConfig réellement accepté par la box, et du type LoadConfig renvoyé par GET. Le schéma est committé parce que nymea REJETTE toute clé inconnue (jsonvalidator.cpp:143) : c'est la liste exhaustive de ce qui peut être réécrit, et donc la référence de l'aller-retour lire→modifier→réécrire. Co-Authored-By: Claude Opus 5 (1M context) --- test/fixtures/loadconfig_hems75.json | 37 ++++++++++++ test/fixtures/loadconfig_schema_hems75.json | 63 +++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 test/fixtures/loadconfig_hems75.json create mode 100644 test/fixtures/loadconfig_schema_hems75.json diff --git a/test/fixtures/loadconfig_hems75.json b/test/fixtures/loadconfig_hems75.json new file mode 100644 index 0000000..85422dc --- /dev/null +++ b/test/fixtures/loadconfig_hems75.json @@ -0,0 +1,37 @@ +{ + "_source": "dump reel HEMS 192.168.1.75 (nymea 1.15.2+202606191336~trixie1, experience NymeaEnergy 0.8), NymeaEnergy.GetLoadConfig, 2026-08-25", + "_note": "Source de verite du modele Dart. Contient les charges utiles VIDES des mecanismes non utilises (sgReady:{}, powerLevels:[], needs a defaut) : serialisation par meta-objet cote plugin. Ne PAS nettoyer.", + "loadConfigs": [ + { + "adapter": "relay-router", + "enabled": true, + "id": "chauffe-eau", + "label": "chauffe-eau", + "maxPowerW": 0, + "minOffS": 60, + "minOnS": 60, + "mode": "fixed", + "needs": { + "dailyDeadline": "", + "minEnergyWhPerDay": 0 + }, + "powerLevels": [], + "priority": 1, + "relays": [ + { + "powerW": 500, + "thingId": "{8538782f-2c8c-4a30-bfce-c8140f791c9b}" + }, + { + "powerW": 1000, + "thingId": "{2ebe6bef-829b-4695-9d11-ddb4c16c5448}" + }, + { + "powerW": 2000, + "thingId": "{b033b212-1adb-4df0-ba2b-8fa477de52a2}" + } + ], + "sgReady": {} + } + ] +} \ No newline at end of file diff --git a/test/fixtures/loadconfig_schema_hems75.json b/test/fixtures/loadconfig_schema_hems75.json new file mode 100644 index 0000000..34d5522 --- /dev/null +++ b/test/fixtures/loadconfig_schema_hems75.json @@ -0,0 +1,63 @@ +{ + "_source": "JSONRPC.Introspect sur 192.168.1.75, 2026-08-25 — schema REELLEMENT accepte par la box", + "_note": "nymea rejette toute cle inconnue (jsonvalidator.cpp:143 \"Invalid key\"). Ce schema est donc la liste exhaustive de ce que SetLoadConfig accepte sur cette box.", + "SetLoadConfig_params": { + "loadConfigs": [ + { + "adapter": "String", + "enabled": "Bool", + "id": "String", + "label": "String", + "mode": "String", + "o:maxPowerW": "Uint", + "o:minOffS": "Uint", + "o:minOnS": "Uint", + "o:needs": { + "o:dailyDeadline": "String", + "o:minEnergyWhPerDay": "Uint" + }, + "o:powerLevels": [ + "Uint" + ], + "o:relays": [ + { + "powerW": "Uint", + "thingId": "String" + } + ], + "o:sgReady": { + "o:minStateHoldS": "Uint", + "o:states": [ + { + "estimatedPowerW": "Double", + "relays": [ + "String" + ], + "state": "Uint" + } + ] + }, + "priority": "Uint" + } + ] + }, + "LoadConfig_getType": { + "adapter": "String", + "enabled": "Bool", + "id": "String", + "label": "String", + "maxPowerW": "Int", + "minOffS": "Int", + "minOnS": "Int", + "mode": "String", + "needs": "$ref:LoadConfigNeeds", + "powerLevels": [ + "Variant" + ], + "priority": "Int", + "relays": [ + "Variant" + ], + "sgReady": "Object" + } +} \ No newline at end of file