adds DictComponent to GenericComponent

This commit is contained in:
Mose Müller
2024-04-22 19:11:23 +02:00
parent d40d9c5e47
commit 2df1a673ac

View File

@ -14,6 +14,7 @@ import { LevelName } from './NotificationsComponent';
import { getIdFromFullAccessPath } from '../utils/stringUtils';
import { WebSettingsContext } from '../WebSettings';
import { updateValue } from '../socket';
import { DictComponent } from './DictComponent';
type AttributeType =
| 'str'
@ -22,6 +23,7 @@ type AttributeType =
| 'int'
| 'Quantity'
| 'list'
| 'dict'
| 'method'
| 'DataService'
| 'DeviceConnection'
@ -212,6 +214,16 @@ export const GenericComponent = React.memo(
id={id}
/>
);
} else if (attribute.type === 'dict') {
return (
<DictComponent
value={attribute.value as Record<string, SerializedValue>}
docString={attribute.doc}
isInstantUpdate={isInstantUpdate}
addNotification={addNotification}
id={id}
/>
);
} else if (attribute.type === 'Image') {
return (
<ImageComponent