digital_out, settings #1375, dev.5b

This commit is contained in:
MichaelDvP
2023-11-02 19:13:22 +01:00
parent 1097b519ae
commit 8307b0920c
21 changed files with 325 additions and 195 deletions

View File

@@ -188,12 +188,12 @@ export const isGPIOUniqueValidator = (sensors: AnalogSensor[]) => ({
}
});
export const analogSensorItemValidation = (sensors: AnalogSensor[], creating: boolean) =>
export const analogSensorItemValidation = (sensors: AnalogSensor[], creating: boolean, platform: string) =>
new Schema({
n: [{ required: true, message: 'Name is required' }],
g: [
{ required: true, message: 'GPIO is required' },
GPIO_VALIDATOR,
platform === 'ESP32-S3' ? GPIO_VALIDATORS3 : platform === 'ESP32-C3' ? GPIO_VALIDATORC3 : GPIO_VALIDATOR,
...(creating ? [isGPIOUniqueValidator(sensors)] : [])
]
});