add transform to max output
This commit is contained in:
parent
01aef649fd
commit
0db9565935
@ -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
|
||||
|
@ -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
Loading…
Reference in New Issue
Block a user