Skip to content

Commit

Permalink
mapping 9.007 to PercentType, sync for KNX2 PR openhab#3410
Browse files Browse the repository at this point in the history
  • Loading branch information
lewie committed Mar 28, 2018
1 parent f1b5028 commit be82986
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public KNXCoreTypeMapper() {
*/
dptMainTypeMap.put(9, DecimalType.class);
/** Exceptions Datapoint Types "2-Octet Float Value", Main number 9 */
// Example: dptTypeMap.put(DPTXlator2ByteFloat.DPT_TEMPERATURE.getID(), DecimalType.class);
dptTypeMap.put(DPTXlator2ByteFloat.DPT_HUMIDITY.getID(), PercentType.class);

/**
* MainType: 10
Expand Down Expand Up @@ -611,6 +611,7 @@ public String toDPTValue(Type type, String dptID) {
return null;
}

@Override
public Type toType(Datapoint datapoint, byte[] data) {
try {
DPTXlator translator = TranslatorTypes.createTranslator(datapoint.getMainNumber(), datapoint.getDPT());
Expand Down Expand Up @@ -807,6 +808,7 @@ public Type toType(Datapoint datapoint, byte[] data) {
* @param dptId the datapoint type id
* @return the openHAB type (command or state) class or {@code null} if the datapoint type id is not supported.
*/
@Override
public Class<? extends Type> toTypeClass(String dptId) {
Class<? extends Type> ohClass = dptTypeMap.get(dptId);
if (ohClass == null) {
Expand Down

0 comments on commit be82986

Please sign in to comment.