mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[mqtt] fix UnDefType comparison in PercentageValue (#16639)
Signed-off-by: Cody Cutrer <cody@cutrer.us> Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
parent
93370fc51d
commit
b2db309512
@ -73,7 +73,7 @@ public class PercentageValue extends Value {
|
||||
|
||||
@Override
|
||||
public PercentType parseCommand(Command command) throws IllegalArgumentException {
|
||||
PercentType oldvalue = (state == UnDefType.UNDEF) ? new PercentType() : (PercentType) state;
|
||||
PercentType oldvalue = (state instanceof UnDefType) ? new PercentType() : (PercentType) state;
|
||||
// Nothing do to -> We have received a percentage
|
||||
if (command instanceof PercentType percent) {
|
||||
return percent;
|
||||
|
Loading…
Reference in New Issue
Block a user