Fixed issue with non smart robots

This commit is contained in:
Arne Blumentritt 2021-05-04 14:29:36 +02:00
parent 552e360f6f
commit e53bb3d777
4 changed files with 56 additions and 43 deletions

View File

@ -20,7 +20,6 @@
"dot-notation": "off",
"eqeqeq": "warn",
"curly": ["warn", "all"],
"brace-style": ["warn", "allman"],
"prefer-arrow-callback": ["warn"],
"max-len": ["warn", 200],
"no-console": ["warn"], // use the provided Homebridge log method instead

View File

@ -120,3 +120,20 @@
## 0.7.3
* Fixed warnings since homebridge 1.3.0
## 1.0.0-beta.1
* Added bin full sensor
* Added config-ui support for all options
* Added config parameter **prefix** to use robot name as prefix for service names
* Changed service names to not include robot name as prefix by default
* Changed background update to use better default intervals (1 minute while cleaning, 30 minutes while idle)
* Changed config parameter **refresh**. Renamed to **backgroundUpdate**, unit changed to minute and will only be used during idle
* Changed config parameter **hidden**. Renamed to **services**, now takes list of services that should be _visible_. Default are all available services.
* Fixed robots no longer disappear or change the room after connection issues with the Neato API
* Fixed plugin no longer crashes if non smart robot is assigned in neato account
* Fixed options for eco, nogo lines, extra care are now saved in homebridge and will no longer be overridden by Neato API
## TODO until 1.0.0 release
* Room cleaning
* Spot size
* Retrying when no connection

View File

@ -1,7 +1,7 @@
{
"name": "homebridge-neato",
"displayName": "Homebridge Neato",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "A Neato vacuum robot plugin for homebridge.",
"license": "MIT",
"keywords": [

View File

@ -21,8 +21,7 @@ export class HomebridgeNeatoPlatform implements DynamicPlatformPlugin
public readonly config: PlatformConfig,
public readonly api: API)
{
this.api.on("didFinishLaunching", () =>
{
this.api.on("didFinishLaunching", () => {
this.discoverRobots();
});
}
@ -44,8 +43,7 @@ export class HomebridgeNeatoPlatform implements DynamicPlatformPlugin
try
{
// Login
client.authorize((this.config)["email"], (this.config)["password"], false, (error) =>
{
client.authorize((this.config)["email"], (this.config)["password"], false, (error) => {
if (error)
{
this.log.warn("Cannot connect to neato server. No new robots will be found and existing robots will be unresponsive.");
@ -55,8 +53,7 @@ export class HomebridgeNeatoPlatform implements DynamicPlatformPlugin
}
// Get all robots from account
client.getRobots((error, robots) =>
{
client.getRobots((error, robots) => {
if (error)
{
this.log.error("Successful login but can't connect to your neato robot: " + error);
@ -75,14 +72,13 @@ export class HomebridgeNeatoPlatform implements DynamicPlatformPlugin
for (const robot of robots)
{
// Get additional information for the robot
robot.getState((error, state) =>
{
robot.getState((error, state) => {
if (error)
{
this.log.error("Error getting robot meta information: " + error + ": " + state);
return;
}
else
{
try
{
robot.meta = state.meta;
@ -121,6 +117,7 @@ export class HomebridgeNeatoPlatform implements DynamicPlatformPlugin
throw new this.api.hap.HapStatusError(this.api.hap.HAPStatus.SERVICE_COMMUNICATION_FAILURE);
}
}
// // Get all maps for each robot
// robot.getPersistentMaps((error, maps) => {