Skip to content

Commit

Permalink
set default value for customizedValues if no value
Browse files Browse the repository at this point in the history
  • Loading branch information
NebzHB authored Sep 17, 2024
1 parent 4d807d8 commit 2fd9e86
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4557,23 +4557,23 @@ JeedomPlatform.prototype.getAccessoryValue = function(characteristic, service, i
cmd.generic_type == 'BARRIER_STATE') {
targetValueToTest=cmd.currentValue.toString();
switch(targetValueToTest) {
case customizedValues.OPEN.toString() :
case (customizedValues.OPEN ?? 255).toString() :
returnValue=Characteristic.TargetDoorState.OPEN; // 0
HRreturnValue="OPEN";
break;
case customizedValues.CLOSED.toString() :
case (customizedValues.CLOSED ?? 0).toString() :
returnValue=Characteristic.TargetDoorState.CLOSED; // 1
HRreturnValue="CLOSED";
break;
case customizedValues.OPENING.toString() :
case (customizedValues.OPENING ?? 254).toString() :
returnValue=Characteristic.TargetDoorState.OPEN; // 0
HRreturnValue="OPEN";
break;
case customizedValues.CLOSING.toString() :
case (customizedValues.CLOSING ?? 252).toString() :
returnValue=Characteristic.TargetDoorState.CLOSED; // 1
HRreturnValue="CLOSED";
break;
case customizedValues.STOPPED.toString() :
case (customizedValues.STOPPED ?? 253).toString() :
returnValue=Characteristic.TargetDoorState.CLOSED; // 1
HRreturnValue="CLOSED";
break;
Expand All @@ -4594,23 +4594,23 @@ JeedomPlatform.prototype.getAccessoryValue = function(characteristic, service, i
cmd.generic_type == 'BARRIER_STATE') {
currentValueToTest=cmd.currentValue.toString();
switch(currentValueToTest) {
case customizedValues.OPEN.toString() :
case (customizedValues.OPEN ?? 255).toString() :
returnValue=Characteristic.CurrentDoorState.OPEN; // 0
HRreturnValue="OPEN";
break;
case customizedValues.CLOSED.toString() :
case (customizedValues.CLOSED ?? 0).toString() :
returnValue=Characteristic.CurrentDoorState.CLOSED; // 1
HRreturnValue="CLOSED";
break;
case customizedValues.OPENING.toString() :
case (customizedValues.OPENING ?? 254).toString() :
returnValue=Characteristic.CurrentDoorState.OPENING; // 2
HRreturnValue="OPENING";
break;
case customizedValues.CLOSING.toString() :
case (customizedValues.CLOSING ?? 252).toString() :
returnValue=Characteristic.CurrentDoorState.CLOSING; // 3
HRreturnValue="CLOSING";
break;
case customizedValues.STOPPED.toString() :
case (customizedValues.STOPPED ?? 253).toString() :
returnValue=Characteristic.CurrentDoorState.STOPPED; // 4
HRreturnValue="STOPPED";
break;
Expand Down

0 comments on commit 2fd9e86

Please sign in to comment.