mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 07:02:02 +01:00
[networkupstools] Add battery.temperature channel (#15812)
* Add channel battery-temperature --------- Signed-off-by: Leo Siepel <leosiepel@gmail.com>
This commit is contained in:
parent
15a673a027
commit
532476a9c6
@ -76,6 +76,7 @@ The following channels are available:
|
||||
| batteryCharge | Number:Dimensionless | % | Battery charge (percent) | no |
|
||||
| batteryRuntime | Number:Time | s | Battery runtime (seconds) | no |
|
||||
| batteryVoltage | Number:ElectricPotential | V | Battery voltage (V) | yes |
|
||||
| batteryTemperature | Number:Temperature | °C | Battery temperature (degrees C) | yes |
|
||||
|
||||
### Dynamic Channels
|
||||
|
||||
|
@ -64,7 +64,8 @@ enum NutName {
|
||||
// Battery
|
||||
BATTERY_CHARGE("batteryCharge", "battery.charge", Units.PERCENT),
|
||||
BATTERY_RUNTIME("batteryRuntime", "battery.runtime", Units.SECOND),
|
||||
BATTERY_VOLTAGE("batteryVoltage", "battery.voltage", Units.VOLT);
|
||||
BATTERY_VOLTAGE("batteryVoltage", "battery.voltage", Units.VOLT),
|
||||
BATTERY_TEMPERATURE("batteryTemperature", "battery.temperature", SIUnits.CELSIUS);
|
||||
|
||||
static final Map<String, NutName> NUT_NAME_MAP = Stream.of(NutName.values())
|
||||
.collect(Collectors.toMap(NutName::getChannelId, Function.identity()));
|
||||
|
@ -29,6 +29,8 @@ channel-type.networkupstools.battery-charge.label = Battery Charge
|
||||
channel-type.networkupstools.battery-charge.description = Battery charge (percent)
|
||||
channel-type.networkupstools.battery-runtime.label = Battery Runtime
|
||||
channel-type.networkupstools.battery-runtime.description = Battery runtime (seconds)
|
||||
channel-type.networkupstools.battery-temperature.label = Battery Temperature
|
||||
channel-type.networkupstools.battery-temperature.description = Battery temperature (degrees C)
|
||||
channel-type.networkupstools.battery-voltage.label = Battery Voltage
|
||||
channel-type.networkupstools.battery-voltage.description = Battery voltage (V)
|
||||
channel-type.networkupstools.input-current-status.label = Input Current Status
|
||||
|
@ -143,5 +143,10 @@
|
||||
<description>Battery voltage (V)</description>
|
||||
<state pattern="%.0f %unit%" readOnly="true"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="battery-temperature" advanced="true">
|
||||
<item-type>Number:Temperature</item-type>
|
||||
<label>Battery Temperature</label>
|
||||
<description>Battery temperature (degrees C)</description>
|
||||
<state pattern="%.1f %unit%" readOnly="true"/>
|
||||
</channel-type>
|
||||
</thing:thing-descriptions>
|
||||
|
@ -13,6 +13,7 @@
|
||||
<channel id="batteryCharge" typeId="battery-charge"/>
|
||||
<channel id="batteryRuntime" typeId="battery-runtime"/>
|
||||
<channel id="batteryVoltage" typeId="battery-voltage"/>
|
||||
<channel id="batteryTemperature" typeId="battery-temperature"/>
|
||||
<channel id="inputRealpower" typeId="input-realpower"/>
|
||||
<channel id="inputVoltageStatus" typeId="input-voltage-status"/>
|
||||
<channel id="inputQuality" typeId="input-quality"/>
|
||||
@ -32,6 +33,10 @@
|
||||
<channel id="upsTestResult" typeId="ups-test-result"/>
|
||||
</channels>
|
||||
|
||||
<properties>
|
||||
<property name="thingTypeVersion">1</property>
|
||||
</properties>
|
||||
|
||||
<config-description-ref uri="thing-type:ups:config"/>
|
||||
</thing-type>
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<update:update-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:update="https://openhab.org/schemas/update-description/v1.0.0"
|
||||
xsi:schemaLocation="https://openhab.org/schemas/update-description/v1.0.0 https://openhab.org/schemas/update-description-1.0.0.xsd">
|
||||
|
||||
<thing-type uid="networkupstools:ups">
|
||||
|
||||
<instruction-set targetVersion="1">
|
||||
<add-channel id="batteryTemperature">
|
||||
<type>networkupstools:battery-temperature</type>
|
||||
</add-channel>
|
||||
</instruction-set>
|
||||
|
||||
</thing-type>
|
||||
|
||||
</update:update-descriptions>
|
@ -43,7 +43,7 @@ public class NutNameChannelsTest {
|
||||
private static final String THING_TYPES_XML = "thing-types.xml";
|
||||
private static final String CHANNELS_XML = "channels.xml";
|
||||
|
||||
private static final int EXPECTED_NUMBER_OF_CHANNELS = 20;
|
||||
private static final int EXPECTED_NUMBER_OF_CHANNELS = 21;
|
||||
private static final int EXPECTED_NUMMBER_OF_CHANNEL_XML_LINES = EXPECTED_NUMBER_OF_CHANNELS * 6;
|
||||
|
||||
// README table is: | Channel Name | Item Type | Unit | Description | Advanced
|
||||
|
Loading…
Reference in New Issue
Block a user