Rework hardware widget
From the rework of the widget using typescript i think about reworking the widget props in order to split widget options and hardware definition
Basically i want to
- Move the widget connected to a dedicated hardware into a dedicated package.
- I would prefer to use
hardware
for them - so maybe the proposal is to move other widgets on the side
- For example
HardwareGroup
orMeasurementGroup
- For example
- I would prefer to use
- Specialize an API for this widgets
For now it looks like that
Props {
// Hardware description
id: string
name: string
online: boolean
properties {}
...
// user options set in the layout for this widget
options?: {
readOnly?: boolean
...
}
}
function Widget(props:Props) { ... }
It is not very convenient because the hardware description is mixed with options. And it's more difficult to type that stuff properly even if there is no issue with.
I want to rework the layout the following way
Props {
hardware: MotorSchema // Hardware description
// user options set in the layout for this widget
options?: {
readOnly?: boolean
...
}
}
// or even better, because it's just a normal widget with properties
Props {
hardware: MotorSchema // Hardware description
// user options set in the layout for this widget
readOnly?: boolean
}
Edited by Valentin Valls