mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
digital_out, settings #1375, dev.5b
This commit is contained in:
@@ -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)] : [])
|
||||
]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user