From 3bea2d28735a950fccc9beb3762986b749a13a21 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Mon, 29 Jan 2024 20:25:56 +0800 Subject: [PATCH] Lefant N3: juggle power_go and pause dps - mark 4, 6, 7, 126 as optional, as they seem to not appear for another user - based on reported behaviour, try power_go as power, pause as activate inverted. I think this was already tried for TTEC vacuum and did not work there, but maybe the vacuums act differently. - based on commands not seeming to work, make them also trigger power and switch_charge dps as appropriate. Issue #1393 --- .../tuya_local/devices/lefant_n3_vacuum.yaml | 44 ++++++++++++++++--- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/custom_components/tuya_local/devices/lefant_n3_vacuum.yaml b/custom_components/tuya_local/devices/lefant_n3_vacuum.yaml index d646c1e986..0e9ed4118e 100644 --- a/custom_components/tuya_local/devices/lefant_n3_vacuum.yaml +++ b/custom_components/tuya_local/devices/lefant_n3_vacuum.yaml @@ -8,22 +8,51 @@ primary_entity: entity: vacuum dps: - id: 1 + name: power + type: boolean + - id: 2 name: activate type: boolean + mapping: + - dps_val: true + value: false + - dps_val: false + value: true + - id: 3 + name: switch_charge + type: boolean + optional: true + hidden: true - id: 4 - name: command + name: work_mode type: string + optional: true mapping: - dps_val: smart - value: clean + conditions: power + constraint: + - dps_val: true + value: smart - dps_val: chargego - value: return_to_base + constraint: switch_charge + conditions: + - dps_val: true + value: return_to_base - dps_val: zone - value: clean_zone + constraint: power + conditions: + - dps_val: true + value: clean_zone - dps_val: pose - value: clean_spot + constraint: power + conditions: + - dps_val: true + value: clean_spot - dps_val: part - value: clean_partial + constraint: power + conditions: + - dps_val: true + value: clean_partial - dps_val: fastmapping value: map - dps_val: CleanModeSectorbased @@ -190,6 +219,7 @@ primary_entity: name: scheduled_clean - id: 126 type: boolean + optional: true name: map_saved secondary_entities: - entity: button @@ -224,6 +254,7 @@ secondary_entities: dps: - id: 6 type: integer + optional: true name: sensor unit: min class: measurement @@ -234,6 +265,7 @@ secondary_entities: dps: - id: 7 type: integer + optional: true name: sensor unit: m2 class: measurement