@iobroker/dm-gui-components 8.0.1 → 8.0.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"DeviceList.js","sourceRoot":"./src/","sources":["DeviceList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EACH,UAAU,EACV,cAAc,EACd,SAAS,EACT,OAAO,EACP,OAAO,EACP,cAAc,EACd,MAAM,EACN,QAAQ,GACX,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEjF,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,aAAmE,MAAM,iBAAiB,CAAC;AAClG,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,IAAI,MAAM,mBAAmB,CAAC;AA8BrC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,aAA+C;IACnF,MAAM,CAAC,eAAe,GAAG,KAAK,CAAC;IAEvB,eAAe,CAAqB;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,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAC1C,IAAI,EAAC,KAAK;oCAEV,oBAAC,KAAK,OAAG,CACA,CACA,CACpB,CAAC,CAAC,CAAC,IAAI;yBACX;wBACD,SAAS,EAAE;4BACP,YAAY,EAAE,KAAK;yBACtB;qBACJ,GACH,CACL,CAAC,CAAC,CAAC,IAAI,CACF;YACV,6BACI,KAAK,EAAE;oBACH,KAAK,EAAE,MAAM;oBACb,MAAM,EAAE,mBAAmB;oBAC3B,SAAS,EAAE,CAAC;oBACZ,QAAQ,EAAE,MAAM;oBAChB,4BAA4B;oBAC5B,yBAAyB;oBACzB,mBAAmB;oBACnB,gBAAgB;oBAChB,aAAa;oBACb,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK;iBACtB;gBAEA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAC,cAAc,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAI,CAAC,CAAC,CAAC,IAAI;gBACxE,IAAI,CACH,CACJ,CACT,CAAC;IACN,CAAC","sourcesContent":["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, DeviceTypeIcon } from '@iobroker/gui-components';\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 a 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 ? <DeviceTypeIcon 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 tabIndex={-1}\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"]}
1
+ {"version":3,"file":"DeviceList.js","sourceRoot":"./src/","sources":["DeviceList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EACH,UAAU,EACV,cAAc,EACd,SAAS,EACT,OAAO,EACP,OAAO,EACP,cAAc,EACd,MAAM,EACN,QAAQ,GACX,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEjF,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,aAAmE,MAAM,iBAAiB,CAAC;AAClG,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,IAAI,MAAM,mBAAmB,CAAC;AA8BrC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,aAA+C;IACnF,MAAM,CAAC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,QAAQ,EAAC,KAAK;gCAC1B,oBAAC,UAAU,IACP,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAC1C,IAAI,EAAC,KAAK;oCAEV,oBAAC,KAAK,OAAG,CACA,CACA,CACpB,CAAC,CAAC,CAAC,IAAI;yBACX;wBACD,SAAS,EAAE;4BACP,YAAY,EAAE,KAAK;yBACtB;qBACJ,GACH,CACL,CAAC,CAAC,CAAC,IAAI,CACF;YACV,6BACI,KAAK,EAAE;oBACH,KAAK,EAAE,MAAM;oBACb,MAAM,EAAE,mBAAmB;oBAC3B,SAAS,EAAE,CAAC;oBACZ,QAAQ,EAAE,MAAM;oBAChB,4BAA4B;oBAC5B,yBAAyB;oBACzB,mBAAmB;oBACnB,gBAAgB;oBAChB,aAAa;oBACb,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK;iBACtB;gBAEA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAC,cAAc,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAI,CAAC,CAAC,CAAC,IAAI;gBACxE,IAAI,CACH,CACJ,CACT,CAAC;IACN,CAAC","sourcesContent":["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, DeviceTypeIcon } 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 a 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 ? <DeviceTypeIcon 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 tabIndex={-1}\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"]}
@@ -1,6 +1,6 @@
1
1
  import React, { type CSSProperties, type MouseEvent } from 'react';
2
2
  import type { DeviceStatus, DeviceAction, ActionBase, ConfigConnectionType } from '@iobroker/dm-utils';
3
- import type { IobTheme } from '@iobroker/gui-components';
3
+ import type { IobTheme } from '@iobroker/adapter-react-v5';
4
4
  export declare const ACTIONS: {
5
5
  STATUS: string;
6
6
  DISABLE: string;
@@ -1 +1 @@
1
- {"version":3,"file":"DeviceStatus.js","sourceRoot":"./src/","sources":["DeviceStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8C,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EACH,IAAI,IAAI,QAAQ,EAChB,OAAO,IAAI,WAAW,EACtB,YAAY,IAAI,gBAAgB,EAChC,SAAS,IAAI,aAAa,EAC1B,SAAS,IAAI,aAAa,EAC1B,SAAS,IAAI,aAAa,EAC1B,SAAS,IAAI,aAAa,EAC1B,SAAS,IAAI,aAAa,EAC1B,SAAS,IAAI,aAAa,EAC1B,WAAW,IAAI,eAAe,EAC9B,YAAY,IAAI,gBAAgB,EAChC,OAAO,IAAI,WAAW,EACtB,iBAAiB,IAAI,qBAAqB,EAC1C,KAAK,IAAI,iBAAiB,EAC1B,IAAI,IAAI,kBAAkB,EAC1B,OAAO,IAAI,oBAAoB,EAC/B,SAAS,IAAI,uBAAuB,EACpC,iBAAiB,IAAI,yBAAyB,GACjD,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,MA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e,IAAC,KAAK,EAAE,WAAW,GAAI,CAC1C,CAAC,CAAC,CAAC,CACA,oBAAC,gBAAgB,IAAC,KAAK,EAAE,cAAc,GAAI,CAC9C,CACC,CACA,CACb;QAEA,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CACd,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,CACvE,oBAAC,OAAO,IACJ,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,EACrC,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,OAAO,EAAE,EAAE;YAE7C,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE;gBAC1E,oBAAC,WAAW,IAAC,KAAK,EAAE,gBAAgB,GAAI,CACtC,CACA,CACb,CAAC,CAAC,CAAC,CACA,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE;YAC1E,oBAAC,WAAW,IAAC,KAAK,EAAE,gBAAgB,GAAI,CACtC,CACT,CACJ,CAAC,CAAC,CAAC,IAAI;QAEP,UAAU,CACT,CACT,CAAC;AACN,CAAC","sourcesContent":["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, ThemeType } from '@iobroker/gui-components';\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\nfunction rssiColor(signal: number, themeType: ThemeType): string {\n if (signal < -80) {\n return themeType === 'dark' ? '#ff5c5c' : '#aa0000';\n }\n if (signal < -60) {\n return themeType === 'dark' ? '#fa8547' : '#ae5c00';\n }\n if (signal < -50) {\n return themeType === 'dark' ? '#cdff4f' : '#7b9500';\n }\n\n return themeType === 'dark' ? '#5cff5c' : '#008500';\n}\n\nconst iconStyleOK = {\n fill: '#00ac00',\n color: '#00ac00',\n};\nconst iconStyleNotOK = {\n fill: '#ff0000',\n color: '#ff0000',\n};\nconst iconStyleWarning = {\n fill: '#da8200',\n color: '#da8200',\n};\nconst iconStyleUnknown = {\n fill: '#8a8a8a',\n color: '#8a8a8a',\n};\nconst iconStylePreWarning = {\n fill: '#ffcc00',\n color: '#ffcc00',\n};\n\nfunction getBatteryIcon(battery: number): React.ReactNode {\n if (battery > 95) {\n return <BatteryFullIcon style={iconStyleOK} />;\n }\n if (battery > 85 && battery <= 95) {\n return <Battery90Icon style={iconStyleOK} />;\n }\n if (battery > 70 && battery <= 85) {\n return <Battery80Icon style={iconStyleOK} />;\n }\n if (battery > 55 && battery <= 70) {\n return <Battery60Icon style={iconStyleOK} />;\n }\n if (battery > 40 && battery <= 55) {\n return <Battery50Icon style={iconStylePreWarning} />;\n }\n if (battery > 25 && battery <= 40) {\n return <Battery30Icon style={iconStylePreWarning} />;\n }\n if (battery > 10 && battery <= 25) {\n return <Battery20Icon style={iconStyleWarning} />;\n }\n\n return <BatteryAlertIcon style={iconStyleNotOK} />;\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 let batteryIconTooltip: React.ReactNode = null;\n if (typeof status.battery === 'number') {\n batteryIconTooltip = getBatteryIcon(status.battery);\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: 'baseline',\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 style={{ color: rssiColor(status.rssi, props.theme.palette.mode) }} />\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"]}
1
+ {"version":3,"file":"DeviceStatus.js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AE,UAAU,EAAE,QAAQ,EAAE;gBAC1E,oBAAC,WAAW,IAAC,KAAK,EAAE,gBAAgB,GAAI,CACtC,CACA,CACb,CAAC,CAAC,CAAC,CACA,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE;YAC1E,oBAAC,WAAW,IAAC,KAAK,EAAE,gBAAgB,GAAI,CACtC,CACT,CACJ,CAAC,CAAC,CAAC,IAAI;QAEP,UAAU,CACT,CACT,CAAC;AACN,CAAC","sourcesContent":["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, ThemeType } 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\nfunction rssiColor(signal: number, themeType: ThemeType): string {\n if (signal < -80) {\n return themeType === 'dark' ? '#ff5c5c' : '#aa0000';\n }\n if (signal < -60) {\n return themeType === 'dark' ? '#fa8547' : '#ae5c00';\n }\n if (signal < -50) {\n return themeType === 'dark' ? '#cdff4f' : '#7b9500';\n }\n\n return themeType === 'dark' ? '#5cff5c' : '#008500';\n}\n\nconst iconStyleOK = {\n fill: '#00ac00',\n color: '#00ac00',\n};\nconst iconStyleNotOK = {\n fill: '#ff0000',\n color: '#ff0000',\n};\nconst iconStyleWarning = {\n fill: '#da8200',\n color: '#da8200',\n};\nconst iconStyleUnknown = {\n fill: '#8a8a8a',\n color: '#8a8a8a',\n};\nconst iconStylePreWarning = {\n fill: '#ffcc00',\n color: '#ffcc00',\n};\n\nfunction getBatteryIcon(battery: number): React.ReactNode {\n if (battery > 95) {\n return <BatteryFullIcon style={iconStyleOK} />;\n }\n if (battery > 85 && battery <= 95) {\n return <Battery90Icon style={iconStyleOK} />;\n }\n if (battery > 70 && battery <= 85) {\n return <Battery80Icon style={iconStyleOK} />;\n }\n if (battery > 55 && battery <= 70) {\n return <Battery60Icon style={iconStyleOK} />;\n }\n if (battery > 40 && battery <= 55) {\n return <Battery50Icon style={iconStylePreWarning} />;\n }\n if (battery > 25 && battery <= 40) {\n return <Battery30Icon style={iconStylePreWarning} />;\n }\n if (battery > 10 && battery <= 25) {\n return <Battery20Icon style={iconStyleWarning} />;\n }\n\n return <BatteryAlertIcon style={iconStyleNotOK} />;\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 let batteryIconTooltip: React.ReactNode = null;\n if (typeof status.battery === 'number') {\n batteryIconTooltip = getBatteryIcon(status.battery);\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: 'baseline',\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 style={{ color: rssiColor(status.rssi, props.theme.palette.mode) }} />\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"]}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { Connection, ThemeName, ThemeType, IobTheme } from '@iobroker/gui-components';
2
+ import type { Connection, ThemeName, ThemeType, IobTheme } from '@iobroker/adapter-react-v5';
3
3
  import { type ConfigItemPanel, type ConfigItemTabs } from '@iobroker/json-config';
4
4
  interface JsonConfigDmProps {
5
5
  instanceId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"JsonConfig.js","sourceRoot":"./src/","sources":["JsonConfig.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAA6C,MAAM,uBAAuB,CAAC;AAgBvG,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAwB;IACvD,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,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AACN,CAAC","sourcesContent":["import React, { useState } from 'react';\nimport type { Connection, AdminConnection, ThemeName, ThemeType, IobTheme } from '@iobroker/gui-components';\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"]}
1
+ {"version":3,"file":"JsonConfig.js","sourceRoot":"./src/","sources":["JsonConfig.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAA6C,MAAM,uBAAuB,CAAC;AAgBvG,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAwB;IACvD,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC7D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE1C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAEzD,OAAO,CACH;QACK,KAAK,IAAI,iCAAM,KAAK,CAAO;QAC5B,oBAAC,mBAAmB,IAChB,UAAU,EAAE,KAAK,CAAC,UAAU,EAC5B,MAAM,EAAE,MAAgC,EACxC,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,EAChC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,CAAC,KAA0B,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EACzD,QAAQ,QACR,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,YAAY,EACR,KAAK,CAAC,YAAY,KAAK,SAAS;gBAC5B,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,YAAY;gBAClD,CAAC,CAAC,KAAK,CAAC,YAAY,EAE5B,UAAU,EACN,KAAK,CAAC,UAAU,KAAK,SAAS;gBAC1B,CAAC,CAAE,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,UAAqB;gBAC1D,CAAC,CAAC,KAAK,CAAC,UAAU,GAE5B,CACH,CACN,CAAC;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAkDE;AACN,CAAC","sourcesContent":["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"]}
package/build/Switch.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { Component } from 'react';
2
- import { type IobTheme } from '@iobroker/gui-components';
2
+ import { type IobTheme } from '@iobroker/adapter-react-v5';
3
3
  interface SwitchProps {
4
4
  checked: boolean;
5
5
  style?: React.CSSProperties;
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","sourceRoot":"./src/","sources":["Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAczC,MAAM,KAAK,GAAG,EAAE,CAAC;AACjB,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,SAAsB;IACtD,MAAM;QACF,MAAM,EAAE,GAAG,CACP,6BACI,KAAK,EAAE;gBACH,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK;gBACxD,MAAM,EAAE,WAAW;gBACnB,OAAO,EAAE,MAAM;gBACf,UAAU,EAAE,QAAQ;gBACpB,MAAM,EAAE,SAAS;gBACjB,QAAQ,EAAE,UAAU;gBACpB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;aACzC,EACD,OAAO,EAAE,CAAC,CAAC,EAAE;gBACT,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;oBACtB,OAAO;gBACX,CAAC;gBACD,CAAC,CAAC,eAAe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K,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,WAAW;oBACrE,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM;oBACpF,SAAS,EACL,+GAA+G;iBACtH,GACH,CACA,CACT,CAAC;QAEF,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YAC5C,OAAO,CACH,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE;gBACxD,IAAI,CAAC,KAAK,CAAC,QAAQ;gBACnB,EAAE;gBACF,IAAI,CAAC,KAAK,CAAC,OAAO,CACjB,CACT,CAAC;QACN,CAAC;QAED,OAAO,EAAE,CAAC;IACd,CAAC;CACJ","sourcesContent":["import React, { Component } from 'react';\nimport { type IobTheme } from '@iobroker/gui-components';\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"]}
1
+ {"version":3,"file":"Switch.js","sourceRoot":"./src/","sources":["Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAczC,MAAM,KAAK,GAAG,EAAE,CAAC;AACjB,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,SAAsB;IACtD,MAAM;QACF,MAAM,EAAE,GAAG,CACP,6BACI,KAAK,EAAE;gBACH,KAAK,EAAE,IAAI,CAAC,KA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GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC5E,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO;wBACpB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO;4BACzB,CAAC,CAAC,WAAW,GAAG,iBAAiB;4BACjC,CAAC,CAAC,KAAK,GAAG,WAAW;wBACzB,CAAC,CAAC,CAAC;oBACP,UAAU,EAAE,WAAW;oBACvB,YAAY,EAAE,EAAE;oBAChB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,WAAW;oBACpE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,WAAW;oBACrE,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM;oBACpF,SAAS,EACL,+GAA+G;iBACtH,GACH,CACA,CACT,CAAC;QAEF,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YAC5C,OAAO,CACH,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE;gBACxD,IAAI,CAAC,KAAK,CAAC,QAAQ;gBACnB,EAAE;gBACF,IAAI,CAAC,KAAK,CAAC,OAAO,CACjB,CACT,CAAC;QACN,CAAC;QAED,OAAO,EAAE,CAAC;IACd,CAAC;CACJ","sourcesContent":["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"]}
package/build/Utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Add, Article, Bluetooth, BluetoothDisabled, Delete, Edit, FastForward, FastRewind, Fluorescent, Group, Info, Lightbulb, Link as LinkIcon, LinkOff, NotListedLocation, Pause, Person, PlayArrow, Power, QrCode, QuestionMark, Refresh, Search, Settings, Stop, Visibility, WbIncandescent, Wifi, WifiOff, } from '@mui/icons-material';
3
- import { I18n, Icon } from '@iobroker/gui-components';
3
+ import { I18n, Icon } from '@iobroker/adapter-react-v5';
4
4
  /**
5
5
  * Get Icon by font-awesome name. Do not use these names, use names from getIconByName
6
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"Utils.js","sourceRoot":"./src/","sources":["Utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EACH,GAAG,EACH,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,WAAW,EACX,KAAK,EACL,IAAI,EACJ,SAAS,EACT,IAAI,IAAI,QAAQ,EAChB,OAAO,EACP,iBAAiB,EACjB,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,OAAO,EACP,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,cAAc,EACd,IAAI,EACJ,OAAO,GACV,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAS,SAAS,CAAC,IAAY,EAAE,KAAc;IAC3C,MAAM,SAAS,GAAG,IAAI;SACjB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SAClB,MAAM,CAAC,CAAC,CA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B,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,GAChC,CACL,CAAC;IACN,CAAC;IACD,OAAO,aAAa,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;AAC/D,CAAC;AAED,IAAI,QAA4B,CAAC;AAEjC;;GAEG;AACH,MAAM,UAAU,cAAc;AAC1B,wBAAwB;AACxB,IAAiC,EACjC,aAAuB;IAEvB,QAAQ,GAAG,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;IAE1C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC;IACrC,CAAC;IAED,OAAO,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["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/gui-components';\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"]}
1
+ {"version":3,"file":"Utils.js","sourceRoot":"./src/","sources":["Utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EACH,GAAG,EACH,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,WAAW,EACX,KAAK,EACL,IAAI,EACJ,SAAS,EACT,IAAI,IAAI,QAAQ,EAChB,OAAO,EACP,iBAAiB,EACjB,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,OAAO,EACP,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,cAAc,EACd,IAAI,EACJ,OAAO,GACV,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAS,SAAS,CAAC,IAAY,EAAE,KAAc;IAC3C,MAAM,SAAS,GAAG,IAAI;SACjB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SAClB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC;IAEnC,IAAI,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACvE,OAAO,oBAAC,MAAM,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAI,CAAC;IACxC,CAAC;IACD,IAAI,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC/B,OAAO,oBAAC,IA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,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;IAE1C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC;IACrC,CAAC;IAED,OAAO,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/dm-gui-components",
3
- "version": "8.0.1",
3
+ "version": "8.0.2",
4
4
  "description": "ReactJS components to develop admin interface for ioBroker device manager.",
5
5
  "author": {
6
6
  "name": "Jey Cee",
@@ -51,8 +51,8 @@
51
51
  },
52
52
  "homepage": "https://github.com/ioBroker/dm-gui-components#readme",
53
53
  "dependencies": {
54
- "@iobroker/gui-components": "^8.0.2",
55
- "@iobroker/json-config": "^8.0.1"
54
+ "@iobroker/adapter-react-v5": "^8.0.3",
55
+ "@iobroker/json-config": "^8.0.2"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@alcalzone/release-script": "^5.0.0",