Skip to content

Commit

Permalink
Do not update spotWdith or spotHeight if equal 0
Browse files Browse the repository at this point in the history
  • Loading branch information
arensman committed Dec 3, 2023
1 parent e946cf3 commit bfd171a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,12 @@ function updateRobot(robot, callback) {
adapter.setState(robot.name + '.status.modelName', state.meta.modelName, true);
adapter.setState(robot.name + '.status.firmware', state.meta.firmware, true);
adapter.setState(robot.name + '.commands.eco', robot.eco, true);
adapter.setState(robot.name + '.commands.spotWidth', robot.spotWidth, true);
adapter.setState(robot.name + '.commands.spotHeight', robot.spotHeight, true);
if (robot.spotWidth) {
adapter.setState(robot.name + '.commands.spotWidth', robot.spotWidth, true);
}
if (robot.spotHeight) {
adapter.setState(robot.name + '.commands.spotHeight', robot.spotHeight, true);
}
adapter.setState(robot.name + '.commands.spotRepeat', robot.spotRepeat, true);
if (typeof callback === 'function') {
callback(null);
Expand Down

0 comments on commit bfd171a

Please sign in to comment.