12 063
правки
(Новая страница: «It is convenient (though not necessary) to use templates to describe devices. The template (device type) is an external configuration file (located in /usr/share/…») |
(Новая страница: «To use the template in the device description in the configuration file, specify the field ''''device_type''''. Among all presented templates, a template with the…») |
||
Строка 160: | Строка 160: | ||
It is convenient (though not necessary) to use templates to describe devices. The template (device type) is an external configuration file (located in /usr/share/wb-mqtt-snmp/templates and named config-[device-type-name].json, for example, config-test-snmp.json), which contains a basic description of the device (such as the SNMP community name) and a basic description of all its channels. | It is convenient (though not necessary) to use templates to describe devices. The template (device type) is an external configuration file (located in /usr/share/wb-mqtt-snmp/templates and named config-[device-type-name].json, for example, config-test-snmp.json), which contains a basic description of the device (such as the SNMP community name) and a basic description of all its channels. | ||
To use the template in the device description in the configuration file, specify the field ''''device_type''''. Among all presented templates, a template with the same ''device_type'' value will be selected, and all fields that were not defined in the configuration file will take values from the template. | |||
Точно так же это работает с каналами. Сравнение каналов происходит по обязательному полю ''name''; если имя канала из конфигурационного файла совпадёт с именем канала в шаблоне, из шаблона будут взяты | Точно так же это работает с каналами. Сравнение каналов происходит по обязательному полю ''name''; если имя канала из конфигурационного файла совпадёт с именем канала в шаблоне, из шаблона будут взяты |
правки