Перейти к содержанию

Навигация

Rule Examples/en: различия между версиями

Новая страница: «A new device "Send custom command to RS-485 port" should appear in the Devices section of the web interface.»
(Новая страница: «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"] ; } } });»)
(Новая страница: «A new device "Send custom command to RS-485 port" should appear in the Devices section of the web interface.»)
Строка 871: Строка 871:
},
},


<div lang="ru" dir="ltr" class="mw-content-ltr">
"properties": {
"properties": {
"temperature_setpoint": {
"temperature_setpoint": {
Строка 881: Строка 880:
"maximum": 40
"maximum": 40
},
},
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
"humidity_setpoint": {
"humidity_setpoint": {
"type":"number",
"type":"number",
Строка 896: Строка 893:
}
}
</syntaxhighlight>
</syntaxhighlight>
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
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. Описание конфигурации по умолчанию (при сохранении формы в веб интерфейсе, значения запишутся в этот файл) : /etc/test-config.conf
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
{
{
Строка 906: Строка 901:
}
}
</syntaxhighlight>
</syntaxhighlight>
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
3. Script that updates config  : /mnt/data/etc/wb-rules/test-config-script.js
3. Скрипт, обновляющий конфиг : /mnt/data/etc/wb-rules/test-config-script.js
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
var config = readConfig("/etc/test-config.conf");
var config = readConfig("/etc/test-config.conf");
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
log("temperature setpoint is: {}".format(config.temperature_setpoint));
log("temperature setpoint is: {}".format(config.temperature_setpoint));
</syntaxhighlight>
</syntaxhighlight>
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
The last file can also be edited from the web interface on the Scripts tab.
Последний файл можно в том числе редактировать из веб-интерфейса на вкладке Scripts.
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
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!
В json файлах описаны схемы вывода html странички браузером, по общепринятому стандарту отображения. Описание ключей тут: json-schema.org.
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
<div lang="ru" dir="ltr" class="mw-content-ltr">
translator, wb_editors
4265

правок