[tacmi] TA-CMI: Fixed some issues when percent values are received or updated (#9061)

Fixes #8927

Signed-off-by: Christian Niessner <github-marvkis@christian-niessner.de>
This commit is contained in:
Christian Niessner 2020-11-22 10:32:04 +01:00 committed by GitHub
parent 06d367a0dd
commit c83af2c66d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -342,7 +342,8 @@ public class ApiPageParser extends AbstractSimpleMarkupHandler {
channelType = "Number:Temperature";
state = new QuantityType<>(bd, SIUnits.CELSIUS);
} else if ("%".equals(valParts[1])) {
channelType = "Number:Percent";
// channelType = "Number:Percent"; Number:Percent is currently not handled...
channelType = "Number:Dimensionless";
state = new QuantityType<>(bd, SmartHomeUnits.PERCENT);
} else if ("Imp".equals(valParts[1])) {
// impulses - no idea how to map this to something useful here?

View File

@ -250,6 +250,17 @@ public class TACmiSchemaHandler extends BaseThingHandler {
return;
}
break;
case NUMERIC_FORM:
ChangerX2Entry cx2en = e.changerX2Entry;
if (cx2en != null) {
reqUpdate = prepareRequest(buildUri("INCLUDE/change.cgi?changeadrx2=" + cx2en.address
+ "&changetox2=" + command.format("%.2f")));
reqUpdate.header(HttpHeader.REFERER, this.serverBase + "schema.html"); // required...
} else {
logger.debug("Got command for uninitalized channel {}: {}", channelUID, command);
return;
}
break;
case READ_ONLY_NUMERIC:
case READ_ONLY_STATE:
case READ_ONLY_SWITCH: