test(fixtures): dump réel LoadConfig + schéma introspecté de hems .75

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) <noreply@anthropic.com>
This commit is contained in:
Patrick Schurig 2026-08-25 10:37:59 +02:00
parent 1056d6c746
commit 40ac3b2c8e
2 changed files with 100 additions and 0 deletions

37
test/fixtures/loadconfig_hems75.json vendored Normal file
View File

@ -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": {}
}
]
}

View File

@ -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"
}
}