@iobroker/dm-gui-components 9.0.17 → 9.0.21
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 +2 -2
- package/build/DeviceControl.js +17 -29
- package/build/DeviceControl.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,7 +78,7 @@ These names are supported for backward compatibility. Prefer the names from the
|
|
|
78
78
|
| `fa-stop` | Stop | Stop |
|
|
79
79
|
| `fa-pause` | Pause | Pause |
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
Unrecognized FA names render a **QuestionMark** icon.
|
|
82
82
|
|
|
83
83
|
<!--
|
|
84
84
|
Placeholder for the next version (at the beginning of the line):
|
|
@@ -86,7 +86,7 @@ Font Awesome names can be prefixed with `fa-solid` (it is stripped automatically
|
|
|
86
86
|
-->
|
|
87
87
|
|
|
88
88
|
## Changelog
|
|
89
|
-
### 9.0.
|
|
89
|
+
### 9.0.21 (2026-03-29)
|
|
90
90
|
- (@GermanBluefox) Layout improved
|
|
91
91
|
|
|
92
92
|
### 9.0.7 (2026-03-27)
|
package/build/DeviceControl.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import { Button, Fab, FormControl, InputLabel, MenuItem, Select, Switch,
|
|
2
|
+
import { Button, Fab, FormControl, InputLabel, MenuItem, Select, Switch, Slider, TextField, InputAdornment, FormControlLabel, } from '@mui/material';
|
|
3
3
|
import { Icon } from '@iobroker/adapter-react-v5';
|
|
4
4
|
import { renderControlIcon, getTranslation } from './Utils';
|
|
5
5
|
/**
|
|
@@ -25,27 +25,9 @@ export default class DeviceControlComponent extends Component {
|
|
|
25
25
|
// read an object to get min and max
|
|
26
26
|
void this.props.socket.getObject(this.props.control.stateId).then(obj => {
|
|
27
27
|
if (obj?.common) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
if (min === undefined) {
|
|
33
|
-
min = 0;
|
|
34
|
-
}
|
|
35
|
-
let max = this.props.control.max;
|
|
36
|
-
if (max === undefined) {
|
|
37
|
-
min = obj.common.max;
|
|
38
|
-
}
|
|
39
|
-
if (min === undefined) {
|
|
40
|
-
max = 100;
|
|
41
|
-
}
|
|
42
|
-
let step = this.props.control.step;
|
|
43
|
-
if (step === undefined) {
|
|
44
|
-
step = obj.common.step;
|
|
45
|
-
}
|
|
46
|
-
if (step === undefined) {
|
|
47
|
-
step = (max - min) / 100;
|
|
48
|
-
}
|
|
28
|
+
const min = this.props.control.min ?? obj.common.min ?? 0;
|
|
29
|
+
const max = this.props.control.max ?? obj.common.max ?? 100;
|
|
30
|
+
const step = this.props.control.step || obj.common.step || (max - min) / 100;
|
|
49
31
|
let unit = this.props.control.unit;
|
|
50
32
|
if (unit === undefined) {
|
|
51
33
|
unit = obj.common.unit;
|
|
@@ -225,13 +207,19 @@ export default class DeviceControlComponent extends Component {
|
|
|
225
207
|
if (this.state.min === undefined || this.state.max === undefined) {
|
|
226
208
|
return React.createElement("div", { style: { width: '100%' } }, "...");
|
|
227
209
|
}
|
|
228
|
-
return (React.createElement("div", { style: {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
210
|
+
return (React.createElement("div", { style: {
|
|
211
|
+
width: '100%',
|
|
212
|
+
minWidth: 300,
|
|
213
|
+
paddingTop: 8,
|
|
214
|
+
marginBottom: 8,
|
|
215
|
+
overflow: 'visible',
|
|
216
|
+
display: 'flex',
|
|
217
|
+
} },
|
|
218
|
+
this.props.control.label ? (React.createElement("div", { style: { color: this.props.control.color, marginBottom: 4 } }, getTranslation(this.props.control.label))) : null,
|
|
219
|
+
this.props.control.icon ? (React.createElement(Icon, { style: { color: this.props.control.color }, src: this.props.control.icon })) : null,
|
|
220
|
+
React.createElement(Slider, { style: { flexGrow: 1 }, value: parseFloat(this.state.value || '0'), min: this.state.min, max: this.state.max, step: this.state.step, valueLabelDisplay: "auto", onChange: (_e, value) => this.sendControl(this.props.deviceId, this.props.control, value) }),
|
|
221
|
+
this.props.control.iconOn ? (React.createElement(Icon, { style: { color: this.props.control.colorOn || this.props.control.color }, src: this.props.control.iconOn })) : null,
|
|
222
|
+
this.props.control.labelOn ? (React.createElement("div", { style: { color: this.props.control.colorOn || this.props.control.color } }, getTranslation(this.props.control.labelOn))) : null));
|
|
235
223
|
}
|
|
236
224
|
renderColor() {
|
|
237
225
|
return (React.createElement(TextField, { fullWidth: true, label: this.props.control.label ? getTranslation(this.props.control.label) : undefined, type: "color", value: this.state.value, onChange: (e) => this.sendControl(this.props.deviceId, this.props.control, e.target.value), variant: "standard" }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceControl.js","sourceRoot":"./src/","sources":["DeviceControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AACnD,OAAO,EACH,MAAM,EACN,GAAG,EACH,WAAW,EACX,UAAU,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,KAAK,EACL,MAAM,EACN,SAAS,EACT,cAAc,EACd,gBAAgB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAmB,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA6B5D;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,SAAiD;IACjG,YAAY,KAAyB;QACjC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACT,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG;YAC/B,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE;YAC3B,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE;SACjC,CAAC;IACN,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\n Slider,\n TextField,\n InputAdornment,\n FormControlLabel,\n} from '@mui/material';\n\nimport { type Connection, Icon } from '@iobroker/adapter-react-v5';\nimport type { DeviceId, ControlBase, ControlState, DeviceControl } from './protocol/api';\n\nimport { renderControlIcon, getTranslation } from './Utils';\n\ninterface DeviceControlProps {\n deviceId: DeviceId;\n /** Control object */\n control: DeviceControl;\n socket: Connection;\n /** Control handler to set the state */\n controlHandler: (\n deviceId: DeviceId,\n control: ControlBase,\n state: ControlState,\n ) => () => Promise<ioBroker.State | null>;\n /** Control handler to read the state */\n controlStateHandler: (deviceId: DeviceId, control: ControlBase) => () => Promise<ioBroker.State | null>;\n colors: { primary: string; secondary: string };\n disabled?: boolean;\n}\n\ninterface DeviceControlState {\n value?: ControlState;\n ts?: number;\n min?: number;\n max?: number;\n step?: number;\n unit?: string;\n options?: { label: string; value: ControlState; icon?: string; color?: string }[];\n}\n\n/**\n * Device Control component\n */\nexport default class DeviceControlComponent extends Component<DeviceControlProps, DeviceControlState> {\n constructor(props: DeviceControlProps) {\n super(props);\n this.state = {\n value: props.control.state?.val,\n ts: props.control.state?.ts,\n unit: props.control.unit || '',\n };\n }\n\n async componentDidMount(): Promise<void> {\n if (this.props.control.stateId) {\n const mayBePromise = this.props.socket.subscribeState(this.props.control.stateId, this.stateHandler);\n if (mayBePromise instanceof Promise) {\n await mayBePromise;\n }\n if (this.props.control.type === 'slider' || this.props.control.type === 'number') {\n if (this.props.control.min === undefined && this.props.control.max === undefined) {\n // read an object to get min and max\n void this.props.socket.getObject(this.props.control.stateId).then(obj => {\n if (obj?.common) {\n let min: number | undefined = this.props.control.min;\n if (min === undefined) {\n min = obj.common.min;\n }\n if (min === undefined) {\n min = 0;\n }\n let max: number | undefined = this.props.control.max;\n if (max === undefined) {\n min = obj.common.max;\n }\n if (min === undefined) {\n max = 100;\n }\n let step: number | undefined = this.props.control.step;\n if (step === undefined) {\n step = obj.common.step;\n }\n if (step === undefined) {\n step = (max! - min!) / 100;\n }\n let unit: string | undefined = this.props.control.unit;\n if (unit === undefined) {\n unit = obj.common.unit;\n }\n\n this.setState({\n min,\n max,\n step,\n unit,\n });\n }\n });\n } else {\n const min = this.props.control.min ?? 0;\n const max = this.props.control.max ?? 100;\n\n this.setState({\n min,\n max,\n step: this.props.control.step === undefined ? (max - min) / 100 : this.props.control.step,\n unit: this.props.control.unit || '',\n });\n }\n } else if (this.props.control.type === 'select') {\n if (!this.props.control.options?.length) {\n // read an object to get options\n void this.props.socket.getObject(this.props.control.stateId).then(obj => {\n if (obj?.common?.states) {\n let options: { label: string; value: ControlState }[] | undefined;\n if (typeof obj.common.states === 'string') {\n const pairs = obj.common.states.split(';');\n options = pairs.map(pair => {\n const parts = pair.split(':');\n return {\n value: parts[0],\n label: parts[1],\n };\n });\n } else if (Array.isArray(obj.common.states)) {\n options = obj.common.states.map((label: string) => ({ label, value: label }));\n } else {\n options = Object.keys(obj.common.states).map(label => ({\n label,\n value: obj.common.states[label],\n }));\n }\n\n this.setState({\n options,\n });\n }\n });\n } else {\n this.setState({\n options: this.props.control.options.map(item => ({\n label: getTranslation(item.label),\n value: item.value,\n icon: item.icon,\n color: item.color,\n })),\n });\n }\n } else if (this.props.control.type === 'info') {\n if (!this.props.control.unit) {\n // read an object to get unit\n void this.props.socket.getObject(this.props.control.stateId).then(obj => {\n if (obj?.common?.unit) {\n this.setState({\n unit: obj.common.unit,\n });\n }\n });\n }\n }\n }\n }\n\n stateHandler = async (id: string, state: ioBroker.State): Promise<void> => {\n if (id === this.props.control.stateId && state) {\n // request new state\n const newState: ioBroker.State | null = await this.props.controlStateHandler(\n this.props.deviceId,\n this.props.control,\n )();\n if (newState?.ts && (!this.state.ts || newState.ts > this.state.ts)) {\n this.setState({\n value: newState.val,\n ts: newState.ts,\n });\n }\n }\n };\n\n componentWillUnmount(): void {\n if (this.props.control.stateId) {\n this.props.socket.unsubscribeState(this.props.control.stateId, this.stateHandler);\n }\n }\n\n static getDerivedStateFromProps(\n props: DeviceControlProps,\n state: DeviceControlState,\n ): Partial<DeviceControlState> | null {\n if (props.control.state?.ts && (!state.ts || props.control.state?.ts > state.ts)) {\n return {\n value: props.control.state.val,\n ts: props.control.state.ts,\n };\n }\n\n return null;\n }\n\n async sendControl(deviceId: DeviceId, control: ControlBase, value: ControlState): Promise<void> {\n const result = await this.props.controlHandler(deviceId, control, value)();\n if (result?.ts && (!this.state.ts || result?.ts > this.state.ts)) {\n this.setState({\n value: result.val,\n ts: result.ts,\n });\n }\n }\n\n renderButton(): JSX.Element {\n const tooltip = getTranslation(this.props.control.description ?? '');\n const icon = renderControlIcon(this.props.control, this.props.colors, this.state.value);\n\n if (!this.props.control.label) {\n return (\n <Fab\n size=\"small\"\n disabled={this.props.disabled}\n title={tooltip}\n onClick={() => this.sendControl(this.props.deviceId, this.props.control, true)}\n >\n {icon}\n </Fab>\n );\n }\n return (\n <Button\n disabled={this.props.disabled}\n title={tooltip}\n onClick={() => this.sendControl(this.props.deviceId, this.props.control, true)}\n startIcon={icon}\n >\n {getTranslation(this.props.control.label)}\n </Button>\n );\n }\n\n renderSwitch(): JSX.Element {\n const tooltip = getTranslation(this.props.control.description ?? '');\n\n if (\n (this.props.control.label || this.props.control.icon) &&\n (this.props.control.labelOn || this.props.control.iconOn)\n ) {\n return (\n <div style={{ display: 'flex', gap: 8 }}>\n <div style={{ color: this.props.control.color, display: 'flex', gap: 4 }}>\n {this.props.control.label ? getTranslation(this.props.control.label) : null}\n {this.props.control.icon ? <Icon src={this.props.control.icon} /> : null}\n </div>\n <Switch\n disabled={this.props.disabled}\n title={tooltip}\n checked={!!this.state.value}\n onChange={e => this.sendControl(this.props.deviceId, this.props.control, e.target.checked)}\n />\n <div\n style={{\n color: this.props.control.colorOn || this.props.control.color,\n display: 'flex',\n gap: 4,\n }}\n >\n {this.props.control.labelOn ? getTranslation(this.props.control.labelOn) : null}\n {this.props.control.icon ? <Icon src={this.props.control.icon} /> : null}\n </div>\n </div>\n );\n }\n if (this.props.control.label || this.props.control.icon) {\n return (\n <FormControlLabel\n control={\n <Switch\n disabled={this.props.disabled}\n title={tooltip}\n checked={!!this.state.value}\n onChange={e => this.sendControl(this.props.deviceId, this.props.control, e.target.checked)}\n />\n }\n slotProps={{\n typography: {\n style: { color: this.props.control.color },\n },\n }}\n label={\n <span style={{ color: this.props.control.color, display: 'flex', gap: 4 }}>\n {this.props.control.label ? getTranslation(this.props.control.label) : null}\n {this.props.control.icon ? <Icon src={this.props.control.icon} /> : null}\n </span>\n }\n />\n );\n }\n return (\n <Switch\n disabled={this.props.disabled}\n title={tooltip}\n checked={!!this.state.value}\n onChange={e => this.sendControl(this.props.deviceId, this.props.control, e.target.checked)}\n />\n );\n }\n\n getColor(): string | undefined {\n let color: string | undefined;\n if (this.state.value) {\n color = this.props.control.colorOn || 'primary';\n } else if (this.props.control.type === 'switch') {\n color = this.props.control.color;\n }\n if (color === 'primary') {\n return this.props.colors.primary;\n }\n if (color === 'secondary') {\n return this.props.colors.secondary;\n }\n return color;\n }\n\n renderSelect(): JSX.Element {\n const anyIcons = this.state.options?.some(option => !!option.icon);\n\n return (\n <FormControl\n fullWidth\n variant=\"standard\"\n >\n {this.props.control.label ? <InputLabel>{getTranslation(this.props.control.label)}</InputLabel> : null}\n <Select\n variant=\"standard\"\n value={this.state.value}\n onChange={(e): Promise<void> =>\n this.sendControl(this.props.deviceId, this.props.control, e.target.value)\n }\n >\n {this.state.options?.map((option, i) => (\n <MenuItem\n key={i.toString()}\n value={typeof option.value === 'boolean' ? option.value.toString() : option.value!}\n style={{ color: option.color }}\n >\n {anyIcons ? (\n <Icon\n src={option.icon}\n style={{ width: 24, height: 24 }}\n />\n ) : null}\n {option.label}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n );\n }\n\n renderSlider(): JSX.Element {\n if (this.state.min === undefined || this.state.max === undefined) {\n return <div style={{ width: '100%' }}>...</div>;\n }\n return (\n <div style={{ width: '100%', minWidth: 300, paddingTop: 24, marginBottom: 8, overflow: 'visible' }}>\n {this.props.control.label ? (\n <InputLabel style={{ color: this.props.control.color, marginBottom: 4 }}>\n {getTranslation(this.props.control.label)}\n </InputLabel>\n ) : null}\n <Stack\n spacing={2}\n direction=\"row\"\n sx={{ alignItems: 'center', width: '100%' }}\n >\n {this.props.control.icon ? (\n <Icon\n style={{ color: this.props.control.color }}\n src={this.props.control.icon}\n />\n ) : null}\n <Slider\n value={parseFloat((this.state.value as string) || '0')}\n min={this.state.min}\n max={this.state.max}\n step={this.state.step}\n valueLabelDisplay=\"auto\"\n onChange={(_e, value) =>\n this.sendControl(this.props.deviceId, this.props.control, value as number)\n }\n />\n {this.props.control.iconOn ? (\n <Icon\n style={{ color: this.props.control.colorOn }}\n src={this.props.control.iconOn}\n />\n ) : null}\n {this.props.control.labelOn ? (\n <InputLabel style={{ color: this.props.control.colorOn }}>\n {getTranslation(this.props.control.labelOn)}\n </InputLabel>\n ) : null}\n </Stack>\n </div>\n );\n }\n\n renderColor(): JSX.Element {\n return (\n <TextField\n fullWidth\n label={this.props.control.label ? getTranslation(this.props.control.label) : undefined}\n type=\"color\"\n value={this.state.value as string}\n onChange={(e): Promise<void> =>\n this.sendControl(this.props.deviceId, this.props.control, e.target.value)\n }\n variant=\"standard\"\n />\n );\n }\n\n renderText(): JSX.Element {\n return (\n <TextField\n fullWidth\n label={this.props.control.label ? getTranslation(this.props.control.label) : undefined}\n value={this.state.value as string}\n onChange={(e): Promise<void> =>\n this.sendControl(this.props.deviceId, this.props.control, e.target.value)\n }\n variant=\"standard\"\n />\n );\n }\n\n renderNumber(): JSX.Element {\n return (\n <TextField\n fullWidth\n type=\"number\"\n label={this.props.control.label ? getTranslation(this.props.control.label) : undefined}\n value={this.state.value as number}\n onChange={(e): Promise<void> => {\n if (isNaN(parseFloat(e.target.value))) {\n return Promise.resolve();\n }\n return this.sendControl(this.props.deviceId, this.props.control, parseFloat(e.target.value));\n }}\n slotProps={{\n htmlInput: { min: this.state.min, max: this.state.max, step: this.state.step },\n input: {\n endAdornment: this.state.unit ? (\n <InputAdornment position=\"end\">{this.state.unit}</InputAdornment>\n ) : undefined,\n },\n }}\n variant=\"standard\"\n />\n );\n }\n\n renderIcon(): JSX.Element {\n const tooltip = getTranslation(this.props.control.description ?? '');\n const icon = renderControlIcon(this.props.control, this.props.colors, this.state.value);\n const color = this.getColor();\n const style: React.CSSProperties | undefined =\n color === this.props.colors.primary || color === this.props.colors.secondary ? {} : { color };\n const colorProps =\n color === this.props.colors.primary\n ? 'primary'\n : color === this.props.colors.secondary\n ? 'secondary'\n : undefined;\n\n if (!this.props.control.label) {\n style.width = 34;\n style.height = 34;\n style.minHeight = 34;\n\n return (\n <Fab\n disabled={this.props.disabled}\n size=\"small\"\n title={tooltip}\n color={colorProps}\n style={style}\n onClick={() => this.sendControl(this.props.deviceId, this.props.control, !this.state.value)}\n >\n {icon}\n </Fab>\n );\n }\n return (\n <Button\n disabled={this.props.disabled}\n title={tooltip}\n color={colorProps}\n style={style}\n onClick={() => this.sendControl(this.props.deviceId, this.props.control, !this.state.value)}\n startIcon={icon}\n >\n {getTranslation(this.props.control.label)}\n </Button>\n );\n }\n\n renderInfo(): JSX.Element {\n return (\n <div>\n {this.props.control.label ? <InputLabel>{getTranslation(this.props.control.label)}</InputLabel> : null}\n <span>\n {this.state.value}\n <span style={{ fontSize: 'smaller', opacity: 0.7, marginLeft: this.state.unit ? 4 : 0 }}>\n {this.state.unit}\n </span>\n </span>\n </div>\n );\n }\n\n render(): JSX.Element {\n if (this.props.control.type === 'button') {\n return this.renderButton();\n }\n\n if (this.props.control.type === 'icon') {\n return this.renderIcon();\n }\n\n if (this.props.control.type === 'switch') {\n return this.renderSwitch();\n }\n\n if (this.props.control.type === 'select') {\n return this.renderSelect();\n }\n\n if (this.props.control.type === 'slider') {\n return this.renderSlider();\n }\n\n if (this.props.control.type === 'color') {\n return this.renderColor();\n }\n\n if (this.props.control.type === 'text') {\n return this.renderText();\n }\n\n if (this.props.control.type === 'number') {\n return this.renderNumber();\n }\n\n if (this.props.control.type === 'info') {\n return this.renderInfo();\n }\n\n return <div style={{ color: 'red' }}>{this.props.control.type}</div>;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DeviceControl.js","sourceRoot":"./src/","sources":["DeviceControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AACnD,OAAO,EACH,MAAM,EACN,GAAG,EACH,WAAW,EACX,UAAU,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,MAAM,EACN,SAAS,EACT,cAAc,EACd,gBAAgB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAmB,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA6B5D;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,SAAiD;IACjG,YAAY,KAAyB;QACjC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACT,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG;YAC/B,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE;YAC3B,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE;SACjC,CAAC;IACN,CAAC;IAED,KAAK,CAAC,iBAAiB;QACnB,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YAC7B,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;YACrG,IAAI,YAAY,YAAY,OAAO,EAAE,CAAC;gBAClC,MAAM,YAAY,CAAC;YACvB,CAAC;YACD,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ,I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B,CAAC;QAED,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACrC,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;QAC7B,CAAC;QAED,OAAO,6BAAK,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAO,CAAC;IACzE,CAAC;CACJ","sourcesContent":["import React, { Component, type JSX } from 'react';\nimport {\n Button,\n Fab,\n FormControl,\n InputLabel,\n MenuItem,\n Select,\n Switch,\n Slider,\n TextField,\n InputAdornment,\n FormControlLabel,\n} from '@mui/material';\n\nimport { type Connection, Icon } from '@iobroker/adapter-react-v5';\nimport type { DeviceId, ControlBase, ControlState, DeviceControl } from './protocol/api';\n\nimport { renderControlIcon, getTranslation } from './Utils';\n\ninterface DeviceControlProps {\n deviceId: DeviceId;\n /** Control object */\n control: DeviceControl;\n socket: Connection;\n /** Control handler to set the state */\n controlHandler: (\n deviceId: DeviceId,\n control: ControlBase,\n state: ControlState,\n ) => () => Promise<ioBroker.State | null>;\n /** Control handler to read the state */\n controlStateHandler: (deviceId: DeviceId, control: ControlBase) => () => Promise<ioBroker.State | null>;\n colors: { primary: string; secondary: string };\n disabled?: boolean;\n}\n\ninterface DeviceControlState {\n value?: ControlState;\n ts?: number;\n min?: number;\n max?: number;\n step?: number;\n unit?: string;\n options?: { label: string; value: ControlState; icon?: string; color?: string }[];\n}\n\n/**\n * Device Control component\n */\nexport default class DeviceControlComponent extends Component<DeviceControlProps, DeviceControlState> {\n constructor(props: DeviceControlProps) {\n super(props);\n this.state = {\n value: props.control.state?.val,\n ts: props.control.state?.ts,\n unit: props.control.unit || '',\n };\n }\n\n async componentDidMount(): Promise<void> {\n if (this.props.control.stateId) {\n const mayBePromise = this.props.socket.subscribeState(this.props.control.stateId, this.stateHandler);\n if (mayBePromise instanceof Promise) {\n await mayBePromise;\n }\n if (this.props.control.type === 'slider' || this.props.control.type === 'number') {\n if (this.props.control.min === undefined && this.props.control.max === undefined) {\n // read an object to get min and max\n void this.props.socket.getObject(this.props.control.stateId).then(obj => {\n if (obj?.common) {\n const min: number = this.props.control.min ?? obj.common.min ?? 0;\n\n const max: number = this.props.control.max ?? obj.common.max ?? 100;\n\n const step: number = this.props.control.step || obj.common.step || (max - min) / 100;\n\n let unit: string | undefined = this.props.control.unit;\n if (unit === undefined) {\n unit = obj.common.unit;\n }\n\n this.setState({\n min,\n max,\n step,\n unit,\n });\n }\n });\n } else {\n const min = this.props.control.min ?? 0;\n const max = this.props.control.max ?? 100;\n\n this.setState({\n min,\n max,\n step: this.props.control.step === undefined ? (max - min) / 100 : this.props.control.step,\n unit: this.props.control.unit || '',\n });\n }\n } else if (this.props.control.type === 'select') {\n if (!this.props.control.options?.length) {\n // read an object to get options\n void this.props.socket.getObject(this.props.control.stateId).then(obj => {\n if (obj?.common?.states) {\n let options: { label: string; value: ControlState }[] | undefined;\n if (typeof obj.common.states === 'string') {\n const pairs = obj.common.states.split(';');\n options = pairs.map(pair => {\n const parts = pair.split(':');\n return {\n value: parts[0],\n label: parts[1],\n };\n });\n } else if (Array.isArray(obj.common.states)) {\n options = obj.common.states.map((label: string) => ({ label, value: label }));\n } else {\n options = Object.keys(obj.common.states).map(label => ({\n label,\n value: obj.common.states[label],\n }));\n }\n\n this.setState({\n options,\n });\n }\n });\n } else {\n this.setState({\n options: this.props.control.options.map(item => ({\n label: getTranslation(item.label),\n value: item.value,\n icon: item.icon,\n color: item.color,\n })),\n });\n }\n } else if (this.props.control.type === 'info') {\n if (!this.props.control.unit) {\n // read an object to get unit\n void this.props.socket.getObject(this.props.control.stateId).then(obj => {\n if (obj?.common?.unit) {\n this.setState({\n unit: obj.common.unit,\n });\n }\n });\n }\n }\n }\n }\n\n stateHandler = async (id: string, state: ioBroker.State): Promise<void> => {\n if (id === this.props.control.stateId && state) {\n // request new state\n const newState: ioBroker.State | null = await this.props.controlStateHandler(\n this.props.deviceId,\n this.props.control,\n )();\n if (newState?.ts && (!this.state.ts || newState.ts > this.state.ts)) {\n this.setState({\n value: newState.val,\n ts: newState.ts,\n });\n }\n }\n };\n\n componentWillUnmount(): void {\n if (this.props.control.stateId) {\n this.props.socket.unsubscribeState(this.props.control.stateId, this.stateHandler);\n }\n }\n\n static getDerivedStateFromProps(\n props: DeviceControlProps,\n state: DeviceControlState,\n ): Partial<DeviceControlState> | null {\n if (props.control.state?.ts && (!state.ts || props.control.state?.ts > state.ts)) {\n return {\n value: props.control.state.val,\n ts: props.control.state.ts,\n };\n }\n\n return null;\n }\n\n async sendControl(deviceId: DeviceId, control: ControlBase, value: ControlState): Promise<void> {\n const result = await this.props.controlHandler(deviceId, control, value)();\n if (result?.ts && (!this.state.ts || result?.ts > this.state.ts)) {\n this.setState({\n value: result.val,\n ts: result.ts,\n });\n }\n }\n\n renderButton(): JSX.Element {\n const tooltip = getTranslation(this.props.control.description ?? '');\n const icon = renderControlIcon(this.props.control, this.props.colors, this.state.value);\n\n if (!this.props.control.label) {\n return (\n <Fab\n size=\"small\"\n disabled={this.props.disabled}\n title={tooltip}\n onClick={() => this.sendControl(this.props.deviceId, this.props.control, true)}\n >\n {icon}\n </Fab>\n );\n }\n return (\n <Button\n disabled={this.props.disabled}\n title={tooltip}\n onClick={() => this.sendControl(this.props.deviceId, this.props.control, true)}\n startIcon={icon}\n >\n {getTranslation(this.props.control.label)}\n </Button>\n );\n }\n\n renderSwitch(): JSX.Element {\n const tooltip = getTranslation(this.props.control.description ?? '');\n\n if (\n (this.props.control.label || this.props.control.icon) &&\n (this.props.control.labelOn || this.props.control.iconOn)\n ) {\n return (\n <div style={{ display: 'flex', gap: 8 }}>\n <div style={{ color: this.props.control.color, display: 'flex', gap: 4 }}>\n {this.props.control.label ? getTranslation(this.props.control.label) : null}\n {this.props.control.icon ? <Icon src={this.props.control.icon} /> : null}\n </div>\n <Switch\n disabled={this.props.disabled}\n title={tooltip}\n checked={!!this.state.value}\n onChange={e => this.sendControl(this.props.deviceId, this.props.control, e.target.checked)}\n />\n <div\n style={{\n color: this.props.control.colorOn || this.props.control.color,\n display: 'flex',\n gap: 4,\n }}\n >\n {this.props.control.labelOn ? getTranslation(this.props.control.labelOn) : null}\n {this.props.control.icon ? <Icon src={this.props.control.icon} /> : null}\n </div>\n </div>\n );\n }\n if (this.props.control.label || this.props.control.icon) {\n return (\n <FormControlLabel\n control={\n <Switch\n disabled={this.props.disabled}\n title={tooltip}\n checked={!!this.state.value}\n onChange={e => this.sendControl(this.props.deviceId, this.props.control, e.target.checked)}\n />\n }\n slotProps={{\n typography: {\n style: { color: this.props.control.color },\n },\n }}\n label={\n <span style={{ color: this.props.control.color, display: 'flex', gap: 4 }}>\n {this.props.control.label ? getTranslation(this.props.control.label) : null}\n {this.props.control.icon ? <Icon src={this.props.control.icon} /> : null}\n </span>\n }\n />\n );\n }\n return (\n <Switch\n disabled={this.props.disabled}\n title={tooltip}\n checked={!!this.state.value}\n onChange={e => this.sendControl(this.props.deviceId, this.props.control, e.target.checked)}\n />\n );\n }\n\n getColor(): string | undefined {\n let color: string | undefined;\n if (this.state.value) {\n color = this.props.control.colorOn || 'primary';\n } else if (this.props.control.type === 'switch') {\n color = this.props.control.color;\n }\n if (color === 'primary') {\n return this.props.colors.primary;\n }\n if (color === 'secondary') {\n return this.props.colors.secondary;\n }\n return color;\n }\n\n renderSelect(): JSX.Element {\n const anyIcons = this.state.options?.some(option => !!option.icon);\n\n return (\n <FormControl\n fullWidth\n variant=\"standard\"\n >\n {this.props.control.label ? <InputLabel>{getTranslation(this.props.control.label)}</InputLabel> : null}\n <Select\n variant=\"standard\"\n value={this.state.value}\n onChange={(e): Promise<void> =>\n this.sendControl(this.props.deviceId, this.props.control, e.target.value)\n }\n >\n {this.state.options?.map((option, i) => (\n <MenuItem\n key={i.toString()}\n value={typeof option.value === 'boolean' ? option.value.toString() : option.value!}\n style={{ color: option.color }}\n >\n {anyIcons ? (\n <Icon\n src={option.icon}\n style={{ width: 24, height: 24 }}\n />\n ) : null}\n {option.label}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n );\n }\n\n renderSlider(): JSX.Element {\n if (this.state.min === undefined || this.state.max === undefined) {\n return <div style={{ width: '100%' }}>...</div>;\n }\n return (\n <div\n style={{\n width: '100%',\n minWidth: 300,\n paddingTop: 8,\n marginBottom: 8,\n overflow: 'visible',\n display: 'flex',\n }}\n >\n {this.props.control.label ? (\n <div style={{ color: this.props.control.color, marginBottom: 4 }}>\n {getTranslation(this.props.control.label)}\n </div>\n ) : null}\n {this.props.control.icon ? (\n <Icon\n style={{ color: this.props.control.color }}\n src={this.props.control.icon}\n />\n ) : null}\n <Slider\n style={{ flexGrow: 1 }}\n value={parseFloat((this.state.value as string) || '0')}\n min={this.state.min}\n max={this.state.max}\n step={this.state.step}\n valueLabelDisplay=\"auto\"\n onChange={(_e, value) => this.sendControl(this.props.deviceId, this.props.control, value as number)}\n />\n {this.props.control.iconOn ? (\n <Icon\n style={{ color: this.props.control.colorOn || this.props.control.color }}\n src={this.props.control.iconOn}\n />\n ) : null}\n {this.props.control.labelOn ? (\n <div style={{ color: this.props.control.colorOn || this.props.control.color }}>\n {getTranslation(this.props.control.labelOn)}\n </div>\n ) : null}\n </div>\n );\n }\n\n renderColor(): JSX.Element {\n return (\n <TextField\n fullWidth\n label={this.props.control.label ? getTranslation(this.props.control.label) : undefined}\n type=\"color\"\n value={this.state.value as string}\n onChange={(e): Promise<void> =>\n this.sendControl(this.props.deviceId, this.props.control, e.target.value)\n }\n variant=\"standard\"\n />\n );\n }\n\n renderText(): JSX.Element {\n return (\n <TextField\n fullWidth\n label={this.props.control.label ? getTranslation(this.props.control.label) : undefined}\n value={this.state.value as string}\n onChange={(e): Promise<void> =>\n this.sendControl(this.props.deviceId, this.props.control, e.target.value)\n }\n variant=\"standard\"\n />\n );\n }\n\n renderNumber(): JSX.Element {\n return (\n <TextField\n fullWidth\n type=\"number\"\n label={this.props.control.label ? getTranslation(this.props.control.label) : undefined}\n value={this.state.value as number}\n onChange={(e): Promise<void> => {\n if (isNaN(parseFloat(e.target.value))) {\n return Promise.resolve();\n }\n return this.sendControl(this.props.deviceId, this.props.control, parseFloat(e.target.value));\n }}\n slotProps={{\n htmlInput: { min: this.state.min, max: this.state.max, step: this.state.step },\n input: {\n endAdornment: this.state.unit ? (\n <InputAdornment position=\"end\">{this.state.unit}</InputAdornment>\n ) : undefined,\n },\n }}\n variant=\"standard\"\n />\n );\n }\n\n renderIcon(): JSX.Element {\n const tooltip = getTranslation(this.props.control.description ?? '');\n const icon = renderControlIcon(this.props.control, this.props.colors, this.state.value);\n const color = this.getColor();\n const style: React.CSSProperties | undefined =\n color === this.props.colors.primary || color === this.props.colors.secondary ? {} : { color };\n const colorProps =\n color === this.props.colors.primary\n ? 'primary'\n : color === this.props.colors.secondary\n ? 'secondary'\n : undefined;\n\n if (!this.props.control.label) {\n style.width = 34;\n style.height = 34;\n style.minHeight = 34;\n\n return (\n <Fab\n disabled={this.props.disabled}\n size=\"small\"\n title={tooltip}\n color={colorProps}\n style={style}\n onClick={() => this.sendControl(this.props.deviceId, this.props.control, !this.state.value)}\n >\n {icon}\n </Fab>\n );\n }\n return (\n <Button\n disabled={this.props.disabled}\n title={tooltip}\n color={colorProps}\n style={style}\n onClick={() => this.sendControl(this.props.deviceId, this.props.control, !this.state.value)}\n startIcon={icon}\n >\n {getTranslation(this.props.control.label)}\n </Button>\n );\n }\n\n renderInfo(): JSX.Element {\n return (\n <div>\n {this.props.control.label ? <InputLabel>{getTranslation(this.props.control.label)}</InputLabel> : null}\n <span>\n {this.state.value}\n <span style={{ fontSize: 'smaller', opacity: 0.7, marginLeft: this.state.unit ? 4 : 0 }}>\n {this.state.unit}\n </span>\n </span>\n </div>\n );\n }\n\n render(): JSX.Element {\n if (this.props.control.type === 'button') {\n return this.renderButton();\n }\n\n if (this.props.control.type === 'icon') {\n return this.renderIcon();\n }\n\n if (this.props.control.type === 'switch') {\n return this.renderSwitch();\n }\n\n if (this.props.control.type === 'select') {\n return this.renderSelect();\n }\n\n if (this.props.control.type === 'slider') {\n return this.renderSlider();\n }\n\n if (this.props.control.type === 'color') {\n return this.renderColor();\n }\n\n if (this.props.control.type === 'text') {\n return this.renderText();\n }\n\n if (this.props.control.type === 'number') {\n return this.renderNumber();\n }\n\n if (this.props.control.type === 'info') {\n return this.renderInfo();\n }\n\n return <div style={{ color: 'red' }}>{this.props.control.type}</div>;\n }\n}\n"]}
|