Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge dev #728

Merged
merged 44 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
551debc
Fix reset of consumables
copystring Oct 15, 2024
a4c7d38
Add cleaned_area to S8
copystring Oct 16, 2024
2934c4c
Fix https://github.com/copystring/ioBroker.roborock/issues/679
copystring Oct 16, 2024
670c2e7
Revert "Fix https://github.com/copystring/ioBroker.roborock/issues/679"
copystring Oct 17, 2024
9cf95c8
Q5 Pro doesn't support carpet_clean_mode
copystring Oct 19, 2024
b119052
Fix `extra_time` in general and for Qrevo Curve
copystring Oct 26, 2024
84be1e6
Add `dss` to Qrevo Curve
copystring Oct 26, 2024
80086a3
Fix https://github.com/copystring/ioBroker.roborock/issues/683
copystring Oct 26, 2024
5ccfed8
Update README.md
copystring Oct 26, 2024
29641a5
Add basic Roborock Qrevo Master support
copystring Oct 28, 2024
b4b8b14
Add more features to Qrevo Master
copystring Oct 28, 2024
af0f95c
lol
copystring Oct 28, 2024
aea186a
Add more features to Qrevo Master
copystring Oct 28, 2024
97ea0c1
Refactor login api and renew login every 12 hours
copystring Nov 2, 2024
28527e8
Fix Qrevo Curv name
copystring Nov 2, 2024
3b0de69
Add and update new map block types
copystring Nov 2, 2024
03875f5
Add water box support to S6
copystring Nov 4, 2024
f823d66
Improve api re-init logic
copystring Nov 6, 2024
2a21751
Fix calculation for cleaned_area in records
copystring Nov 7, 2024
954aba0
add unit clean_percent in % (#703)
fL4sH3r Nov 7, 2024
0bf0fcc
Make area and clean_area have 2 decimals
copystring Nov 9, 2024
62035f4
Increase request timeout from 10s to 30s
copystring Nov 9, 2024
8514ee2
Add extra debugging for testing
copystring Nov 10, 2024
f337f7e
Update README.md
copystring Nov 10, 2024
244656c
S6 uses string consumables
copystring Nov 13, 2024
73ab5e2
Update roborock_mqtt_connector.js
copystring Nov 14, 2024
35c7d8b
Update main.js
copystring Nov 16, 2024
7baf941
Update roborock_mqtt_connector.js
copystring Nov 16, 2024
4a7b344
Update main.js
copystring Nov 18, 2024
2aa5166
Update messageQueueHandler.js
copystring Nov 18, 2024
f5fecc5
Update main.js
copystring Nov 19, 2024
86e428f
Update main.js
copystring Nov 28, 2024
0fa6ef7
Update main.js
copystring Nov 29, 2024
3b694c6
Revert "Update main.js"
copystring Nov 30, 2024
5ce40c9
Revert "Update main.js"
copystring Nov 30, 2024
889fd05
Update main.js
copystring Dec 1, 2024
a7bc75c
Add max+ vacuum mode to S8 Pro Ultra
copystring Dec 2, 2024
90b3ce6
set info.connection to false on stop of adapter
copystring Dec 2, 2024
6d2b82a
Add basic Roborock Qrevo Slim support
copystring Dec 2, 2024
7b75cd8
Update main.js
copystring Dec 3, 2024
6f8fa1d
Disconnect mqtt client before creating a new one
copystring Dec 9, 2024
2df47f8
Maybe fix this stupid mqtt connect bug 🙄
copystring Dec 10, 2024
cf88caf
Fix #727
copystring Dec 11, 2024
0e10ff2
Update README.md
copystring Dec 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ This adapter allows you the control, get states, cleaning history and view the m

**This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers.** For more details and for information how to disable the error reporting see [Sentry-Plugin Documentation](https://github.com/ioBroker/plugin-sentry#plugin-sentry)! Sentry reporting is used starting with js-controller 3.0.

### This adapter cannot work on on MacOS

## The supported robots are:

- Roborock S4
Expand Down Expand Up @@ -55,6 +57,17 @@ This feature only works when map creation is enabled in the adapter options!
Placeholder for the next version (at the beginning of the line):
### **WORK IN PROGRESS**
-->
### **WORK IN PROGRESS**
* (copystring) Add cleaned_area to S8
* (copystring) Bugfixes for Qrevo Curve
* (copystring) Fix reset of consumables
* (copystring) Fix io-package.json
* (copystring) Add Roborock Qrevo Master
* (copystring) Refactor login api and renew login every 3 hours
* (fL4sH3r) Fix unit of clean_percent
* (copystring) Add water box support to S6
* (copystring) Many small fixed I can't be bothered to list 😅

### 0.6.17 (2024-10-14)
* (copystring) Add some missing attributes
* (copystring) Change min of update interval to 60s to prevent issues
Expand Down
1 change: 1 addition & 0 deletions admin/i18n/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"clean_type": "Clean Type",
"cleaningInfo_description": "Description of cleaning information.",
"cleaningRecords_description": "Description of the cleaning records.",
"cleaningRecord_extra_time": "Extra cleaning time",
"cleaning_area": "Cleaning Area",
"cleaning_brush_work_times": "How many times the high-speed maintenance brush has been used",
"collision_avoid_status": "Collision Avoid Status",
Expand Down
2 changes: 1 addition & 1 deletion io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
"link": "%web_protocol%://%ip%:%webserverPort%/map.html",
"fa-icon": "</i><img style='width:24px;margin-bottom:-6px;' src='/adapter/admin/roborock.png'><i>"
},
"localLink": "%web_protocol%://%ip%:%webserverPort%/map.html",
"localLinks": { "_default": "%web_protocol%://%ip%:%webserverPort%/map.html" },
"dependencies": [
{
"js-controller": ">=5.0.19"
Expand Down
7 changes: 7 additions & 0 deletions lib/RRMapParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ const TYPES = {
IGNORE_DIRTY_RECT: 43, // not currently processed
BRUSH_PT: 44, // not currently processed
DIRTY_NEW: 45, // not currently processed
MOP_ERR_PT: 46, // not currently processed
ERAZER_ZONE: 47, // not currently processed
LONG_CARPET: 48, // not currently processed
DS_SIDES: 49, // not currently processed
STEERING_PT: 50, // not currently processed
SENSOR_INFO: 51, // not currently processed
LOW_SPACES: 52, // not currently processed
DIGEST: 1024,
};
const TYPES_REVERSE = Object.fromEntries(Object.entries(TYPES).map(([key, value]) => [value, key]));
Expand Down
62 changes: 50 additions & 12 deletions lib/deviceFeatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const actions = {
deviceStates.charge_status = "number";
},
set_clean_percent: async () => {
deviceStates.clean_percent = "number";
deviceStates.clean_percent = { type: "number", unit: "%" };
},
set_common_status: () => {
deviceStates.common_status = "number";
Expand Down Expand Up @@ -273,7 +273,7 @@ const actions = {
deviceStates.repeat = "number";
},
set_cleaned_area: () => {
cleaningRecordsString.cleaned_area = { type: "number", name: "cleaning_record_cleaned_area", unit: "m²", divider: 1000000 };
cleaningRecordsString.cleaned_area = { type: "number", name: "cleaning_record_cleaned_area", unit: "m²" };
},
set_clean_times: () => {
cleaningRecordsString.clean_times = { type: "number", name: "cleaning_record_clean_times" };
Expand All @@ -291,14 +291,18 @@ const actions = {
deviceStates.clean_fluid = "number";
},
set_extra_time: () => {
cleaningRecordsString.extra_time = "number";
cleaningRecordsString.extra_time = { type: "number", name: "cleaningRecord_extra_time" },
deviceStates.extra_time = "number";
},
set_cleaning_info: () => {
deviceStates.cleaning_info = "string";
},
set_exit_dock: () => {
deviceStates.exit_dock = "number";
},
set_custom_mode_max_plus: () => {
commands.set_custom_mode.states[108] = "Max+";
}
};

class deviceFeatures {
Expand Down Expand Up @@ -600,7 +604,8 @@ class deviceFeatures {
"roborock.vacuum.a101", // Q Revo Pro
"roborock.vacuum.a97", // S8 MaxV (Ultra)
"roborock.vacuum.a104", // Roborock Qrevo S
"roborock.vacuum.a135" // Qrevo Curve
"roborock.vacuum.a135", // Qrevo Curv
"roborock.vacuum.a117" // Qrevo Master
].includes(robotModel),
// isShakeMopStrengthSupported: p.DMM.currentProduct == p.Products.TanosS || p.DMM.currentProduct == p.Products.TanosSPlus || p.DMM.isGarnet || p.DMM.isTopazSV || p.DMM.isPearlPlus || p.DMM.isCoral || p.DMM.isTopazS || p.DMM.isTopazSPlus || p.DMM.isTopazSC || p.DMM.isTopazSV || p.DMM.isPearlPlus || p.DMM.isTanosSMax || p.DMM.isUltron || p.DMM.isUltronSPlus || p.DMM.isUltronSMop || p.DMM.isUltronSV || p.DMM.isPearl
isShakeMopStrengthSupported: [
Expand All @@ -624,6 +629,7 @@ class deviceFeatures {
// isWaterBoxSupported: [p.Products.Tanos_CE, p.Products.Tanos_CN].hasElement(p.DMM.currentProduct)
isWaterBoxSupported: [
"roborock.vacuum.s5e", // S5 Max
"roborock.vacuum.s6", // S6
"roborock.vacuum.a08", // S6 Pure
"roborock.vacuum.a10", // S6 MaxV
"roborock.vacuum.a15", // S7
Expand All @@ -641,15 +647,15 @@ class deviceFeatures {
"roborock.vacuum.a101", // Q Revo Pro
"roborock.vacuum.a97", // S8 MaxV (Ultra)
"roborock.vacuum.a104", // Roborock Qrevo S
"roborock.vacuum.a135" // Qrevo Curve
"roborock.vacuum.a135", // Qrevo Curv
"roborock.vacuum.a117" // Qrevo Master
].includes(robotModel),
isCustomWaterBoxDistanceSupported: !!(2147483648 & this.features),
isBackChargeAutoWashSupported: this.featuresStr && !!(4096 & parseInt("0x" + this.featuresStr.slice(-8))),
isAvoidCarpetSupported: [
"roborock.vacuum.a10", // S6 MaxV
"roborock.vacuum.a40", // Q7
"roborock.vacuum.s6", // S6
"roborock.vacuum.a72", // Q5 Pro
"roborock.vacuum.a73", // Q8 Max
"roborock.vacuum.a38", // Q7 Max
"roborock.vacuum.a51", // S8
Expand All @@ -663,7 +669,8 @@ class deviceFeatures {
"roborock.vacuum.a101", // Q Revo Pro
"roborock.vacuum.a97", // S8 MaxV (Ultra)
"roborock.vacuum.a104", // Roborock Qrevo S
"roborock.vacuum.a135" // Qrevo Curve
"roborock.vacuum.a135", // Qrevo Curv
"roborock.vacuum.a117" // Qrevo Master
].includes(robotModel),
// this isn't the correct way to use this. This code must be from a different robot
// isVoiceControlSupported: !!(parseInt(`0x${this.featuresStr || "0"}`.slice(-10, -9)) & 2),
Expand All @@ -677,7 +684,8 @@ class deviceFeatures {
"roborock.vacuum.a27", // S7 MaxV (Ultra)
"roborock.vacuum.a97", // S8 MaxV (Ultra)
"roborock.vacuum.a87", // Qrevo MaxV
"roborock.vacuum.a135", // Qrevo Curve
"roborock.vacuum.a135", // Qrevo Curv
"roborock.vacuum.a117" // Qrevo Master
].includes(robotModel),
};
}
Expand Down Expand Up @@ -722,6 +730,7 @@ class deviceFeatures {
"set_charge_status",
"set_clean_percent",
"set_switch_status",
"set_cleaned_area"
],
// S7 Pro Ultra
"roborock.vacuum.a62": ["setCleaningRecordsString", "setConsumablesInt", "set_dss", "set_rss", "set_map_flag", "set_charge_status", "set_clean_percent"],
Expand Down Expand Up @@ -751,8 +760,8 @@ class deviceFeatures {
"set_back_type",
"set_charge_status",
"set_switch_status",

"set_clean_percent",
"set_custom_mode_max_plus",
],
// Q5 Pro
"roborock.vacuum.a72": [
Expand Down Expand Up @@ -782,6 +791,7 @@ class deviceFeatures {
"set_map_flag",
"set_charge_status",
"set_clean_percent",
"set_switch_status",
],
// Q Revo
"roborock.vacuum.a75": [
Expand All @@ -806,7 +816,7 @@ class deviceFeatures {
// S5 Max
"roborock.vacuum.s5e": ["setCleaningRecordsMixed", "setConsumablesInt"],
// S6
"roborock.vacuum.s6": ["setCleaningRecordsMixed", "setConsumablesInt"],
"roborock.vacuum.s6": ["setCleaningRecordsMixed", "setConsumablesString"],
// Qrevo MaxV
"roborock.vacuum.a87": [
"setCleaningRecordsString",
Expand Down Expand Up @@ -877,7 +887,7 @@ class deviceFeatures {
"set_cleaned_area",

],
// Roborock Qrevo Curve
// Roborock Qrevo Curv
"roborock.vacuum.a135": [
"setCleaningRecordsString",
"setConsumablesInt",
Expand All @@ -896,8 +906,36 @@ class deviceFeatures {
"set_map_flag",
"set_cleaned_area",
"set_task_id",
"set_extra_time",
"set_dss",
],
// Roborock Qrevo Master
"roborock.vacuum.a117": [
"setCleaningRecordsString",
"setConsumablesInt",
"set_last_clean_t",
"set_switch_status",
"set_kct",
"set_common_status",
"set_dss",
"set_rss",
"set_clean_percent",
"set_charge_status",
"set_in_warmup",
"set_monitor_status",
"set_task_id",
"set_cleaned_area",
"set_map_flag",
],
// Roborock Qrevo Slim
"roborock.vacuum.a21": [
"setCleaningRecordsString",
"setConsumablesInt",
"set_map_flag",
"set_cleaned_area",
"set_replenish_mode",
"set_clean_times",
"set_task_id",
]
};

// process modelConfig
Expand Down
6 changes: 3 additions & 3 deletions lib/messageQueueHandler.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

const requestTimeout = 10000; // 10s
const requestTimeout = 30000; // 10s

class messageQueueHandler {
constructor(adapter) {
Expand Down Expand Up @@ -49,9 +49,9 @@ class messageQueueHandler {
this.adapter.pendingRequests.delete(messageID);
this.adapter.localConnector.clearChunkBuffer(duid);
if (remoteConnection) {
reject(new Error(`Cloud request with id ${messageID} with method ${method} timed out after 10 seconds. MQTT connection state: ${mqttConnectionState}`));
reject(new Error(`Cloud request with id ${messageID} with method ${method} timed out after 30 seconds. MQTT connection state: ${mqttConnectionState}`));
} else {
reject(new Error(`Local request with id ${messageID} with method ${method} timed out after 10 seconds Local connect state: ${localConnectionState}`));
reject(new Error(`Local request with id ${messageID} with method ${method} timed out after 30 seconds Local connect state: ${localConnectionState}`));
}
}, requestTimeout);

Expand Down
Loading
Loading