iobroker.admin 7.4.13 → 7.4.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static/js/7435.4eee6b92.chunk.js","mappings":"gNAWe,SAASA,EAAcC,GAClC,MAAM,QAAEC,EAAO,MAAEC,EAAK,SAAEC,EAAQ,KAAEC,EAAI,QAAEC,GAAYL,EAE9CM,IAASJ,IACXK,EAAAA,EAAAA,KAACC,EAAAA,WAAU,CACPC,QAAQ,SACRC,MAAO,CAAEC,WAAY,GAAIC,SAExBV,IAIT,OAAID,GAEIM,EAAAA,EAAAA,KAACM,EAAAA,QAAO,CACJC,MAAOb,EACPc,UAAW,CAAEC,OAAQ,CAAEC,GAAI,CAAEC,cAAe,UAAaN,UAEzDL,EAAAA,EAAAA,KAAA,QAAAK,UACIO,EAAAA,EAAAA,MAACC,EAAAA,WAAU,CACPf,QAASA,EACTF,SAAUA,EACVkB,KAAK,QAAOT,SAAA,CAEXR,EACAE,UAQjBa,EAAAA,EAAAA,MAACC,EAAAA,WAAU,CACPf,QAASA,EACTF,SAAUA,EACVkB,KAAK,QAAOT,SAAA,CAEXR,EACAE,IAGb,CCSA,SAASgB,EAAUC,EAAcC,GAC7B,MAAMC,EAAYF,EACbG,MAAM,KACNC,KAAIC,GAAKA,EAAEC,SACXC,QAAOF,GAAW,aAANA,IAEjB,OAAIH,EAAUM,SAAS,iBAAmBN,EAAUM,SAAS,aAClDxB,EAAAA,EAAAA,KAACyB,EAAAA,OAAM,CAACtB,MAAO,CAAEc,WAExBC,EAAUM,SAAS,WACZxB,EAAAA,EAAAA,KAAC0B,EAAAA,KAAI,CAACvB,MAAO,CAAEc,WAEtBC,EAAUM,SAAS,gBACZxB,EAAAA,EAAAA,KAAC2B,EAAAA,QAAO,CAACxB,MAAO,CAAEc,WAEzBC,EAAUM,SAAS,YACZxB,EAAAA,EAAAA,KAAC4B,EAAAA,IAAG,CAACz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AAiBJ,GACtC,IAAIgG,EAAS5F,EAAQ,OACrB/K,OAAO0K,eAAeC,EAAS,UAAW,CAAE0F,YAAY,EAAMjE,IAAK,WAAc,OAAOuE,EAAO9U,OAAS,G","sources":["../../../dm-gui-components/src/TooltipButton.tsx","../../../dm-gui-components/src/Utils.tsx","../../../dm-gui-components/src/DeviceActionButton.tsx","../../../dm-gui-components/src/DeviceControl.tsx","../../../dm-gui-components/src/Switch.tsx","../../../dm-gui-components/src/DeviceStatus.tsx","../../../dm-gui-components/src/JsonConfig.tsx","../../../dm-gui-components/src/DeviceImageUpload.tsx","../../../dm-gui-components/src/DeviceCard.tsx","../../../dm-gui-components/src/Communication.tsx","../../../dm-gui-components/src/InstanceActionButton.tsx","../../../dm-gui-components/src/DeviceList.tsx","../../../dm-gui-components/src/index.ts","../../../dm-gui-components/node_modules/@iobroker/dm-utils/build/DeviceManagement.js","../../../dm-gui-components/node_modules/@iobroker/dm-utils/build/index.js","../../../dm-gui-components/node_modules/@iobroker/dm-utils/build/types/base.js","../../../dm-gui-components/node_modules/@iobroker/dm-utils/build/types/errorCodes.js","../../../dm-gui-components/node_modules/@iobroker/dm-utils/build/types/index.js"],"sourcesContent":["import React from 'react';\nimport { IconButton, Tooltip, Typography } from '@mui/material';\n\ninterface TooltipButtonProps {\n tooltip?: string;\n label?: string;\n disabled?: boolean;\n Icon: React.JSX.Element | null;\n onClick?: () => void;\n}\n\nexport default function TooltipButton(props: TooltipButtonProps): React.JSX.Element {\n const { tooltip, label, disabled, Icon, onClick } = props;\n\n const text = !!label && (\n <Typography\n variant=\"button\"\n style={{ marginLeft: 4 }}\n >\n {label}\n </Typography>\n );\n\n if (tooltip) {\n return (\n <Tooltip\n title={tooltip}\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n >\n <span>\n <IconButton\n onClick={onClick}\n disabled={disabled}\n size=\"small\"\n >\n {Icon}\n {text}\n </IconButton>\n </span>\n </Tooltip>\n );\n }\n\n return (\n <IconButton\n onClick={onClick}\n disabled={disabled}\n size=\"small\"\n >\n {Icon}\n {text}\n </IconButton>\n );\n}\n","import React from 'react';\n\nimport type { ControlBase } from '@iobroker/dm-utils/build/types/base';\nimport type { ActionBase } from '@iobroker/dm-utils/build/types/api';\nimport {\n Add,\n Article,\n Bluetooth,\n BluetoothDisabled,\n Delete,\n Edit,\n FastForward,\n FastRewind,\n Fluorescent,\n Group,\n Info,\n Lightbulb,\n Link as LinkIcon,\n LinkOff,\n NotListedLocation,\n Pause,\n Person,\n PlayArrow,\n Power,\n QrCode,\n QuestionMark,\n Refresh,\n Search,\n Settings,\n Stop,\n Visibility,\n WbIncandescent,\n Wifi,\n WifiOff,\n} from '@mui/icons-material';\n\nimport { I18n, Icon } from '@iobroker/adapter-react-v5';\n\n/**\n * Get Icon by font-awesome name. Do not use these names, use names from getIconByName\n *\n * @param icon font-awesome icon name\n * Only following font-awesome icons are supported:\n * - fa-trash-can, fa-trash\n * - fa-pen\n * - fa-redo-alt\n * - fa-plus\n * - fa-qrcode, qrcode\n * - fa-wifi\n * - fa-wifi-slash\n * - fa-bluetooth\n * - fa-bluetooth-slash\n * - fa-eye\n * - fa-search\n * - fa-unlink\n * - fa-link\n * - fa-search-location\n * - fa-play\n * - fa-stop\n * - fa-pause\n * @param color color of the icon\n */\nfunction getFaIcon(icon: string, color?: string): React.JSX.Element | null {\n const iconStyle = icon\n .split(' ')\n .map(s => s.trim())\n .filter(s => s !== 'fa-solid');\n\n if (iconStyle.includes('fa-trash-can') || iconStyle.includes('fa-trash')) {\n return <Delete style={{ color }} />;\n }\n if (iconStyle.includes('fa-pen')) {\n return <Edit style={{ color }} />;\n }\n if (iconStyle.includes('fa-redo-alt')) {\n return <Refresh style={{ color }} />;\n }\n if (iconStyle.includes('fa-plus')) {\n return <Add style={{ color }} />;\n }\n if (iconStyle.includes('fa-qrcode') || iconStyle.includes('qrcode')) {\n return <QrCode style={{ color }} />;\n }\n if (iconStyle.includes('fa-wifi')) {\n return <Wifi style={{ color }} />;\n }\n if (iconStyle.includes('fa-wifi-slash')) {\n return <WifiOff style={{ color }} />;\n }\n if (iconStyle.includes('fa-bluetooth')) {\n return <Bluetooth style={{ color }} />;\n }\n if (iconStyle.includes('fa-bluetooth-slash')) {\n return <BluetoothDisabled style={{ color }} />;\n }\n if (iconStyle.includes('fa-eye')) {\n return <Visibility style={{ color }} />;\n }\n if (iconStyle.includes('fa-search')) {\n return <Search style={{ color }} />;\n }\n if (iconStyle.includes('fa-unlink')) {\n return <LinkOff style={{ color }} />;\n }\n if (iconStyle.includes('fa-link')) {\n return <LinkIcon style={{ color }} />;\n }\n if (iconStyle.includes('fa-search-location')) {\n return <NotListedLocation style={{ color }} />;\n }\n if (iconStyle.includes('fa-play')) {\n return <PlayArrow style={{ color }} />;\n }\n if (iconStyle.includes('fa-stop')) {\n return <Stop style={{ color }} />;\n }\n if (iconStyle.includes('fa-pause')) {\n return <Pause style={{ color }} />;\n }\n return <QuestionMark style={{ color }} />;\n}\n\n/**\n * Get Icon by name or by action\n *\n * @param name action name\n * possible action or icon names are\n * - edit, rename\n * - delete\n * - refresh\n * - newDevice, new, add\n * - discover, search\n * - unpairDevice, unpair\n * - pairDevice, pair\n * - identify\n * - play\n * - stop\n * - pause\n * - forward, next\n * - rewind, previous\n * - lamp, light\n * - backlight\n * - dimmer\n * - socket\n * - settings\n * - users, group\n * - user\n * - qrcode\n * - identify\n * - info\n * - lines\n * @param altName icon name\n * @param color color of the icon\n */\nfunction getIconByName(name: string, altName?: string, color?: string): React.JSX.Element | null {\n if (name === 'edit' || name === 'rename' || altName === 'edit' || altName === 'rename') {\n return <Edit style={{ color }} />;\n }\n if (name === 'delete' || altName === 'delete') {\n return <Delete style={{ color }} />;\n }\n if (name === 'refresh' || altName === 'refresh') {\n return <Refresh style={{ color }} />;\n }\n if (\n name === 'newDevice' ||\n name === 'new' ||\n name === 'add' ||\n altName === 'newDevice' ||\n altName === 'new' ||\n altName === 'add'\n ) {\n return <Add style={{ color }} />;\n }\n if (name === 'discover' || name === 'search' || altName === 'discover' || altName === 'search') {\n return <Search style={{ color }} />;\n }\n if (name === 'unpairDevice' || name === 'unpair' || altName === 'unpairDevice' || altName === 'unpair') {\n return <LinkOff style={{ color }} />;\n }\n if (name === 'pairDevice' || name === 'pair' || altName === 'pairDevice' || altName === 'pair') {\n return <LinkIcon style={{ color }} />;\n }\n if (name === 'identify' || altName === 'identify') {\n return <NotListedLocation style={{ color }} />;\n }\n if (name === 'play' || altName === 'play') {\n return <PlayArrow style={{ color }} />;\n }\n if (name === 'stop' || altName === 'stop') {\n return <Stop style={{ color }} />;\n }\n if (name === 'pause' || altName === 'pause') {\n return <Pause style={{ color }} />;\n }\n if (name === 'forward' || name === 'next' || altName === 'forward' || altName === 'next') {\n return <FastForward style={{ color }} />;\n }\n if (name === 'rewind' || name === 'previous' || altName === 'rewind' || altName === 'previous') {\n return <FastRewind style={{ color }} />;\n }\n if (name === 'lamp' || name === 'light' || altName === 'lamp' || altName === 'light') {\n return <Lightbulb style={{ color }} />;\n }\n if (name === 'backlight' || altName === 'backlight') {\n return <Fluorescent style={{ color }} />;\n }\n if (name === 'dimmer' || altName === 'dimmer') {\n return <WbIncandescent style={{ color }} />;\n }\n if (name === 'socket' || altName === 'socket') {\n return <Power style={{ color }} />;\n }\n if (name === 'settings' || altName === 'settings') {\n return <Settings style={{ color }} />;\n }\n if (name === 'users' || name === 'group' || altName === 'users' || altName === 'group') {\n return <Group style={{ color }} />;\n }\n if (name === 'user' || altName === 'user') {\n return <Person style={{ color }} />;\n }\n if (name === 'qrcode' || altName === 'qrcode') {\n return <QrCode style={{ color }} />;\n }\n if (name === 'info' || altName === 'info') {\n return <Info style={{ color }} />;\n }\n if (name === 'lines' || altName === 'lines') {\n return <Article style={{ color }} />;\n }\n return <QuestionMark style={{ color }} />;\n}\n\nexport function renderControlIcon(\n action: ControlBase,\n colors?: { primary: string; secondary: string },\n value?: string | number | boolean | null,\n): React.JSX.Element | null {\n if (!action) {\n return null;\n }\n\n let color = (value && action.colorOn) || action.color || (action.state ? 'primary' : 'inherit');\n\n if (colors) {\n if (color === 'primary') {\n color = colors.primary;\n } else if (color === 'secondary') {\n color = colors.secondary;\n }\n }\n\n if (action.icon?.startsWith('fa-') || action.icon?.startsWith('fas')) {\n return getFaIcon(action.icon, color);\n }\n if (value && action.iconOn?.startsWith('data:image')) {\n return (\n <Icon\n src={action.iconOn}\n style={{ color }}\n />\n );\n }\n if (action.icon?.startsWith('data:image')) {\n return (\n <Icon\n src={action.icon}\n style={{ color }}\n />\n );\n }\n return getIconByName(action.id, action.icon, color);\n}\n\nexport function renderActionIcon(action: ActionBase): React.JSX.Element | null {\n if (!action) {\n return null;\n }\n\n if (action.icon?.startsWith('fa-') || action.icon?.startsWith('fas')) {\n return getFaIcon(action.icon, action.color);\n }\n if (action.icon?.startsWith('data:image')) {\n return (\n <Icon\n src={action.icon}\n style={{ color: action.color }}\n />\n );\n }\n return getIconByName(action.id, action.icon, action.color);\n}\n\nlet language: ioBroker.Languages;\n\n/**\n * Get Translation\n */\nexport function getTranslation(\n /** Text to translate */\n text: ioBroker.StringOrTranslated,\n noTranslation?: boolean,\n): string {\n language = language || I18n.getLanguage();\n\n if (typeof text === 'object') {\n return text[language] || text.en;\n }\n\n return noTranslation ? text : I18n.t(text);\n}\n","import React from 'react';\n\nimport type { ActionBase, DeviceAction } from '@iobroker/dm-utils';\nimport TooltipButton from './TooltipButton';\nimport { renderActionIcon, getTranslation } from './Utils';\n\ninterface DeviceActionButtonProps {\n deviceId: string;\n action: DeviceAction;\n refresh: () => void;\n deviceHandler: (deviceId: string, action: ActionBase, refresh: () => void) => () => void;\n disabled?: boolean;\n}\n\nexport default function DeviceActionButton(props: DeviceActionButtonProps): React.JSX.Element {\n const { deviceId, action, refresh, deviceHandler, disabled } = props;\n\n const icon = renderActionIcon(action);\n\n const tooltip = getTranslation(action.description ?? '') || (icon ? null : action.id);\n\n return (\n <TooltipButton\n tooltip={tooltip || undefined}\n disabled={disabled || action.disabled}\n Icon={icon}\n onClick={deviceHandler(deviceId, action, refresh)}\n />\n );\n}\n","import React, { Component, type JSX } from 'react';\nimport { Button, Fab, Switch } from '@mui/material';\n\nimport type { Connection } from '@iobroker/adapter-react-v5';\nimport type { ControlBase, ControlState, DeviceControl } from '@iobroker/dm-utils';\n\nimport { renderControlIcon, getTranslation } from './Utils';\n\ninterface DeviceControlProps {\n deviceId: string;\n /** Control object */\n control: DeviceControl;\n socket: Connection;\n /** Control handler to set the state */\n controlHandler: (\n deviceId: string,\n control: ControlBase,\n state: ControlState,\n ) => () => Promise<ioBroker.State | null>;\n /** Control handler to read the state */\n controlStateHandler: (deviceId: string, control: ControlBase) => () => Promise<ioBroker.State | null>;\n colors: { primary: string; secondary: string };\n disabled?: boolean;\n}\n\ninterface DeviceControlState {\n value?: ControlState;\n ts?: number;\n}\n\n/**\n * Device Control component\n */\nexport default class DeviceControlComponent extends Component<DeviceControlProps, DeviceControlState> {\n constructor(props: DeviceControlProps) {\n super(props);\n this.state = {\n value: props.control.state?.val,\n ts: props.control.state?.ts,\n };\n }\n\n async componentDidMount(): Promise<void> {\n if (this.props.control.stateId) {\n const mayBePromise = this.props.socket.subscribeState(this.props.control.stateId, this.stateHandler);\n if (mayBePromise instanceof Promise) {\n await mayBePromise;\n }\n }\n }\n\n stateHandler = async (id: string, state: ioBroker.State): Promise<void> => {\n if (id === this.props.control.stateId && state) {\n // request new state\n const newState: ioBroker.State | null = await this.props.controlStateHandler(\n this.props.deviceId,\n this.props.control,\n )();\n if (newState?.ts && (!this.state.ts || newState.ts > this.state.ts)) {\n this.setState({\n value: newState.val,\n ts: newState.ts,\n });\n }\n }\n };\n\n componentWillUnmount(): void {\n if (this.props.control.stateId) {\n this.props.socket.unsubscribeState(this.props.control.stateId, this.stateHandler);\n }\n }\n\n static getDerivedStateFromProps(\n props: DeviceControlProps,\n state: DeviceControlState,\n ): Partial<DeviceControlState> | null {\n if (props.control.state?.ts && (!state.ts || props.control.state?.ts > state.ts)) {\n return {\n value: props.control.state.val,\n ts: props.control.state.ts,\n };\n }\n\n return null;\n }\n\n async sendControl(deviceId: string, control: ControlBase, value: ControlState): Promise<void> {\n const result = await this.props.controlHandler(deviceId, control, value)();\n if (result?.ts && (!this.state.ts || result?.ts > this.state.ts)) {\n this.setState({\n value: result.val,\n ts: result.ts,\n });\n }\n }\n\n renderButton(): JSX.Element {\n const tooltip = getTranslation(this.props.control.description ?? '');\n const icon = renderControlIcon(this.props.control, this.props.colors, this.state.value);\n\n if (!this.props.control.label) {\n return (\n <Fab\n size=\"small\"\n disabled={this.props.disabled}\n title={tooltip}\n onClick={() => this.sendControl(this.props.deviceId, this.props.control, true)}\n >\n {icon}\n </Fab>\n );\n }\n return (\n <Button\n disabled={this.props.disabled}\n title={tooltip}\n onClick={() => this.sendControl(this.props.deviceId, this.props.control, true)}\n startIcon={icon}\n >\n {getTranslation(this.props.control.label)}\n </Button>\n );\n }\n\n renderSwitch(): JSX.Element {\n const tooltip = getTranslation(this.props.control.description ?? '');\n // const icon = renderIcon(this.props.control, this.props.colors, this.state.value);\n\n return (\n <Switch\n disabled={this.props.disabled}\n title={tooltip}\n checked={!!this.state.value}\n onChange={e => this.sendControl(this.props.deviceId, this.props.control, e.target.checked)}\n />\n );\n }\n\n getColor(): string | undefined {\n let color: string | undefined;\n if (this.state.value) {\n color = this.props.control.colorOn || 'primary';\n } else if (this.props.control.type === 'switch') {\n color = this.props.control.color;\n }\n if (color === 'primary') {\n return this.props.colors.primary;\n }\n if (color === 'secondary') {\n return this.props.colors.secondary;\n }\n return color;\n }\n\n // TODO: implement the following render methods\n // eslint-disable-next-line react/no-unused-class-component-methods,class-methods-use-this\n renderSelect(): JSX.Element | null {\n return null;\n }\n\n // eslint-disable-next-line react/no-unused-class-component-methods,class-methods-use-this\n renderSlider(): JSX.Element | null {\n return null;\n }\n\n // eslint-disable-next-line react/no-unused-class-component-methods,class-methods-use-this\n renderColor(): JSX.Element | null {\n return null;\n }\n\n renderIcon(): JSX.Element {\n const tooltip = getTranslation(this.props.control.description ?? '');\n const icon = renderControlIcon(this.props.control, this.props.colors, this.state.value);\n const color = this.getColor();\n const style: React.CSSProperties | undefined =\n color === this.props.colors.primary || color === this.props.colors.secondary ? {} : { color };\n const colorProps =\n color === this.props.colors.primary\n ? 'primary'\n : color === this.props.colors.secondary\n ? 'secondary'\n : undefined;\n\n if (!this.props.control.label) {\n style.width = 34;\n style.height = 34;\n style.minHeight = 34;\n\n return (\n <Fab\n disabled={this.props.disabled}\n size=\"small\"\n title={tooltip}\n color={colorProps}\n style={style}\n onClick={() => this.sendControl(this.props.deviceId, this.props.control, !this.state.value)}\n >\n {icon}\n </Fab>\n );\n }\n return (\n <Button\n disabled={this.props.disabled}\n title={tooltip}\n color={colorProps}\n style={style}\n onClick={() => this.sendControl(this.props.deviceId, this.props.control, !this.state.value)}\n startIcon={icon}\n >\n {getTranslation(this.props.control.label)}\n </Button>\n );\n }\n\n render(): JSX.Element {\n if (this.props.control.type === 'button') {\n return this.renderButton();\n }\n\n if (this.props.control.type === 'icon') {\n return this.renderIcon();\n }\n\n if (this.props.control.type === 'switch') {\n return this.renderSwitch();\n }\n\n return <div style={{ color: 'red' }}>{this.props.control.type}</div>;\n }\n}\n","import React, { Component } from 'react';\nimport { type IobTheme } from '@iobroker/adapter-react-v5';\n\ninterface SwitchProps {\n checked: boolean;\n style?: React.CSSProperties;\n onChange: (checked: boolean) => void;\n theme: IobTheme;\n labelOn?: string;\n labelOff?: string;\n size?: 'small';\n disabled?: boolean;\n}\n\nconst WIDTH = 34;\nconst HANDLE_SIZE = 20;\nconst WIDTH_SMALL = 30;\nconst HANDLE_SIZE_SMALL = 15;\n\nexport default class Switch extends Component<SwitchProps> {\n render(): React.JSX.Element {\n const sw = (\n <div\n style={{\n width: this.props.size === 'small' ? WIDTH_SMALL : WIDTH,\n height: HANDLE_SIZE,\n display: 'flex',\n alignItems: 'center',\n cursor: 'pointer',\n position: 'relative',\n opacity: this.props.disabled ? 0.7 : 1,\n }}\n onClick={e => {\n if (this.props.disabled) {\n return;\n }\n e.stopPropagation();\n e.preventDefault();\n this.props.onChange(!this.props.checked);\n }}\n >\n <div\n style={{\n borderRadius: 15,\n width: '100%',\n height: (this.props.size === 'small' ? HANDLE_SIZE_SMALL : HANDLE_SIZE) * 0.7,\n opacity: 0.6,\n backgroundColor: this.props.checked\n ? this.props.theme.palette.primary.main\n : this.props.theme.palette.text.disabled,\n }}\n />\n <div\n style={{\n position: 'absolute',\n top: this.props.size === 'small' ? (HANDLE_SIZE - HANDLE_SIZE_SMALL) / 2 : 0,\n left: this.props.checked\n ? this.props.size === 'small'\n ? WIDTH_SMALL - HANDLE_SIZE_SMALL\n : WIDTH - HANDLE_SIZE\n : 0,\n transition: 'left 0.2s',\n borderRadius: 50,\n width: this.props.size === 'small' ? HANDLE_SIZE_SMALL : HANDLE_SIZE,\n height: this.props.size === 'small' ? HANDLE_SIZE_SMALL : HANDLE_SIZE,\n backgroundColor: this.props.checked ? this.props.theme.palette.primary.main : '#EEE',\n boxShadow:\n 'rgba(0, 0, 0, 0.2) 0px 2px 1px -1px, rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px',\n }}\n />\n </div>\n );\n\n if (this.props.labelOn || this.props.labelOff) {\n return (\n <div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>\n {this.props.labelOff}\n {sw}\n {this.props.labelOn}\n </div>\n );\n }\n\n return sw;\n }\n}\n","import React, { type CSSProperties, type MouseEvent } from 'react';\nimport { IconButton, Tooltip } from '@mui/material';\n\nimport {\n Link as LinkIcon,\n LinkOff as LinkOffIcon,\n NetworkCheck as NetworkCheckIcon,\n Battery20 as Battery20Icon,\n Battery30 as Battery30Icon,\n Battery50 as Battery50Icon,\n Battery60 as Battery60Icon,\n Battery80 as Battery80Icon,\n Battery90 as Battery90Icon,\n BatteryFull as BatteryFullIcon,\n BatteryAlert as BatteryAlertIcon,\n Warning as WarningIcon,\n BatteryCharging50 as BatteryCharging50Icon,\n Cable as IconConnectionLan,\n Wifi as IconConnectionWifi,\n WifiOff as IconConnectionNoWifi,\n Bluetooth as IconConnectionBluetooth,\n BluetoothDisabled as IconConnectionNoBluetooth,\n} from '@mui/icons-material';\n\nimport type { DeviceStatus, DeviceAction, ActionBase, ConfigConnectionType } from '@iobroker/dm-utils';\nimport { type IobTheme } from '@iobroker/adapter-react-v5';\n\nimport { getTranslation } from './Utils';\nimport Switch from './Switch';\n\nexport const ACTIONS = {\n STATUS: 'status',\n DISABLE: 'disable',\n ENABLE: 'enable',\n};\n\nconst styles: Record<string, React.CSSProperties> = {\n tooltip: {\n pointerEvents: 'none',\n },\n};\n\nexport interface IconProps {\n /** The width in pixels or percentage of the icon. */\n width?: number | string;\n /** The height in pixels or percentage of the icon. */\n height?: number | string;\n /** Click handler. */\n onClick?: (e: MouseEvent) => void;\n /** The class name for the SVG element. */\n className?: string;\n /** Styles for the SVG element. */\n style?: CSSProperties;\n /** The font size of the icon. */\n fontSize?: 'small';\n}\n\nfunction ThreadIcon(props: IconProps): React.JSX.Element {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n onClick={e => props.onClick && props.onClick(e)}\n viewBox=\"0 0 165 165\"\n width={props.width || (props.fontSize === 'small' ? 16 : 20)}\n height={props.height || props.width || (props.fontSize === 'small' ? 16 : 20)}\n className={props.className}\n style={props.style}\n >\n <path\n fill=\"currentColor\"\n d=\"M82.498,0C37.008,0,0,37.008,0,82.496c0,45.181,36.51,81.977,81.573,82.476V82.569l-27.002-0.002 c-8.023,0-14.554,6.53-14.554,14.561c0,8.023,6.531,14.551,14.554,14.551v17.98c-17.939,0-32.534-14.595-32.534-32.531 c0-17.944,14.595-32.543,32.534-32.543l27.002,0.004v-9.096c0-14.932,12.146-27.08,27.075-27.08 c14.932,0,27.082,12.148,27.082,27.08c0,14.931-12.15,27.08-27.082,27.08l-9.097-0.001v80.641 C136.889,155.333,165,122.14,165,82.496C165,37.008,127.99,0,82.498,0z\"\n />\n <path\n fill=\"currentColor\"\n d=\"M117.748,55.493c0-5.016-4.082-9.098-9.1-9.098c-5.015,0-9.097,4.082-9.097,9.098v9.097l9.097,0.001 C113.666,64.591,117.748,60.51,117.748,55.493z\"\n />\n </svg>\n );\n}\n\nfunction ZWaveIcon(props: IconProps): React.JSX.Element {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n onClick={e => props.onClick && props.onClick(e)}\n viewBox=\"0 0 1073 1068\"\n width={props.width || (props.fontSize === 'small' ? 16 : 20)}\n height={props.height || props.width || (props.fontSize === 'small' ? 16 : 20)}\n className={props.className}\n style={props.style}\n >\n <path\n fill=\"currentColor\"\n d=\"M716 1.1C632.9 5.3 549.8 23.7 472 55c-66.4 26.7-132.6 65.5-188.5 110.4-43.8 35.1-85.2 76.7-120.1 120.6C72.4 400.4 16.7 539.8 3.5 686 1.8 705.1-.1 754.7.7 758c.5 2 1 2 49.7 1.8l49.1-.3.7-20c2.4-64.6 13.4-126 33.2-186 80.8-243.9 297-419.9 552.1-449.4 20.2-2.4 44.2-4.1 56.6-4.1h8.9V50 0l-9.7.1c-5.4.1-16.8.6-25.3 1zm-.8 208c-78.5 4.7-158 27.4-226.5 64.5-68.7 37.3-126.4 86.3-175.2 148.9-11 14-33.2 47.3-42.3 63.5-44 77.8-68.6 164.9-70.9 251.2l-.6 22.8h49.5 49.4l1.2-19c6.3-98.7 40-185.8 102.2-263.3 12.7-15.9 41.2-45.2 57-58.7 66.1-56.3 142.1-91.8 226-105.5 18.9-3 44.1-5.5 56.7-5.5h9.3v-50-50l-11.2.1c-6.2.1-17.3.6-24.6 1zm17.8 251c-104.5 9.2-195.2 69.7-243.6 162.4-43.9 84-45.5 184.2-4.5 270 60.3 125.9 198.1 194.2 334.9 166 46.6-9.7 89.5-29.7 127.2-59.6 13.5-10.7 37.3-34.5 48-47.9 34.2-43.1 55.2-92 63.7-148.6 2.2-15.1 2.5-62.7.5-77.4-3.6-25.2-10.1-51.4-17.8-71.2-10.1-26.2-29.4-59.7-47-81.8-9.7-12.1-35-37.2-47.4-47-47.8-37.9-104.5-60.1-165.4-65-14.7-1.1-34.7-1.1-48.6.1zm174.7 138.6c-.3.5-30.9 49.2-68.1 108.3L772 814.5l67.9.5 68 .5-30.1 48.8-30 48.7h-131c-104.4 0-130.9-.3-130.5-1.3.2-.6 32.7-51.1 72.1-112.1L730 687.9c0-.5-29.5-1-66.5-1.1l-66.6-.3 27.7-44.3 27.6-44.2h128l127.5.7z\"\n />\n </svg>\n );\n}\n\nfunction ZigBeeIcon(props: IconProps): React.JSX.Element {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n onClick={e => props.onClick && props.onClick(e)}\n viewBox=\"0 0 48 48\"\n width={props.width || (props.fontSize === 'small' ? 16 : 20)}\n height={props.height || props.width || (props.fontSize === 'small' ? 16 : 20)}\n className={props.className}\n style={props.style}\n >\n <path\n fill=\"currentColor\"\n d=\"M32.042,9.792c4.595,1.238,4.88,3.165,5.524,5.048C34.841,17.664,17.35,35.7,17.35,35.7 s10.901,1.177,23.487-1.003c-0.001,0.029-0.002,0.048-0.003,0.076C42.829,31.661,44,27.97,44,24c0-11.046-8.954-20-20-20 c-5.634,0-10.715,2.338-14.35,6.087C15.489,9.124,26.89,8.403,32.042,9.792z\"\n />\n <path\n fill=\"currentColor\"\n d=\"M14.724,37.285c-1.982-0.347-4.212-2.131-4.707-5.302c1.437-1.239,19.994-20.507,19.994-20.507 c-7.008-0.424-14.569-0.465-22.237,0.864C5.408,15.625,4,19.644,4,24c0,11.046,8.954,20,20,20c6.173,0,11.689-2.8,15.358-7.195 C35.486,37.33,23.257,38.769,14.724,37.285z\"\n />\n </svg>\n );\n}\n\ninterface DeviceStatusProps {\n status: DeviceStatus | null;\n deviceId: string;\n connectionType?: ConfigConnectionType;\n statusAction?: DeviceAction;\n enabled?: boolean;\n disableEnableAction?: DeviceAction;\n deviceHandler: (deviceId: string, action: ActionBase, refresh: () => void) => () => void;\n refresh: () => void;\n theme: IobTheme;\n}\n\n/**\n * Device Status component\n *\n * @param props - Parameters\n * @param props.status - Status object, e.g. { connection: 'connected', battery: 100, rssi: -50 }\n */\nexport default function DeviceStatus(props: DeviceStatusProps): React.JSX.Element | null {\n if (!props.status) {\n return null;\n }\n\n let status: DeviceStatus;\n\n if (typeof props.status === 'string') {\n status = {\n connection: props.status,\n };\n } else {\n status = props.status;\n }\n\n const iconStyleOK = {\n fill: '#00ac00',\n };\n const iconStyleNotOK = {\n fill: '#ff0000',\n };\n const iconStyleWarning = {\n fill: '#ff9900',\n };\n const iconStyleUnknown = {\n fill: '#8a8a8a',\n };\n\n let batteryIconTooltip: React.ReactNode = null;\n if (typeof status.battery === 'number') {\n if (status.battery >= 96 && status.battery <= 100) {\n batteryIconTooltip = <BatteryFullIcon style={iconStyleOK} />;\n } else if (status.battery >= 90 && status.battery <= 95) {\n batteryIconTooltip = <Battery90Icon style={iconStyleOK} />;\n } else if (status.battery >= 80 && status.battery <= 89) {\n batteryIconTooltip = <Battery80Icon style={iconStyleOK} />;\n } else if (status.battery >= 60 && status.battery <= 79) {\n batteryIconTooltip = <Battery60Icon style={iconStyleOK} />;\n } else if (status.battery >= 50 && status.battery <= 59) {\n batteryIconTooltip = <Battery50Icon style={iconStyleOK} />;\n } else if (status.battery >= 30 && status.battery <= 49) {\n batteryIconTooltip = <Battery30Icon style={iconStyleOK} />;\n } else if (status.battery >= 20 && status.battery <= 29) {\n batteryIconTooltip = <Battery20Icon style={iconStyleNotOK} />;\n } else {\n batteryIconTooltip = <BatteryAlertIcon style={iconStyleNotOK} />;\n }\n }\n\n const disability =\n typeof props.enabled === 'boolean' ? (\n <>\n <div style={{ flexGrow: 1 }} />\n {\n <Tooltip\n title={\n props.enabled ? getTranslation('disableIconTooltip') : getTranslation('enableIconTooltip')\n }\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>\n <Switch\n size=\"small\"\n checked={props.enabled}\n disabled={!props.disableEnableAction}\n onChange={() =>\n props.disableEnableAction &&\n props.deviceHandler(props.deviceId, props.disableEnableAction, props.refresh)()\n }\n theme={props.theme}\n />\n </div>\n </Tooltip>\n }\n </>\n ) : null;\n let connectionSymbol: React.JSX.Element | null;\n if (props.connectionType === 'wifi') {\n connectionSymbol =\n status.connection === 'connected' ? (\n <IconConnectionWifi style={iconStyleOK} />\n ) : status.connection === 'disconnected' ? (\n <IconConnectionNoWifi style={iconStyleNotOK} />\n ) : (\n <IconConnectionWifi style={iconStyleUnknown} />\n );\n } else if (props.connectionType === 'bluetooth') {\n connectionSymbol =\n status.connection === 'connected' ? (\n <IconConnectionBluetooth style={iconStyleOK} />\n ) : status.connection === 'disconnected' ? (\n <IconConnectionNoBluetooth style={iconStyleNotOK} />\n ) : (\n <IconConnectionBluetooth style={iconStyleUnknown} />\n );\n } else if (props.connectionType === 'lan') {\n connectionSymbol =\n status.connection === 'connected' ? (\n <IconConnectionLan style={iconStyleOK} />\n ) : status.connection === 'disconnected' ? (\n <IconConnectionLan style={iconStyleNotOK} />\n ) : (\n <IconConnectionLan style={iconStyleUnknown} />\n );\n } else if (props.connectionType === 'thread') {\n connectionSymbol =\n status.connection === 'connected' ? (\n <ThreadIcon style={iconStyleOK} />\n ) : status.connection === 'disconnected' ? (\n <ThreadIcon style={iconStyleNotOK} />\n ) : (\n <ThreadIcon style={iconStyleUnknown} />\n );\n } else if (props.connectionType === 'z-wave') {\n connectionSymbol =\n status.connection === 'connected' ? (\n <ZWaveIcon style={iconStyleOK} />\n ) : status.connection === 'disconnected' ? (\n <ZWaveIcon style={iconStyleNotOK} />\n ) : (\n <ZWaveIcon style={iconStyleUnknown} />\n );\n } else if (props.connectionType === 'zigbee') {\n connectionSymbol =\n status.connection === 'connected' ? (\n <ZigBeeIcon style={iconStyleOK} />\n ) : status.connection === 'disconnected' ? (\n <ZigBeeIcon style={iconStyleNotOK} />\n ) : (\n <ZigBeeIcon style={iconStyleUnknown} />\n );\n } else {\n connectionSymbol =\n status.connection === 'connected' ? (\n <LinkIcon style={iconStyleOK} />\n ) : status.connection === 'disconnected' ? (\n <LinkOffIcon style={iconStyleNotOK} />\n ) : null;\n }\n\n const connectionIcon =\n status.connection === 'connected' || status.connection === 'disconnected' ? (\n <Tooltip\n title={\n (status.connection === 'connected'\n ? getTranslation('connectedIconTooltip')\n : getTranslation('disconnectedIconTooltip')) +\n (props.statusAction\n ? `. ${getTranslation(props.statusAction.description || 'moreInformation')}`\n : '')\n }\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n {props.statusAction ? (\n <IconButton\n onClick={e => {\n if (props.statusAction) {\n e.stopPropagation();\n props.deviceHandler(props.deviceId, props.statusAction, props.refresh)();\n }\n }}\n >\n {connectionSymbol}\n <div style={{ position: 'absolute', top: 0, left: 0, color: 'grey' }}>*</div>\n </IconButton>\n ) : (\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>\n {connectionSymbol}\n </div>\n )}\n </Tooltip>\n ) : (\n connectionSymbol\n );\n\n return (\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n cursor: props.statusAction ? 'pointer' : undefined,\n width: props.disableEnableAction ? '100%' : undefined,\n gap: 8,\n }}\n >\n {connectionIcon}\n\n {status.rssi && (\n <Tooltip\n title=\"RSSI\"\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>\n <NetworkCheckIcon />\n <p style={{ fontSize: 'small', margin: 0 }}>{status.rssi}</p>\n </div>\n </Tooltip>\n )}\n\n {typeof status.battery === 'number' && (\n <Tooltip\n title={getTranslation('batteryTooltip')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>\n {batteryIconTooltip}\n <p style={{ fontSize: 'small', margin: 0 }}>{status.battery}%</p>\n </div>\n </Tooltip>\n )}\n\n {typeof status.battery === 'string' && (\n <Tooltip\n title={getTranslation('batteryTooltip')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>\n {status.battery === 'charging' ? <BatteryCharging50Icon /> : <BatteryFullIcon />}\n {status.battery !== 'charging' ? (\n status.battery.includes('V') || status.battery.includes('mV') ? (\n <p style={{ fontSize: 'small', margin: 0 }}>{status.battery}</p>\n ) : (\n <p style={{ fontSize: 'small', margin: 0 }}>\n <span style={{ marginRight: 4 }}>{status.battery}</span>\n mV\n </p>\n )\n ) : null}\n </div>\n </Tooltip>\n )}\n\n {typeof status.battery === 'boolean' && (\n <Tooltip\n title={getTranslation('batteryTooltip')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>\n {status.battery ? (\n <BatteryFullIcon style={iconStyleOK} />\n ) : (\n <BatteryAlertIcon style={iconStyleNotOK} />\n )}\n </div>\n </Tooltip>\n )}\n\n {status.warning ? (\n typeof status.warning === 'string' || typeof status.warning === 'object' ? (\n <Tooltip\n title={getTranslation(status.warning)}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>\n <WarningIcon style={iconStyleWarning} />\n </div>\n </Tooltip>\n ) : (\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>\n <WarningIcon style={iconStyleWarning} />\n </div>\n )\n ) : null}\n\n {disability}\n </div>\n );\n}\n","import React, { useState } from 'react';\nimport type { Connection, AdminConnection, ThemeName, ThemeType, IobTheme } from '@iobroker/adapter-react-v5';\nimport { JsonConfigComponent, type ConfigItemPanel, type ConfigItemTabs } from '@iobroker/json-config';\n\ninterface JsonConfigDmProps {\n instanceId: string;\n socket: Connection;\n schema: ConfigItemPanel | ConfigItemTabs;\n data: Record<string, any>;\n onChange: (data: Record<string, any>) => void;\n themeName: ThemeName;\n themeType: ThemeType;\n theme: IobTheme;\n isFloatComma?: boolean;\n dateFormat?: string;\n expertMode?: boolean;\n}\n\nexport default function JsonConfig(props: JsonConfigDmProps): React.JSX.Element | null {\n const { instanceId, socket, schema, data, onChange } = props;\n const [error, setError] = useState(false);\n\n if (schema === undefined) {\n return null;\n }\n\n const [adapterName, instance] = instanceId.split('.', 2);\n\n return (\n <>\n {error && <div>{error}</div>}\n <JsonConfigComponent\n expertMode={props.expertMode}\n socket={socket as any as AdminConnection}\n adapterName={adapterName}\n instance={parseInt(instance, 10)}\n schema={schema}\n data={data}\n onError={setError}\n onChange={(_data: Record<string, any>) => onChange(_data)}\n embedded\n themeName={props.themeName}\n themeType={props.themeType}\n theme={props.theme}\n isFloatComma={\n props.isFloatComma === undefined\n ? !!props.socket.systemConfig?.common.isFloatComma\n : props.isFloatComma\n }\n dateFormat={\n props.dateFormat === undefined\n ? (props.socket.systemConfig?.common.dateFormat as string)\n : props.dateFormat\n }\n />\n </>\n );\n\n /*\n JSON adapter config:\n className={classes.scroll}\n socket={socket}\n theme={this.props.theme}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n adapterName={this.props.adapterName}\n instance={this.props.instance}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n schema={this.state.schema}\n common={this.state.common}\n data={this.state.data}\n updateData={this.state.updateData}\n onError={(error) => this.setState({ error })}\n onChange={(data, changed) => this.setState({ data, changed })}\n customs={{ configCustomEasyAccess: ConfigCustomEasyAccess }}\n Object custom:\n instanceObj={instanceObj}\n customObj={customObj}\n custom={true}\n className={ '' }\n adapterName={adapter}\n instance={parseInt(instance.split('.').pop(), 10) || 0}\n socket={this.props.socket}\n theme={this.props.theme}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n multiEdit={this.props.objectIDs.length > 1}\n\n schema={this.jsonConfigs[adapter].json}\n data={data}\n onError={error =>\n this.setState({error}, () => this.props.onError && this.props.onError(error))}\n onValueChange={(attr, value) => {\n console.log(attr + ' => ' + value);\n const newValues = JSON.parse(JSON.stringify(this.state.newValues));\n newValues[instance] = newValues[instance] || {};\n if (this.commonConfig[instance][attr] === value) {\n delete newValues[instance][attr];\n if (!Object.keys(newValues[instance]).length) {\n delete newValues[instance];\n }\n } else {\n newValues[instance][attr] = value;\n }\n this.setState({newValues, hasChanges: this.isChanged(newValues)}, () =>\n this.props.onChange && this.props.onChange(this.state.hasChanges));\n }}\n */\n}\n","import React, { type ChangeEvent, type ChangeEventHandler } from 'react';\nimport type { Connection } from '@iobroker/adapter-react-v5';\n\ninterface DeviceImageUploadProps {\n socket: Connection;\n manufacturer?: string;\n model?: string;\n deviceId: string;\n onImageSelect: (image: string) => void;\n uploadImagesToInstance: string;\n}\n\nfunction DeviceImageUpload(params: DeviceImageUploadProps): React.JSX.Element | null {\n const { socket, manufacturer, model, deviceId, onImageSelect, uploadImagesToInstance } = params;\n\n const handleImageUpload: ChangeEventHandler<HTMLInputElement> = (event: ChangeEvent<HTMLInputElement>): void => {\n const target = event.target as HTMLInputElement;\n const files: FileList | null = target.files;\n if (!files || files.length === 0) {\n return;\n }\n\n const file = files[0];\n\n if (file) {\n const reader = new FileReader();\n\n reader.onload = (e: ProgressEvent<FileReader>): void => {\n if (!e.target || !e.target.result) {\n return;\n }\n\n const img = new Image();\n img.src = e.target.result as string;\n\n img.onload = async () => {\n const maxWidth = 50;\n const maxHeight = 50;\n let width = img.width;\n let height = img.height;\n\n if (width > height) {\n if (width > maxWidth) {\n height *= maxWidth / width;\n width = maxWidth;\n }\n } else if (height > maxHeight) {\n width *= maxHeight / height;\n height = maxHeight;\n }\n\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n if (ctx) {\n canvas.width = width;\n canvas.height = height;\n ctx.drawImage(img, 0, 0, width, height);\n\n const resizedImage = canvas.toDataURL('image/webp');\n\n // Build the file name from a manufacturer and model, if not available, use device id\n const fileName = `${manufacturer ? `${manufacturer}_` : ''}${model || deviceId}`;\n const base64Data = resizedImage.replace(/^data:image\\/webp;base64,/, '');\n const response = await socket.writeFile64(uploadImagesToInstance, fileName, base64Data);\n console.log(`saveImage response: ${JSON.stringify(response)}`);\n\n if (onImageSelect) {\n onImageSelect(resizedImage);\n }\n }\n };\n };\n\n reader.readAsDataURL(file);\n }\n };\n\n const imageUploadButtonStyle: React.CSSProperties = {\n // make the button invisible but still clickable\n opacity: 0,\n position: 'absolute',\n width: '45px',\n height: '45px',\n zIndex: 3,\n };\n\n return (\n <div>\n <input\n style={imageUploadButtonStyle}\n type=\"file\"\n accept=\"image/*\"\n onChange={handleImageUpload}\n />\n </div>\n );\n}\n\nexport default DeviceImageUpload;\n","import React, { Component, type JSX } from 'react';\n\nimport {\n Button,\n Typography,\n Dialog,\n DialogActions,\n DialogContent,\n IconButton,\n Fab,\n DialogTitle,\n Card,\n CardActions,\n CardHeader,\n CardContent,\n Paper,\n Box,\n} from '@mui/material';\n\nimport { MoreVert as MoreVertIcon, VideogameAsset as ControlIcon, Close as CloseIcon } from '@mui/icons-material';\n\nimport {\n Utils,\n type Connection,\n I18n,\n type ThemeName,\n type ThemeType,\n type IobTheme,\n IconDeviceType,\n} from '@iobroker/adapter-react-v5';\nimport {\n type DeviceDetails,\n type DeviceInfo,\n type ActionBase,\n type ControlBase,\n type ControlState,\n ACTIONS,\n} from '@iobroker/dm-utils';\n\nimport DeviceActionButton from './DeviceActionButton';\nimport DeviceControlComponent from './DeviceControl';\nimport DeviceStatusComponent from './DeviceStatus';\nimport JsonConfig from './JsonConfig';\nimport DeviceImageUpload from './DeviceImageUpload';\nimport { getTranslation } from './Utils';\nimport type { ConfigItemPanel, ConfigItemTabs } from '@iobroker/json-config';\n\nfunction NoImageIcon(props: { style?: React.CSSProperties; className?: string }): JSX.Element {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n style={props.style}\n className={props.className}\n >\n <path\n fill=\"currentColor\"\n d=\"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z\"\n />\n </svg>\n );\n}\n\ninterface DeviceCardProps {\n title?: string;\n /* Device ID */\n id: string;\n device: DeviceInfo;\n instanceId: string;\n socket: Connection;\n /* Instance, where the images should be uploaded to */\n uploadImagesToInstance?: string;\n deviceHandler: (deviceId: string, action: ActionBase, refresh: () => void) => () => void;\n controlHandler: (\n deviceId: string,\n control: ControlBase,\n state: ControlState,\n ) => () => Promise<ioBroker.State | null>;\n controlStateHandler: (deviceId: string, control: ControlBase) => () => Promise<ioBroker.State | null>;\n smallCards?: boolean;\n alive: boolean;\n themeName: ThemeName;\n themeType: ThemeType;\n theme: IobTheme;\n isFloatComma: boolean;\n dateFormat: string;\n}\n\nfunction getText(text: ioBroker.StringOrTranslated | undefined): string | undefined {\n if (typeof text === 'object') {\n return text[I18n.getLanguage()] || text.en;\n }\n\n return text;\n}\n\ninterface DeviceCardState {\n open: boolean;\n details: DeviceDetails | null;\n data: Record<string, any>;\n icon: string | undefined;\n showControlDialog: boolean;\n}\n\n/**\n * Device Card Component\n */\nclass DeviceCard extends Component<DeviceCardProps, DeviceCardState> {\n constructor(props: DeviceCardProps) {\n super(props);\n\n this.state = {\n open: false,\n details: null,\n data: {},\n icon: props.device.icon,\n showControlDialog: false,\n };\n }\n\n async fetchIcon(): Promise<void> {\n if (!this.props.device.icon) {\n const lang = I18n.getLanguage();\n const manufacturer =\n this.props.device.manufacturer && typeof this.props.device.manufacturer === 'object'\n ? this.props.device.manufacturer[lang] || this.props.device.manufacturer.en\n : this.props.device.manufacturer;\n const model =\n this.props.device.model && typeof this.props.device.model === 'object'\n ? this.props.device.model[lang] || this.props.device.model.en\n : this.props.device.model;\n\n // try to load the icon from file storage\n const fileName = `${manufacturer ? `${manufacturer}_` : ''}${model || this.props.device.id}`;\n\n try {\n const file = await this.props.socket.readFile(\n this.props.instanceId.replace('system.adapter.', ''),\n `${fileName}.webp`,\n true,\n );\n if (file) {\n this.setState({ icon: `data:image/${file.mimeType},${file.file}` });\n } else {\n this.setState({ icon: '' });\n }\n // const response = await fetch(url);\n // if (response.ok) {\n // const blob = await response.blob();\n // const reader = new FileReader();\n // reader.onloadend = () => {\n // setIcon(reader.result);\n // };\n // reader.readAsDataURL(blob);\n // } else {\n // throw new Error('Response not ok');\n // }\n } catch {\n if (this.state.icon) {\n this.setState({ icon: '' });\n }\n }\n }\n }\n\n componentDidMount(): void {\n this.fetchIcon().catch(e => console.error(e));\n }\n\n /**\n * Load the device details\n */\n async loadDetails(): Promise<void> {\n console.log(`Loading device details for ${this.props.device.id}... from ${this.props.instanceId}`);\n const details: DeviceDetails | null = await this.props.socket.sendTo(\n this.props.instanceId,\n 'dm:deviceDetails',\n this.props.device.id,\n );\n console.log(`Got device details for ${this.props.device.id}:`, details);\n this.setState({ details, data: details?.data || {} });\n }\n\n /**\n * Refresh the device details\n */\n refresh = (): void => {\n this.setState({ details: null });\n this.loadDetails().catch(console.error);\n };\n\n /**\n * Copy the device ID to the clipboard\n */\n copyToClipboard = (): void => {\n const textToCopy = this.props.device.id;\n Utils.copyToClipboard(textToCopy);\n alert(`${getTranslation('copied')} ${textToCopy} ${getTranslation('toClipboard')}!`);\n };\n\n renderDialog(): JSX.Element | null {\n if (!this.state.open || !this.state.details) {\n return null;\n }\n\n return (\n <Dialog\n open={!0}\n maxWidth=\"md\"\n onClose={() => this.setState({ open: false })}\n >\n <DialogContent>\n <JsonConfig\n instanceId={this.props.instanceId}\n socket={this.props.socket}\n schema={this.state.details.schema as ConfigItemPanel | ConfigItemTabs}\n data={this.state.data}\n onChange={(data: Record<string, any>) => this.setState({ data })}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </DialogContent>\n <DialogActions>\n <Button\n disabled={!this.props.alive}\n variant=\"contained\"\n color=\"primary\"\n onClick={() => this.setState({ open: false })}\n autoFocus\n >\n {getTranslation('closeButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderControlDialog(): JSX.Element | null {\n if (!this.state.showControlDialog || !this.props.alive) {\n return null;\n }\n const colors = { primary: '#111', secondary: '#888' };\n return (\n <Dialog\n open={!0}\n onClose={() => this.setState({ showControlDialog: false })}\n >\n <DialogTitle>\n {this.props.title}\n <IconButton\n style={{\n position: 'absolute',\n top: 5,\n right: 5,\n zIndex: 10,\n }}\n onClick={() => this.setState({ showControlDialog: false })}\n >\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <DialogContent style={{ display: 'flex', flexDirection: 'column' }}>\n {this.props.device.controls?.map(control => (\n <DeviceControlComponent\n disabled={false}\n key={control.id}\n control={control}\n socket={this.props.socket}\n colors={colors}\n deviceId={this.props.device.id}\n controlHandler={this.props.controlHandler}\n controlStateHandler={this.props.controlStateHandler}\n />\n ))}\n </DialogContent>\n </Dialog>\n );\n }\n\n renderControls(): JSX.Element | null {\n const colors = { primary: '#111', secondary: '#888' };\n const firstControl = this.props.device.controls?.[0];\n if (\n this.props.device.controls?.length === 1 &&\n firstControl &&\n (firstControl.type === 'icon' || firstControl.type === 'switch') &&\n !firstControl.label\n ) {\n // control can be placed in the button icon\n return (\n <DeviceControlComponent\n disabled={!this.props.alive}\n control={firstControl}\n colors={colors}\n socket={this.props.socket}\n deviceId={this.props.device.id}\n controlHandler={this.props.controlHandler}\n controlStateHandler={this.props.controlStateHandler}\n />\n );\n }\n\n if (this.props.device.controls?.length) {\n // place button and show controls dialog\n return (\n <Fab\n size=\"small\"\n disabled={!this.props.alive}\n onClick={() => this.setState({ showControlDialog: true })}\n >\n <ControlIcon />\n </Fab>\n );\n }\n return null;\n }\n\n renderActions(): JSX.Element[] | null {\n const actions = this.props.device.actions?.filter(\n a => a.id !== ACTIONS.STATUS && a.id !== ACTIONS.ENABLE_DISABLE,\n );\n\n return actions?.length\n ? actions.map(a => (\n <DeviceActionButton\n disabled={!this.props.alive}\n key={a.id}\n deviceId={this.props.device.id}\n action={a}\n deviceHandler={this.props.deviceHandler}\n refresh={this.refresh}\n />\n ))\n : null;\n }\n\n renderSmall(): JSX.Element {\n const hasDetails = this.props.device.hasDetails;\n const status = !this.props.device.status\n ? []\n : Array.isArray(this.props.device.status)\n ? this.props.device.status\n : [this.props.device.status];\n\n const icon = this.state.icon ? <IconDeviceType src={this.state.icon} /> : <NoImageIcon />;\n\n return (\n <Card\n sx={{\n maxWidth: 345,\n minWidth: 200,\n }}\n >\n <CardHeader\n sx={theme => ({\n backgroundColor:\n this.props.device.color === 'primary'\n ? theme.palette.primary.main\n : theme.palette.secondary.main === 'secondary'\n ? theme.palette.secondary.main\n : this.props.device.color || theme.palette.secondary.main,\n color:\n this.props.device.color &&\n this.props.device.color !== 'primary' &&\n this.props.device.color !== 'secondary'\n ? Utils.invertColor(this.props.device.color, true)\n : theme.palette.secondary.contrastText,\n maxWidth: 345,\n })}\n avatar={\n <div>\n {this.props.uploadImagesToInstance ? (\n <DeviceImageUpload\n uploadImagesToInstance={this.props.uploadImagesToInstance}\n deviceId={this.props.device.id}\n manufacturer={getText(this.props.device.manufacturer)}\n model={getText(this.props.device.model)}\n onImageSelect={(imageData: string): void => {\n if (imageData) {\n this.setState({ icon: imageData });\n }\n }}\n socket={this.props.socket}\n />\n ) : null}\n {icon}\n </div>\n }\n action={\n hasDetails ? (\n <IconButton\n aria-label=\"settings\"\n onClick={() => {\n if (!this.state.open) {\n this.loadDetails().catch(console.error);\n this.setState({ open: true });\n }\n }}\n >\n <MoreVertIcon />\n </IconButton>\n ) : null\n }\n title={this.props.title}\n subheader={\n this.props.device.manufacturer ? (\n <span>\n <b style={{ marginRight: 4 }}>{getTranslation('manufacturer')}:</b>\n {getText(this.props.device.manufacturer)}\n </span>\n ) : null\n }\n />\n <CardContent style={{ position: 'relative' }}>\n {status?.length ? (\n <div\n style={{\n display: 'flex',\n position: 'absolute',\n top: -11,\n background: '#88888880',\n padding: '0 8px',\n borderRadius: 5,\n width: 'calc(100% - 46px)',\n }}\n >\n {status.map((s, i) => (\n <DeviceStatusComponent\n key={i}\n status={s}\n connectionType={this.props.device.connectionType}\n enabled={this.props.device.enabled}\n deviceId={this.props.device.id}\n statusAction={this.props.device.actions?.find(a => a.id === ACTIONS.STATUS)}\n disableEnableAction={this.props.device.actions?.find(\n a => a.id === ACTIONS.ENABLE_DISABLE,\n )}\n deviceHandler={this.props.deviceHandler}\n refresh={this.refresh}\n theme={this.props.theme}\n />\n ))}\n </div>\n ) : null}\n <div>\n <Typography variant=\"body1\">\n <div\n onClick={this.copyToClipboard}\n style={{ textOverflow: 'ellipsis', overflow: 'hidden' }}\n >\n <b>ID:</b>\n <span style={{ marginLeft: 4 }}>{this.props.device.id.replace(/.*\\.\\d\\./, '')}</span>\n </div>\n {this.props.device.manufacturer ? (\n <div>\n <b style={{ marginRight: 4 }}>{getTranslation('manufacturer')}:</b>\n {getText(this.props.device.manufacturer)}\n </div>\n ) : null}\n {this.props.device.model ? (\n <div>\n <b style={{ marginRight: 4 }}>{getTranslation('model')}:</b>\n {getText(this.props.device.model)}\n </div>\n ) : null}\n </Typography>\n </div>\n </CardContent>\n <CardActions disableSpacing>\n {this.renderActions()}\n <div style={{ flexGrow: 1 }} />\n {this.renderControls()}\n </CardActions>\n {this.renderDialog()}\n {this.renderControlDialog()}\n </Card>\n );\n }\n\n renderBig(): JSX.Element {\n const cardStyle: React.CSSProperties = {\n width: 300,\n minHeight: 280,\n margin: 10,\n overflow: 'hidden',\n display: 'inline-block',\n };\n const headerStyle: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n paddingLeft: 8,\n paddingRight: 8,\n position: 'relative',\n minHeight: 60,\n color: '#000',\n };\n const imgAreaStyle: React.CSSProperties = {\n height: 45,\n width: 45,\n justifyContent: 'center',\n display: 'flex',\n alignItems: 'center',\n };\n const imgStyle: React.CSSProperties = {\n zIndex: 2,\n maxWidth: '100%',\n maxHeight: '100%',\n color: '#FFF',\n };\n const titleStyle: React.CSSProperties = {\n fontSize: 16,\n fontWeight: 'bold',\n // whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n };\n const detailsButtonStyle: React.CSSProperties = {\n right: 20,\n bottom: -20,\n position: 'absolute',\n };\n const bodyStyle: React.CSSProperties = {\n height: 'calc(100% - 116px)',\n };\n const deviceInfoStyle: React.CSSProperties = {\n padding: '20px 16px 0 16px',\n height: 133,\n };\n const statusStyle: React.CSSProperties = {\n padding: '15px 25px 0 15px',\n height: 41,\n };\n const status = !this.props.device.status\n ? []\n : Array.isArray(this.props.device.status)\n ? this.props.device.status\n : [this.props.device.status];\n\n const icon = this.state.icon ? (\n <IconDeviceType\n src={this.state.icon}\n style={imgStyle}\n />\n ) : (\n <NoImageIcon style={imgStyle} />\n );\n\n const title: string = this.state.details?.data?.name || this.props.title || '';\n\n return (\n <Paper\n style={cardStyle}\n key={this.props.id}\n >\n <Box\n sx={theme => ({ backgroundColor: theme.palette.secondary.main })}\n style={headerStyle}\n >\n <div style={imgAreaStyle}>\n {this.props.uploadImagesToInstance ? (\n <DeviceImageUpload\n uploadImagesToInstance={this.props.uploadImagesToInstance}\n deviceId={this.props.device.id}\n manufacturer={getText(this.props.device.manufacturer)}\n model={getText(this.props.device.model)}\n onImageSelect={(imageData: string): void => {\n if (imageData) {\n this.setState({ icon: imageData });\n }\n }}\n socket={this.props.socket}\n />\n ) : null}\n {icon}\n </div>\n <Box\n style={titleStyle}\n title={title.length > 20 ? title : undefined}\n sx={theme => ({ color: theme.palette.secondary.contrastText })}\n >\n {this.state.details?.data?.name || this.props.title}\n </Box>\n {this.props.device.hasDetails ? (\n <Fab\n disabled={!this.props.alive}\n size=\"small\"\n style={detailsButtonStyle}\n onClick={() => {\n if (!this.state.open) {\n this.loadDetails().catch(console.error);\n this.setState({ open: true });\n }\n }}\n color=\"primary\"\n >\n <MoreVertIcon />\n </Fab>\n ) : null}\n </Box>\n <div style={statusStyle}>\n {status.map((s, i) => (\n <DeviceStatusComponent\n key={i}\n deviceId={this.props.device.id}\n connectionType={this.props.device.connectionType}\n status={s}\n enabled={this.props.device.enabled}\n statusAction={this.props.device.actions?.find(a => a.id === ACTIONS.STATUS)}\n disableEnableAction={this.props.device.actions?.find(a => a.id === ACTIONS.ENABLE_DISABLE)}\n deviceHandler={this.props.deviceHandler}\n refresh={this.refresh}\n theme={this.props.theme}\n />\n ))}\n </div>\n <div style={bodyStyle}>\n <Typography\n variant=\"body1\"\n style={deviceInfoStyle}\n >\n <div onClick={this.copyToClipboard}>\n <b style={{ marginRight: 4 }}>ID:</b>\n {this.props.device.id.replace(/.*\\.\\d\\./, '')}\n </div>\n {this.props.device.manufacturer ? (\n <div>\n <b style={{ marginRight: 4 }}>{getTranslation('manufacturer')}:</b>\n {getText(this.props.device.manufacturer)}\n </div>\n ) : null}\n {this.props.device.model ? (\n <div>\n <b style={{ marginRight: 4 }}>{getTranslation('model')}:</b>\n {getText(this.props.device.model)}\n </div>\n ) : null}\n </Typography>\n {!!this.props.device.actions?.length && (\n <div\n style={{\n flex: 1,\n position: 'relative',\n display: 'flex',\n gap: 8,\n paddingBottom: 5,\n height: 34,\n paddingLeft: 10,\n paddingRight: 10,\n }}\n >\n {this.renderActions()}\n <div style={{ flexGrow: 1 }} />\n {this.renderControls()}\n </div>\n )}\n </div>\n {this.renderDialog()}\n {this.renderControlDialog()}\n </Paper>\n );\n }\n\n render(): JSX.Element {\n if (this.props.smallCards) {\n return this.renderSmall();\n }\n\n return this.renderBig();\n }\n}\n\nexport default DeviceCard;\n","import React, { Component } from 'react';\n\nimport {\n Backdrop,\n Box,\n Button,\n Checkbox,\n CircularProgress,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n FormControl,\n FormControlLabel,\n Grid2,\n IconButton,\n Input,\n InputAdornment,\n InputLabel,\n LinearProgress,\n MenuItem,\n Select,\n Slider,\n Snackbar,\n TextField,\n Typography,\n} from '@mui/material';\n\nimport { Close, Check } from '@mui/icons-material';\n\nimport {\n type Connection,\n type AdminConnection,\n type ThemeName,\n type ThemeType,\n type IobTheme,\n I18n,\n Icon,\n} from '@iobroker/adapter-react-v5';\nimport type {\n ActionBase,\n ControlBase,\n ControlState,\n DeviceInfo,\n DeviceRefresh,\n InstanceDetails,\n JsonFormSchema,\n ActionButton,\n} from '@iobroker/dm-utils';\nimport type { ConfigItemPanel, ConfigItemTabs } from '@iobroker/json-config';\n\nimport { getTranslation } from './Utils';\nimport JsonConfig from './JsonConfig';\n\ndeclare module '@mui/material/Button' {\n interface ButtonPropsColorOverrides {\n grey: true;\n }\n}\n\nexport type CommunicationProps = {\n /** Socket connection */\n socket: Connection;\n /** Instance to communicate with device-manager backend, like `adapterName.X` */\n selectedInstance: string; // adapterName.X\n registerHandler?: (handler: null | ((command: string) => void)) => void;\n themeName: ThemeName;\n themeType: ThemeType;\n theme: IobTheme;\n isFloatComma: boolean;\n dateFormat: string;\n};\n\ninterface CommunicationForm {\n title?: ioBroker.StringOrTranslated | null | undefined;\n label?: ioBroker.StringOrTranslated | null | undefined; // same as title\n noTranslation?: boolean; // Do not translate title/label\n schema: JsonFormSchema;\n data?: Record<string, any>;\n buttons?: (ActionButton | 'apply' | 'cancel' | 'close')[];\n maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n}\n\ninterface CommunicationFormInState extends CommunicationForm {\n handleClose?: (data?: Record<string, any>) => void;\n originalData: string;\n changed: boolean;\n}\n\ninterface InputAction extends ActionBase {\n /** If it is a device action */\n deviceId?: string;\n /** Optional refresh function to execute */\n refresh?: () => void;\n}\n\nexport type CommunicationState = {\n showSpinner: boolean;\n showToast: string | null;\n message: {\n message: string;\n handleClose: () => void;\n } | null;\n confirm: {\n message: string;\n handleClose: (confirmation?: boolean) => void;\n } | null;\n form: CommunicationFormInState | null;\n progress: {\n open: boolean;\n progress: number;\n } | null;\n showConfirmation: InputAction | null;\n showInput: InputAction | null;\n inputValue: string | boolean | number | null;\n};\n\ninterface DmResponse {\n /* Type of message */\n type: 'message' | 'confirm' | 'progress' | 'result' | 'form';\n /* Origin */\n origin: string;\n}\n\ninterface DmControlResponse extends DmResponse {\n result: {\n error?: {\n code: number;\n message: string;\n };\n state?: ioBroker.State;\n deviceId: string;\n controlId: string;\n };\n}\n\ninterface Message {\n actionId?: string;\n deviceId?: string;\n value?: unknown;\n origin?: string;\n confirm?: boolean;\n data?: any;\n}\n\ninterface DmActionResponse extends DmResponse {\n result: {\n refresh?: DeviceRefresh;\n error?: {\n code: number;\n message: string;\n };\n };\n message?: string;\n confirm?: string;\n form?: CommunicationForm;\n progress?: {\n open: boolean;\n progress: number;\n };\n}\n\n/**\n * Device List Component\n */\nclass Communication<P extends CommunicationProps, S extends CommunicationState> extends Component<P, S> {\n private responseTimeout: ReturnType<typeof setTimeout> | null = null;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n instanceHandler: (action: ActionBase) => () => void;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n deviceHandler: (deviceId: string, action: ActionBase, refresh: () => void) => () => void;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n controlHandler: (\n deviceId: string,\n control: ControlBase,\n state: ControlState,\n ) => () => Promise<ioBroker.State | null>;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n controlStateHandler: (deviceId: string, control: ControlBase) => () => Promise<ioBroker.State | null>;\n\n constructor(props: P) {\n super(props);\n\n this.state = {\n showSpinner: false,\n showToast: null,\n message: null,\n confirm: null,\n form: null,\n progress: null,\n showConfirmation: null,\n showInput: null,\n inputValue: null,\n } as S;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n this.instanceHandler = action => () => {\n if (action.confirmation) {\n this.setState({ showConfirmation: action });\n return;\n }\n if (action.inputBefore) {\n this.setState({ showInput: action });\n return;\n }\n\n this.sendActionToInstance('dm:instanceAction', { actionId: action.id });\n };\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n this.deviceHandler = (deviceId, action, refresh) => () => {\n if (action.confirmation) {\n this.setState({ showConfirmation: { ...action, deviceId, refresh } });\n return;\n }\n if (action.inputBefore) {\n this.setState({\n showInput: { ...action, deviceId, refresh },\n inputValue: action.inputBefore.defaultValue || '',\n });\n return;\n }\n\n this.sendActionToInstance('dm:deviceAction', { deviceId, actionId: action.id }, refresh);\n };\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n this.controlHandler = (deviceId, control, state) => () =>\n this.sendControlToInstance('dm:deviceControl', { deviceId, controlId: control.id, state });\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n this.controlStateHandler = (deviceId, control) => () =>\n this.sendControlToInstance('dm:deviceControlState', { deviceId, controlId: control.id });\n\n if (this.props.registerHandler) {\n this.props.registerHandler(() => this.loadData());\n }\n }\n\n componentWillUnmount(): void {\n if (this.responseTimeout) {\n clearTimeout(this.responseTimeout);\n this.responseTimeout = null;\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n loadData(): void {\n console.error('loadData not implemented');\n }\n\n sendActionToInstance = (command: `dm:${string}`, messageToSend: Message, refresh?: () => void): void => {\n const send = async (): Promise<void> => {\n this.setState({ showSpinner: true });\n this.responseTimeout = setTimeout(() => {\n this.setState({ showSpinner: false });\n window.alert(I18n.t('ra_No response from the backend'));\n }, 5000);\n\n const response: DmActionResponse = await this.props.socket.sendTo(\n this.props.selectedInstance,\n command,\n messageToSend,\n );\n\n if (this.responseTimeout) {\n clearTimeout(this.responseTimeout);\n this.responseTimeout = null;\n }\n\n const type: string = response.type;\n console.log(`Response: ${response.type}`);\n switch (type) {\n case 'message':\n console.log(`Message received: ${response.message}`);\n if (response.message) {\n this.setState({\n message: {\n message: response.message,\n handleClose: () =>\n this.setState({ message: null }, () =>\n this.sendActionToInstance(\n 'dm:actionProgress',\n { origin: response.origin },\n refresh,\n ),\n ),\n },\n showSpinner: false,\n });\n }\n break;\n\n case 'confirm':\n console.log(`Confirm received: ${response.confirm}`);\n if (response.confirm) {\n this.setState({\n confirm: {\n message: response.confirm,\n handleClose: (confirm?: boolean) =>\n this.setState({ confirm: null }, () =>\n this.sendActionToInstance(\n 'dm:actionProgress',\n {\n origin: response.origin,\n confirm,\n },\n refresh,\n ),\n ),\n },\n showSpinner: false,\n });\n }\n break;\n\n case 'form':\n console.log('Form received');\n if (response.form) {\n const data: Record<string, any> | undefined = response.form.data;\n const originalData: Record<string, any> = {};\n if (data) {\n Object.keys(data).forEach(key => {\n if (data[key] !== undefined) {\n originalData[key] = data[key];\n }\n });\n }\n response.form.data = JSON.parse(JSON.stringify(originalData)) as Record<string, any>;\n\n this.setState({\n form: {\n ...response.form,\n changed: false,\n originalData: JSON.stringify(originalData),\n handleClose: (data: any) =>\n this.setState({ form: null }, () => {\n console.log(`Form ${JSON.stringify(data)}`);\n this.sendActionToInstance(\n 'dm:actionProgress',\n {\n origin: response.origin,\n data,\n },\n refresh,\n );\n }),\n },\n showSpinner: false,\n });\n }\n break;\n\n case 'progress':\n if (response.progress) {\n if (this.state.progress) {\n const progress = { ...this.state.progress, ...response.progress };\n this.setState({ progress, showSpinner: false });\n } else {\n this.setState({ progress: response.progress, showSpinner: false });\n }\n }\n this.sendActionToInstance('dm:actionProgress', { origin: response.origin }, refresh);\n break;\n\n case 'result':\n console.log('Response content', response.result);\n if (response.result.refresh) {\n if (response.result.refresh === true) {\n console.log('Refreshing all');\n this.loadData();\n } else if (response.result.refresh === 'instance') {\n console.log(`Refreshing instance infos: ${this.props.selectedInstance}`);\n } else if (response.result.refresh === 'device') {\n if (!refresh) {\n console.log('No refresh function provided to refresh \"device\"');\n } else {\n console.log(`Refreshing device infos: ${this.props.selectedInstance}`);\n refresh();\n }\n } else {\n console.log('Not refreshing anything');\n }\n }\n if (response.result.error) {\n console.error(`Error: ${response.result.error.message}`);\n this.setState({ showToast: response.result.error.message, showSpinner: false });\n } else {\n this.setState({ showSpinner: false });\n }\n break;\n\n default:\n console.log(`Unknown response type: ${type}`);\n this.setState({ showSpinner: false });\n break;\n }\n };\n\n void send().catch(console.error);\n };\n\n sendControlToInstance = async (\n command: string,\n messageToSend: { deviceId: string; controlId: string; state?: ControlState },\n ): Promise<null | ioBroker.State> => {\n const response: DmControlResponse = await this.props.socket.sendTo(\n this.props.selectedInstance,\n command,\n messageToSend,\n );\n const type = response.type;\n console.log(`Response: ${response.type}`);\n if (response.type === 'result') {\n console.log('Response content', response.result);\n if (response.result.error) {\n console.error(`Error: ${response.result.error.message}`);\n this.setState({ showToast: response.result.error.message });\n } else if (response.result.state !== undefined) {\n return response.result.state;\n }\n } else {\n console.warn('Unexpected response type', type);\n }\n\n return null;\n };\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n loadDevices(): Promise<DeviceInfo[]> {\n return this.props.socket.sendTo(this.props.selectedInstance, 'dm:listDevices');\n }\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n loadInstanceInfos(): Promise<InstanceDetails> {\n return this.props.socket.sendTo(this.props.selectedInstance, 'dm:instanceInfo');\n }\n\n renderMessageDialog(): React.JSX.Element | null {\n if (!this.state.message) {\n return null;\n }\n\n return (\n <Dialog\n open={!0}\n onClose={() => this.state.message?.handleClose()}\n hideBackdrop\n aria-describedby=\"message-dialog-description\"\n >\n <DialogContent>\n <DialogContentText id=\"message-dialog-description\">{this.state.message?.message}</DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button\n color=\"primary\"\n onClick={() => this.state.message?.handleClose()}\n variant=\"contained\"\n autoFocus\n >\n {getTranslation('okButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderConfirmDialog(): React.JSX.Element | null {\n if (!this.state.confirm) {\n return null;\n }\n\n return (\n <Dialog\n open={!0}\n onClose={() => this.state.confirm?.handleClose()}\n hideBackdrop\n aria-describedby=\"confirm-dialog-description\"\n >\n <DialogContent>\n <DialogContentText id=\"confirm-dialog-description\">\n {getTranslation(this.state.confirm?.message)}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() => this.state.confirm?.handleClose(true)}\n autoFocus\n >\n {getTranslation('yesButtonText')}\n </Button>\n <Button\n variant=\"contained\"\n color=\"grey\"\n onClick={() => this.state.confirm?.handleClose(false)}\n autoFocus\n >\n {getTranslation('noButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderSnackbar(): React.JSX.Element {\n return (\n <Snackbar\n open={!!this.state.showToast}\n autoHideDuration={6_000}\n onClose={() => this.setState({ showToast: null })}\n message={this.state.showToast}\n />\n );\n }\n\n getOkButton(button?: ActionButton | 'apply' | 'cancel' | 'close'): React.JSX.Element {\n if (typeof button === 'string') {\n button = undefined;\n }\n return (\n <Button\n key=\"apply\"\n disabled={!this.state.form?.changed}\n variant={button?.variant || 'contained'}\n color={button?.color || 'primary'}\n onClick={() => this.state.form?.handleClose && this.state.form.handleClose(this.state.form?.data)}\n startIcon={button?.icon ? <Icon src={button?.icon} /> : undefined}\n >\n {getTranslation(button?.label || 'okButtonText', button?.noTranslation)}\n </Button>\n );\n }\n\n getCancelButton(button?: ActionButton | 'apply' | 'cancel' | 'close'): React.JSX.Element {\n let isClose = false;\n if (typeof button === 'string') {\n isClose = button === 'close';\n button = undefined;\n }\n return (\n <Button\n key=\"cancel\"\n variant={button?.variant || 'contained'}\n color={button?.color || 'grey'}\n onClick={() => this.state.form?.handleClose && this.state.form.handleClose()}\n startIcon={isClose ? <Close /> : button?.icon ? <Icon src={button?.icon} /> : undefined}\n >\n {getTranslation(button?.label || 'cancelButtonText', button?.noTranslation)}\n </Button>\n );\n }\n\n renderFormDialog(): React.JSX.Element | null {\n if (!this.state.form || !this.state.form.schema) {\n return null;\n }\n let buttons: React.JSX.Element[];\n if (this.state.form.buttons) {\n buttons = [];\n this.state.form.buttons.forEach((button: ActionButton | 'apply' | 'cancel' | 'close'): void => {\n if (button === 'apply' || (button as ActionButton).type === 'apply') {\n buttons.push(this.getOkButton(button));\n } else {\n buttons.push(this.getCancelButton(button));\n }\n });\n } else {\n buttons = [this.getOkButton(), this.getCancelButton()];\n }\n return (\n <Dialog\n open={!0}\n onClose={() => this.state.form?.handleClose && this.state.form.handleClose()}\n hideBackdrop\n fullWidth\n maxWidth={this.state.form.maxWidth || 'md'}\n >\n {this.state.form?.title ? (\n <DialogTitle>\n {getTranslation(\n this.state.form?.label || this.state.form?.title,\n this.state.form.noTranslation,\n )}\n </DialogTitle>\n ) : null}\n <DialogContent>\n <JsonConfig\n instanceId={this.props.selectedInstance}\n schema={this.state.form.schema as ConfigItemPanel | ConfigItemTabs}\n data={this.state.form.data || {}}\n socket={this.props.socket as AdminConnection}\n onChange={(data: Record<string, any>) => {\n console.log('handleFormChange', { data });\n const form: CommunicationFormInState = {\n ...(this.state.form as CommunicationFormInState),\n };\n if (form) {\n form.data = data;\n form.changed = JSON.stringify(data) !== form.originalData;\n this.setState({ form });\n }\n }}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </DialogContent>\n <DialogActions>{buttons}</DialogActions>\n </Dialog>\n );\n }\n\n renderProgressDialog(): React.JSX.Element | null {\n if (!this.state.progress?.open) {\n return null;\n }\n\n return (\n <Dialog\n open={!0}\n onClose={() => {}}\n hideBackdrop\n >\n <LinearProgress\n variant=\"determinate\"\n value={this.state.progress?.progress || 0}\n />\n </Dialog>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n renderContent(): React.JSX.Element | React.JSX.Element[] | null {\n return null;\n }\n\n renderSpinner(): React.JSX.Element | null {\n if (!this.state.showSpinner) {\n return null;\n }\n return (\n <Backdrop\n style={{ zIndex: 1000 }}\n open={!0}\n >\n <CircularProgress />\n </Backdrop>\n );\n }\n\n renderConfirmationDialog(): React.JSX.Element | null {\n if (!this.state.showConfirmation) {\n return null;\n }\n return (\n <Dialog\n open={!0}\n onClose={() => this.setState({ showConfirmation: null })}\n >\n <DialogTitle>\n {getTranslation(\n this.state.showConfirmation.confirmation === true\n ? getTranslation('areYouSureText')\n : getTranslation(this.state.showConfirmation.confirmation as ioBroker.StringOrTranslated),\n )}\n </DialogTitle>\n <DialogActions>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() => {\n if (!this.state.showConfirmation) {\n return;\n }\n\n const showConfirmation = this.state.showConfirmation;\n this.setState({ showConfirmation: null }, () => {\n if (showConfirmation.deviceId) {\n this.sendActionToInstance(\n 'dm:deviceAction',\n { actionId: showConfirmation.id, deviceId: showConfirmation.deviceId },\n showConfirmation.refresh,\n );\n } else {\n this.sendActionToInstance('dm:instanceAction', { actionId: showConfirmation.id });\n }\n });\n }}\n autoFocus\n startIcon={<Check />}\n >\n {getTranslation('yesButtonText')}\n </Button>\n <Button\n variant=\"contained\"\n color=\"grey\"\n onClick={() => this.setState({ showConfirmation: null })}\n startIcon={<Close />}\n >\n {getTranslation('cancelButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n onShowInputOk(): void {\n if (!this.state.showInput) {\n return;\n }\n\n const showInput = this.state.showInput;\n this.setState({ showInput: null }, () => {\n if (showInput.deviceId) {\n this.sendActionToInstance(\n 'dm:deviceAction',\n {\n actionId: showInput.id,\n deviceId: showInput.deviceId,\n value:\n showInput.inputBefore?.type === 'checkbox'\n ? !!this.state.inputValue\n : showInput.inputBefore?.type === 'number'\n ? parseFloat(this.state.inputValue as string) || 0\n : this.state.inputValue,\n },\n showInput.refresh,\n );\n } else {\n this.sendActionToInstance('dm:instanceAction', {\n actionId: showInput.id,\n value:\n showInput.inputBefore?.type === 'checkbox'\n ? !!this.state.inputValue\n : showInput.inputBefore?.type === 'number'\n ? parseFloat(this.state.inputValue as string) || 0\n : this.state.inputValue,\n });\n }\n });\n }\n\n renderInputDialog(): React.JSX.Element | null {\n if (!this.state.showInput || !this.state.showInput.inputBefore) {\n return null;\n }\n let okDisabled = false;\n if (!this.state.showInput.inputBefore.allowEmptyValue && this.state.showInput.inputBefore.type !== 'checkbox') {\n if (\n this.state.showInput.inputBefore.type === 'number' ||\n this.state.showInput.inputBefore.type === 'slider'\n ) {\n okDisabled =\n this.state.inputValue === '' ||\n this.state.inputValue === null ||\n !window.isFinite(this.state.inputValue as number);\n } else {\n okDisabled = !this.state.inputValue;\n }\n }\n\n return (\n <Dialog\n open={!0}\n onClose={() => this.setState({ showInput: null })}\n >\n <DialogTitle>{getTranslation('pleaseEnterValueText')}</DialogTitle>\n <DialogContent>\n {this.state.showInput.inputBefore.type === 'text' ||\n this.state.showInput.inputBefore.type === 'number' ||\n !this.state.showInput.inputBefore.type ? (\n <TextField\n autoFocus\n margin=\"dense\"\n label={getTranslation(this.state.showInput.inputBefore.label)}\n slotProps={{\n htmlInput:\n this.state.showInput.inputBefore.type === 'number'\n ? {\n min: this.state.showInput.inputBefore.min,\n max: this.state.showInput.inputBefore.max,\n step: this.state.showInput.inputBefore.step,\n }\n : undefined,\n input: {\n endAdornment: this.state.inputValue ? (\n <InputAdornment position=\"end\">\n <IconButton\n size=\"small\"\n onClick={() => this.setState({ inputValue: '' })}\n >\n <Close />\n </IconButton>\n </InputAdornment>\n ) : null,\n },\n }}\n type={this.state.showInput.inputBefore.type === 'number' ? 'number' : 'text'}\n fullWidth\n value={this.state.inputValue}\n onChange={e => this.setState({ inputValue: e.target.value })}\n onKeyUp={(e: React.KeyboardEvent) => {\n if (e.key === 'Enter') {\n this.onShowInputOk();\n }\n }}\n />\n ) : null}\n {this.state.showInput.inputBefore.type === 'checkbox' ? (\n <FormControlLabel\n control={\n <Checkbox\n checked={!!this.state.inputValue}\n autoFocus\n onChange={e => this.setState({ inputValue: e.target.checked })}\n />\n }\n label={getTranslation(this.state.showInput.inputBefore.label)}\n />\n ) : null}\n {this.state.showInput.inputBefore.type === 'select' ? (\n <FormControl fullWidth>\n <InputLabel>{getTranslation(this.state.showInput.inputBefore.label)}</InputLabel>\n <Select\n variant=\"standard\"\n value={this.state.inputValue}\n onChange={e => this.setState({ inputValue: e.target.value })}\n >\n {this.state.showInput.inputBefore.options?.map(item => (\n <MenuItem\n key={item.value}\n value={item.value}\n >\n {getTranslation(item.label)}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n ) : null}\n {this.state.showInput.inputBefore.type === 'slider' ? (\n <Box sx={{ width: '100%' }}>\n <Typography gutterBottom>\n {getTranslation(this.state.showInput.inputBefore.label)}\n </Typography>\n <Grid2\n container\n spacing={2}\n alignItems=\"center\"\n >\n <Grid2>\n <Slider\n value={typeof this.state.inputValue === 'number' ? this.state.inputValue : 0}\n onChange={(_event: Event, newValue: number) =>\n this.setState({ inputValue: newValue })\n }\n />\n </Grid2>\n <Grid2>\n <Input\n value={this.state.inputValue}\n size=\"small\"\n onChange={e =>\n this.setState({\n inputValue: e.target.value === '' ? 0 : Number(e.target.value),\n })\n }\n onBlur={() => {\n if (!this.state.showInput) {\n return;\n }\n\n const min =\n this.state.showInput.inputBefore?.min === undefined\n ? 0\n : this.state.showInput.inputBefore.min;\n const max =\n this.state.showInput.inputBefore?.max === undefined\n ? 100\n : this.state.showInput.inputBefore.max;\n\n if ((this.state.inputValue as number) < min) {\n this.setState({ inputValue: min });\n } else if ((this.state.inputValue as number) > max) {\n this.setState({ inputValue: max });\n }\n }}\n inputProps={{\n step: this.state.showInput.inputBefore.step,\n min:\n this.state.showInput.inputBefore.min === undefined\n ? 0\n : this.state.showInput.inputBefore.min,\n max:\n this.state.showInput.inputBefore.max === undefined\n ? 100\n : this.state.showInput.inputBefore.max,\n type: 'number',\n }}\n />\n </Grid2>\n </Grid2>\n </Box>\n ) : null}\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n disabled={okDisabled}\n color=\"primary\"\n onClick={() => this.onShowInputOk()}\n startIcon={<Check />}\n >\n {getTranslation('yesButtonText')}\n </Button>\n <Button\n variant=\"contained\"\n color=\"grey\"\n onClick={() => this.setState({ showInput: null })}\n startIcon={<Close />}\n >\n {getTranslation('cancelButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n render(): React.JSX.Element {\n return (\n <>\n {this.renderSnackbar()}\n {this.renderContent()}\n {this.renderConfirmDialog()}\n {this.renderMessageDialog()}\n {this.renderFormDialog()}\n {this.renderProgressDialog()}\n {this.renderConfirmationDialog()}\n {this.renderInputDialog()}\n {this.renderSpinner()}\n </>\n );\n }\n}\n\nexport default Communication;\n","import React from 'react';\n\nimport type { ActionBase, InstanceAction } from '@iobroker/dm-utils';\n\nimport TooltipButton from './TooltipButton';\nimport { getTranslation, renderActionIcon } from './Utils';\n\ninterface InstanceActionButtonProps {\n action: InstanceAction;\n instanceHandler: (action: ActionBase) => () => void;\n}\n\nexport default function InstanceActionButton(params: InstanceActionButtonProps): React.JSX.Element | null {\n const { action, instanceHandler } = params;\n\n const tooltip = getTranslation(action?.description ? action.description : '');\n const title = getTranslation(action?.title ? action.title : '');\n\n const icon = renderActionIcon(action);\n\n return (\n <TooltipButton\n tooltip={tooltip}\n label={title}\n disabled={action.disabled}\n Icon={icon}\n onClick={instanceHandler(action)}\n />\n );\n}\n","import React, { type JSX } from 'react';\nimport {\n IconButton,\n InputAdornment,\n TextField,\n Toolbar,\n Tooltip,\n LinearProgress,\n Select,\n MenuItem,\n} from '@mui/material';\n\nimport { Clear, QuestionMark, Refresh, FilterAltOff } from '@mui/icons-material';\n\nimport { I18n, IconDeviceType } from '@iobroker/adapter-react-v5';\nimport type { DeviceInfo, InstanceDetails } from '@iobroker/dm-utils';\n\nimport DeviceCard from './DeviceCard';\nimport { getTranslation } from './Utils';\nimport Communication, { type CommunicationProps, type CommunicationState } from './Communication';\nimport InstanceActionButton from './InstanceActionButton';\n\nimport de from './i18n/de.json';\nimport en from './i18n/en.json';\nimport ru from './i18n/ru.json';\nimport pt from './i18n/pt.json';\nimport nl from './i18n/nl.json';\nimport fr from './i18n/fr.json';\nimport it from './i18n/it.json';\nimport es from './i18n/es.json';\nimport pl from './i18n/pl.json';\nimport uk from './i18n/uk.json';\nimport zhCn from './i18n/zh-cn.json';\n\ninterface DeviceListProps extends CommunicationProps {\n /** Instance to upload images to, like `adapterName.X` */\n uploadImagesToInstance?: string;\n /** Filter devices with this string */\n filter?: string;\n /** If this component is used in GUI with own toolbar. `false` if this list is used with multiple instances and true if only with one (in this case, it will monitor alive itself */\n embedded?: boolean;\n /** If embedded, this text is shown in the toolbar */\n title?: string;\n /** Style of a component that displays all devices */\n style?: React.CSSProperties;\n /** Use small cards for devices */\n smallCards?: boolean;\n /** To trigger the reload of devices, just change this variable */\n triggerLoad?: number;\n}\n\ninterface DeviceListState extends CommunicationState {\n devices: DeviceInfo[];\n filteredDevices: DeviceInfo[];\n filter: string;\n instanceInfo: InstanceDetails;\n loading: boolean;\n alive: boolean | null;\n triggerLoad: number;\n groupKey: string;\n}\n\n/**\n * Device List Component\n */\nexport default class DeviceList extends Communication<DeviceListProps, DeviceListState> {\n static i18nInitialized = false;\n\n private lastPropsFilter: string | undefined;\n\n private lastInstance: string;\n\n private lastTriggerLoad = 0;\n\n private filterTimeout: ReturnType<typeof setTimeout> | null;\n\n private readonly language: ioBroker.Languages;\n\n constructor(props: DeviceListProps) {\n super(props);\n\n if (!DeviceList.i18nInitialized) {\n DeviceList.i18nInitialized = true;\n I18n.extendTranslations({\n en,\n de,\n ru,\n pt,\n nl,\n fr,\n it,\n es,\n pl,\n uk,\n 'zh-cn': zhCn,\n });\n }\n\n Object.assign(this.state, {\n devices: [],\n filteredDevices: [],\n filter: '',\n instanceInfo: null,\n loading: null,\n alive: null,\n groupKey: '',\n });\n\n this.lastPropsFilter = this.props.filter;\n this.lastInstance = this.props.selectedInstance;\n this.lastTriggerLoad = this.props.triggerLoad || 0;\n this.filterTimeout = null;\n this.language = I18n.getLanguage();\n }\n\n async componentDidMount(): Promise<void> {\n let alive = false;\n if (this.state.alive === null) {\n try {\n // check if instance is alive\n const stateAlive = await this.props.socket.getState(\n `system.adapter.${this.props.selectedInstance}.alive`,\n );\n if (stateAlive?.val) {\n alive = true;\n }\n } catch (error) {\n console.error(error);\n }\n this.setState({ alive }, () =>\n this.props.socket.subscribeState(\n `system.adapter.${this.props.selectedInstance}.alive`,\n this.aliveHandler,\n ),\n );\n if (!alive) {\n return;\n }\n } else {\n alive = this.state.alive;\n }\n\n if (!this.props.embedded && alive) {\n try {\n const instanceInfo = await this.loadInstanceInfos();\n this.setState({ instanceInfo });\n } catch (error) {\n console.error(error);\n }\n }\n if (alive) {\n this.loadData();\n }\n }\n\n componentWillUnmount(): void {\n this.props.socket.unsubscribeState(`system.adapter.${this.props.selectedInstance}.alive`, this.aliveHandler);\n }\n\n aliveHandler: ioBroker.StateChangeHandler = (id: string, state: ioBroker.State | null | undefined): void => {\n if (id === `system.adapter.${this.props.selectedInstance}.alive`) {\n const alive = !!state?.val;\n if (alive !== this.state.alive) {\n this.setState({ alive }, () => {\n if (alive) {\n this.componentDidMount().catch(console.error);\n }\n });\n }\n }\n };\n\n /**\n * Load devices\n */\n override loadData(): void {\n this.setState({ loading: true }, async () => {\n console.log(`Loading devices for ${this.props.selectedInstance}...`);\n let devices: DeviceInfo[] = [];\n try {\n devices = await this.loadDevices();\n\n if (!devices || !Array.isArray(devices)) {\n console.error(\n `Message returned from sendTo() doesn't look like one from DeviceManagement, did you accidentally handle the message in your adapter? ${JSON.stringify(\n devices,\n )}`,\n );\n devices = [];\n }\n } catch (error) {\n console.error(error);\n devices = [];\n }\n\n this.setState({ devices, loading: false }, () => this.applyFilter());\n });\n }\n\n getText(text: ioBroker.StringOrTranslated): string {\n if (typeof text === 'object') {\n return text[this.language] || text.en;\n }\n\n return text;\n }\n\n applyFilter(): void {\n const filter = this.props.embedded ? this.props.filter : this.state.filter;\n\n // filter devices name\n if (filter) {\n const filteredDevices = this.state.devices.filter(device =>\n this.getText(device.name).toLowerCase().includes(filter.toLowerCase()),\n );\n this.setState({ filteredDevices });\n } else {\n this.setState({ filteredDevices: this.state.devices });\n }\n }\n\n handleFilterChange(filter: string): void {\n this.setState({ filter }, () => {\n if (this.filterTimeout) {\n clearTimeout(this.filterTimeout);\n }\n this.filterTimeout = setTimeout(() => {\n this.filterTimeout = null;\n this.applyFilter();\n }, 250);\n });\n }\n\n renderGroups(\n groups: { name: string; value: string; count: number; icon?: React.JSX.Element | string | null }[] | undefined,\n ): React.JSX.Element | null {\n if (!groups?.length) {\n return null;\n }\n\n return (\n <Select\n style={{ minWidth: 120, marginRight: 8, marginTop: 12.5 }}\n variant=\"standard\"\n value={this.state.groupKey || '_'}\n renderValue={value => {\n if (value === '_') {\n value = '';\n }\n const g = groups.find(g => g.value === value);\n return (\n <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>\n {g?.icon || <div style={{ width: 24 }} />}\n {g?.name || value}\n </div>\n );\n }}\n onChange={e => this.setState({ groupKey: e.target.value === '_' ? '' : e.target.value })}\n >\n {groups.map(g => (\n <MenuItem\n value={g.value || '_'}\n key={g.value || '_'}\n style={{ display: 'flex', alignItems: 'center', gap: 8 }}\n >\n {g.icon || <div style={{ width: 24 }} />}\n {g.name}\n </MenuItem>\n ))}\n </Select>\n );\n }\n\n renderContent(): JSX.Element | JSX.Element[] | null {\n const emptyStyle: React.CSSProperties = {\n padding: 25,\n };\n\n if ((this.props.triggerLoad || 0) !== this.lastTriggerLoad) {\n this.lastTriggerLoad = this.props.triggerLoad || 0;\n setTimeout(() => this.loadData(), 50);\n }\n\n if (this.props.embedded && this.lastPropsFilter !== this.props.filter) {\n this.lastPropsFilter = this.props.filter;\n setTimeout(() => this.applyFilter(), 50);\n }\n // if instance changed\n if (this.props.embedded && this.lastInstance !== this.props.selectedInstance) {\n this.lastInstance = this.props.selectedInstance;\n setTimeout(() => this.loadData(), 50);\n }\n const deviceGroups: { name: string; value: string; count: number; icon?: React.JSX.Element | string | null }[] =\n [];\n let list: React.JSX.Element[] | undefined;\n if (!this.props.embedded && !this.state.alive) {\n list = [\n <div\n style={emptyStyle}\n key=\"notAlive\"\n >\n <span>{getTranslation('instanceNotAlive')}</span>\n </div>,\n ];\n } else if (!this.state.devices.length && this.props.selectedInstance) {\n list = [\n <div\n style={emptyStyle}\n key=\"notFound\"\n >\n <span>{getTranslation('noDevicesFoundText')}</span>\n </div>,\n ];\n } else if (this.state.devices.length && !this.state.filteredDevices.length) {\n list = [\n <div\n style={emptyStyle}\n key=\"filtered\"\n >\n <span>{getTranslation('allDevicesFilteredOut')}</span>\n </div>,\n ];\n } else {\n // build device types list\n let filteredDevices = this.state.filteredDevices;\n if (!this.props.embedded && filteredDevices.find(device => device.group)) {\n deviceGroups.push({\n name: I18n.t('All'),\n value: '',\n count: filteredDevices.length,\n icon: <FilterAltOff />,\n });\n filteredDevices.forEach(device => {\n if (device.group) {\n const type = deviceGroups.find(t => t.value === device.group?.key);\n if (type) {\n type.count++;\n } else {\n const icon = device.group.icon ? <IconDeviceType src={device.group.icon} /> : null;\n\n deviceGroups.push({\n name: this.getText(device.group.name || device.group.key),\n value: device.group.key,\n count: 1,\n icon,\n });\n }\n }\n });\n const unknown = filteredDevices.filter(device => !device.group);\n if (unknown.length) {\n deviceGroups.push({\n name: I18n.t('Unknown'),\n value: '?',\n count: unknown.length,\n icon: <QuestionMark />,\n });\n }\n\n if (this.state.groupKey) {\n // filter out all devices belonging to this group\n if (this.state.groupKey === '?') {\n filteredDevices = filteredDevices.filter(device => !device.group?.key);\n } else {\n filteredDevices = filteredDevices.filter(device => device.group?.key === this.state.groupKey);\n }\n if (!filteredDevices.length) {\n list = [\n <div\n style={emptyStyle}\n key=\"filtered\"\n >\n <span>{getTranslation('allDevicesFilteredOut')}</span>\n </div>,\n ];\n }\n }\n }\n\n if (filteredDevices.length) {\n list = filteredDevices.map(device => (\n <DeviceCard\n alive={!!this.state.alive}\n key={device.id}\n id={device.id}\n title={this.getText(device.name)}\n device={device}\n instanceId={this.props.selectedInstance}\n uploadImagesToInstance={this.props.uploadImagesToInstance}\n deviceHandler={this.deviceHandler}\n controlHandler={this.controlHandler}\n controlStateHandler={this.controlStateHandler}\n socket={this.props.socket}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n ));\n }\n }\n\n if (this.props.embedded) {\n return (\n <>\n {this.state.loading ? <LinearProgress style={{ width: '100%' }} /> : null}\n {list}\n </>\n );\n }\n\n return (\n <div style={{ width: '100%', height: '100%', overflow: 'hidden' }}>\n <Toolbar\n variant=\"dense\"\n style={{ backgroundColor: '#777', display: 'flex' }}\n >\n {this.props.title}\n {this.props.selectedInstance ? (\n <Tooltip\n title={getTranslation('refreshTooltip')}\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n >\n <span>\n <IconButton\n onClick={() => this.loadData()}\n disabled={!this.state.alive}\n size=\"small\"\n >\n <Refresh />\n </IconButton>\n </span>\n </Tooltip>\n ) : null}\n {this.state.alive && this.state.instanceInfo?.actions?.length ? (\n <div style={{ marginLeft: 20 }}>\n {this.state.instanceInfo.actions.map(action => (\n <InstanceActionButton\n key={action.id}\n action={action}\n instanceHandler={this.instanceHandler}\n />\n ))}\n </div>\n ) : null}\n\n <div style={{ flexGrow: 1 }} />\n\n {this.renderGroups(deviceGroups)}\n {this.state.alive ? (\n <TextField\n variant=\"standard\"\n style={{ width: 200 }}\n size=\"small\"\n label={getTranslation('filterLabelText')}\n onChange={e => this.handleFilterChange(e.target.value)}\n value={this.state.filter}\n autoComplete=\"off\"\n slotProps={{\n input: {\n autoComplete: 'new-password',\n endAdornment: this.state.filter ? (\n <InputAdornment position=\"end\">\n <IconButton\n onClick={() => this.handleFilterChange('')}\n edge=\"end\"\n >\n <Clear />\n </IconButton>\n </InputAdornment>\n ) : null,\n },\n htmlInput: {\n autoComplete: 'off',\n },\n }}\n />\n ) : null}\n </Toolbar>\n <div\n style={{\n width: '100%',\n height: 'calc(100% - 56px)',\n marginTop: 8,\n overflow: 'auto',\n // justifyContent: 'center',\n // alignItems: 'stretch',\n // display: 'grid',\n // columnGap: 8,\n // rowGap: 8,\n ...this.props.style,\n }}\n >\n {this.state.loading ? <LinearProgress style={{ width: '100%' }} /> : null}\n {list}\n </div>\n </div>\n );\n }\n}\n","import DeviceList from './DeviceList';\n\nexport default DeviceList;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MessageContext = exports.DeviceManagement = void 0;\nconst types_1 = require(\"./types\");\nclass DeviceManagement {\n constructor(adapter) {\n this.adapter = adapter;\n this.contexts = new Map();\n adapter.on('message', this.onMessage.bind(this));\n }\n get log() {\n return this.adapter.log;\n }\n getInstanceInfo() {\n return { apiVersion: 'v1' };\n }\n getDeviceDetails(id) {\n return { id, schema: {} };\n }\n handleInstanceAction(actionId, context, options) {\n var _a;\n if (!this.instanceInfo) {\n this.log.warn(`Instance action ${actionId} was called before getInstanceInfo()`);\n return {\n error: {\n code: types_1.ErrorCodes.E_INSTANCE_ACTION_NOT_INITIALIZED,\n message: `Instance action ${actionId} was called before getInstanceInfo()`,\n },\n };\n }\n const action = (_a = this.instanceInfo.actions) === null || _a === void 0 ? void 0 : _a.find(a => a.id === actionId);\n if (!action) {\n this.log.warn(`Instance action ${actionId} is unknown`);\n return {\n error: {\n code: types_1.ErrorCodes.E_INSTANCE_ACTION_UNKNOWN,\n message: `Instance action ${actionId} is unknown`,\n },\n };\n }\n if (!action.handler) {\n this.log.warn(`Instance action ${actionId} is disabled because it has no handler`);\n return {\n error: {\n code: types_1.ErrorCodes.E_INSTANCE_ACTION_NO_HANDLER,\n message: `Instance action ${actionId} is disabled because it has no handler`,\n },\n };\n }\n return action.handler(context, options);\n }\n handleDeviceAction(deviceId, actionId, context, options) {\n var _a;\n if (!this.devices) {\n this.log.warn(`Device action ${actionId} was called before listDevices()`);\n return {\n error: {\n code: types_1.ErrorCodes.E_DEVICE_ACTION_NOT_INITIALIZED,\n message: `Device action ${actionId} was called before listDevices()`,\n },\n };\n }\n const device = this.devices.get(deviceId);\n if (!device) {\n this.log.warn(`Device action ${actionId} was called on unknown device: ${deviceId}`);\n return {\n error: {\n code: types_1.ErrorCodes.E_DEVICE_ACTION_DEVICE_UNKNOWN,\n message: `Device action ${actionId} was called on unknown device: ${deviceId}`,\n },\n };\n }\n const action = (_a = device.actions) === null || _a === void 0 ? void 0 : _a.find(a => a.id === actionId);\n if (!action) {\n this.log.warn(`Device action ${actionId} doesn't exist on device ${deviceId}`);\n return {\n error: {\n code: types_1.ErrorCodes.E_DEVICE_ACTION_UNKNOWN,\n message: `Device action ${actionId} doesn't exist on device ${deviceId}`,\n },\n };\n }\n if (!action.handler) {\n this.log.warn(`Device action ${actionId} on ${deviceId} is disabled because it has no handler`);\n return {\n error: {\n code: types_1.ErrorCodes.E_DEVICE_ACTION_NO_HANDLER,\n message: `Device action ${actionId} on ${deviceId} is disabled because it has no handler`,\n },\n };\n }\n return action.handler(deviceId, context, options);\n }\n handleDeviceControl(deviceId, controlId, newState, context) {\n var _a;\n if (!this.devices) {\n this.log.warn(`Device control ${controlId} was called before listDevices()`);\n return {\n error: {\n code: types_1.ErrorCodes.E_DEVICE_CONTROL_NOT_INITIALIZED,\n message: `Device control ${controlId} was called before listDevices()`,\n },\n };\n }\n const device = this.devices.get(deviceId);\n if (!device) {\n this.log.warn(`Device control ${controlId} was called on unknown device: ${deviceId}`);\n return {\n error: {\n code: types_1.ErrorCodes.E_DEVICE_CONTROL_DEVICE_UNKNOWN,\n message: `Device control ${controlId} was called on unknown device: ${deviceId}`,\n },\n };\n }\n const control = (_a = device.controls) === null || _a === void 0 ? void 0 : _a.find(a => a.id === controlId);\n if (!control) {\n this.log.warn(`Device control ${controlId} doesn't exist on device ${deviceId}`);\n return {\n error: {\n code: types_1.ErrorCodes.E_DEVICE_CONTROL_UNKNOWN,\n message: `Device control ${controlId} doesn't exist on device ${deviceId}`,\n },\n };\n }\n if (!control.handler) {\n this.log.warn(`Device control ${controlId} on ${deviceId} is disabled because it has no handler`);\n return {\n error: {\n code: types_1.ErrorCodes.E_DEVICE_CONTROL_NO_HANDLER,\n message: `Device control ${controlId} on ${deviceId} is disabled because it has no handler`,\n },\n };\n }\n return control.handler(deviceId, controlId, newState, context);\n }\n // request state of control\n handleDeviceControlState(deviceId, controlId, context) {\n var _a;\n if (!this.devices) {\n this.log.warn(`Device get state ${controlId} was called before listDevices()`);\n return {\n error: {\n code: types_1.ErrorCodes.E_DEVICE_GET_STATE_NOT_INITIALIZED,\n message: `Device control ${controlId} was called before listDevices()`,\n },\n };\n }\n const device = this.devices.get(deviceId);\n if (!device) {\n this.log.warn(`Device get state ${controlId} was called on unknown device: ${deviceId}`);\n return {\n error: {\n code: types_1.ErrorCodes.E_DEVICE_GET_STATE_DEVICE_UNKNOWN,\n message: `Device control ${controlId} was called on unknown device: ${deviceId}`,\n },\n };\n }\n const control = (_a = device.controls) === null || _a === void 0 ? void 0 : _a.find(a => a.id === controlId);\n if (!control) {\n this.log.warn(`Device get state ${controlId} doesn't exist on device ${deviceId}`);\n return {\n error: {\n code: types_1.ErrorCodes.E_DEVICE_GET_STATE_UNKNOWN,\n message: `Device control ${controlId} doesn't exist on device ${deviceId}`,\n },\n };\n }\n if (!control.getStateHandler) {\n this.log.warn(`Device get state ${controlId} on ${deviceId} is disabled because it has no handler`);\n return {\n error: {\n code: types_1.ErrorCodes.E_DEVICE_GET_STATE_NO_HANDLER,\n message: `Device get state ${controlId} on ${deviceId} is disabled because it has no handler`,\n },\n };\n }\n return control.getStateHandler(deviceId, controlId, context);\n }\n onMessage(obj) {\n if (!obj.command.startsWith('dm:')) {\n return;\n }\n void this.handleMessage(obj).catch(this.log.error);\n }\n async handleMessage(msg) {\n this.log.debug(`DeviceManagement received: ${JSON.stringify(msg)}`);\n switch (msg.command) {\n case 'dm:instanceInfo': {\n this.instanceInfo = await this.getInstanceInfo();\n this.sendReply(Object.assign(Object.assign({}, this.instanceInfo), { actions: this.convertActions(this.instanceInfo.actions) }), msg);\n return;\n }\n case 'dm:listDevices': {\n const deviceList = await this.listDevices();\n this.devices = deviceList.reduce((map, value) => {\n if (map.has(value.id)) {\n throw new Error(`Device ID ${value.id} is not unique`);\n }\n map.set(value.id, value);\n return map;\n }, new Map());\n const apiDeviceList = deviceList.map(d => (Object.assign(Object.assign({}, d), { actions: this.convertActions(d.actions), controls: this.convertControls(d.controls) })));\n this.sendReply(apiDeviceList, msg);\n this.adapter.sendTo(msg.from, msg.command, this.devices, msg.callback);\n return;\n }\n case 'dm:deviceDetails': {\n const details = await this.getDeviceDetails(msg.message);\n this.adapter.sendTo(msg.from, msg.command, details, msg.callback);\n return;\n }\n case 'dm:instanceAction': {\n const action = msg.message;\n const context = new MessageContext(msg, this.adapter);\n this.contexts.set(msg._id, context);\n const result = await this.handleInstanceAction(action.actionId, context, { value: action.value });\n this.contexts.delete(msg._id);\n context.sendFinalResult(result);\n return;\n }\n case 'dm:deviceAction': {\n const action = msg.message;\n const context = new MessageContext(msg, this.adapter);\n this.contexts.set(msg._id, context);\n const result = await this.handleDeviceAction(action.deviceId, action.actionId, context, {\n value: action.value,\n });\n this.contexts.delete(msg._id);\n context.sendFinalResult(result);\n return;\n }\n case 'dm:deviceControl': {\n const control = msg.message;\n const context = new MessageContext(msg, this.adapter);\n this.contexts.set(msg._id, context);\n const result = await this.handleDeviceControl(control.deviceId, control.controlId, control.state, context);\n this.contexts.delete(msg._id);\n context.sendControlResult(control.deviceId, control.controlId, result);\n return;\n }\n case 'dm:deviceControlState': {\n const control = msg.message;\n const context = new MessageContext(msg, this.adapter);\n this.contexts.set(msg._id, context);\n const result = await this.handleDeviceControlState(control.deviceId, control.controlId, context);\n this.contexts.delete(msg._id);\n context.sendControlResult(control.deviceId, control.controlId, result);\n return;\n }\n case 'dm:actionProgress': {\n const { origin } = msg.message;\n const context = this.contexts.get(origin);\n if (!context) {\n this.log.warn(`Unknown message origin: ${origin}`);\n this.sendReply({ error: 'Unknown action origin' }, msg);\n return;\n }\n context.handleProgress(msg);\n return;\n }\n }\n }\n convertActions(actions) {\n if (!actions) {\n return undefined;\n }\n // detect duplicate IDs\n const ids = new Set();\n actions.forEach(a => {\n if (ids.has(a.id)) {\n throw new Error(`Action ID ${a.id} is used twice, this would lead to unexpected behavior`);\n }\n ids.add(a.id);\n });\n // remove handler function to send it as JSON\n return actions.map((a) => (Object.assign(Object.assign({}, a), { handler: undefined, disabled: !a.handler })));\n }\n convertControls(controls) {\n if (!controls) {\n return undefined;\n }\n // detect duplicate IDs\n const ids = new Set();\n controls.forEach(a => {\n if (ids.has(a.id)) {\n throw new Error(`Control ID ${a.id} is used twice, this would lead to unexpected behavior`);\n }\n ids.add(a.id);\n });\n // remove handler function to send it as JSON\n return controls.map((a) => (Object.assign(Object.assign({}, a), { handler: undefined, getStateHandler: undefined })));\n }\n sendReply(reply, msg) {\n this.adapter.sendTo(msg.from, msg.command, reply, msg.callback);\n }\n}\nexports.DeviceManagement = DeviceManagement;\nclass MessageContext {\n constructor(msg, adapter) {\n this.adapter = adapter;\n this.hasOpenProgressDialog = false;\n this.lastMessage = msg;\n }\n showMessage(text) {\n this.checkPreconditions();\n const promise = new Promise(resolve => {\n this.progressHandler = () => resolve();\n });\n this.send('message', {\n message: text,\n });\n return promise;\n }\n showConfirmation(text) {\n this.checkPreconditions();\n const promise = new Promise(resolve => {\n this.progressHandler = msg => resolve(!!msg.confirm);\n });\n this.send('confirm', {\n confirm: text,\n });\n return promise;\n }\n showForm(schema, options) {\n this.checkPreconditions();\n const promise = new Promise(resolve => {\n this.progressHandler = msg => resolve(msg.data);\n });\n this.send('form', {\n form: Object.assign({ schema }, options),\n });\n return promise;\n }\n openProgress(title, options) {\n this.checkPreconditions();\n this.hasOpenProgressDialog = true;\n const dialog = {\n update: (update) => {\n const promise = new Promise(resolve => {\n this.progressHandler = () => resolve();\n });\n this.send('progress', {\n progress: Object.assign(Object.assign(Object.assign({ title }, options), update), { open: true }),\n }, true);\n return promise;\n },\n close: () => {\n const promise = new Promise(resolve => {\n this.progressHandler = () => {\n this.hasOpenProgressDialog = false;\n resolve();\n };\n });\n this.send('progress', {\n progress: { open: false },\n });\n return promise;\n },\n };\n const promise = new Promise(resolve => {\n this.progressHandler = () => resolve(dialog);\n });\n this.send('progress', {\n progress: Object.assign(Object.assign({ title }, options), { open: true }),\n }, true);\n return promise;\n }\n sendFinalResult(result) {\n this.send('result', {\n result,\n });\n }\n sendControlResult(deviceId, controlId, result) {\n if (typeof result === 'object' && 'error' in result) {\n this.send('result', {\n result: {\n error: result.error,\n deviceId,\n controlId,\n },\n });\n }\n else {\n this.send('result', {\n result: {\n state: result,\n deviceId,\n controlId,\n },\n });\n }\n }\n handleProgress(message) {\n const currentHandler = this.progressHandler;\n if (currentHandler && typeof message.message !== 'string') {\n this.lastMessage = message;\n this.progressHandler = undefined;\n currentHandler(message.message);\n }\n }\n checkPreconditions() {\n if (this.hasOpenProgressDialog) {\n throw new Error(\"Can't show another dialog while a progress dialog is open. Please call 'close()' on the dialog before opening another dialog.\");\n }\n }\n send(type, message, doNotClose) {\n if (!this.lastMessage) {\n throw new Error(\"No outstanding message, can't send a new one\");\n }\n this.adapter.sendTo(this.lastMessage.from, this.lastMessage.command, Object.assign(Object.assign({}, message), { type, origin: this.lastMessage.message.origin || this.lastMessage._id }), this.lastMessage.callback);\n if (!doNotClose) {\n // \"progress\" is exception. It will be closed with \"close\" flag\n this.lastMessage = undefined;\n }\n }\n}\nexports.MessageContext = MessageContext;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./DeviceManagement\"), exports);\n// don't export * from \"./MessageContext\" as it is private\n__exportStar(require(\"./types\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ACTIONS = void 0;\n/** Reserved action names */\nexports.ACTIONS = {\n /** This action will be called when user clicks on connection icon */\n STATUS: 'status',\n /** This action will be called when the user clicks on enabled/disabled icon. The enabled/disabled icon will be shown only if the node status has \"enabled\" flag set to false or true */\n ENABLE_DISABLE: 'enable/disable',\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ErrorCodes = void 0;\nvar ErrorCodes;\n(function (ErrorCodes) {\n ErrorCodes[ErrorCodes[\"E_INSTANCE_ACTION_NOT_INITIALIZED\"] = 101] = \"E_INSTANCE_ACTION_NOT_INITIALIZED\";\n ErrorCodes[ErrorCodes[\"E_INSTANCE_ACTION_UNKNOWN\"] = 102] = \"E_INSTANCE_ACTION_UNKNOWN\";\n ErrorCodes[ErrorCodes[\"E_INSTANCE_ACTION_NO_HANDLER\"] = 103] = \"E_INSTANCE_ACTION_NO_HANDLER\";\n ErrorCodes[ErrorCodes[\"E_DEVICE_ACTION_NOT_INITIALIZED\"] = 201] = \"E_DEVICE_ACTION_NOT_INITIALIZED\";\n ErrorCodes[ErrorCodes[\"E_DEVICE_ACTION_DEVICE_UNKNOWN\"] = 202] = \"E_DEVICE_ACTION_DEVICE_UNKNOWN\";\n ErrorCodes[ErrorCodes[\"E_DEVICE_ACTION_UNKNOWN\"] = 203] = \"E_DEVICE_ACTION_UNKNOWN\";\n ErrorCodes[ErrorCodes[\"E_DEVICE_ACTION_NO_HANDLER\"] = 204] = \"E_DEVICE_ACTION_NO_HANDLER\";\n ErrorCodes[ErrorCodes[\"E_DEVICE_CONTROL_NOT_INITIALIZED\"] = 301] = \"E_DEVICE_CONTROL_NOT_INITIALIZED\";\n ErrorCodes[ErrorCodes[\"E_DEVICE_CONTROL_DEVICE_UNKNOWN\"] = 302] = \"E_DEVICE_CONTROL_DEVICE_UNKNOWN\";\n ErrorCodes[ErrorCodes[\"E_DEVICE_CONTROL_UNKNOWN\"] = 303] = \"E_DEVICE_CONTROL_UNKNOWN\";\n ErrorCodes[ErrorCodes[\"E_DEVICE_CONTROL_NO_HANDLER\"] = 304] = \"E_DEVICE_CONTROL_NO_HANDLER\";\n ErrorCodes[ErrorCodes[\"E_DEVICE_GET_STATE_NOT_INITIALIZED\"] = 401] = \"E_DEVICE_GET_STATE_NOT_INITIALIZED\";\n ErrorCodes[ErrorCodes[\"E_DEVICE_GET_STATE_DEVICE_UNKNOWN\"] = 402] = \"E_DEVICE_GET_STATE_DEVICE_UNKNOWN\";\n ErrorCodes[ErrorCodes[\"E_DEVICE_GET_STATE_UNKNOWN\"] = 403] = \"E_DEVICE_GET_STATE_UNKNOWN\";\n ErrorCodes[ErrorCodes[\"E_DEVICE_GET_STATE_NO_HANDLER\"] = 404] = \"E_DEVICE_GET_STATE_NO_HANDLER\";\n})(ErrorCodes || (exports.ErrorCodes = ErrorCodes = {}));\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ACTIONS = void 0;\n__exportStar(require(\"./errorCodes\"), exports);\nvar base_1 = require(\"./base\");\nObject.defineProperty(exports, \"ACTIONS\", { enumerable: true, get: function () { return base_1.ACTIONS; } });\n"],"names":["TooltipButton","props","tooltip","label","disabled","Icon","onClick","text","_jsx","Typography","variant","style","marginLeft","children","Tooltip","title","slotProps","popper","sx","pointerEvents","_jsxs","IconButton","size","getFaIcon","icon","color","iconStyle","split","map","s","trim","filter","includes","Delete","Edit","Refresh","Add","QrCode","Wifi","WifiOff","Bluetooth","BluetoothDisabled","Visibility","Search","LinkOff","LinkIcon","NotListedLocation","PlayArrow","Stop","Pause","QuestionMark","getIconByName","name","altName","FastForward","FastRewind","Lightbulb","Fluorescent","WbIncandescent","Power","Settings","Group","Person","Info","Article","renderControlIcon","action","colors","value","_action$icon","_action$icon2","_action$iconOn","_action$icon3","colorOn","state","primary","secondary","startsWith","iconOn","src","id","renderActionIcon","_action$icon4","_action$icon5","_action$icon6","language","getTranslation","noTranslation","I18n","getLanguage","en","t","DeviceActionButton","_action$description","deviceId","refresh","deviceHandler","description","undefined","DeviceControlComponent","Component","constructor","_props$control$state","_props$control$state2","super","stateHandler","async","this","control","stateId","newState","controlStateHandler","ts","setState","val","componentDidMount","mayBePromise","socket","subscribeState","Promise","componentWillUnmount","unsubscribeState","getDerivedStateFromProps","_props$control$state3","_props$control$state4","sendControl","result","controlHandler","renderButton","_this$props$control$d","Button","startIcon","Fab","renderSwitch","_this$props$control$d2","Switch","checked","onChange","e","target","getColor","type","renderSelect","renderSlider","renderColor","renderIcon","_this$props$control$d3","colorProps","width","height","minHeight","render","HANDLE_SIZE","sw","display","alignItems","cursor","position","opacity","stopPropagation","preventDefault","borderRadius","backgroundColor","theme","palette","main","top","left","WIDTH_SMALL","WIDTH","transition","boxShadow","labelOn","labelOff","gap","styles","ThreadIcon","xmlns","viewBox","fontSize","className","fill","d","ZWaveIcon","ZigBeeIcon","DeviceStatus","status","connection","iconStyleOK","iconStyleNotOK","iconStyleWarning","iconStyleUnknown","batteryIconTooltip","battery","BatteryFullIcon","Battery90Icon","Battery80Icon","Battery60Icon","Battery50Icon","Battery30Icon","Battery20Icon","BatteryAlertIcon","disability","enabled","_Fragment","flexGrow","flexDirection","disableEnableAction","connectionSymbol","connectionType","IconConnectionWifi","IconConnectionNoWifi","IconConnectionBluetooth","IconConnectionNoBluetooth","IconConnectionLan","LinkOffIcon","connectionIcon","statusAction","concat","rssi","NetworkCheckIcon","margin","BatteryCharging50Icon","marginRight","warning","WarningIcon","JsonConfig","_props$socket$systemC","_props$socket$systemC2","instanceId","schema","data","error","setError","useState","adapterName","instance","JsonConfigComponent","expertMode","parseInt","onError","_data","embedded","themeName","themeType","isFloatComma","systemConfig","common","dateFormat","params","manufacturer","model","onImageSelect","uploadImagesToInstance","zIndex","accept","event","files","length","file","reader","FileReader","onload","img","Image","canvas","document","createElement","ctx","getContext","drawImage","resizedImage","toDataURL","fileName","base64Data","replace","response","writeFile64","console","log","JSON","stringify","readAsDataURL","NoImageIcon","getText","DeviceCard","details","loadDetails","catch","copyToClipboard","textToCopy","device","Utils","alert","open","showControlDialog","fetchIcon","lang","readFile","mimeType","_unused","sendTo","renderDialog","Dialog","maxWidth","onClose","DialogContent","DialogActions","alive","autoFocus","renderControlDialog","_this$props$device$co","DialogTitle","right","CloseIcon","controls","renderControls","_this$props$device$co2","_this$props$device$co3","_this$props$device$co4","firstControl","ControlIcon","renderActions","_this$props$device$ac","actions","a","ACTIONS","STATUS","ENABLE_DISABLE","renderSmall","hasDetails","Array","isArray","IconDeviceType","Card","minWidth","CardHeader","invertColor","contrastText","avatar","DeviceImageUpload","imageData","MoreVertIcon","subheader","CardContent","background","padding","i","_this$props$device$ac2","_this$props$device$ac3","DeviceStatusComponent","find","textOverflow","overflow","CardActions","disableSpacing","renderBig","_this$state$details","_this$state$details$d","_this$state$details2","_this$state$details2$","_this$props$device$ac6","imgStyle","maxHeight","Paper","Box","paddingLeft","paddingRight","justifyContent","fontWeight","bottom","_this$props$device$ac4","_this$props$device$ac5","flex","paddingBottom","smallCards","Communication","responseTimeout","instanceHandler","sendActionToInstance","command","messageToSend","showSpinner","setTimeout","window","selectedInstance","clearTimeout","message","handleClose","origin","confirm","form","originalData","Object","keys","forEach","key","parse","_objectSpread","changed","progress","loadData","showToast","send","sendControlToInstance","warn","showConfirmation","showInput","inputValue","confirmation","inputBefore","actionId","defaultValue","controlId","registerHandler","loadDevices","loadInstanceInfos","renderMessageDialog","_this$state$message2","_this$state$message","hideBackdrop","DialogContentText","_this$state$message3","renderConfirmDialog","_this$state$confirm2","_this$state$confirm","_this$state$confirm3","_this$state$confirm4","renderSnackbar","Snackbar","autoHideDuration","getOkButton","button","_this$state$form","_button","_button2","_button3","_button4","_button5","_button6","_this$state$form2","_this$state$form3","getCancelButton","_button7","_button8","_button9","_button10","_button11","_button12","isClose","_this$state$form4","Close","renderFormDialog","_this$state$form6","_this$state$form7","_this$state$form8","buttons","push","_this$state$form5","fullWidth","renderProgressDialog","_this$state$progress","_this$state$progress2","LinearProgress","renderContent","renderSpinner","Backdrop","CircularProgress","renderConfirmationDialog","Check","onShowInputOk","_showInput$inputBefor","_showInput$inputBefor2","_showInput$inputBefor3","_showInput$inputBefor4","parseFloat","renderInputDialog","_this$state$showInput","okDisabled","allowEmptyValue","isFinite","TextField","htmlInput","min","max","step","input","endAdornment","InputAdornment","onKeyUp","FormControlLabel","Checkbox","FormControl","InputLabel","Select","options","item","MenuItem","gutterBottom","Grid2","container","spacing","Slider","_event","newValue","Input","Number","onBlur","_this$state$showInput2","_this$state$showInput3","inputProps","InstanceActionButton","DeviceList","lastPropsFilter","lastInstance","lastTriggerLoad","filterTimeout","aliveHandler","i18nInitialized","extendTranslations","de","ru","pt","nl","fr","it","es","pl","uk","zhCn","assign","devices","filteredDevices","instanceInfo","loading","groupKey","triggerLoad","stateAlive","getState","applyFilter","toLowerCase","handleFilterChange","renderGroups","groups","marginTop","renderValue","g","_this$state$instanceI","_this$state$instanceI2","emptyStyle","deviceGroups","list","group","count","FilterAltOff","_device$group","unknown","_device$group2","_device$group3","Toolbar","autoComplete","edge","Clear","defineProperty","exports","MessageContext","DeviceManagement","types_1","require","adapter","contexts","Map","on","onMessage","bind","getInstanceInfo","apiVersion","getDeviceDetails","handleInstanceAction","context","_a","code","ErrorCodes","E_INSTANCE_ACTION_NOT_INITIALIZED","handler","E_INSTANCE_ACTION_NO_HANDLER","E_INSTANCE_ACTION_UNKNOWN","handleDeviceAction","E_DEVICE_ACTION_NOT_INITIALIZED","get","E_DEVICE_ACTION_DEVICE_UNKNOWN","E_DEVICE_ACTION_NO_HANDLER","E_DEVICE_ACTION_UNKNOWN","handleDeviceControl","E_DEVICE_CONTROL_NOT_INITIALIZED","E_DEVICE_CONTROL_DEVICE_UNKNOWN","E_DEVICE_CONTROL_NO_HANDLER","E_DEVICE_CONTROL_UNKNOWN","handleDeviceControlState","E_DEVICE_GET_STATE_NOT_INITIALIZED","E_DEVICE_GET_STATE_DEVICE_UNKNOWN","getStateHandler","E_DEVICE_GET_STATE_NO_HANDLER","E_DEVICE_GET_STATE_UNKNOWN","obj","handleMessage","msg","debug","sendReply","convertActions","deviceList","listDevices","reduce","has","Error","set","apiDeviceList","convertControls","from","callback","_id","delete","sendFinalResult","sendControlResult","handleProgress","ids","Set","add","reply","hasOpenProgressDialog","lastMessage","showMessage","checkPreconditions","promise","resolve","progressHandler","showForm","openProgress","dialog","update","close","currentHandler","doNotClose","__createBinding","create","o","m","k","k2","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","__exportStar","p","prototype","hasOwnProperty","call","base_1"],"sourceRoot":""}