From b9e0e6439053816b8e46fba45e9372072ed13e19 Mon Sep 17 00:00:00 2001 From: Luis R Date: Fri, 30 Apr 2021 14:29:01 +0200 Subject: [PATCH 1/5] Create Github Action for publishing to npm --- .github/workflows/npm.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/npm.yml diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml new file mode 100644 index 0000000..a8f9c11 --- /dev/null +++ b/.github/workflows/npm.yml @@ -0,0 +1,18 @@ +name: npm +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v2 + with: + node-version: '12.x' + registry-url: 'https://registry.npmjs.org' + - run: npm install + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 310ed41e28167804e539a86b192304caa2d2c715 Mon Sep 17 00:00:00 2001 From: Luis R Date: Fri, 30 Apr 2021 14:41:40 +0200 Subject: [PATCH 2/5] Update npm.yml --- .github/workflows/npm.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index a8f9c11..f88088a 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -1,5 +1,6 @@ name: npm on: + workflow_dispatch: release: types: [created] jobs: From 16140dc71e7f123cc5dbfbc3bd2e7b9f446ee859 Mon Sep 17 00:00:00 2001 From: Arne Blumentritt Date: Sun, 25 Apr 2021 19:35:34 +0200 Subject: [PATCH 3/5] Fixed #61 Warnings in homebridge 1.3 because of illegal characteristic values --- accessories/koboldVacuumRobot.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/accessories/koboldVacuumRobot.js b/accessories/koboldVacuumRobot.js index 0be1c3d..a571760 100644 --- a/accessories/koboldVacuumRobot.js +++ b/accessories/koboldVacuumRobot.js @@ -516,7 +516,7 @@ KoboldVacuumRobotAccessory.prototype = { getSpotClean: function (callback) { - callback(); + callback(false, this.spotCleanService.getCharacteristic(Characteristic.On).value); }, setSpotClean: function (on, callback) @@ -674,8 +674,13 @@ KoboldVacuumRobotAccessory.prototype = { if (this.spotPlusFeatures) { - this.spotCleanService.setCharacteristic(SpotWidthCharacteristic, this.robot.spotWidth); - this.spotCleanService.setCharacteristic(SpotHeightCharacteristic, this.robot.spotHeight); + let widthProps = this.spotCleanService.getCharacteristic(SpotWidthCharacteristic).props; + let heightProps = this.spotCleanService.getCharacteristic(SpotHeightCharacteristic).props; + + this.spotCleanService.setCharacteristic(SpotWidthCharacteristic, + this.robot.spotWidth >= widthProps.minValue && this.robot.spotWidth <= widthProps.maxValue ? this.robot.spotWidth : widthProps.minValue); + this.spotCleanService.setCharacteristic(SpotHeightCharacteristic, + this.robot.spotHeight >= heightProps.minValue && this.robot.spotHeight <= heightProps.maxValue ? this.robot.spotHeight : heightProps.minValue); } } From ae7138e24543d6aeaf35d76afb4639eb38f46397 Mon Sep 17 00:00:00 2001 From: Arne Blumentritt Date: Sun, 25 Apr 2021 20:05:46 +0200 Subject: [PATCH 4/5] Fixed homebridge 1.3 warning because of additional parameter in setter callback --- accessories/koboldVacuumRobot.js | 58 +++++++++++++++++++------------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/accessories/koboldVacuumRobot.js b/accessories/koboldVacuumRobot.js index a571760..a1d9817 100644 --- a/accessories/koboldVacuumRobot.js +++ b/accessories/koboldVacuumRobot.js @@ -260,7 +260,10 @@ KoboldVacuumRobotAccessory.prototype = { if (this.robot.canResume) { debug(this.name + ": ## Resume cleaning"); - this.robot.resumeCleaning(callback); + this.robot.resumeCleaning((error) => + { + callback(error); + }); } // Start cleaning else if (this.robot.canStart) @@ -302,7 +305,10 @@ KoboldVacuumRobotAccessory.prototype = { if (this.robot.canPause) { debug(this.name + ": ## Pause cleaning"); - this.robot.pauseCleaning(callback); + this.robot.pauseCleaning((error) => + { + callback(error); + }); } else { @@ -338,12 +344,8 @@ KoboldVacuumRobotAccessory.prototype = { if (error) { this.log.error("Cannot start cleaning. " + error + ": " + JSON.stringify(result)); - callback(true); - } - else - { - callback(); } + callback(error); }); } // Room cleaning @@ -354,12 +356,8 @@ KoboldVacuumRobotAccessory.prototype = { if (error) { this.log.error("Cannot start room cleaning. " + error + ": " + JSON.stringify(result)); - callback(true); - } - else - { - callback(); } + callback(error); }); } // Spot cleaning @@ -370,12 +368,8 @@ KoboldVacuumRobotAccessory.prototype = { if (error) { this.log.error("Cannot start spot cleaning. " + error + ": " + JSON.stringify(result)); - callback(true); - } - else - { - callback(); } + callback(error); }); } }, @@ -399,14 +393,20 @@ KoboldVacuumRobotAccessory.prototype = { setTimeout(() => { debug(this.name + ": ## Go to dock"); - this.robot.sendToBase(callback); + this.robot.sendToBase(() => + { + callback(); + }); }, 1000); }); } else if (this.robot.canGoToBase) { debug(this.name + ": ## Go to dock"); - this.robot.sendToBase(callback); + this.robot.sendToBase(() => + { + callback(); + }); } else { @@ -485,12 +485,18 @@ KoboldVacuumRobotAccessory.prototype = { if (on) { debug(this.name + ": " + "Enabled".brightGreen + " Schedule"); - this.robot.enableSchedule(callback); + this.robot.enableSchedule((error) => + { + callback(error); + }); } else { debug(this.name + ": " + "Disabled".red + " Schedule"); - this.robot.disableSchedule(callback); + this.robot.disableSchedule((error) => + { + callback(error); + }); } }); }, @@ -510,7 +516,10 @@ KoboldVacuumRobotAccessory.prototype = { this.findMeService.setCharacteristic(Characteristic.On, false); }, 1000); - this.robot.findMe(callback); + this.robot.findMe((error) => + { + callback(error); + }); } }, @@ -556,7 +565,10 @@ KoboldVacuumRobotAccessory.prototype = { if (this.robot.canPause) { debug(this.name + ": ## Pause cleaning"); - this.robot.pauseCleaning(callback); + this.robot.pauseCleaning((error) => + { + callback(error); + }); } else { From 13846a9322c28f917acd73ae3fd1ce34d0afb32b Mon Sep 17 00:00:00 2001 From: Luis Riegger Date: Fri, 30 Apr 2021 15:00:52 +0200 Subject: [PATCH 5/5] update changelog and bump version to 0.8.2 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8fcf5b..49a16c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -123,4 +123,7 @@ * Added possibility to toggle between languages (English/German) in Homebridge UI Plugin Settings ## 0.8.1 -* Include Robot name in Homekit battery service name \ No newline at end of file +* Include Robot name in Homekit battery service name + +## 0.8.2 +* Eliminate warnings on Homebridge >= 1.3.0 (77945f8 and 877c3d7 on `naofireblade/homebridge-neato`) \ No newline at end of file diff --git a/package.json b/package.json index f8f6cf7..68f2b0a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-kobold", - "version": "0.8.1", + "version": "0.8.2", "description": "A Vorwerk Kobold vacuum robot plugin for homebridge.", "license": "MIT", "keywords": [