Skip to content

Commit e3d4922

Browse files
author
Marko Petzold
committed
chore: regenerate types
1 parent d7ca140 commit e3d4922

1 file changed

Lines changed: 29 additions & 8 deletions

File tree

src/definition-schema.d.ts

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,37 @@
55
* and run json-schema-to-typescript to regenerate this file.
66
*/
77

8+
/**
9+
* The main heading displayed above the switch controls. Use to describe the control group (e.g., 'Light Controls', 'Pump Switches').
10+
*/
811
export type Title = string;
12+
/**
13+
* Secondary text displayed below the title. Use for additional context like location, device group, or instructions.
14+
*/
915
export type Subtitle = string;
1016
/**
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').
1218
*/
1319
export type Label = string;
1420
/**
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.
1622
*/
1723
export type ONValues = string;
1824
/**
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.
2026
*/
2127
export type OFFValues = string;
2228
/**
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.
2430
*/
2531
export type SwitchState = string;
2632
/**
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 app for 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.
2834
*/
2935
export type ActionAppTopic = string;
36+
/**
37+
* Array of switch configurations. Each entry creates a toggle switch with its own state mapping and optional device action binding.
38+
*/
3039
export type Switches = {
3140
label?: Label;
3241
stateMap?: StateMap;
@@ -38,40 +47,52 @@ export type Switches = {
3847
[k: string]: unknown;
3948
}[];
4049

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+
*/
4153
export interface InputData {
4254
title?: Title;
4355
subTitle?: Subtitle;
4456
dataseries?: Switches;
4557
[k: string]: unknown;
4658
}
4759
/**
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).
4961
*/
5062
export interface StateMap {
5163
on?: ONValues;
5264
off?: OFFValues;
5365
[k: string]: unknown;
5466
}
5567
/**
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.
5769
*/
5870
export interface ActionDeviceTarget {
5971
[k: string]: unknown;
6072
}
6173
/**
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.
6375
*/
6476
export interface ActionApp {
6577
[k: string]: unknown;
6678
}
79+
/**
80+
* Visual styling options for the switch and its label.
81+
*/
6782
export interface Styling {
6883
labelColor?: LabelColor;
6984
valueColor?: ValueColor;
7085
[k: string]: unknown;
7186
}
87+
/**
88+
* Color of the switch label text.
89+
*/
7290
export interface LabelColor {
7391
[k: string]: unknown;
7492
}
93+
/**
94+
* Color of the state value text displayed with the switch.
95+
*/
7596
export interface ValueColor {
7697
[k: string]: unknown;
7798
}

0 commit comments

Comments
 (0)