Skip to content

Commit

Permalink
1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoduj committed Nov 11, 2020
1 parent 95b1474 commit af8aa95
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 127 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ You can also use the [PACKAGES](https://github.com/oznu/docker-homebridge#option

All notable changes to this project will be documented in this file.

## 1.3.0

- [NEW] swithches instead of direction and handling zones
- [FIX] Deebots needs attention does not reset #34
- [FIX] bump dep for Ozmo T8 #36

## 1.2.1

- [NEW] bump dep on [js lib](https://github.com/mrbungle64/ecovacs-deebot.js) to support new deebot
Expand Down
28 changes: 18 additions & 10 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,25 @@
"default": true,
"description": "Provides trouble notifications for your Deebot as a motion alert."
},
"rightDirectionCleaningMode": {
"title": "Cleaning Mode – Counterclockwise",
"type": "string",
"default": "auto",
"description": "Set the cleaning mode for the counterclockwise fan direction. Default is auto. (edge OR auto OR spot OR spotArea,start,1 (or any other spot number) OR customArea,start,1,1 (or any other area number and number of cleanings) "
"publishAutoSwitch": {
"title": "Publish Auto Cleaning Switch",
"type": "boolean",
"default": true,
"description": "Start cleaning in auto mode"
},
"leftDirectionCleaningMode": {
"title": "Cleaning Mode – Clockwise",
"type": "string",
"default": "edge",
"description": "Set the cleaning mode for the clockwise fan direction. Default is auto. (edge OR auto OR spot OR spotArea,start,1 (or any other spot number) OR customArea,start,1,1 (or any other area number and number of cleanings) "
"publishEdgeSwitch": {
"title": "Publish Edge Cleaning Switch",
"type": "boolean",
"default": true,
"description": "Start cleaning in edge mode"
},
"publishZoneSwitches": {
"title": "Publish Zone Cleaning Switchs",
"type": "array",
"items": {
"title": "Zone number",
"type": "integer"
}
}
}
},
Expand Down
36 changes: 20 additions & 16 deletions deebotEcovacsAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,27 +140,19 @@ DeebotEcovacsAPI.prototype = {
this.log.debug('INFO - Clean status: %s', clean_status);

if (clean_status) {
//reset last error
if (deebotAccessory.publishMotionDetector && HKMotionService) {
this.log.debug('INFO - Reset Motion Service');
HKMotionService.getCharacteristic(Characteristic.MotionDetected).updateValue(false);
}

let cleaning = clean_status != 'stop' && clean_status != 'pause' && clean_status != 'idle';

if (deebotAccessory.publishFan && HKFanService) {
let currentOnValue = HKFanService.getCharacteristic(Characteristic.On).value;
if (currentOnValue !== cleaning) {
HKFanService.getCharacteristic(Characteristic.On).updateValue(cleaning);
}

let currentDirectionValue = HKFanService.getCharacteristic(
Characteristic.RotationDirection
).value;
if (
clean_status == deebotAccessory.leftDirectionCleaningMode &&
currentDirectionValue == 0
) {
HKFanService.getCharacteristic(Characteristic.RotationDirection).updateValue(0);
} else if (
clean_status != deebotAccessory.leftDirectionCleaningMode &&
currentDirectionValue == 1
) {
HKFanService.getCharacteristic(Characteristic.RotationDirection).updateValue(1);
vacBot.run('GetCleanSpeed'); // to update speed accordingly.
}
}

Expand All @@ -169,6 +161,8 @@ DeebotEcovacsAPI.prototype = {
if (cleaning && !currentMainOnValue)
HKSwitchOnService.getCharacteristic(Characteristic.On).updateValue(true);
}

//could handle clean status to update switches .... (zone ???)
}
});

Expand All @@ -188,7 +182,17 @@ DeebotEcovacsAPI.prototype = {

vacBot.on('Error', (error_message) => {
this.log.debug('INFO - Error from deebot : %s ', error_message);
if (deebotAccessory.publishMotionDetector && HKMotionService) {
if (error_message.indexOf('Timeout') > -1) {
//an order might have been lost, so we update
vacBot.run('GetCleanState');
vacBot.run('GetBatteryState');
vacBot.run('GetChargeState');
vacBot.run('GetCleanSpeed');
} else if (
deebotAccessory.publishMotionDetector &&
HKMotionService &&
error_message.indexOf('NoError') == -1
) {
if (error_message)
HKMotionService.getCharacteristic(Characteristic.MotionDetected).updateValue(true);
}
Expand Down
Loading

0 comments on commit af8aa95

Please sign in to comment.