[knx] Fix DPT 10 handling (#15082)

Signed-off-by: Karel Goderis <karel.goderis@me.com>
This commit is contained in:
Karel Goderis 2023-06-11 12:15:23 +02:00 committed by GitHub
parent 4eec1a7f47
commit 14726013b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -215,8 +215,11 @@ public class ValueDecoder {
try { try {
date = new SimpleDateFormat(TIME_DAY_FORMAT, Locale.US).parse(value); date = new SimpleDateFormat(TIME_DAY_FORMAT, Locale.US).parse(value);
} catch (ParseException pe) { } catch (ParseException pe) {
date = new SimpleDateFormat(TIME_FORMAT, Locale.US).parse(value); try {
throw pe; date = new SimpleDateFormat(TIME_FORMAT, Locale.US).parse(value);
} catch (ParseException pe2) {
throw pe2;
}
} }
return DateTimeType.valueOf(new SimpleDateFormat(DateTimeType.DATE_PATTERN).format(date)); return DateTimeType.valueOf(new SimpleDateFormat(DateTimeType.DATE_PATTERN).format(date));
} }