Skip to content

Commit

Permalink
Improve handling of model types
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbungle64 committed Feb 16, 2024
1 parent 57a2ec3 commit 4610f62
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
20 changes: 20 additions & 0 deletions lib/deebotModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -729,10 +729,30 @@ class Model {
return this.vacbot.getModelType();
}

isModelTypeT8Based() {
return this.isModelTypeT8() || this.isModelTypeN8();
}

isModelTypeT9Based() {
return this.isModelTypeT9() || this.isModelTypeT10() || this.isModelTypeT20() || this.isModelTypeX1() || this.isModelTypeX2();
}

isModelTypeN8() {
return this.vacbot.isModelTypeN8();
}

isModelTypeT8() {
return this.vacbot.isModelTypeT8();
}

isModelTypeT9() {
return this.vacbot.isModelTypeT9();
}

isModelTypeT10() {
return this.vacbot.isModelTypeT10();
}

isModelTypeT20() {
return this.vacbot.isModelTypeT20();
}
Expand Down
5 changes: 1 addition & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1727,10 +1727,7 @@ class EcovacsDeebot extends utils.Adapter {
const crypto = require('crypto');
(async () => {
let filename = '';
if (this.getModel().isModelTypeT9() ||
this.getModel().isModelTypeT20() ||
this.getModel().isModelTypeX1() ||
this.getModel().isModelTypeX2()) {
if (this.getModel().isModelTypeT9Based()) {
try {
const imageId = imageUrl.substring(imageUrl.lastIndexOf('=') + 1);
if (configValue === 1) {
Expand Down

0 comments on commit 4610f62

Please sign in to comment.