translator, wb_editors
4265
правок
Matveevrj (обсуждение | вклад) (Новая страница: «defineRule("_system_track_vin", { whenChanged: "wb-adc/Vin", then: function() { if (dev["wb-adc"]["Vin"] < dev["wb-adc"]["BAT"] ) { dev["power_status"]["Vin"] = 0; } else { dev["power_status"]["Vin"] = dev["wb-adc"]["Vin"] ; } } });») |
Matveevrj (обсуждение | вклад) (Новая страница: «A new device "Send custom command to RS-485 port" should appear in the Devices section of the web interface.») |
||
Строка 871: | Строка 871: | ||
}, | }, | ||
"properties": { | "properties": { | ||
"temperature_setpoint": { | "temperature_setpoint": { | ||
Строка 881: | Строка 880: | ||
"maximum": 40 | "maximum": 40 | ||
}, | }, | ||
"humidity_setpoint": { | "humidity_setpoint": { | ||
"type":"number", | "type":"number", | ||
Строка 896: | Строка 893: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
2. Description of the default configuration (when saving the form in the web interface, the values will be written to this file) : /etc/test-config.conf | |||
2. | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
{ | { | ||
Строка 906: | Строка 901: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
3. Script that updates config : /mnt/data/etc/wb-rules/test-config-script.js | |||
3. | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
var config = readConfig("/etc/test-config.conf"); | var config = readConfig("/etc/test-config.conf"); | ||
log("temperature setpoint is: {}".format(config.temperature_setpoint)); | log("temperature setpoint is: {}".format(config.temperature_setpoint)); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
The last file can also be edited from the web interface on the Scripts tab. | |||
In the json file describes the schema of the output html page browser, according to generally accepted mapping standard. Description of keys here: json-schema.org ahhh! | |||
<div lang="ru" dir="ltr" class="mw-content-ltr"> | <div lang="ru" dir="ltr" class="mw-content-ltr"> |