add transform to max output

This commit is contained in:
Tykayn 2023-10-01 11:56:42 +02:00 committed by tykayn
parent 01aef649fd
commit 0db9565935
3 changed files with 65149 additions and 0 deletions

View File

@ -147,6 +147,20 @@ const MappingIRVE: MappingConfigType = {
]
}
}
},
puissance_nominale: {
key_converted: 'socket:max:output',
conditionnal_values: {
transform_function: (original_value:string) => {
let converted_value = parseInt(original_value)
let accepted_values = [3, 7, 22, 50, 150, 300]
if (accepted_values.includes(converted_value)) {
return converted_value+ ' kW'
} else {
return null
}
},
}
}
// TODO gestion des puissances de bornes
// avec une fonction de transformation des valeurs

View File

@ -400,6 +400,7 @@ export default class {
// une transformation de la valeur
// apply transformation to value
convertedValue = conditionnalConfig.transform_function(originalValue)
console.log('transform_function: originalValue', originalValue, convertedValue)
}
// use the value converted
else if (conditionnalConfig.value_converted) {

File diff suppressed because it is too large Load Diff