Controleur : trois ecritures jamais relayees (budget, verrou P12, reset borne) + garde-fou ; verrou P12 leve en fin de session
This commit is contained in:
@@ -40,6 +40,22 @@ const nodeCode = Object.fromEntries(
|
||||
CHAIN.map(n => [n, wf.nodes.find(x => x.name === n).parameters.jsCode])
|
||||
);
|
||||
|
||||
// GARDE-FOU (01/10/2026) : tout appel produit par HA_SERVICE_CALLS_OUTPUT doit
|
||||
// etre transmis par « Build … Actions », qui ne relaie QUE les appels qu'il
|
||||
// nomme. Trois ecritures ne partaient jamais (le verrou P12 depuis le 15/09,
|
||||
// l'acquittement du bouton reset borne, le budget voiture du 30/09) : les
|
||||
// scenarios s'arretent a HA_SERVICE_CALLS_OUTPUT et ne pouvaient pas le voir.
|
||||
const BUILD_CODE = wf.nodes.find(x => x.name === 'Build EVCS Surplus Controller V2.0 Actions').parameters.jsCode;
|
||||
const appelsProduits = [...nodeCode.HA_SERVICE_CALLS_OUTPUT.matchAll(/^ {6}([a-z_0-9]+): \{/gm)].map(m => m[1]);
|
||||
const appelsPerdus = [...new Set(appelsProduits)].filter(n => !BUILD_CODE.includes(`'${n}'`));
|
||||
let gardeFou = 0;
|
||||
if (appelsPerdus.length) {
|
||||
gardeFou = 1;
|
||||
console.log(`❌ build-actions-transmet-tout | appels produits mais jamais executes : ${appelsPerdus.join(', ')}`);
|
||||
} else {
|
||||
console.log(`✅ build-actions-transmet-tout (${new Set(appelsProduits).size} appels)`);
|
||||
}
|
||||
|
||||
// Horloge simulée : Date épinglée à l'instant du scénario dans la sandbox.
|
||||
function makeFakeDate(fixedMs) {
|
||||
return class FakeDate extends Date {
|
||||
@@ -122,6 +138,8 @@ function summarize(out) {
|
||||
sessionCommittedService: calls.helper_night_grid_session_committed?.execute
|
||||
? calls.helper_night_grid_session_committed.service
|
||||
: null,
|
||||
// Verrou P12 : service ecrit ce cycle (turn_on/turn_off), null sinon.
|
||||
nightBatteryDoneService: calls.helper_night_battery_done?.execute ? calls.helper_night_battery_done.service : null,
|
||||
// Budget voiture de la nuit (30/09) : valeur ecrite ce cycle, null sinon.
|
||||
nightBudgetWrite: calls.helper_night_budget?.execute ? calls.helper_night_budget.data.value : null,
|
||||
// Consigne de puissance reseau ecrite ce cycle (null = aucune ecriture).
|
||||
@@ -132,7 +150,7 @@ function summarize(out) {
|
||||
}
|
||||
|
||||
const jsonResults = {};
|
||||
let failures = 0, ran = 0;
|
||||
let failures = gardeFou, ran = 0;
|
||||
for (const sc of scenarios) {
|
||||
if (only && !sc.id.includes(only)) continue;
|
||||
ran++;
|
||||
|
||||
Reference in New Issue
Block a user