change temperaturesensor id to underscore notation

This commit is contained in:
MichaelDvP
2024-07-04 13:42:23 +02:00
parent 147804b4b8
commit cee2d5ca31
4 changed files with 15 additions and 9 deletions

View File

@@ -389,7 +389,13 @@ export const entityItemValidation = (entity: EntityItem[], entityItem: EntityIte
export const temperatureSensorItemValidation = () =>
new Schema({
n: [{ required: true, message: 'Name is required' }]
n: [
{
type: 'string',
pattern: /^[a-zA-Z0-9_\\.]{0,15}$/,
message: "Must be <15 characters: alpha numeric, '_' or '.'"
}
]
});
export const isGPIOUniqueValidator = (sensors: AnalogSensor[]) => ({