diff --git a/packages/jsonConfig/src/JsonConfigComponent/ConfigPanel.tsx b/packages/jsonConfig/src/JsonConfigComponent/ConfigPanel.tsx index 361893219..d54832ab1 100644 --- a/packages/jsonConfig/src/JsonConfigComponent/ConfigPanel.tsx +++ b/packages/jsonConfig/src/JsonConfigComponent/ConfigPanel.tsx @@ -4,7 +4,7 @@ import { Grid2, Accordion, AccordionSummary, AccordionDetails, Typography, Box } import { ExpandMore as ExpandMoreIcon } from '@mui/icons-material'; -import { type IobTheme, Utils } from '@iobroker/adapter-react-v5'; +import { type AdminConnection, type IobTheme, Utils } from '@iobroker/adapter-react-v5'; import type { ConfigItemPanel } from '#JC/types'; import ConfigGeneric, { type ConfigGenericState, type ConfigGenericProps } from './ConfigGeneric'; @@ -180,6 +180,7 @@ class ConfigPanel extends ConfigGeneric { const type = items[attr].type || 'panel'; let ItemComponent: typeof ConfigGeneric; + let socket: string | AdminConnection = 'Use this.props.oContext.socket!'; if (type === 'custom') { // name // url @@ -191,6 +192,7 @@ class ConfigPanel extends ConfigGeneric { console.error(`Cannot find custom component: ${items[attr].component}`); ItemComponent = ConfigGeneric; } + socket = this.props.oContext.socket; } else if (type === 'panel') { ItemComponent = ConfigPanel; } else { @@ -199,6 +201,8 @@ class ConfigPanel extends ConfigGeneric { return (