diff --git a/lib/dreame.js b/lib/dreame.js index 3e0e1504..5a25ab2c 100644 --- a/lib/dreame.js +++ b/lib/dreame.js @@ -117,6 +117,10 @@ const DreameState = { SWEEPING_AND_MOPPING: 12, CHARGING_COMPLETED: 13, UPGRADING: 14, + WATER_INSPECTING: 19, + WASHING_MOP_PAUSE: 21, + DUST_COLLECTION: 22, + REMOTE_CLEAN: 23 }; const DreameWashBaseState = { @@ -138,15 +142,23 @@ const DreameProperties = { control_mapping: { 0: DreameState.UNKNOWN, 3: DreameState.IDLE, - 5: [DreameState.SWEEPING_AND_MOPPING, DreameState.SWEEPING], + 5: DreameState.SWEEPING, 6: DreameState.RETURNING, - 8: [DreameState.CHARGING, DreameState.CHARGING_COMPLETED], + 8: DreameState.CHARGING, 10: DreameState.PAUSED, 12: DreameState.ERROR, 14: DreameState.UPGRADING, + 22: DreameState.DUST_COLLECTION, 26: DreameState.RETURNING_WASHING, + 27: DreameState.WASHING_MOP_PAUSE, 28: DreameState.DRYING, 29: DreameState.WASHING, + 30: DreameState.MOPPING, + 31: DreameState.SWEEPING_AND_MOPPING, + 32: DreameState.REMOTE_CLEAN, + 33: DreameState.WATER_INSPECTING, + 34: DreameState.CHARGING_COMPLETED, + 35: DreameState.BUILDING, }, type: 'int', }, @@ -350,7 +362,7 @@ const DreameProperties = { AUTO_EMPTY_STATUS: { did: '', siid: 15, piid: 5 }, SENSOR_DIRTY_LEFT: { did: '', siid: 16, piid: 1, control: 'consumable.sensors', type: 'int' }, SENSOR_DIRTY_TIME_LEFT: { did: '', siid: 16, piid: 2 }, - MOP_PAD_LEFT: { did: '', siid: 18, piid: 1 }, + MOP_PAD_LEFT: { did: '', siid: 18, piid: 1, control: 'consumable.mop_pad', type: 'int' }, MOP_PAD_TIME_LEFT: { did: '', siid: 18, piid: 2 }, SILVER_ION_TIME_LEFT: { did: '', siid: 19, piid: 1 }, SILVER_ION_LEFT: { did: '', siid: 19, piid: 2 }, @@ -397,7 +409,7 @@ const DreameActions = { RESET_FILTER: { did: '', siid: 11, aiid: 1, control: 'consumable.filter_reset' }, RESET_SENSOR: { did: '', siid: 16, aiid: 1, control: 'consumable.sensors_reset' }, START_AUTO_EMPTY: { did: '', siid: 15, aiid: 1 }, - RESET_MOP_PAD: { did: '', siid: 18, aiid: 1 }, + RESET_MOP_PAD: { did: '', siid: 18, aiid: 1, control: 'consumable.mop_pad_reset' }, RESET_SILVER_ION: { did: '', siid: 19, aiid: 1 }, RESET_DETERGENT: { did: '', siid: 20, aiid: 1 }, STREAM_CAMERA: { did: '', siid: 10001, aiid: 1 }, @@ -449,6 +461,7 @@ class DreameManager { DreameProperties.CLEANING_TIME, DreameProperties.VOLUME, DreameProperties.MAIN_BRUSH_LEFT, + DreameProperties.MOP_PAD_LEFT, DreameProperties.SIDE_BRUSH_LEFT, DreameProperties.FILTER_LEFT, DreameProperties.SENSOR_DIRTY_LEFT, diff --git a/lib/objects.js b/lib/objects.js index cbcb7f34..6c0f9bd6 100644 --- a/lib/objects.js +++ b/lib/objects.js @@ -507,6 +507,35 @@ module.exports = { }, calc: 3600 * 3, // 300h }, + mop_pad: { + state: { + _id: 'mop_pad', + type: 'state', + common: { + name: 'Mop pad lifetime', + type: 'number', + role: 'value.usage.mop', + read: true, + write: false, + unit: '%', + }, + native: {}, + }, + button: { + _id: 'mop_pad_reset', + type: 'state', + common: { + role: 'button', + name: 'Reset mop pad lifetime', + type: 'boolean', + def: false, + read: false, + write: true, + }, + native: {}, + }, + calc: 3600 * 0.8, // 80h + }, sensors: { state: { _id: 'sensors', @@ -1134,7 +1163,7 @@ module.exports = { role: 'value.state', read: true, write: false, - max: 30, + max: 40, states: { 0: 'Unknown', 1: 'Initiating', @@ -1165,7 +1194,13 @@ module.exports = { 26: 'Going to Mop cleaning', 27: 'Cleaning Mop paused', 28: 'Drying Mop', - 29: 'Washing', + 29: 'Washing Mop', + 30: 'Mopping', + 31: 'Cleaning and Mopping', + 32: 'Remote clean', + 33: 'Water inspecting', + 34: 'Charging complete', + 35: 'Building', }, }, native: {}, diff --git a/lib/stockCommands.js b/lib/stockCommands.js index f4d64e4e..dadc09ca 100644 --- a/lib/stockCommands.js +++ b/lib/stockCommands.js @@ -59,6 +59,10 @@ module.exports = { method: 'reset_consumable', params: 'main_brush_work_time', }, + mop_pad_reset: { + method: 'reset_consumable', + params: 'mop_pad_work_time', + }, side_brush_reset: { method: 'reset_consumable', params: 'side_brush_work_time',