You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/definition-schema.d.ts
+29-8Lines changed: 29 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -5,28 +5,37 @@
5
5
* and run json-schema-to-typescript to regenerate this file.
6
6
*/
7
7
8
+
/**
9
+
* The main heading displayed above the switch controls. Use to describe the control group (e.g., 'Light Controls', 'Pump Switches').
10
+
*/
8
11
exporttypeTitle=string;
12
+
/**
13
+
* Secondary text displayed below the title. Use for additional context like location, device group, or instructions.
14
+
*/
9
15
exporttypeSubtitle=string;
10
16
/**
11
-
* The label for the switch.
17
+
* Display text identifying this switch. Should clearly describe what the switch controls (e.g., 'Main Power', 'Pump 1', 'Night Mode').
12
18
*/
13
19
exporttypeLabel=string;
14
20
/**
15
-
* The value or list of values that represent the ON state. You can also use an expression like <4 or >33 to specify a numeric range. If a value matches an ON and an OFF state, the ON state will be used.
21
+
* Values that indicate the ON state. Can be: a single value ('1', 'true', 'ON'), comma-separated list ('1,true,ON'), or numeric expression ('<4' means values below 4 are ON, '>33' means values above 33 are ON). If a value matches both ON and OFF, ON takes precedence.
16
22
*/
17
23
exporttypeONValues=string;
18
24
/**
19
-
* The value or list of values that represent the OFF state. You can also use an expression like <4 or >33 to specify a numeric range. If a value matches an ON and an OFF state, the ON state will be used.
25
+
* Values that indicate the OFF state. Can be: a single value ('0', 'false', 'OFF'), comma-separated list ('0,false,OFF'), or numeric expression ('<4' means values below 4 are OFF, '>33' means values above 33 are OFF). Values matching neither ON nor OFF show as UNKNOWN.
20
26
*/
21
27
exporttypeOFFValues=string;
22
28
/**
23
-
* Is not strictly required, but is strongly recommended to be connected to the backend column that represents the switch state. This keeps the switch visual state consistent with its physical state.
29
+
* The current state value from the backend, used to display the correct switch position. Strongly recommended to bind this to the actual device state column to keep the visual state synchronized with the physical device state.
24
30
*/
25
31
exporttypeSwitchState=string;
26
32
/**
27
-
* The action topic that is called at the selected app at the selected device when clicking the switch. The arguments will be True for 'ON' and False for 'OFF'. Refer to the documentation of the appfor available topics to call.
33
+
* The specific command/topic sent to the app when the switch is clicked. Arguments sent are: True for turning ON, False for turning OFF. Refer to the app's documentation for available topics.
28
34
*/
29
35
exporttypeActionAppTopic=string;
36
+
/**
37
+
* Array of switch configurations. Each entry creates a toggle switch with its own state mapping and optional device action binding.
38
+
*/
30
39
exporttypeSwitches={
31
40
label?: Label;
32
41
stateMap?: StateMap;
@@ -38,40 +47,52 @@ export type Switches = {
38
47
[k: string]: unknown;
39
48
}[];
40
49
50
+
/**
51
+
* A toggle switch widget for displaying and controlling binary device states. Use this widget to show ON/OFF status indicators that can also trigger device actions when clicked. Supports configurable state mapping to interpret various data values as ON, OFF, or UNKNOWN states. When connected to a device action, clicking the switch sends commands to control physical devices or trigger backend operations. Multiple switches can be displayed in one widget. Ideal for IoT device control panels, smart home interfaces, equipment control dashboards, or any scenario requiring visual toggle controls with action capabilities.
52
+
*/
41
53
exportinterfaceInputData{
42
54
title?: Title;
43
55
subTitle?: Subtitle;
44
56
dataseries?: Switches;
45
57
[k: string]: unknown;
46
58
}
47
59
/**
48
-
* Specify the values for the ON and OFF states. Any value that does not match to either an ON or OFF state will be considered as UNKNOWN.
60
+
* Defines how data values are interpreted as switch states. Configure which values represent ON and OFF. Values not matching either state display as UNKNOWN (neutral position).
49
61
*/
50
62
exportinterfaceStateMap{
51
63
on?: ONValues;
52
64
off?: OFFValues;
53
65
[k: string]: unknown;
54
66
}
55
67
/**
56
-
* The device that should handle the click on the switch. The 'Device ID' column can be used here when using data driven mode.
68
+
* The device that receives commands when the switch is clicked. In data-driven mode, bind to a 'Device ID' column to dynamically target different devices per row.
57
69
*/
58
70
exportinterfaceActionDeviceTarget{
59
71
[k: string]: unknown;
60
72
}
61
73
/**
62
-
* The app that should handle the click on the switch.
74
+
* The application/service on the target device that handles the switch command. Select from available apps installed on the device.
63
75
*/
64
76
exportinterfaceActionApp{
65
77
[k: string]: unknown;
66
78
}
79
+
/**
80
+
* Visual styling options for the switch and its label.
81
+
*/
67
82
exportinterfaceStyling{
68
83
labelColor?: LabelColor;
69
84
valueColor?: ValueColor;
70
85
[k: string]: unknown;
71
86
}
87
+
/**
88
+
* Color of the switch label text.
89
+
*/
72
90
exportinterfaceLabelColor{
73
91
[k: string]: unknown;
74
92
}
93
+
/**
94
+
* Color of the state value text displayed with the switch.
0 commit comments