mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-29 12:34:21 +02:00
[viessmann] Fix parsing of unit Seconds (#20411)
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
This commit is contained in:
+1
@@ -76,6 +76,7 @@ public class ViessmannBindingConstants {
|
||||
entry("power-kilowattHour", Units.KILOWATT_HOUR.toString()), //
|
||||
entry("heat-kilowattHour", Units.KILOWATT_HOUR.toString()), //
|
||||
entry("percent", Units.PERCENT.toString()), //
|
||||
entry("seconds", Units.SECOND.toString()), //
|
||||
entry("minute", Units.MINUTE.toString()), //
|
||||
entry("hour", Units.HOUR.toString()), //
|
||||
entry("hours", Units.HOUR.toString()), //
|
||||
|
||||
+4
-2
@@ -1497,8 +1497,10 @@ public class DeviceHandler extends ViessmannThingHandler {
|
||||
if (channelType.isBlank() || "object".equals(channelType)) {
|
||||
channelType = "string";
|
||||
}
|
||||
if ("meter".equals(msg.getUnit()) || "degree".equals(msg.getUnit())) {
|
||||
channelType = msg.getUnit();
|
||||
|
||||
String unit = msg.getUnit();
|
||||
if ("meter".equals(unit) || "degree".equals(unit) || "seconds".equals(unit)) {
|
||||
channelType = unit;
|
||||
}
|
||||
|
||||
List<String> com = msg.getAllCommands();
|
||||
|
||||
@@ -453,6 +453,17 @@
|
||||
<state pattern="%d %unit%" readOnly="true"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="seconds">
|
||||
<item-type>Number:Time</item-type>
|
||||
<label>Seconds</label>
|
||||
<category>Time</category>
|
||||
<tags>
|
||||
<tag>Status</tag>
|
||||
<tag>Duration</tag>
|
||||
</tags>
|
||||
<state pattern="%d %unit%" readOnly="true"/>
|
||||
</channel-type>
|
||||
|
||||
<channel-type id="percent">
|
||||
<item-type>Number:Dimensionless</item-type>
|
||||
<label>Percentage</label>
|
||||
|
||||
Reference in New Issue
Block a user