Skip to content

Commit a733cc2

Browse files
authored
Merge pull request #49 from ShellyUSA/DanielWinks
Make sure cover is only set to 0-100 and not below or above
2 parents f7ecf1e + e9a2012 commit a733cc2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ShellyDriverLibrary/ShellyUSA.ShellyUSA_Driver_Library.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@ void setCoverState(String value, Integer id = 0) {
13751375
}
13761376
}
13771377

1378-
void setChildCoverPosition(Integer position, ChildDeviceWrapper child) {child?.setCoverPosition(position)}
1378+
void setChildCoverPosition(Integer position, ChildDeviceWrapper child) {child?.setCoverPosition(boundedLevel(position))}
13791379

13801380
@CompileStatic
13811381
void setCoverPosition(Integer position, Integer id = 0) {
@@ -2261,7 +2261,7 @@ void processGen2JsonMessageBody(LinkedHashMap<String, Object> json, Integer id =
22612261
id = update?.id as Integer
22622262
if(update?.current_pos != null) {
22632263
Integer current_pos = update?.current_pos as Integer
2264-
if(current_pos != null) { setCoverPosition(current_pos, id) }
2264+
if(current_pos != null) { setCoverPosition(boundedLevel(current_pos), id) }
22652265
}
22662266
if(update?.state != null) {
22672267
String coverState = update?.state as String

0 commit comments

Comments
 (0)