@iobroker/dm-gui-components 10.0.20 → 10.0.22
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.
- package/README.md +12 -0
- package/build/DeviceCard.d.ts +46 -45
- package/build/DeviceCard.js +130 -163
- package/build/DeviceCard.js.map +1 -1
- package/build/DeviceFields.d.ts +75 -0
- package/build/DeviceFields.js +190 -0
- package/build/DeviceFields.js.map +1 -0
- package/build/DeviceList.d.ts +59 -7
- package/build/DeviceList.js +260 -87
- package/build/DeviceList.js.map +1 -1
- package/build/InstanceActionButton.js +3 -1
- package/build/InstanceActionButton.js.map +1 -1
- package/build/LazyRender.d.ts +69 -0
- package/build/LazyRender.js +128 -0
- package/build/LazyRender.js.map +1 -0
- package/build/StateOrObjectHandler.d.ts +3 -0
- package/build/StateOrObjectHandler.js +57 -7
- package/build/StateOrObjectHandler.js.map +1 -1
- package/build/TooltipButton.d.ts +2 -0
- package/build/TooltipButton.js +2 -2
- package/build/TooltipButton.js.map +1 -1
- package/build/Utils.d.ts +7 -0
- package/build/Utils.js +13 -0
- package/build/Utils.js.map +1 -1
- package/build/hooks.js +22 -3
- package/build/hooks.js.map +1 -1
- package/build/i18n/de.json +1 -0
- package/build/i18n/en.json +1 -0
- package/build/i18n/es.json +1 -0
- package/build/i18n/fr.json +1 -0
- package/build/i18n/it.json +1 -0
- package/build/i18n/nl.json +1 -0
- package/build/i18n/pl.json +1 -0
- package/build/i18n/pt.json +1 -0
- package/build/i18n/ru.json +1 -0
- package/build/i18n/uk.json +1 -0
- package/build/i18n/zh-cn.json +1 -0
- package/package.json +16 -15
package/build/DeviceCard.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceCard.js","sourceRoot":"./src/","sources":["DeviceCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AACnD,OAAO,EACH,KAAK,IAAI,SAAS,EA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AAkB,CAAC,KAAe,EAAE,QAAiB;QACjD,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;QACrD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC;QAEnD,OAAO;YACH,eAAe;YACf,KAAK;YACL,QAAQ;SACX,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React, { Component, type JSX } from 'react';\nimport {\n Close as CloseIcon,\n VideogameAsset as ControlIcon,\n MoreVert as MoreVertIcon,\n ExpandMore,\n} from '@mui/icons-material';\nimport {\n Box,\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n Fab,\n IconButton,\n Paper,\n Skeleton,\n Tooltip,\n Typography,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n} from '@mui/material';\n\nimport {\n DeviceTypeIcon,\n I18n,\n Utils,\n type Connection,\n type IobTheme,\n type ThemeName,\n type ThemeType,\n Icon,\n} from '@iobroker/gui-components';\nimport DeviceActionButton from './DeviceActionButton';\nimport DeviceControlComponent from './DeviceControl';\nimport DeviceImageUpload from './DeviceImageUpload';\nimport DeviceStatusComponent from './DeviceStatus';\nimport JsonConfig from './JsonConfig';\nimport { StatusIndicators } from './StatusIndicator';\nimport type {\n ActionBase,\n ControlBase,\n ControlState,\n DeviceDetails,\n DeviceAction,\n DeviceControl,\n DeviceInfo,\n DeviceId,\n ConfigConnectionType,\n DeviceStatus,\n} from './protocol/api';\n\n/** Device fields that can be used for the text filter */\nexport type DeviceFilterField = 'name' | 'identifier' | 'manufacturer' | 'model';\nimport { getTranslation } from './Utils';\nimport { StateOrObjectHandler, type StateOrObjectSubscription } from './StateOrObjectHandler';\n\n/** Reserved action names (this is copied from https://github.com/ioBroker/dm-utils/blob/main/src/types/base.ts as we can only have type references to dm-utils) */\nconst ACTIONS = {\n /** This action will be called when the user clicks on the connection icon */\n STATUS: 'status',\n /** This action will be called when the user clicks on the enabled / disabled icon. The enabled/disabled icon will be shown only if the node status has the \"enabled\" flag set to false or true */\n ENABLE_DISABLE: 'enable/disable',\n /** This action will be called when the user clicks on the update indicator. The update indicator is shown only if `DeviceInfo.update.available` is true */\n UPDATE: 'update',\n /** This action will be called when the user clicks on the battery indicator. The battery indicator is shown only if the node status has the \"battery\" property */\n BATTERY: 'battery',\n};\n\nconst styles: Record<string, any> = {\n cardStyle: (theme: IobTheme): React.CSSProperties => ({\n width: 300,\n minHeight: 280,\n margin: '10px',\n overflow: 'hidden',\n display: 'flex',\n flexDirection: 'column',\n backgroundColor: theme.palette.mode === 'dark' ? '#0b0b0b' : '#d5d5d5',\n }),\n headerStyle: {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n paddingLeft: 8,\n paddingRight: 8,\n position: 'relative',\n minHeight: 60,\n color: '#000',\n },\n imgAreaStyle: {\n height: 45,\n width: 45,\n justifyContent: 'center',\n display: 'flex',\n alignItems: 'center',\n },\n imgStyle: {\n zIndex: 2,\n maxWidth: '100%',\n maxHeight: '100%',\n color: '#FFF',\n },\n titleStyle: {\n fontSize: 16,\n fontWeight: 'bold',\n // whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n detailsButtonStyle: {\n right: 20,\n bottom: -20,\n position: 'absolute',\n },\n bodyStyle: {\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n },\n deviceInfoStyle: {\n padding: '20px 16px 0 16px',\n },\n statusStyle: {\n padding: '15px 25px 0 15px',\n // The line may grow if the device provides custom indicators, so only the minimum is fixed\n minHeight: 41,\n },\n};\n\nfunction NoImageIcon(props: { style?: React.CSSProperties; className?: string }): JSX.Element {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n style={props.style}\n className={props.className}\n >\n <path\n fill=\"currentColor\"\n d=\"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z\"\n />\n </svg>\n );\n}\n\ninterface DeviceCardProps {\n filter?: string;\n /* Device ID */\n id: DeviceId;\n identifierLabel: ioBroker.StringOrTranslated;\n device: DeviceInfo;\n instanceId: string;\n socket: Connection;\n /* Instance, where the images should be uploaded to */\n uploadImagesToInstance?: string;\n deviceHandler: (deviceId: DeviceId, action: ActionBase) => () => void;\n controlHandler: (\n deviceId: DeviceId,\n control: ControlBase,\n state: ControlState,\n ) => () => Promise<ioBroker.State | null>;\n controlStateHandler: (deviceId: DeviceId, control: ControlBase) => () => Promise<ioBroker.State | null>;\n smallCards?: boolean;\n alive: boolean;\n themeName: ThemeName;\n themeType: ThemeType;\n theme: IobTheme;\n isFloatComma: boolean;\n dateFormat: string;\n /** If true, only devices that have an available update are shown */\n onlyUpdatable?: boolean;\n /** If true, only devices that have a battery problem (empty/low battery) are shown */\n onlyBatteryProblem?: boolean;\n /** Device field the text filter applies to. Default `name` */\n filterField?: DeviceFilterField;\n /** IDs of configurable indicators the user has switched off */\n hiddenIndicators?: string[];\n /** Reports the resolved model value of this device up to the list (used to build the model filter dropdown) */\n onModel?: (deviceId: DeviceId, model: string | undefined) => void;\n}\n\nfunction getText(text: ioBroker.StringOrTranslated | undefined): string | undefined {\n if (typeof text === 'object') {\n return text[I18n.getLanguage()] || text.en;\n }\n\n return text;\n}\n\ninterface DeviceCardState {\n open: boolean;\n details: DeviceDetails | null;\n data: Record<string, any>;\n showControlDialog: boolean;\n\n // values possibly loaded from states/objects\n name?: string;\n identifier?: string;\n hasDetails?: boolean;\n icon?: string;\n backgroundColor?: string;\n color?: string;\n manufacturer?: string;\n model?: string;\n connectionType?: ConfigConnectionType;\n enabled?: boolean;\n updateAvailable?: boolean;\n batteryProblem?: boolean;\n}\n\n/**\n * Device Card Component\n */\nexport default class DeviceCard extends Component<DeviceCardProps, DeviceCardState> {\n private readonly stateOrObjectHandler: StateOrObjectHandler;\n private readonly subscriptions: Map<\n keyof DeviceInfo & keyof DeviceCardState,\n { subscription: StateOrObjectSubscription; transform?: (value: any) => any }\n > = new Map();\n\n /** Separate subscription for the nested `device.update.available` field (used for the update indicator and the \"only updatable\" filter) */\n private updateAvailableSubscription?: StateOrObjectSubscription;\n\n /** Separate subscription for the nested battery status (used for the \"battery problem\" filter) */\n private batteryProblemSubscription?: StateOrObjectSubscription;\n\n constructor(props: DeviceCardProps) {\n super(props);\n\n this.state = {\n open: false,\n details: null,\n data: {},\n showControlDialog: false,\n };\n\n this.stateOrObjectHandler = new StateOrObjectHandler(this.props.socket);\n }\n\n async fetchIcon(): Promise<void> {\n if (!this.props.device.icon) {\n const manufacturer = this.state.manufacturer;\n const model = this.state.model;\n\n // try to load the icon from file storage\n const fileName = `${manufacturer ? `${manufacturer}_` : ''}${model || JSON.stringify(this.props.device.id)}`;\n\n try {\n const file = await this.props.socket.readFile(\n this.props.instanceId.replace('system.adapter.', ''),\n `${fileName}.webp`,\n true,\n );\n if (file) {\n this.setState({ icon: `data:${file.mimeType};base64,${file.file}` });\n } else {\n this.setState({ icon: '' });\n }\n // const response = await fetch(url);\n // if (response.ok) {\n // const blob = await response.blob();\n // const reader = new FileReader();\n // reader.onloadend = () => {\n // setIcon(reader.result);\n // };\n // reader.readAsDataURL(blob);\n // } else {\n // throw new Error('Response not ok');\n // }\n } catch {\n if (this.state.icon) {\n this.setState({ icon: '' });\n }\n }\n }\n }\n\n async componentDidMount(): Promise<void> {\n await this.addStateOrObjectListener('name', getText);\n await this.addStateOrObjectListener('identifier');\n await this.addStateOrObjectListener('hasDetails');\n await this.addStateOrObjectListener('icon');\n await this.addStateOrObjectListener('backgroundColor');\n await this.addStateOrObjectListener('color');\n await this.addStateOrObjectListener('manufacturer', getText);\n await this.addStateOrObjectListener('model', getText);\n await this.addStateOrObjectListener('connectionType');\n await this.addStateOrObjectListener('enabled');\n await this.subscribeUpdateAvailable();\n await this.subscribeBatteryProblem();\n\n await this.fetchIcon().catch(e => console.error(e));\n }\n\n private async subscribeUpdateAvailable(): Promise<void> {\n this.updateAvailableSubscription = await this.stateOrObjectHandler.addListener(\n this.props.device.update?.available,\n value => this.setState({ updateAvailable: !!value }),\n );\n }\n\n /** Extract the battery value (literal or state/object reference) from the device status */\n private getBatteryItem(): Extract<DeviceStatus, object>['battery'] {\n const status = this.props.device.status;\n if (!status || typeof status === 'string') {\n return undefined;\n }\n const list = Array.isArray(status) ? status : [status];\n for (const entry of list) {\n if (typeof entry !== 'string' && entry.battery !== undefined) {\n return entry.battery;\n }\n }\n return undefined;\n }\n\n /** A battery problem is an explicit battery warning (`false`) or a charge level below 30 % */\n private static isBatteryProblem(value: number | boolean | string | undefined): boolean {\n if (value === false) {\n return true;\n }\n return typeof value === 'number' && value < 30;\n }\n\n private async subscribeBatteryProblem(): Promise<void> {\n this.batteryProblemSubscription = await this.stateOrObjectHandler.addListener(this.getBatteryItem(), value =>\n this.setState({ batteryProblem: DeviceCard.isBatteryProblem(value) }),\n );\n }\n\n private async addStateOrObjectListener(\n key: keyof DeviceInfo & keyof DeviceCardState,\n transform?: (value: any) => any,\n ): Promise<void> {\n const sub = await this.stateOrObjectHandler.addListener(this.props.device[key], value =>\n this.setState<typeof key>({ [key]: transform ? transform(value) : value }),\n );\n this.subscriptions.set(key, { subscription: sub, transform });\n }\n\n async componentDidUpdate(prevProps: DeviceCardProps, prevState: DeviceCardState): Promise<void> {\n if (prevState.model !== this.state.model) {\n this.props.onModel?.(this.props.device.id, this.state.model);\n }\n\n for (const [key, { subscription, transform }] of [...this.subscriptions]) {\n const newItem = this.props.device[key];\n const prevItem = prevProps.device[key];\n\n if (newItem !== prevItem) {\n console.log(`${key} of device ${JSON.stringify(this.props.device.id)} updated`, prevItem, newItem);\n this.subscriptions.delete(key);\n await this.addStateOrObjectListener(key, transform);\n await subscription.unsubscribe();\n }\n }\n\n if (this.props.device.update?.available !== prevProps.device.update?.available) {\n await this.updateAvailableSubscription?.unsubscribe();\n await this.subscribeUpdateAvailable();\n }\n\n if (this.props.device.status !== prevProps.device.status) {\n await this.batteryProblemSubscription?.unsubscribe();\n await this.subscribeBatteryProblem();\n }\n }\n\n async componentWillUnmount(): Promise<void> {\n for (const [, { subscription }] of this.subscriptions) {\n await subscription.unsubscribe();\n }\n this.subscriptions.clear();\n await this.updateAvailableSubscription?.unsubscribe();\n await this.batteryProblemSubscription?.unsubscribe();\n this.props.onModel?.(this.props.device.id, undefined);\n }\n\n /**\n * Load the device details\n */\n async loadDetails(): Promise<void> {\n console.log(`Loading device details for`, this.props.device.id, `... from ${this.props.instanceId}`);\n const details: DeviceDetails | null = await this.props.socket.sendTo(\n this.props.instanceId,\n 'dm:deviceDetails',\n this.props.device.id,\n );\n console.log(`Got device details for`, this.props.device.id, details);\n this.setState({ details, data: details?.data || {} });\n }\n\n /**\n * Copy the device ID to the clipboard\n */\n copyToClipboard = (): void => {\n const textToCopy = this.state.identifier;\n if (!textToCopy) {\n return;\n }\n Utils.copyToClipboard(textToCopy);\n alert(`${getTranslation('copied')} ${textToCopy} ${getTranslation('toClipboard')}!`);\n };\n\n renderDialog(): JSX.Element | null {\n if (!this.state.open || !this.state.details) {\n return null;\n }\n\n return (\n <Dialog\n open={!0}\n maxWidth=\"md\"\n onClose={() => this.setState({ open: false })}\n >\n <DialogContent>\n <JsonConfig\n instanceId={this.props.instanceId}\n socket={this.props.socket}\n schema={this.state.details.schema}\n data={this.state.data}\n onChange={(data: Record<string, any> | null) => data && this.setState({ data })}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </DialogContent>\n <DialogActions>\n <Button\n disabled={!this.props.alive}\n variant=\"contained\"\n color=\"primary\"\n onClick={() => this.setState({ open: false })}\n autoFocus\n >\n {getTranslation('closeButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderControlItems(\n controls: DeviceControl[],\n allControls: DeviceControl[],\n colors: { primary: string; secondary: string },\n parentGroupId?: string,\n ): JSX.Element[] {\n return controls\n .filter(control => (parentGroupId ? control.group === parentGroupId : !control.group))\n .map(control => {\n if (control.type === 'group') {\n const children = allControls.filter(ctrl => ctrl.group === control.id);\n return (\n <Accordion key={control.id}>\n <AccordionSummary expandIcon={<ExpandMore />}>\n <Typography\n component=\"span\"\n style={{ display: 'flex', gap: 8, color: control.color }}\n >\n {control.icon ? <Icon src={control.icon} /> : null}\n {getTranslation(control.label!)}\n </Typography>\n </AccordionSummary>\n <AccordionDetails style={{ display: 'flex', flexDirection: 'column' }}>\n {this.renderControlItems(children, allControls, colors, control.id)}\n </AccordionDetails>\n </Accordion>\n );\n }\n return (\n <DeviceControlComponent\n disabled={false}\n key={control.id}\n control={control}\n socket={this.props.socket}\n colors={colors}\n deviceId={this.props.device.id}\n controlHandler={this.props.controlHandler}\n controlStateHandler={this.props.controlStateHandler}\n />\n );\n });\n }\n\n renderControlDialog(): JSX.Element | null {\n if (!this.state.showControlDialog || !this.props.alive) {\n return null;\n }\n const colors = { primary: '#111', secondary: '#888' };\n const allControls = this.props.device.controls || [];\n return (\n <Dialog\n open={!0}\n onClose={() => this.setState({ showControlDialog: false })}\n >\n <DialogTitle style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 }}>\n {this.state.name}\n <IconButton onClick={() => this.setState({ showControlDialog: false })}>\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <DialogContent style={{ display: 'flex', flexDirection: 'column' }}>\n {this.renderControlItems(allControls, allControls, colors)}\n </DialogContent>\n </Dialog>\n );\n }\n\n renderControls(): JSX.Element | null {\n const colors = { primary: '#111', secondary: '#888' };\n const firstControl = this.props.device.controls?.[0];\n if (\n this.props.device.controls?.length === 1 &&\n firstControl &&\n (firstControl.type === 'icon' || firstControl.type === 'switch') &&\n !firstControl.label\n ) {\n // control can be placed in the button icon\n return (\n <DeviceControlComponent\n disabled={!this.props.alive}\n control={firstControl}\n colors={colors}\n socket={this.props.socket}\n deviceId={this.props.device.id}\n controlHandler={this.props.controlHandler}\n controlStateHandler={this.props.controlStateHandler}\n />\n );\n }\n\n if (this.props.device.controls?.length) {\n // place a button and show a control dialog\n return (\n <Fab\n size=\"small\"\n style={{ width: 32, height: 32, minHeight: 32 }}\n disabled={!this.props.alive}\n onClick={() => this.setState({ showControlDialog: true })}\n >\n <ControlIcon />\n </Fab>\n );\n }\n return null;\n }\n\n /**\n * IDs of all actions that are not rendered as a normal button in the footer, because they\n * already have their place in the status line: the reserved actions, the actions with\n * `placement: 'status'` and the actions referenced by a custom indicator.\n */\n private getStatusActionIds(): Set<string> {\n const ids = new Set<string>([ACTIONS.STATUS, ACTIONS.ENABLE_DISABLE, ACTIONS.UPDATE, ACTIONS.BATTERY]);\n\n for (const indicator of this.props.device.indicators || []) {\n if (indicator.actionId) {\n ids.add(indicator.actionId);\n }\n }\n for (const action of this.props.device.actions || []) {\n if (action.placement === 'status') {\n ids.add(action.id);\n }\n }\n\n return ids;\n }\n\n /** True if at least one action is left for the button row at the bottom of the card */\n private hasFooterActions(): boolean {\n const statusActionIds = this.getStatusActionIds();\n return !!this.props.device.actions?.some(action => !statusActionIds.has(action.id));\n }\n\n /** Resolve how a custom indicator behaves on click by looking up the referenced action */\n private resolveIndicatorAction = (\n actionId: string,\n ): { onClick?: () => void; url?: string; disabled?: boolean } | undefined => {\n const action = this.props.device.actions?.find(a => a.id === actionId);\n if (!action) {\n console.warn(\n `Indicator of device ${JSON.stringify(this.props.device.id)} references the unknown action \"${actionId}\"`,\n );\n return undefined;\n }\n\n if ('url' in action && action.url) {\n return { url: getTranslation(action.url), disabled: action.disabled };\n }\n\n return {\n onClick: this.props.deviceHandler(this.props.device.id, action),\n disabled: action.disabled,\n };\n };\n\n /** Custom indicators and the actions that requested to be shown in the status line */\n renderIndicators(small?: boolean): JSX.Element | null {\n const reserved: string[] = [ACTIONS.STATUS, ACTIONS.ENABLE_DISABLE, ACTIONS.UPDATE, ACTIONS.BATTERY];\n const statusActions: DeviceAction[] =\n this.props.device.actions?.filter(a => a.placement === 'status' && !reserved.includes(a.id)) || [];\n\n // An indicator switched off by the user is not shown at all. An action referenced by it stays\n // out of the footer too, as hiding the indicator was an explicit decision of the user.\n const indicators = this.props.hiddenIndicators?.length\n ? this.props.device.indicators?.filter(indicator => !this.props.hiddenIndicators!.includes(indicator.id))\n : this.props.device.indicators;\n\n if (!indicators?.length && !statusActions.length) {\n return null;\n }\n\n return (\n <StatusIndicators\n indicators={indicators}\n theme={this.props.theme}\n stateOrObjectHandler={this.stateOrObjectHandler}\n disabled={!this.props.alive}\n resolveAction={this.resolveIndicatorAction}\n style={{ marginTop: small ? 2 : 4 }}\n >\n {statusActions.map(action => (\n <DeviceActionButton\n disabled={!this.props.alive}\n key={action.id}\n deviceId={this.props.device.id}\n action={action}\n deviceHandler={this.props.deviceHandler}\n />\n ))}\n </StatusIndicators>\n );\n }\n\n renderActions(): JSX.Element[] | null {\n const statusActionIds = this.getStatusActionIds();\n const actions = this.props.device.actions?.filter(a => !statusActionIds.has(a.id));\n\n return actions?.length\n ? actions.map(a => (\n <DeviceActionButton\n disabled={!this.props.alive}\n key={a.id}\n deviceId={this.props.device.id}\n action={a}\n deviceHandler={this.props.deviceHandler}\n />\n ))\n : null;\n }\n\n renderSmall(): JSX.Element {\n const status = !this.props.device.status\n ? []\n : Array.isArray(this.props.device.status)\n ? this.props.device.status\n : [this.props.device.status];\n\n const icon = this.state.icon ? (\n <DeviceTypeIcon\n src={this.state.icon}\n style={styles.imgStyle}\n />\n ) : (\n <NoImageIcon style={styles.imgStyle} />\n );\n const headerStyle = this.getCardHeaderStyle(this.props.theme);\n\n const title: string = this.state.details?.data?.name || this.props.device.name || '';\n\n return (\n <Paper\n style={{ width: 200, minHeight: 200, margin: 5 }}\n sx={styles.cardStyle}\n key={JSON.stringify(this.props.id)}\n >\n {/* Header */}\n <Box\n sx={headerStyle}\n style={{ ...styles.headerStyle, minHeight: 48 }}\n >\n <div style={{ ...styles.imgAreaStyle, height: 32, width: 32 }}>\n {this.props.uploadImagesToInstance ? (\n <DeviceImageUpload\n uploadImagesToInstance={this.props.uploadImagesToInstance}\n deviceId={this.props.device.id}\n manufacturer={this.state.manufacturer}\n model={this.state.model}\n onImageSelect={(imageData: string): void => {\n if (imageData) {\n this.setState({ icon: imageData });\n }\n }}\n socket={this.props.socket}\n />\n ) : null}\n {icon}\n </div>\n <Box\n style={{ ...styles.titleStyle, fontSize: 14 }}\n title={title.length > 15 ? title : undefined}\n sx={theme => ({ color: headerStyle.color || theme.palette.secondary.contrastText })}\n >\n {this.state.details?.data?.name || this.state.name}\n </Box>\n {this.state.hasDetails ? (\n <Fab\n disabled={!this.props.alive}\n size=\"small\"\n style={styles.detailsButtonStyle}\n onClick={() => {\n if (!this.state.open) {\n this.loadDetails().catch(console.error);\n this.setState({ open: true });\n }\n }}\n color=\"primary\"\n >\n <MoreVertIcon />\n </Fab>\n ) : null}\n </Box>\n {/* Status */}\n <div style={{ ...styles.statusStyle, height: 'auto', padding: '8px 15px 0 15px' }}>\n {status.map((s, i) => (\n <DeviceStatusComponent\n key={i}\n socket={this.props.socket}\n deviceId={this.props.device.id}\n connectionType={this.state.connectionType}\n status={s}\n enabled={this.state.enabled}\n statusAction={this.props.device.actions?.find(a => a.id === ACTIONS.STATUS)}\n disableEnableAction={this.props.device.actions?.find(a => a.id === ACTIONS.ENABLE_DISABLE)}\n update={i === 0 ? this.props.device.update : undefined}\n updateAction={\n i === 0 ? this.props.device.actions?.find(a => a.id === ACTIONS.UPDATE) : undefined\n }\n batteryAction={this.props.device.actions?.find(a => a.id === ACTIONS.BATTERY)}\n deviceHandler={this.props.deviceHandler}\n theme={this.props.theme}\n stateOrObjectHandler={this.stateOrObjectHandler}\n />\n ))}\n {this.renderIndicators(true)}\n </div>\n {/* Body */}\n <div style={styles.bodyStyle}>\n <Typography\n variant=\"body2\"\n style={{ ...styles.deviceInfoStyle, padding: '10px 10px 0 10px' }}\n >\n {this.state.identifier ? (\n <div\n onClick={this.copyToClipboard}\n style={{ textOverflow: 'ellipsis', overflow: 'hidden' }}\n >\n <b>{getText(this.props.identifierLabel)}:</b>\n <span style={{ marginLeft: 4 }}>{this.state.identifier}</span>\n </div>\n ) : null}\n {this.state.manufacturer ? (\n <Tooltip\n title={getTranslation('manufacturer')}\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n >\n <div>{this.state.manufacturer}</div>\n </Tooltip>\n ) : null}\n {this.state.model ? (\n <Tooltip\n title={getTranslation('model')}\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n >\n <div>{this.state.model}</div>\n </Tooltip>\n ) : null}\n </Typography>\n {this.props.device.customInfo ? (\n // The bottom padding is not symmetry for its own sake: the footer below is\n // only rendered when the device has actions or controls, so without it the\n // last row would sit flush on the card's lower edge.\n <div style={{ padding: '0 10px 10px' }}>\n <JsonConfig\n instanceId={this.props.instanceId}\n socket={this.props.socket}\n schema={this.props.device.customInfo.schema}\n data={this.props.device.customInfo.data || {}}\n onChange={(_data: Record<string, any> | null) => {\n /* ignore */\n }}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </div>\n ) : null}\n {/* Footer */}\n {!!(this.hasFooterActions() || this.props.device.controls?.length) && (\n <div\n style={{\n marginTop: 'auto',\n display: 'flex',\n gap: 4,\n paddingBottom: 5,\n minHeight: 34,\n paddingLeft: 8,\n paddingRight: 8,\n }}\n >\n {this.renderActions()}\n <div style={{ flexGrow: 1 }} />\n {this.renderControls()}\n </div>\n )}\n </div>\n {this.renderDialog()}\n {this.renderControlDialog()}\n </Paper>\n );\n }\n\n getCardHeaderStyle(theme: IobTheme, maxWidth?: number): React.CSSProperties {\n const backgroundColor =\n this.state.backgroundColor === 'primary'\n ? theme.palette.primary.main\n : this.state.backgroundColor === 'secondary'\n ? theme.palette.secondary.main\n : this.state.backgroundColor || theme.palette.secondary.main;\n\n let color;\n if (this.state.color && this.state.color !== 'primary' && this.state.color !== 'secondary') {\n // Color was directly defined\n color = this.state.color;\n } else if (this.state.color === 'primary') {\n color = theme.palette.primary.main;\n } else if (this.state.color === 'secondary') {\n color = theme.palette.secondary.main;\n } else {\n // Color was not defined\n if (this.state.backgroundColor === 'primary') {\n color = theme.palette.primary.contrastText;\n } else if (this.state.backgroundColor === 'secondary' || !this.state.backgroundColor) {\n color = theme.palette.secondary.contrastText;\n } else {\n color = Utils.invertColor(backgroundColor, true);\n }\n }\n\n return {\n backgroundColor,\n color,\n maxWidth,\n };\n }\n\n renderBig(): JSX.Element {\n const status = !this.props.device.status\n ? []\n : Array.isArray(this.props.device.status)\n ? this.props.device.status\n : [this.props.device.status];\n\n const icon = this.state.icon ? (\n <DeviceTypeIcon\n src={this.state.icon}\n style={styles.imgStyle}\n />\n ) : (\n <NoImageIcon style={styles.imgStyle} />\n );\n const headerStyle = this.getCardHeaderStyle(this.props.theme);\n\n const title: string = this.state.details?.data?.name || this.props.device.name || '';\n\n return (\n <Paper\n sx={styles.cardStyle}\n key={JSON.stringify(this.props.id)}\n >\n {/* Header */}\n <Box\n sx={headerStyle}\n style={styles.headerStyle}\n >\n <div style={styles.imgAreaStyle}>\n {this.props.uploadImagesToInstance ? (\n <DeviceImageUpload\n uploadImagesToInstance={this.props.uploadImagesToInstance}\n deviceId={this.props.device.id}\n manufacturer={this.state.manufacturer}\n model={this.state.model}\n onImageSelect={(imageData: string): void => {\n if (imageData) {\n this.setState({ icon: imageData });\n }\n }}\n socket={this.props.socket}\n />\n ) : null}\n {icon}\n </div>\n <Box\n style={styles.titleStyle}\n title={title.length > 20 ? title : undefined}\n sx={theme => ({ color: headerStyle.color || theme.palette.secondary.contrastText })}\n >\n {this.state.details?.data?.name || this.state.name}\n </Box>\n {this.state.hasDetails ? (\n <Fab\n disabled={!this.props.alive}\n size=\"small\"\n style={styles.detailsButtonStyle}\n onClick={() => {\n if (!this.state.open) {\n this.loadDetails().catch(console.error);\n this.setState({ open: true });\n }\n }}\n color=\"primary\"\n >\n <MoreVertIcon />\n </Fab>\n ) : null}\n </Box>\n {/* Body */}\n <div style={styles.statusStyle}>\n {status.map((s, i) => (\n <DeviceStatusComponent\n key={i}\n socket={this.props.socket}\n deviceId={this.props.device.id}\n connectionType={this.state.connectionType}\n status={s}\n enabled={this.state.enabled}\n statusAction={this.props.device.actions?.find(a => a.id === ACTIONS.STATUS)}\n disableEnableAction={this.props.device.actions?.find(a => a.id === ACTIONS.ENABLE_DISABLE)}\n update={i === 0 ? this.props.device.update : undefined}\n updateAction={\n i === 0 ? this.props.device.actions?.find(a => a.id === ACTIONS.UPDATE) : undefined\n }\n batteryAction={this.props.device.actions?.find(a => a.id === ACTIONS.BATTERY)}\n deviceHandler={this.props.deviceHandler}\n theme={this.props.theme}\n stateOrObjectHandler={this.stateOrObjectHandler}\n />\n ))}\n {this.renderIndicators()}\n </div>\n <div style={styles.bodyStyle}>\n <Typography\n variant=\"body1\"\n style={styles.deviceInfoStyle}\n >\n {this.state.identifier ? (\n <div onClick={this.copyToClipboard}>\n <b style={{ marginRight: 4 }}>{getText(this.props.identifierLabel)}:</b>\n {this.state.identifier}\n </div>\n ) : null}\n {this.state.manufacturer ? (\n <div>\n <b style={{ marginRight: 4 }}>{getTranslation('manufacturer')}:</b>\n {this.state.manufacturer}\n </div>\n ) : null}\n {this.state.model ? (\n <div>\n <b style={{ marginRight: 4 }}>{getTranslation('model')}:</b>\n {this.state.model}\n </div>\n ) : null}\n </Typography>\n {this.props.device.customInfo ? (\n // See the compact card above — the footer that used to provide the gap is\n // conditional, so the padding has to be here.\n <div style={{ padding: '0 16px 16px' }}>\n <JsonConfig\n instanceId={this.props.instanceId}\n socket={this.props.socket}\n schema={this.props.device.customInfo.schema}\n data={this.props.device.customInfo.data || {}}\n onChange={(_data: Record<string, any> | null) => {\n /* ignore */\n }}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </div>\n ) : null}\n {/* Footer */}\n {!!(this.hasFooterActions() || this.props.device.controls?.length) && (\n <div\n style={{\n marginTop: 'auto',\n display: 'flex',\n gap: 8,\n paddingBottom: 5,\n minHeight: 34,\n paddingLeft: 10,\n paddingRight: 10,\n }}\n >\n {this.renderActions()}\n <div style={{ flexGrow: 1 }} />\n {this.renderControls()}\n </div>\n )}\n </div>\n {this.renderDialog()}\n {this.renderControlDialog()}\n </Paper>\n );\n }\n\n render(): JSX.Element {\n if (this.props.filter) {\n const field = this.props.filterField ?? 'name';\n const value = String(this.state[field] ?? '').toLowerCase();\n if (!value.includes(this.props.filter.toLowerCase())) {\n return <></>;\n }\n }\n\n if (this.props.onlyUpdatable && !this.state.updateAvailable) {\n return <></>;\n }\n\n if (this.props.onlyBatteryProblem && !this.state.batteryProblem) {\n return <></>;\n }\n\n if (this.props.smallCards) {\n return this.renderSmall();\n }\n\n return this.renderBig();\n }\n}\n\ntype DeviceCardSkeletonProps = Pick<DeviceCardProps, 'smallCards' | 'theme'>;\n\nexport class DeviceCardSkeleton extends Component<DeviceCardSkeletonProps> {\n render(): JSX.Element {\n if (this.props.smallCards) {\n return this.renderSmall();\n }\n\n return this.renderBig();\n }\n\n renderSmall(): JSX.Element {\n const headerStyle = this.getCardHeaderStyle(this.props.theme);\n\n return (\n <Paper\n sx={styles.cardStyle}\n style={{ width: 200, minHeight: 200, margin: 5 }}\n >\n <Box\n sx={headerStyle}\n style={{ ...styles.headerStyle, minHeight: 48 }}\n >\n <div style={{ ...styles.imgAreaStyle, height: 32, width: 32 }}>\n <Skeleton\n variant=\"rounded\"\n width={24}\n height={24}\n />\n </div>\n <Box\n style={{ ...styles.titleStyle, fontSize: 14, minWidth: '50%' }}\n sx={theme => ({\n color: headerStyle.color || theme.palette.secondary.contrastText,\n })}\n >\n <Skeleton />\n </Box>\n </Box>\n <div style={{ ...styles.statusStyle, height: 'auto', padding: '8px 15px 0 15px' }} />\n <div style={styles.bodyStyle}>\n <Typography\n variant=\"body2\"\n style={{ ...styles.deviceInfoStyle, padding: '10px 10px 0 10px' }}\n >\n <div>\n <Skeleton />\n </div>\n <div>\n <Skeleton />\n </div>\n <div>\n <Skeleton />\n </div>\n </Typography>\n </div>\n </Paper>\n );\n }\n\n renderBig(): JSX.Element {\n const headerStyle = this.getCardHeaderStyle(this.props.theme);\n\n return (\n <Paper sx={styles.cardStyle}>\n <Box\n sx={headerStyle}\n style={styles.headerStyle}\n >\n <div style={styles.imgAreaStyle}>\n <Skeleton\n variant=\"rounded\"\n width={24}\n height={24}\n />\n </div>\n <Box\n style={styles.titleStyle}\n sx={theme => ({\n color: headerStyle.color || theme.palette.secondary.contrastText,\n minWidth: '50%',\n })}\n >\n <Skeleton />\n </Box>\n </Box>\n <div style={styles.statusStyle}></div>\n <div style={styles.bodyStyle}>\n <Typography\n variant=\"body1\"\n style={styles.deviceInfoStyle}\n >\n <div>\n <Skeleton />\n </div>\n <div>\n <Skeleton />\n </div>\n <div>\n <Skeleton />\n </div>\n </Typography>\n </div>\n </Paper>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n getCardHeaderStyle(theme: IobTheme, maxWidth?: number): React.CSSProperties {\n const backgroundColor = theme.palette.secondary.main;\n const color = theme.palette.secondary.contrastText;\n\n return {\n backgroundColor,\n color,\n maxWidth,\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DeviceCard.js","sourceRoot":"./src/","sources":["DeviceCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;AACvD,OAAO,EACH,KAAK,IAAI,SAAS,EAClB,cAAc,IAAI,WAAW,EAC7B,QAAQ,IAAI,YAAY,EACxB,UAAU,GACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,GAAG,EACH,MAAM,EACN,MAAM,EACN,aAAa,EACb,aAAa,EACb,WAAW,EACX,GAAG,EACH,UA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AAC,SAAS,EACjB,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,GACZ,CACA;gBACN,oBAAC,GAAG,IACA,KAAK,EAAE,MAAM,CAAC,UAAU,EACxB,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;wBACV,KAAK,EAAE,WAAW,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,YAAY;wBAChE,QAAQ,EAAE,KAAK;qBAClB,CAAC;oBAEF,oBAAC,QAAQ,OAAG,CACV,CACJ;YACN,6BAAK,KAAK,EAAE,MAAM,CAAC,WAAW,GAAQ;YACtC,6BAAK,KAAK,EAAE,MAAM,CAAC,SAAS;gBACxB,oBAAC,UAAU,IACP,OAAO,EAAC,OAAO,EACf,KAAK,EAAE,MAAM,CAAC,eAAe;oBAE7B;wBACI,oBAAC,QAAQ,OAAG,CACV;oBACN;wBACI,oBAAC,QAAQ,OAAG,CACV;oBACN;wBACI,oBAAC,QAAQ,OAAG,CACV,CACG,CACX,CACF,CACX,CAAC;IACN,CAAC;IAED,kDAAkD;IAClD,kBAAkB,CAAC,KAAe,EAAE,QAAiB;QACjD,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;QACrD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC;QAEnD,OAAO;YACH,eAAe;YACf,KAAK;YACL,QAAQ;SACX,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React, { PureComponent, type JSX } from 'react';\nimport {\n Close as CloseIcon,\n VideogameAsset as ControlIcon,\n MoreVert as MoreVertIcon,\n ExpandMore,\n} from '@mui/icons-material';\nimport {\n Box,\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n Fab,\n IconButton,\n Paper,\n Skeleton,\n Tooltip,\n Typography,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n} from '@mui/material';\n\nimport {\n DeviceTypeIcon,\n Utils,\n type Connection,\n type IobTheme,\n type ThemeName,\n type ThemeType,\n Icon,\n} from '@iobroker/gui-components';\nimport DeviceActionButton from './DeviceActionButton';\nimport DeviceControlComponent from './DeviceControl';\nimport DeviceImageUpload from './DeviceImageUpload';\nimport DeviceStatusComponent from './DeviceStatus';\nimport JsonConfig from './JsonConfig';\nimport { StatusIndicators } from './StatusIndicator';\nimport type {\n ActionBase,\n ControlBase,\n ControlState,\n DeviceDetails,\n DeviceAction,\n DeviceControl,\n DeviceInfo,\n DeviceId,\n} from './protocol/api';\n\nimport { getText, getTranslation } from './Utils';\nimport type { StateOrObjectHandler } from './StateOrObjectHandler';\nimport type { ResolvedDeviceFields } from './DeviceFields';\n\n// The type moved to `DeviceFields` together with the filtering itself. Re-exported here, because it\n// used to be exported from this module.\nexport type { DeviceFilterField } from './DeviceFields';\n\n/** Reserved action names (this is copied from https://github.com/ioBroker/dm-utils/blob/main/src/types/base.ts as we can only have type references to dm-utils) */\nconst ACTIONS = {\n /** This action will be called when the user clicks on the connection icon */\n STATUS: 'status',\n /** This action will be called when the user clicks on the enabled / disabled icon. The enabled/disabled icon will be shown only if the node status has the \"enabled\" flag set to false or true */\n ENABLE_DISABLE: 'enable/disable',\n /** This action will be called when the user clicks on the update indicator. The update indicator is shown only if `DeviceInfo.update.available` is true */\n UPDATE: 'update',\n /** This action will be called when the user clicks on the battery indicator. The battery indicator is shown only if the node status has the \"battery\" property */\n BATTERY: 'battery',\n};\n\n/**\n * Footprint of a card. The list needs it to give a not yet rendered card a placeholder of exactly\n * the same size, so that neither the layout nor the length of the scrollbar changes.\n */\nexport const CARD_WIDTH = 300;\nexport const CARD_MIN_HEIGHT = 280;\nexport const CARD_MARGIN = 10;\n\nexport const SMALL_CARD_WIDTH = 200;\nexport const SMALL_CARD_MIN_HEIGHT = 200;\nexport const SMALL_CARD_MARGIN = 5;\n\nconst cardSize: React.CSSProperties = { width: CARD_WIDTH, minHeight: CARD_MIN_HEIGHT, margin: CARD_MARGIN };\nconst smallCardSize: React.CSSProperties = {\n width: SMALL_CARD_WIDTH,\n minHeight: SMALL_CARD_MIN_HEIGHT,\n margin: SMALL_CARD_MARGIN,\n};\n/** A card that sits in a container which already has the footprint of a card */\nconst filledCardSize: React.CSSProperties = { width: '100%', margin: 0 };\n\n/**\n * Icons read from the file storage of the adapter, keyed by `<instance>/<file>`.\n *\n * A card is unmounted and mounted again while scrolling, and without this cache every one of those\n * would repeat the `readFile` round trip for an icon that is very often not there at all.\n */\nconst fileIconCache = new Map<string, string>();\n\nconst styles: Record<string, any> = {\n cardStyle: (theme: IobTheme): React.CSSProperties => ({\n overflow: 'hidden',\n display: 'flex',\n flexDirection: 'column',\n backgroundColor: theme.palette.mode === 'dark' ? '#0b0b0b' : '#d5d5d5',\n }),\n headerStyle: {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n paddingLeft: 8,\n paddingRight: 8,\n position: 'relative',\n minHeight: 60,\n color: '#000',\n },\n imgAreaStyle: {\n height: 45,\n width: 45,\n justifyContent: 'center',\n display: 'flex',\n alignItems: 'center',\n },\n imgStyle: {\n zIndex: 2,\n maxWidth: '100%',\n maxHeight: '100%',\n color: '#FFF',\n },\n titleStyle: {\n fontSize: 16,\n fontWeight: 'bold',\n // whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n detailsButtonStyle: {\n right: 20,\n bottom: -20,\n position: 'absolute',\n },\n bodyStyle: {\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n },\n deviceInfoStyle: {\n padding: '20px 16px 0 16px',\n },\n statusStyle: {\n padding: '15px 25px 0 15px',\n // The line may grow if the device provides custom indicators, so only the minimum is fixed\n minHeight: 41,\n },\n};\n\nfunction NoImageIcon(props: { style?: React.CSSProperties; className?: string }): JSX.Element {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n style={props.style}\n className={props.className}\n >\n <path\n fill=\"currentColor\"\n d=\"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z\"\n />\n </svg>\n );\n}\n\ninterface DeviceCardProps {\n /* Device ID */\n id: DeviceId;\n identifierLabel: ioBroker.StringOrTranslated;\n device: DeviceInfo;\n /**\n * The device fields resolved by the list. They may be bound to a state or an object, and the\n * list resolves them centrally: a card that is not rendered cannot resolve its own name, and\n * the filter of the list needs the values of all devices, not only of the rendered ones.\n */\n fields: ResolvedDeviceFields;\n /** Handler of the whole list, so that identical states/objects are only subscribed once */\n stateOrObjectHandler: StateOrObjectHandler;\n instanceId: string;\n socket: Connection;\n /* Instance, where the images should be uploaded to */\n uploadImagesToInstance?: string;\n deviceHandler: (deviceId: DeviceId, action: ActionBase) => () => void;\n controlHandler: (\n deviceId: DeviceId,\n control: ControlBase,\n state: ControlState,\n ) => () => Promise<ioBroker.State | null>;\n controlStateHandler: (deviceId: DeviceId, control: ControlBase) => () => Promise<ioBroker.State | null>;\n smallCards?: boolean;\n /** The card is rendered inside a container that already has the footprint of a card */\n fillContainer?: boolean;\n alive: boolean;\n themeName: ThemeName;\n themeType: ThemeType;\n theme: IobTheme;\n isFloatComma: boolean;\n dateFormat: string;\n /** IDs of configurable indicators the user has switched off */\n hiddenIndicators?: string[];\n}\n\ninterface DeviceCardState {\n open: boolean;\n details: DeviceDetails | null;\n data: Record<string, any>;\n showControlDialog: boolean;\n /** Icon read from the file storage or picked by the user. Overrides `fields.icon` */\n localIcon?: string;\n}\n\n/**\n * Device Card Component.\n *\n * A `PureComponent`: the list re-renders on every loading step, on every filter change and on every\n * resolved device value. Without the shallow property comparison all cards would be re-rendered\n * every time, so all properties the list passes down are kept stable there.\n */\nexport default class DeviceCard extends PureComponent<DeviceCardProps, DeviceCardState> {\n /** True as long as the component is mounted; guards the asynchronous icon loading */\n private mounted = false;\n\n constructor(props: DeviceCardProps) {\n super(props);\n\n const cacheKey = DeviceCard.iconCacheKey(props);\n\n this.state = {\n open: false,\n details: null,\n data: {},\n showControlDialog: false,\n // Take a known icon over directly, so a card that is scrolled back into view does not flicker\n localIcon: cacheKey ? fileIconCache.get(cacheKey) : undefined,\n };\n }\n\n /**\n * Key of the icon in the file storage, or `null` if the device brings its own icon.\n *\n * The file is named after manufacturer and model, both of which may be bound to a state or an\n * object and therefore arrive only after the first render.\n */\n private static iconCacheKey(props: DeviceCardProps): string | null {\n if (props.device.icon) {\n return null;\n }\n const manufacturer = props.fields.manufacturer;\n const model = props.fields.model;\n const fileName = `${manufacturer ? `${manufacturer}_` : ''}${model || JSON.stringify(props.device.id)}`;\n return `${props.instanceId.replace('system.adapter.', '')}/${fileName}.webp`;\n }\n\n async fetchIcon(): Promise<void> {\n const cacheKey = DeviceCard.iconCacheKey(this.props);\n if (cacheKey) {\n const cached = fileIconCache.get(cacheKey);\n if (cached !== undefined) {\n if (this.state.localIcon !== cached) {\n this.setState({ localIcon: cached });\n }\n return;\n }\n\n const [adapter, ...rest] = cacheKey.split('/');\n try {\n const file = await this.props.socket.readFile(adapter, rest.join('/'), true);\n const localIcon = file ? `data:${file.mimeType};base64,${file.file}` : '';\n fileIconCache.set(cacheKey, localIcon);\n if (!this.mounted) {\n return;\n }\n this.setState({ localIcon });\n // const response = await fetch(url);\n // if (response.ok) {\n // const blob = await response.blob();\n // const reader = new FileReader();\n // reader.onloadend = () => {\n // setIcon(reader.result);\n // };\n // reader.readAsDataURL(blob);\n // } else {\n // throw new Error('Response not ok');\n // }\n } catch {\n fileIconCache.set(cacheKey, '');\n if (this.mounted && this.state.localIcon) {\n this.setState({ localIcon: '' });\n }\n }\n }\n }\n\n componentDidMount(): void {\n this.mounted = true;\n void this.fetchIcon().catch(e => console.error(e));\n }\n\n componentDidUpdate(prevProps: DeviceCardProps): void {\n // The icon is looked up in the file storage under `<manufacturer>_<model>`. Both may be bound\n // to a state or an object and therefore arrive only after the first render.\n if (\n prevProps.fields.manufacturer !== this.props.fields.manufacturer ||\n prevProps.fields.model !== this.props.fields.model ||\n prevProps.device.icon !== this.props.device.icon\n ) {\n void this.fetchIcon().catch(e => console.error(e));\n }\n }\n\n componentWillUnmount(): void {\n this.mounted = false;\n }\n\n /**\n * Load the device details\n */\n async loadDetails(): Promise<void> {\n console.log(`Loading device details for`, this.props.device.id, `... from ${this.props.instanceId}`);\n const details: DeviceDetails | null = await this.props.socket.sendTo(\n this.props.instanceId,\n 'dm:deviceDetails',\n this.props.device.id,\n );\n console.log(`Got device details for`, this.props.device.id, details);\n this.setState({ details, data: details?.data || {} });\n }\n\n /**\n * Copy the device ID to the clipboard\n */\n copyToClipboard = (): void => {\n const textToCopy = this.props.fields.identifier;\n if (!textToCopy) {\n return;\n }\n Utils.copyToClipboard(textToCopy);\n alert(`${getTranslation('copied')} ${textToCopy} ${getTranslation('toClipboard')}!`);\n };\n\n renderDialog(): JSX.Element | null {\n if (!this.state.open || !this.state.details) {\n return null;\n }\n\n return (\n <Dialog\n open={!0}\n maxWidth=\"md\"\n onClose={() => this.setState({ open: false })}\n >\n <DialogContent>\n <JsonConfig\n instanceId={this.props.instanceId}\n socket={this.props.socket}\n schema={this.state.details.schema}\n data={this.state.data}\n onChange={(data: Record<string, any> | null) => data && this.setState({ data })}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </DialogContent>\n <DialogActions>\n <Button\n disabled={!this.props.alive}\n variant=\"contained\"\n color=\"primary\"\n onClick={() => this.setState({ open: false })}\n autoFocus\n >\n {getTranslation('closeButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderControlItems(\n controls: DeviceControl[],\n allControls: DeviceControl[],\n colors: { primary: string; secondary: string },\n parentGroupId?: string,\n ): JSX.Element[] {\n return controls\n .filter(control => (parentGroupId ? control.group === parentGroupId : !control.group))\n .map(control => {\n if (control.type === 'group') {\n const children = allControls.filter(ctrl => ctrl.group === control.id);\n return (\n <Accordion key={control.id}>\n <AccordionSummary expandIcon={<ExpandMore />}>\n <Typography\n component=\"span\"\n style={{ display: 'flex', gap: 8, color: control.color }}\n >\n {control.icon ? <Icon src={control.icon} /> : null}\n {getTranslation(control.label!)}\n </Typography>\n </AccordionSummary>\n <AccordionDetails style={{ display: 'flex', flexDirection: 'column' }}>\n {this.renderControlItems(children, allControls, colors, control.id)}\n </AccordionDetails>\n </Accordion>\n );\n }\n return (\n <DeviceControlComponent\n disabled={false}\n key={control.id}\n control={control}\n socket={this.props.socket}\n colors={colors}\n deviceId={this.props.device.id}\n controlHandler={this.props.controlHandler}\n controlStateHandler={this.props.controlStateHandler}\n />\n );\n });\n }\n\n renderControlDialog(): JSX.Element | null {\n if (!this.state.showControlDialog || !this.props.alive) {\n return null;\n }\n const colors = { primary: '#111', secondary: '#888' };\n const allControls = this.props.device.controls || [];\n return (\n <Dialog\n open={!0}\n onClose={() => this.setState({ showControlDialog: false })}\n >\n <DialogTitle style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 }}>\n {this.props.fields.name}\n <IconButton onClick={() => this.setState({ showControlDialog: false })}>\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <DialogContent style={{ display: 'flex', flexDirection: 'column' }}>\n {this.renderControlItems(allControls, allControls, colors)}\n </DialogContent>\n </Dialog>\n );\n }\n\n renderControls(): JSX.Element | null {\n const colors = { primary: '#111', secondary: '#888' };\n const firstControl = this.props.device.controls?.[0];\n if (\n this.props.device.controls?.length === 1 &&\n firstControl &&\n (firstControl.type === 'icon' || firstControl.type === 'switch') &&\n !firstControl.label\n ) {\n // control can be placed in the button icon\n return (\n <DeviceControlComponent\n disabled={!this.props.alive}\n control={firstControl}\n colors={colors}\n socket={this.props.socket}\n deviceId={this.props.device.id}\n controlHandler={this.props.controlHandler}\n controlStateHandler={this.props.controlStateHandler}\n />\n );\n }\n\n if (this.props.device.controls?.length) {\n // place a button and show a control dialog\n return (\n <Fab\n size=\"small\"\n style={{ width: 32, height: 32, minHeight: 32 }}\n disabled={!this.props.alive}\n onClick={() => this.setState({ showControlDialog: true })}\n >\n <ControlIcon />\n </Fab>\n );\n }\n return null;\n }\n\n /**\n * IDs of all actions that are not rendered as a normal button in the footer, because they\n * already have their place in the status line: the reserved actions, the actions with\n * `placement: 'status'` and the actions referenced by a custom indicator.\n */\n private getStatusActionIds(): Set<string> {\n const ids = new Set<string>([ACTIONS.STATUS, ACTIONS.ENABLE_DISABLE, ACTIONS.UPDATE, ACTIONS.BATTERY]);\n\n for (const indicator of this.props.device.indicators || []) {\n if (indicator.actionId) {\n ids.add(indicator.actionId);\n }\n }\n for (const action of this.props.device.actions || []) {\n if (action.placement === 'status') {\n ids.add(action.id);\n }\n }\n\n return ids;\n }\n\n /** True if at least one action is left for the button row at the bottom of the card */\n private hasFooterActions(): boolean {\n const statusActionIds = this.getStatusActionIds();\n return !!this.props.device.actions?.some(action => !statusActionIds.has(action.id));\n }\n\n /** Resolve how a custom indicator behaves on click by looking up the referenced action */\n private resolveIndicatorAction = (\n actionId: string,\n ): { onClick?: () => void; url?: string; disabled?: boolean } | undefined => {\n const action = this.props.device.actions?.find(a => a.id === actionId);\n if (!action) {\n console.warn(\n `Indicator of device ${JSON.stringify(this.props.device.id)} references the unknown action \"${actionId}\"`,\n );\n return undefined;\n }\n\n if ('url' in action && action.url) {\n return { url: getTranslation(action.url), disabled: action.disabled };\n }\n\n return {\n onClick: this.props.deviceHandler(this.props.device.id, action),\n disabled: action.disabled,\n };\n };\n\n /** Custom indicators and the actions that requested to be shown in the status line */\n renderIndicators(small?: boolean): JSX.Element | null {\n const reserved: string[] = [ACTIONS.STATUS, ACTIONS.ENABLE_DISABLE, ACTIONS.UPDATE, ACTIONS.BATTERY];\n const statusActions: DeviceAction[] =\n this.props.device.actions?.filter(a => a.placement === 'status' && !reserved.includes(a.id)) || [];\n\n // An indicator switched off by the user is not shown at all. An action referenced by it stays\n // out of the footer too, as hiding the indicator was an explicit decision of the user.\n const indicators = this.props.hiddenIndicators?.length\n ? this.props.device.indicators?.filter(indicator => !this.props.hiddenIndicators!.includes(indicator.id))\n : this.props.device.indicators;\n\n if (!indicators?.length && !statusActions.length) {\n return null;\n }\n\n return (\n <StatusIndicators\n indicators={indicators}\n theme={this.props.theme}\n stateOrObjectHandler={this.props.stateOrObjectHandler}\n disabled={!this.props.alive}\n resolveAction={this.resolveIndicatorAction}\n style={{ marginTop: small ? 2 : 4 }}\n >\n {statusActions.map(action => (\n <DeviceActionButton\n disabled={!this.props.alive}\n key={action.id}\n deviceId={this.props.device.id}\n action={action}\n deviceHandler={this.props.deviceHandler}\n />\n ))}\n </StatusIndicators>\n );\n }\n\n renderActions(): JSX.Element[] | null {\n const statusActionIds = this.getStatusActionIds();\n const actions = this.props.device.actions?.filter(a => !statusActionIds.has(a.id));\n\n return actions?.length\n ? actions.map(a => (\n <DeviceActionButton\n disabled={!this.props.alive}\n key={a.id}\n deviceId={this.props.device.id}\n action={a}\n deviceHandler={this.props.deviceHandler}\n />\n ))\n : null;\n }\n\n renderSmall(): JSX.Element {\n const status = !this.props.device.status\n ? []\n : Array.isArray(this.props.device.status)\n ? this.props.device.status\n : [this.props.device.status];\n\n const iconSrc = this.state.localIcon || this.props.fields.icon;\n const icon = iconSrc ? (\n <DeviceTypeIcon\n src={iconSrc}\n style={styles.imgStyle}\n />\n ) : (\n <NoImageIcon style={styles.imgStyle} />\n );\n const headerStyle = this.getCardHeaderStyle(this.props.theme);\n\n const title: string = this.state.details?.data?.name || this.props.device.name || '';\n\n return (\n <Paper\n style={this.props.fillContainer ? filledCardSize : smallCardSize}\n sx={styles.cardStyle}\n >\n {/* Header */}\n <Box\n sx={headerStyle}\n style={{ ...styles.headerStyle, minHeight: 48 }}\n >\n <div style={{ ...styles.imgAreaStyle, height: 32, width: 32 }}>\n {this.props.uploadImagesToInstance ? (\n <DeviceImageUpload\n uploadImagesToInstance={this.props.uploadImagesToInstance}\n deviceId={this.props.device.id}\n manufacturer={this.props.fields.manufacturer}\n model={this.props.fields.model}\n onImageSelect={(imageData: string): void => {\n if (imageData) {\n this.setState({ localIcon: imageData });\n }\n }}\n socket={this.props.socket}\n />\n ) : null}\n {icon}\n </div>\n <Box\n style={{ ...styles.titleStyle, fontSize: 14 }}\n title={title.length > 15 ? title : undefined}\n sx={theme => ({ color: headerStyle.color || theme.palette.secondary.contrastText })}\n >\n {this.state.details?.data?.name || this.props.fields.name}\n </Box>\n {this.props.fields.hasDetails ? (\n <Fab\n disabled={!this.props.alive}\n size=\"small\"\n style={styles.detailsButtonStyle}\n onClick={() => {\n if (!this.state.open) {\n this.loadDetails().catch(console.error);\n this.setState({ open: true });\n }\n }}\n color=\"primary\"\n >\n <MoreVertIcon />\n </Fab>\n ) : null}\n </Box>\n {/* Status */}\n <div style={{ ...styles.statusStyle, height: 'auto', padding: '8px 15px 0 15px' }}>\n {status.map((s, i) => (\n <DeviceStatusComponent\n key={i}\n socket={this.props.socket}\n deviceId={this.props.device.id}\n connectionType={this.props.fields.connectionType}\n status={s}\n enabled={this.props.fields.enabled}\n statusAction={this.props.device.actions?.find(a => a.id === ACTIONS.STATUS)}\n disableEnableAction={this.props.device.actions?.find(a => a.id === ACTIONS.ENABLE_DISABLE)}\n update={i === 0 ? this.props.device.update : undefined}\n updateAction={\n i === 0 ? this.props.device.actions?.find(a => a.id === ACTIONS.UPDATE) : undefined\n }\n batteryAction={this.props.device.actions?.find(a => a.id === ACTIONS.BATTERY)}\n deviceHandler={this.props.deviceHandler}\n theme={this.props.theme}\n stateOrObjectHandler={this.props.stateOrObjectHandler}\n />\n ))}\n {this.renderIndicators(true)}\n </div>\n {/* Body */}\n <div style={styles.bodyStyle}>\n <Typography\n variant=\"body2\"\n style={{ ...styles.deviceInfoStyle, padding: '10px 10px 0 10px' }}\n >\n {this.props.fields.identifier ? (\n <div\n onClick={this.copyToClipboard}\n style={{ textOverflow: 'ellipsis', overflow: 'hidden' }}\n >\n <b>{getText(this.props.identifierLabel)}:</b>\n <span style={{ marginLeft: 4 }}>{this.props.fields.identifier}</span>\n </div>\n ) : null}\n {this.props.fields.manufacturer ? (\n <Tooltip\n title={getTranslation('manufacturer')}\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n >\n <div>{this.props.fields.manufacturer}</div>\n </Tooltip>\n ) : null}\n {this.props.fields.model ? (\n <Tooltip\n title={getTranslation('model')}\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n >\n <div>{this.props.fields.model}</div>\n </Tooltip>\n ) : null}\n </Typography>\n {this.props.device.customInfo ? (\n // The bottom padding is not symmetry for its own sake: the footer below is\n // only rendered when the device has actions or controls, so without it the\n // last row would sit flush on the card's lower edge.\n <div style={{ padding: '0 10px 10px' }}>\n <JsonConfig\n instanceId={this.props.instanceId}\n socket={this.props.socket}\n schema={this.props.device.customInfo.schema}\n data={this.props.device.customInfo.data || {}}\n onChange={(_data: Record<string, any> | null) => {\n /* ignore */\n }}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </div>\n ) : null}\n {/* Footer */}\n {!!(this.hasFooterActions() || this.props.device.controls?.length) && (\n <div\n style={{\n marginTop: 'auto',\n display: 'flex',\n gap: 4,\n paddingBottom: 5,\n minHeight: 34,\n paddingLeft: 8,\n paddingRight: 8,\n }}\n >\n {this.renderActions()}\n <div style={{ flexGrow: 1 }} />\n {this.renderControls()}\n </div>\n )}\n </div>\n {this.renderDialog()}\n {this.renderControlDialog()}\n </Paper>\n );\n }\n\n getCardHeaderStyle(theme: IobTheme, maxWidth?: number): React.CSSProperties {\n const backgroundColor =\n this.props.fields.backgroundColor === 'primary'\n ? theme.palette.primary.main\n : this.props.fields.backgroundColor === 'secondary'\n ? theme.palette.secondary.main\n : this.props.fields.backgroundColor || theme.palette.secondary.main;\n\n let color;\n if (\n this.props.fields.color &&\n this.props.fields.color !== 'primary' &&\n this.props.fields.color !== 'secondary'\n ) {\n // Color was directly defined\n color = this.props.fields.color;\n } else if (this.props.fields.color === 'primary') {\n color = theme.palette.primary.main;\n } else if (this.props.fields.color === 'secondary') {\n color = theme.palette.secondary.main;\n } else {\n // Color was not defined\n if (this.props.fields.backgroundColor === 'primary') {\n color = theme.palette.primary.contrastText;\n } else if (this.props.fields.backgroundColor === 'secondary' || !this.props.fields.backgroundColor) {\n color = theme.palette.secondary.contrastText;\n } else {\n color = Utils.invertColor(backgroundColor, true);\n }\n }\n\n return {\n backgroundColor,\n color,\n maxWidth,\n };\n }\n\n renderBig(): JSX.Element {\n const status = !this.props.device.status\n ? []\n : Array.isArray(this.props.device.status)\n ? this.props.device.status\n : [this.props.device.status];\n\n const iconSrc = this.state.localIcon || this.props.fields.icon;\n const icon = iconSrc ? (\n <DeviceTypeIcon\n src={iconSrc}\n style={styles.imgStyle}\n />\n ) : (\n <NoImageIcon style={styles.imgStyle} />\n );\n const headerStyle = this.getCardHeaderStyle(this.props.theme);\n\n const title: string = this.state.details?.data?.name || this.props.device.name || '';\n\n return (\n <Paper\n style={this.props.fillContainer ? filledCardSize : cardSize}\n sx={styles.cardStyle}\n >\n {/* Header */}\n <Box\n sx={headerStyle}\n style={styles.headerStyle}\n >\n <div style={styles.imgAreaStyle}>\n {this.props.uploadImagesToInstance ? (\n <DeviceImageUpload\n uploadImagesToInstance={this.props.uploadImagesToInstance}\n deviceId={this.props.device.id}\n manufacturer={this.props.fields.manufacturer}\n model={this.props.fields.model}\n onImageSelect={(imageData: string): void => {\n if (imageData) {\n this.setState({ localIcon: imageData });\n }\n }}\n socket={this.props.socket}\n />\n ) : null}\n {icon}\n </div>\n <Box\n style={styles.titleStyle}\n title={title.length > 20 ? title : undefined}\n sx={theme => ({ color: headerStyle.color || theme.palette.secondary.contrastText })}\n >\n {this.state.details?.data?.name || this.props.fields.name}\n </Box>\n {this.props.fields.hasDetails ? (\n <Fab\n disabled={!this.props.alive}\n size=\"small\"\n style={styles.detailsButtonStyle}\n onClick={() => {\n if (!this.state.open) {\n this.loadDetails().catch(console.error);\n this.setState({ open: true });\n }\n }}\n color=\"primary\"\n >\n <MoreVertIcon />\n </Fab>\n ) : null}\n </Box>\n {/* Body */}\n <div style={styles.statusStyle}>\n {status.map((s, i) => (\n <DeviceStatusComponent\n key={i}\n socket={this.props.socket}\n deviceId={this.props.device.id}\n connectionType={this.props.fields.connectionType}\n status={s}\n enabled={this.props.fields.enabled}\n statusAction={this.props.device.actions?.find(a => a.id === ACTIONS.STATUS)}\n disableEnableAction={this.props.device.actions?.find(a => a.id === ACTIONS.ENABLE_DISABLE)}\n update={i === 0 ? this.props.device.update : undefined}\n updateAction={\n i === 0 ? this.props.device.actions?.find(a => a.id === ACTIONS.UPDATE) : undefined\n }\n batteryAction={this.props.device.actions?.find(a => a.id === ACTIONS.BATTERY)}\n deviceHandler={this.props.deviceHandler}\n theme={this.props.theme}\n stateOrObjectHandler={this.props.stateOrObjectHandler}\n />\n ))}\n {this.renderIndicators()}\n </div>\n <div style={styles.bodyStyle}>\n <Typography\n variant=\"body1\"\n style={styles.deviceInfoStyle}\n >\n {this.props.fields.identifier ? (\n <div onClick={this.copyToClipboard}>\n <b style={{ marginRight: 4 }}>{getText(this.props.identifierLabel)}:</b>\n {this.props.fields.identifier}\n </div>\n ) : null}\n {this.props.fields.manufacturer ? (\n <div>\n <b style={{ marginRight: 4 }}>{getTranslation('manufacturer')}:</b>\n {this.props.fields.manufacturer}\n </div>\n ) : null}\n {this.props.fields.model ? (\n <div>\n <b style={{ marginRight: 4 }}>{getTranslation('model')}:</b>\n {this.props.fields.model}\n </div>\n ) : null}\n </Typography>\n {this.props.device.customInfo ? (\n // See the compact card above — the footer that used to provide the gap is\n // conditional, so the padding has to be here.\n <div style={{ padding: '0 16px 16px' }}>\n <JsonConfig\n instanceId={this.props.instanceId}\n socket={this.props.socket}\n schema={this.props.device.customInfo.schema}\n data={this.props.device.customInfo.data || {}}\n onChange={(_data: Record<string, any> | null) => {\n /* ignore */\n }}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </div>\n ) : null}\n {/* Footer */}\n {!!(this.hasFooterActions() || this.props.device.controls?.length) && (\n <div\n style={{\n marginTop: 'auto',\n display: 'flex',\n gap: 8,\n paddingBottom: 5,\n minHeight: 34,\n paddingLeft: 10,\n paddingRight: 10,\n }}\n >\n {this.renderActions()}\n <div style={{ flexGrow: 1 }} />\n {this.renderControls()}\n </div>\n )}\n </div>\n {this.renderDialog()}\n {this.renderControlDialog()}\n </Paper>\n );\n }\n\n render(): JSX.Element {\n if (this.props.smallCards) {\n return this.renderSmall();\n }\n\n return this.renderBig();\n }\n}\n\ntype DeviceCardSkeletonProps = Pick<DeviceCardProps, 'smallCards' | 'theme'>;\n\nexport class DeviceCardSkeleton extends PureComponent<DeviceCardSkeletonProps> {\n render(): JSX.Element {\n if (this.props.smallCards) {\n return this.renderSmall();\n }\n\n return this.renderBig();\n }\n\n renderSmall(): JSX.Element {\n const headerStyle = this.getCardHeaderStyle(this.props.theme);\n\n return (\n <Paper\n sx={styles.cardStyle}\n style={smallCardSize}\n >\n <Box\n sx={headerStyle}\n style={{ ...styles.headerStyle, minHeight: 48 }}\n >\n <div style={{ ...styles.imgAreaStyle, height: 32, width: 32 }}>\n <Skeleton\n variant=\"rounded\"\n width={24}\n height={24}\n />\n </div>\n <Box\n style={{ ...styles.titleStyle, fontSize: 14, minWidth: '50%' }}\n sx={theme => ({\n color: headerStyle.color || theme.palette.secondary.contrastText,\n })}\n >\n <Skeleton />\n </Box>\n </Box>\n <div style={{ ...styles.statusStyle, height: 'auto', padding: '8px 15px 0 15px' }} />\n <div style={styles.bodyStyle}>\n <Typography\n variant=\"body2\"\n style={{ ...styles.deviceInfoStyle, padding: '10px 10px 0 10px' }}\n >\n <div>\n <Skeleton />\n </div>\n <div>\n <Skeleton />\n </div>\n <div>\n <Skeleton />\n </div>\n </Typography>\n </div>\n </Paper>\n );\n }\n\n renderBig(): JSX.Element {\n const headerStyle = this.getCardHeaderStyle(this.props.theme);\n\n return (\n <Paper\n sx={styles.cardStyle}\n style={cardSize}\n >\n <Box\n sx={headerStyle}\n style={styles.headerStyle}\n >\n <div style={styles.imgAreaStyle}>\n <Skeleton\n variant=\"rounded\"\n width={24}\n height={24}\n />\n </div>\n <Box\n style={styles.titleStyle}\n sx={theme => ({\n color: headerStyle.color || theme.palette.secondary.contrastText,\n minWidth: '50%',\n })}\n >\n <Skeleton />\n </Box>\n </Box>\n <div style={styles.statusStyle}></div>\n <div style={styles.bodyStyle}>\n <Typography\n variant=\"body1\"\n style={styles.deviceInfoStyle}\n >\n <div>\n <Skeleton />\n </div>\n <div>\n <Skeleton />\n </div>\n <div>\n <Skeleton />\n </div>\n </Typography>\n </div>\n </Paper>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n getCardHeaderStyle(theme: IobTheme, maxWidth?: number): React.CSSProperties {\n const backgroundColor = theme.palette.secondary.main;\n const color = theme.palette.secondary.contrastText;\n\n return {\n backgroundColor,\n color,\n maxWidth,\n };\n }\n}\n"]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ConfigConnectionType, DeviceInfo } from './protocol/api';
|
|
2
|
+
import type { StateOrObjectHandler } from './StateOrObjectHandler';
|
|
3
|
+
/**
|
|
4
|
+
* The device fields that may be bound to a state or an object and that the list has to know about,
|
|
5
|
+
* because they are used for filtering and for the header of a card.
|
|
6
|
+
*
|
|
7
|
+
* They are resolved centrally in `DeviceList` instead of inside every `DeviceCard`: a card that is
|
|
8
|
+
* not mounted (because it is filtered out or scrolled far out of the viewport) cannot resolve its
|
|
9
|
+
* own name, and the filter would have nothing to work with.
|
|
10
|
+
*/
|
|
11
|
+
export interface ResolvedDeviceFields {
|
|
12
|
+
name?: string;
|
|
13
|
+
identifier?: string;
|
|
14
|
+
hasDetails?: boolean;
|
|
15
|
+
icon?: string;
|
|
16
|
+
backgroundColor?: string;
|
|
17
|
+
color?: string;
|
|
18
|
+
manufacturer?: string;
|
|
19
|
+
model?: string;
|
|
20
|
+
connectionType?: ConfigConnectionType;
|
|
21
|
+
enabled?: boolean;
|
|
22
|
+
/** Resolved from `device.update.available` */
|
|
23
|
+
updateAvailable?: boolean;
|
|
24
|
+
/** Derived from the battery entry of `device.status` */
|
|
25
|
+
batteryProblem?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** Device fields that can be used for the text filter */
|
|
28
|
+
export type DeviceFilterField = 'name' | 'identifier' | 'manufacturer' | 'model';
|
|
29
|
+
export declare const EMPTY_FIELDS: ResolvedDeviceFields;
|
|
30
|
+
/**
|
|
31
|
+
* Resolves the filterable device fields of all devices of the list.
|
|
32
|
+
*
|
|
33
|
+
* All devices share a single `StateOrObjectHandler`, so several devices that refer to the same
|
|
34
|
+
* object or state result in exactly one `getObject`/`subscribeObject` on the socket.
|
|
35
|
+
*/
|
|
36
|
+
export declare class DeviceFieldsResolver {
|
|
37
|
+
private readonly handler;
|
|
38
|
+
private readonly onChange;
|
|
39
|
+
private readonly entries;
|
|
40
|
+
private notifyTimer;
|
|
41
|
+
private destroyed;
|
|
42
|
+
/**
|
|
43
|
+
* @param handler shared handler used for all subscriptions
|
|
44
|
+
* @param onChange called (coalesced) whenever at least one resolved value changed
|
|
45
|
+
*/
|
|
46
|
+
constructor(handler: StateOrObjectHandler, onChange: () => void);
|
|
47
|
+
/** Resolved values of one device. Never `undefined`, so the cards can rely on the object */
|
|
48
|
+
getValues(key: string): ResolvedDeviceFields;
|
|
49
|
+
/** All distinct, sorted model values found so far (used for the model filter dropdown) */
|
|
50
|
+
getModels(): string[];
|
|
51
|
+
/**
|
|
52
|
+
* Synchronize the subscriptions with the given device list.
|
|
53
|
+
*
|
|
54
|
+
* Devices that disappeared are unsubscribed, new ones are subscribed and for the devices that
|
|
55
|
+
* stayed only those fields are re-subscribed whose source actually changed. Literal values are
|
|
56
|
+
* resolved synchronously, so right after this call the list can already filter on them.
|
|
57
|
+
*
|
|
58
|
+
* @param devices the devices with their (pre-computed) key
|
|
59
|
+
*/
|
|
60
|
+
setDevices(devices: {
|
|
61
|
+
key: string;
|
|
62
|
+
device: DeviceInfo;
|
|
63
|
+
}[]): void;
|
|
64
|
+
destroy(): void;
|
|
65
|
+
/** (Re-)subscribe all fields of one device whose source changed */
|
|
66
|
+
private syncEntry;
|
|
67
|
+
private syncField;
|
|
68
|
+
private disposeEntry;
|
|
69
|
+
private disposeSubscription;
|
|
70
|
+
/**
|
|
71
|
+
* Values arrive one by one - a single device already produces a dozen callbacks. Without this
|
|
72
|
+
* throttle every one of them would re-render the complete list.
|
|
73
|
+
*/
|
|
74
|
+
private scheduleNotify;
|
|
75
|
+
}
|