sysutils/nut: add apcsmart driver (#781)

This commit is contained in:
Michael
2018-08-12 12:23:36 +02:00
committed by Franco Fichtner
parent afb93f56a6
commit a0483bad7d
4 changed files with 33 additions and 2 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
PLUGIN_NAME= nut
PLUGIN_VERSION= 1.0
PLUGIN_VERSION= 1.1
PLUGIN_COMMENT= Network UPS Tools
PLUGIN_DEPENDS= nut
PLUGIN_MAINTAINER= m.muenz@gmail.com
@@ -50,6 +50,20 @@
<help>Set extra arguments for this UPS, e.g. "port=auto".</help>
</field>
</subtab>
<subtab id="nut-ups-apcsmart" description="APCSMART-Driver">
<field>
<id>nut.apcsmart.enable</id>
<label>Enable</label>
<type>checkbox</type>
<help>Enable the APCSMART driver.</help>
</field>
<field>
<id>nut.apcsmart.args</id>
<label>Extra Arguments</label>
<type>text</type>
<help>Set extra arguments for this UPS, e.g. "port=auto".</help>
</field>
</subtab>
<subtab id="nut-ups-netclient" description="Netclient">
<field>
<id>nut.netclient.enable</id>
@@ -1,7 +1,7 @@
<model>
<mount>//OPNsense/Nut</mount>
<description>Network UPS Tools</description>
<version>1.0.0</version>
<version>1.0.1</version>
<items>
<general>
<enable type="BooleanField">
@@ -43,6 +43,16 @@
<Required>N</Required>
</args>
</usbhid>
<apcsmart>
<enable type="BooleanField">
<Required>Y</Required>
<default>0</default>
</enable>
<args type="TextField">
<default>port=auto</default>
<Required>N</Required>
</args>
</apcsmart>
<netclient>
<enable type="BooleanField">
<Required>Y</Required>
@@ -9,4 +9,11 @@ driver=usbhid-ups
{{ OPNsense.Nut.usbhid.args }}
{% endif %}
{% endif %}
{% if helpers.exists('OPNsense.Nut.apcsmart.enable') and OPNsense.Nut.apcsmart.enable == '1' %}
[{{ OPNsense.Nut.general.name }}]
driver=apcsmart
{% if helpers.exists('OPNsense.Nut.apcsmart.args') and OPNsense.Nut.apcsmart.args != '' %}
{{ OPNsense.Nut.apcsmart.args }}
{% endif %}
{% endif %}
{% endif %}