Compare commits

...

20 Commits

Author SHA1 Message Date
2990bf2d75 just drying someting 2022-05-02 14:20:05 +00:00
Luis R
5c52edeb3b
Update README.md 2021-05-12 12:58:49 +02:00
Luis Riegger
56364f2ff3 Update Changelog 2021-05-04 08:04:20 +02:00
Luis Riegger
76dad58bbe 0.8.4 2021-05-04 08:03:07 +02:00
Luis Riegger
1e494ae683 Link to token getter in UI 2021-05-04 08:02:18 +02:00
Luis R
f206d3ddaf
Update README.md 2021-05-03 13:16:30 +02:00
Luis Riegger
70099e3c5a Bump node-kobold-control version 2021-05-02 10:06:32 +02:00
Luis R
15f93ba1d7
Update README.md
Add npm shield tag
2021-04-30 15:18:10 +02:00
Luis R
bd6c77a4da
Bump version to 0.8.3 2021-04-30 15:12:17 +02:00
Luis R
81d3385c48
Merge pull request #1 from aluini/feature/lang-fr
Add french plugin language
2021-04-30 15:11:38 +02:00
Luis R
6c7d669a43
Merge branch 'master' into feature/lang-fr 2021-04-30 15:08:46 +02:00
Luis Riegger
8ae17f6a4a Merge branch 'master' of https://github.com/himbeles/homebridge-kobold 2021-04-30 15:00:55 +02:00
Luis Riegger
13846a9322 update changelog and bump version to 0.8.2 2021-04-30 15:00:52 +02:00
Arne Blumentritt
ae7138e245 Fixed homebridge 1.3 warning because of additional parameter in setter callback 2021-04-30 14:52:26 +02:00
Arne Blumentritt
16140dc71e Fixed #61 Warnings in homebridge 1.3 because of illegal characteristic values 2021-04-30 14:51:47 +02:00
Luis R
310ed41e28
Update npm.yml 2021-04-30 14:41:40 +02:00
Luis R
b9e0e64390
Create Github Action for publishing to npm 2021-04-30 14:29:01 +02:00
Alexandre Luini
0376dc09d5 add french plugin language 2021-03-10 16:49:40 +01:00
Luis Riegger
4b6002f686 bump npm version 2021-02-07 15:31:31 +01:00
Luis Riegger
c847481487 Include Include Robot name in Homekit battery service name 2021-02-07 15:27:57 +01:00
6 changed files with 127 additions and 49 deletions

19
.github/workflows/npm.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: npm
on:
workflow_dispatch:
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 }}

View File

@ -121,3 +121,15 @@
## 0.8.0 ## 0.8.0
* Add German plugin language (for example, this gives you a "Sauge Küche" Siri command for a zone called "Küche") * Add German plugin language (for example, this gives you a "Sauge Küche" Siri command for a zone called "Küche")
* Added possibility to toggle between languages (English/German) in Homebridge UI Plugin Settings * Added possibility to toggle between languages (English/German) in Homebridge UI Plugin Settings
## 0.8.1
* 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`)
## 0.8.3
* Add French plugin language (for example, this gives you a "Aspirer la cuisine" Siri command for a zone called "La cuisine")
## 0.8.4
* Link to token getter tool in homebridge UI

View File

@ -1,3 +1,7 @@
[![Latest NPM release](https://img.shields.io/npm/v/homebridge-kobold.svg)](https://www.npmjs.com/package/homebridge-kobold)
[![NPM Downloads](https://img.shields.io/npm/dt/homebridge-kobold.svg)](https://www.npmjs.com/package/homebridge-kobold?activeTab=versions)
# homebridge-kobold # homebridge-kobold
This is a plugin for [homebridge](https://github.com/nfarina/homebridge) to control your [Vorwerk Kobold](https://kobold.vorwerk.de/saugroboter/) VR300 vacuum robot. You can download it via [npm](https://www.npmjs.com/package/homebridge-kobold). This is a plugin for [homebridge](https://github.com/nfarina/homebridge) to control your [Vorwerk Kobold](https://kobold.vorwerk.de/saugroboter/) VR300 vacuum robot. You can download it via [npm](https://www.npmjs.com/package/homebridge-kobold).
@ -27,7 +31,7 @@ The interaction with the Server is handled by the underlying [node-kobold-contro
- Automatic or periodic refresh of robot state - Automatic or periodic refresh of robot state
- Multiple robots - Multiple robots
- German or English Language Setting - German, English or French Language Setting
> <b name="change-room">2</b> You can send the robot from one room to another as well. He will return to the base, wait there some seconds and then starts cleaning the next room. > <b name="change-room">2</b> You can send the robot from one room to another as well. He will return to the base, wait there some seconds and then starts cleaning the next room.
@ -43,7 +47,7 @@ The interaction with the Server is handled by the underlying [node-kobold-contro
## Configuration ## Configuration
Add the following information to your config file. Change the values for email and password. Add the following information to your config file. Adapt the value for `token`.
### Simple ### Simple
@ -57,7 +61,7 @@ Add the following information to your config file. Change the values for email a
] ]
``` ```
You can get a token using the following two curl commands: You can get a token using the GUI tool [Kobold Token Getter](https://github.com/himbeles/kobold-token-get) or using the following two curl commands:
```bash ```bash
# This will trigger the email sending # This will trigger the email sending
@ -95,7 +99,7 @@ curl -X "POST" "https://mykobold.eu.auth0.com/oauth/token" \
From the output, you want to copy the `id_token` value. From the output, you want to copy the `id_token` value.
The `language` can be `de` for German, or `en` for English. The `language` can be `de` for German, `en` for English, or `fr` for French.
### Advanced ### Advanced

View File

@ -64,6 +64,19 @@ function KoboldVacuumRobotAccessory(platform, robotObject)
"findMe": "Finde mich", "findMe": "Finde mich",
"cleanSpot": "Spot Reinigung", "cleanSpot": "Spot Reinigung",
"battery": "Batterie" "battery": "Batterie"
},
'fr': {
"clean": "Aspirer",
"clean the": "Aspirer",
"goToDock": "Retour à la base",
"dockState": "Sur la base",
"eco": "Eco mode",
"noGoLines": "Lignes NoGo",
"extraCare": "Extra Care",
"schedule": "Planifier",
"findMe": "Me retrouver",
"cleanSpot": "Nettoyage local",
"battery": "Batterie"
} }
}[this.platform.language] }[this.platform.language]
@ -93,7 +106,7 @@ function KoboldVacuumRobotAccessory(platform, robotObject)
this.name = this.robot.name + ' - ' + this.boundary.name; this.name = this.robot.name + ' - ' + this.boundary.name;
} }
this.batteryService = new Service.BatteryService(this.dict["battery"], "battery"); this.batteryService = new Service.BatteryService(this.name + " " + this.dict["battery"], "battery");
if (this.boundary == null) if (this.boundary == null)
{ {
@ -123,6 +136,7 @@ function KoboldVacuumRobotAccessory(platform, robotObject)
serviceName = this.dict["clean"] + " " + this.boundary.name; serviceName = this.dict["clean"] + " " + this.boundary.name;
} }
this.cleanService = new Service.Switch(serviceName, "cleanBoundary:" + this.boundary.id); this.cleanService = new Service.Switch(serviceName, "cleanBoundary:" + this.boundary.id);
this.cleanService = new Service.Switch(serviceName + "1", "cleanBoundary:" + this.boundary.id)
} }
this.log("Added cleaning device named: " + this.name); this.log("Added cleaning device named: " + this.name);
@ -260,7 +274,10 @@ KoboldVacuumRobotAccessory.prototype = {
if (this.robot.canResume) if (this.robot.canResume)
{ {
debug(this.name + ": ## Resume cleaning"); debug(this.name + ": ## Resume cleaning");
this.robot.resumeCleaning(callback); this.robot.resumeCleaning((error) =>
{
callback(error);
});
} }
// Start cleaning // Start cleaning
else if (this.robot.canStart) else if (this.robot.canStart)
@ -302,7 +319,10 @@ KoboldVacuumRobotAccessory.prototype = {
if (this.robot.canPause) if (this.robot.canPause)
{ {
debug(this.name + ": ## Pause cleaning"); debug(this.name + ": ## Pause cleaning");
this.robot.pauseCleaning(callback); this.robot.pauseCleaning((error) =>
{
callback(error);
});
} }
else else
{ {
@ -338,12 +358,8 @@ KoboldVacuumRobotAccessory.prototype = {
if (error) if (error)
{ {
this.log.error("Cannot start cleaning. " + error + ": " + JSON.stringify(result)); this.log.error("Cannot start cleaning. " + error + ": " + JSON.stringify(result));
callback(true);
}
else
{
callback();
} }
callback(error);
}); });
} }
// Room cleaning // Room cleaning
@ -354,12 +370,8 @@ KoboldVacuumRobotAccessory.prototype = {
if (error) if (error)
{ {
this.log.error("Cannot start room cleaning. " + error + ": " + JSON.stringify(result)); this.log.error("Cannot start room cleaning. " + error + ": " + JSON.stringify(result));
callback(true);
}
else
{
callback();
} }
callback(error);
}); });
} }
// Spot cleaning // Spot cleaning
@ -370,12 +382,8 @@ KoboldVacuumRobotAccessory.prototype = {
if (error) if (error)
{ {
this.log.error("Cannot start spot cleaning. " + error + ": " + JSON.stringify(result)); this.log.error("Cannot start spot cleaning. " + error + ": " + JSON.stringify(result));
callback(true);
}
else
{
callback();
} }
callback(error);
}); });
} }
}, },
@ -399,14 +407,20 @@ KoboldVacuumRobotAccessory.prototype = {
setTimeout(() => setTimeout(() =>
{ {
debug(this.name + ": ## Go to dock"); debug(this.name + ": ## Go to dock");
this.robot.sendToBase(callback); this.robot.sendToBase(() =>
{
callback();
});
}, 1000); }, 1000);
}); });
} }
else if (this.robot.canGoToBase) else if (this.robot.canGoToBase)
{ {
debug(this.name + ": ## Go to dock"); debug(this.name + ": ## Go to dock");
this.robot.sendToBase(callback); this.robot.sendToBase(() =>
{
callback();
});
} }
else else
{ {
@ -485,12 +499,18 @@ KoboldVacuumRobotAccessory.prototype = {
if (on) if (on)
{ {
debug(this.name + ": " + "Enabled".brightGreen + " Schedule"); debug(this.name + ": " + "Enabled".brightGreen + " Schedule");
this.robot.enableSchedule(callback); this.robot.enableSchedule((error) =>
{
callback(error);
});
} }
else else
{ {
debug(this.name + ": " + "Disabled".red + " Schedule"); debug(this.name + ": " + "Disabled".red + " Schedule");
this.robot.disableSchedule(callback); this.robot.disableSchedule((error) =>
{
callback(error);
});
} }
}); });
}, },
@ -510,13 +530,16 @@ KoboldVacuumRobotAccessory.prototype = {
this.findMeService.setCharacteristic(Characteristic.On, false); this.findMeService.setCharacteristic(Characteristic.On, false);
}, 1000); }, 1000);
this.robot.findMe(callback); this.robot.findMe((error) =>
{
callback(error);
});
} }
}, },
getSpotClean: function (callback) getSpotClean: function (callback)
{ {
callback(); callback(false, this.spotCleanService.getCharacteristic(Characteristic.On).value);
}, },
setSpotClean: function (on, callback) setSpotClean: function (on, callback)
@ -556,7 +579,10 @@ KoboldVacuumRobotAccessory.prototype = {
if (this.robot.canPause) if (this.robot.canPause)
{ {
debug(this.name + ": ## Pause cleaning"); debug(this.name + ": ## Pause cleaning");
this.robot.pauseCleaning(callback); this.robot.pauseCleaning((error) =>
{
callback(error);
});
} }
else else
{ {
@ -674,8 +700,13 @@ KoboldVacuumRobotAccessory.prototype = {
if (this.spotPlusFeatures) if (this.spotPlusFeatures)
{ {
this.spotCleanService.setCharacteristic(SpotWidthCharacteristic, this.robot.spotWidth); let widthProps = this.spotCleanService.getCharacteristic(SpotWidthCharacteristic).props;
this.spotCleanService.setCharacteristic(SpotHeightCharacteristic, this.robot.spotHeight); 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);
} }
} }

View File

@ -9,7 +9,7 @@
"title": "token", "title": "token",
"type": "string", "type": "string",
"required": true, "required": true,
"description": "Your Token" "description": "Your Kobold Token (https://git.io/J3g1b)"
}, },
"language": { "language": {
"title": "language", "title": "language",
@ -27,6 +27,12 @@
"enum": [ "enum": [
"de" "de"
] ]
},
{
"title": "French",
"enum": [
"fr"
]
} }
], ],
"required": true "required": true

View File

@ -1,6 +1,6 @@
{ {
"name": "homebridge-kobold", "name": "homebridge-kobold",
"version": "0.8.0", "version": "0.8.4",
"description": "A Vorwerk Kobold vacuum robot plugin for homebridge.", "description": "A Vorwerk Kobold vacuum robot plugin for homebridge.",
"license": "MIT", "license": "MIT",
"keywords": [ "keywords": [
@ -16,6 +16,12 @@
"name": "Luis R.", "name": "Luis R.",
"url2": "https://github.com/himbeles" "url2": "https://github.com/himbeles"
}, },
"contributors": [
{
"name": "Alexandre L.",
"url": "https://github.com/aluini"
}
],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/himbeles/homebridge-kobold.git" "url": "git://github.com/himbeles/homebridge-kobold.git"
@ -23,7 +29,7 @@
"dependencies": { "dependencies": {
"colors": "^1.4.0", "colors": "^1.4.0",
"debug": "^4.1.1", "debug": "^4.1.1",
"node-kobold-control": ">=0.4.0", "node-kobold-control": ">=0.4.2",
"uuid": "^3.3.2" "uuid": "^3.3.2"
} }
} }