From a2493c611d7049f94c6cc9aa969b07950de5e173 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Sat, 2 Mar 2024 19:13:39 +0900 Subject: [PATCH] Tank full/empty sensors: use translations for name, state and icon Issue #1579 --- .../devices/AlecoAir_D25_Traditio.yaml | 3 +-- .../devices/alecoair_d12_dehumidifier.yaml | 4 +--- .../alecoair_d12_home_dehumidifier.yaml | 4 +--- .../devices/alecoair_d14_dehumidifier.yaml | 3 +-- .../devices/alecoair_d16_dehumidifier.yaml | 4 +--- .../devices/blitzwolf_bwsh5_humidifier.yaml | 3 +-- .../devices/breville_lad208_dehumidifier.yaml | 7 +------ .../devices/carro_ph805_humidifier.yaml | 2 +- .../devices/cleanair_604b_humidifier.yaml | 4 +--- .../devices/cleanair_605b_humidifier.yaml | 3 +-- .../devices/dry_pury_evo_dehumidifier.yaml | 4 +--- .../tuya_local/devices/eanons_humidifier.yaml | 3 +-- .../devices/ebac_dj4000_dehumidifier.yaml | 5 +---- .../devices/eeese_anna_dehumidifier.yaml | 3 +-- .../devices/eeese_carl_dehumidifier.yaml | 3 +-- .../devices/eeese_otto_dehumidifier.yaml | 3 +-- .../devices/eesee_adam_dehumidifier.yaml | 3 +-- .../devices/electriq_cd12pro_dehumidifier.yaml | 5 +---- .../electriq_cd12pwv2_dehumidifier.yaml | 4 +--- .../devices/goldair_dehumidifier.yaml | 3 +-- .../devices/goldair_gpdh340_dehumidifier.yaml | 3 +-- .../devices/hyundai_sahara_dehumidifier.yaml | 3 +-- .../inventor_atmospherexl_dehumidifier.yaml | 3 +-- .../inventor_evaionpro_dehumidifier.yaml | 3 +-- .../devices/jjpro_jpd01_dehumidifier.yaml | 3 +-- .../devices/jjpro_jpd02_dehumidifier.yaml | 3 +-- .../tuya_local/devices/kogan_dehumidifier.yaml | 3 +-- .../devices/kyvol_ea200_humidifier.yaml | 3 +-- .../tuya_local/devices/probreeze_pb20.yaml | 7 +------ .../devices/shinco_30d_dehumidifier.yaml | 3 +-- .../devices/stadlerform_karl_humidifier.yaml | 3 +-- .../devices/suntec_coolfix_airconditioner.yaml | 3 +-- .../devices/vivosun_de0003_dehumidifier.yaml | 4 +--- .../devices/wilfa_haze_hu400bc_humidifier.yaml | 4 +--- .../devices/woods_cortina_airconditioner.yaml | 3 +-- custom_components/tuya_local/icons.json | 12 ++++++++++++ .../tuya_local/translations/bg.json | 14 ++++++++++++++ .../tuya_local/translations/cz.json | 14 ++++++++++++++ .../tuya_local/translations/en.json | 14 ++++++++++++++ .../tuya_local/translations/es.json | 14 ++++++++++++++ .../tuya_local/translations/fr.json | 14 ++++++++++++++ .../tuya_local/translations/hu.json | 14 ++++++++++++++ .../tuya_local/translations/id.json | 14 ++++++++++++++ .../tuya_local/translations/it.json | 14 ++++++++++++++ .../tuya_local/translations/no-NB.json | 14 ++++++++++++++ .../tuya_local/translations/pl.json | 18 ++++++++++++++++-- .../tuya_local/translations/pt-BR.json | 14 ++++++++++++++ .../tuya_local/translations/ru.json | 16 +++++++++++++++- .../tuya_local/translations/uk.json | 18 ++++++++++++++++-- .../tuya_local/translations/ur.json | 14 ++++++++++++++ tests/devices/test_eanons_humidifier.py | 7 ++++--- .../test_wilfa_haze_hu400bc_humidifier.py | 5 ++--- tests/test_binary_sensor.py | 3 ++- 53 files changed, 256 insertions(+), 101 deletions(-) diff --git a/custom_components/tuya_local/devices/AlecoAir_D25_Traditio.yaml b/custom_components/tuya_local/devices/AlecoAir_D25_Traditio.yaml index e4bbf36fde..3646848d17 100644 --- a/custom_components/tuya_local/devices/AlecoAir_D25_Traditio.yaml +++ b/custom_components/tuya_local/devices/AlecoAir_D25_Traditio.yaml @@ -80,8 +80,7 @@ secondary_entities: type: boolean name: switch - entity: binary_sensor - name: Tank - class: problem + translation_key: tank_full category: diagnostic dps: - id: 19 diff --git a/custom_components/tuya_local/devices/alecoair_d12_dehumidifier.yaml b/custom_components/tuya_local/devices/alecoair_d12_dehumidifier.yaml index d59104768b..7b0267c319 100644 --- a/custom_components/tuya_local/devices/alecoair_d12_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/alecoair_d12_dehumidifier.yaml @@ -111,9 +111,7 @@ secondary_entities: type: boolean name: lock - entity: binary_sensor - class: problem - name: Tank full - icon: "mdi:cup-water" + translation_key: tank_full dps: - id: 19 type: bitfield diff --git a/custom_components/tuya_local/devices/alecoair_d12_home_dehumidifier.yaml b/custom_components/tuya_local/devices/alecoair_d12_home_dehumidifier.yaml index 5a45fe51a7..29ae367398 100755 --- a/custom_components/tuya_local/devices/alecoair_d12_home_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/alecoair_d12_home_dehumidifier.yaml @@ -151,9 +151,7 @@ secondary_entities: name: sensor unit: min - entity: binary_sensor - name: Tank - class: problem - icon: "mdi:cup-water" + translation_key: tank_full category: diagnostic dps: - id: 11 diff --git a/custom_components/tuya_local/devices/alecoair_d14_dehumidifier.yaml b/custom_components/tuya_local/devices/alecoair_d14_dehumidifier.yaml index 372b8378c3..87682698b2 100644 --- a/custom_components/tuya_local/devices/alecoair_d14_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/alecoair_d14_dehumidifier.yaml @@ -95,8 +95,7 @@ secondary_entities: unit: "%" class: measurement - entity: binary_sensor - name: Tank - class: problem + translation_key: tank_full category: diagnostic dps: - id: 19 diff --git a/custom_components/tuya_local/devices/alecoair_d16_dehumidifier.yaml b/custom_components/tuya_local/devices/alecoair_d16_dehumidifier.yaml index 18dfcf779b..79b48ab116 100644 --- a/custom_components/tuya_local/devices/alecoair_d16_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/alecoair_d16_dehumidifier.yaml @@ -107,9 +107,7 @@ secondary_entities: unit: "%" class: measurement - entity: binary_sensor - class: problem - name: Tank full - icon: "mdi:cup-water" + translation_key: tank_full dps: - id: 19 type: bitfield diff --git a/custom_components/tuya_local/devices/blitzwolf_bwsh5_humidifier.yaml b/custom_components/tuya_local/devices/blitzwolf_bwsh5_humidifier.yaml index edeb2762c3..b54a86f1af 100644 --- a/custom_components/tuya_local/devices/blitzwolf_bwsh5_humidifier.yaml +++ b/custom_components/tuya_local/devices/blitzwolf_bwsh5_humidifier.yaml @@ -175,8 +175,7 @@ secondary_entities: - dps_val: f value: fahrenheit - entity: binary_sensor - name: Low water - class: problem + translation_key: tank_empty category: diagnostic dps: - id: 22 diff --git a/custom_components/tuya_local/devices/breville_lad208_dehumidifier.yaml b/custom_components/tuya_local/devices/breville_lad208_dehumidifier.yaml index 1037746421..a14c96c2d8 100644 --- a/custom_components/tuya_local/devices/breville_lad208_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/breville_lad208_dehumidifier.yaml @@ -152,10 +152,7 @@ secondary_entities: type: boolean name: lock - entity: binary_sensor - class: problem - name: Tank full - icon: "mdi:cup-outline" - icon_priority: 2 + translation_key: tank_full dps: - id: 11 type: bitfield @@ -164,8 +161,6 @@ secondary_entities: mapping: - dps_val: 8 value: true - icon: "mdi:cup-water" - icon_priority: 1 - value: false - entity: binary_sensor translation_key: defrost diff --git a/custom_components/tuya_local/devices/carro_ph805_humidifier.yaml b/custom_components/tuya_local/devices/carro_ph805_humidifier.yaml index ca9bb2be21..2ecfb5b4f7 100644 --- a/custom_components/tuya_local/devices/carro_ph805_humidifier.yaml +++ b/custom_components/tuya_local/devices/carro_ph805_humidifier.yaml @@ -99,7 +99,7 @@ secondary_entities: - dps_val: 9h value: 9 hours - entity: binary_sensor - name: Tank empty + translation_key: tank_empty class: problem category: diagnostic dps: diff --git a/custom_components/tuya_local/devices/cleanair_604b_humidifier.yaml b/custom_components/tuya_local/devices/cleanair_604b_humidifier.yaml index fd4e9efd44..bed4a65dbb 100644 --- a/custom_components/tuya_local/devices/cleanair_604b_humidifier.yaml +++ b/custom_components/tuya_local/devices/cleanair_604b_humidifier.yaml @@ -88,9 +88,7 @@ secondary_entities: type: integer unit: min - entity: binary_sensor - name: Water tank empty - icon: mdi:water-remove - class: problem + translation_key: tank_empty category: diagnostic dps: - id: 22 diff --git a/custom_components/tuya_local/devices/cleanair_605b_humidifier.yaml b/custom_components/tuya_local/devices/cleanair_605b_humidifier.yaml index 9ece608887..67c4a7b75c 100644 --- a/custom_components/tuya_local/devices/cleanair_605b_humidifier.yaml +++ b/custom_components/tuya_local/devices/cleanair_605b_humidifier.yaml @@ -88,8 +88,7 @@ secondary_entities: name: sensor unit: "min" - entity: binary_sensor - name: Water tank empty - class: problem + translation_key: tank_empty category: diagnostic dps: - id: 22 diff --git a/custom_components/tuya_local/devices/dry_pury_evo_dehumidifier.yaml b/custom_components/tuya_local/devices/dry_pury_evo_dehumidifier.yaml index 7b18926b3d..600e80ba09 100644 --- a/custom_components/tuya_local/devices/dry_pury_evo_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/dry_pury_evo_dehumidifier.yaml @@ -83,10 +83,8 @@ secondary_entities: type: boolean name: lock - entity: binary_sensor - class: problem - name: Tank full + translation_key: tank_full category: diagnostic - icon: "mdi:cup-water" dps: - id: 19 type: bitfield diff --git a/custom_components/tuya_local/devices/eanons_humidifier.yaml b/custom_components/tuya_local/devices/eanons_humidifier.yaml index d8b62fbc3e..2cdc61a310 100644 --- a/custom_components/tuya_local/devices/eanons_humidifier.yaml +++ b/custom_components/tuya_local/devices/eanons_humidifier.yaml @@ -107,8 +107,7 @@ secondary_entities: type: integer unit: min - entity: binary_sensor - name: Tank - class: problem + translation_key: tank_empty category: diagnostic dps: - id: 9 diff --git a/custom_components/tuya_local/devices/ebac_dj4000_dehumidifier.yaml b/custom_components/tuya_local/devices/ebac_dj4000_dehumidifier.yaml index 45061529f1..6e60ad2dc6 100644 --- a/custom_components/tuya_local/devices/ebac_dj4000_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/ebac_dj4000_dehumidifier.yaml @@ -119,8 +119,7 @@ secondary_entities: name: sensor unit: min - entity: binary_sensor - name: Tank - class: problem + translation_key: tank_full category: diagnostic dps: - id: 102 @@ -129,10 +128,8 @@ secondary_entities: mapping: - dps_val: Bucket_OK value: false - icon: "mdi:pail-outline" - dps_val: Bucket_Full value: true - icon: "mdi:pail-remove" - entity: switch name: Night mode category: config diff --git a/custom_components/tuya_local/devices/eeese_anna_dehumidifier.yaml b/custom_components/tuya_local/devices/eeese_anna_dehumidifier.yaml index a7588f93b1..d7bf9d5dae 100644 --- a/custom_components/tuya_local/devices/eeese_anna_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/eeese_anna_dehumidifier.yaml @@ -54,8 +54,7 @@ primary_entity: icon_priority: 1 secondary_entities: - entity: binary_sensor - name: Tank - class: problem + translation_key: tank_full category: diagnostic dps: - id: 19 diff --git a/custom_components/tuya_local/devices/eeese_carl_dehumidifier.yaml b/custom_components/tuya_local/devices/eeese_carl_dehumidifier.yaml index b26c86c300..e10be35a8b 100644 --- a/custom_components/tuya_local/devices/eeese_carl_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/eeese_carl_dehumidifier.yaml @@ -58,8 +58,7 @@ secondary_entities: unit: "%" class: measurement - entity: binary_sensor - name: Tank - class: problem + translation_key: tank_full category: diagnostic dps: - id: 19 diff --git a/custom_components/tuya_local/devices/eeese_otto_dehumidifier.yaml b/custom_components/tuya_local/devices/eeese_otto_dehumidifier.yaml index 4e57833c85..b64dab000e 100644 --- a/custom_components/tuya_local/devices/eeese_otto_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/eeese_otto_dehumidifier.yaml @@ -59,8 +59,7 @@ secondary_entities: unit: "%" class: measurement - entity: binary_sensor - name: Tank - class: problem + translation_key: tank_full category: diagnostic dps: - id: 19 diff --git a/custom_components/tuya_local/devices/eesee_adam_dehumidifier.yaml b/custom_components/tuya_local/devices/eesee_adam_dehumidifier.yaml index 1a3b5d10c6..19d2adce03 100644 --- a/custom_components/tuya_local/devices/eesee_adam_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/eesee_adam_dehumidifier.yaml @@ -76,8 +76,7 @@ secondary_entities: unit: "%" class: measurement - entity: binary_sensor - name: Tank - class: problem + translation_key: tank_full category: diagnostic dps: - id: 19 diff --git a/custom_components/tuya_local/devices/electriq_cd12pro_dehumidifier.yaml b/custom_components/tuya_local/devices/electriq_cd12pro_dehumidifier.yaml index 6202caa744..91237d9ce8 100644 --- a/custom_components/tuya_local/devices/electriq_cd12pro_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/electriq_cd12pro_dehumidifier.yaml @@ -133,8 +133,7 @@ secondary_entities: - dps_val: false icon: "mdi:sleep-off" - entity: binary_sensor - name: Tank - class: problem + translation_key: tank_full category: diagnostic dps: - id: 19 @@ -143,7 +142,5 @@ secondary_entities: mapping: - dps_val: 1 value: true - icon: "mdi:flask-empty" - dps_val: 0 value: false - icon: "mdi:flask-empty-outline" diff --git a/custom_components/tuya_local/devices/electriq_cd12pwv2_dehumidifier.yaml b/custom_components/tuya_local/devices/electriq_cd12pwv2_dehumidifier.yaml index c402121132..5d3cd31ecb 100644 --- a/custom_components/tuya_local/devices/electriq_cd12pwv2_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/electriq_cd12pwv2_dehumidifier.yaml @@ -74,7 +74,7 @@ secondary_entities: - dps_val: false icon: "mdi:sleep-off" - entity: binary_sensor - name: Tank + translation_key: tank_full category: diagnostic dps: - id: 19 @@ -83,7 +83,5 @@ secondary_entities: mapping: - dps_val: 1 value: true - icon: "mdi:flask-empty" - dps_val: 0 value: false - icon: "mdi:flask-empty-outline" diff --git a/custom_components/tuya_local/devices/goldair_dehumidifier.yaml b/custom_components/tuya_local/devices/goldair_dehumidifier.yaml index 3a6c124645..89da0b34a8 100644 --- a/custom_components/tuya_local/devices/goldair_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/goldair_dehumidifier.yaml @@ -146,8 +146,7 @@ secondary_entities: class: measurement unit: "%" - entity: binary_sensor - name: Tank - class: problem + translation_key: tank_full category: diagnostic dps: - id: 11 diff --git a/custom_components/tuya_local/devices/goldair_gpdh340_dehumidifier.yaml b/custom_components/tuya_local/devices/goldair_gpdh340_dehumidifier.yaml index 9f0778ea64..fb59c25f9e 100644 --- a/custom_components/tuya_local/devices/goldair_gpdh340_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/goldair_gpdh340_dehumidifier.yaml @@ -122,8 +122,7 @@ secondary_entities: unit: "%" class: measurement - entity: binary_sensor - name: Tank - class: problem + translation_key: tank_full category: diagnostic dps: - id: 11 diff --git a/custom_components/tuya_local/devices/hyundai_sahara_dehumidifier.yaml b/custom_components/tuya_local/devices/hyundai_sahara_dehumidifier.yaml index 2a3ef86dd8..2decfbf222 100644 --- a/custom_components/tuya_local/devices/hyundai_sahara_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/hyundai_sahara_dehumidifier.yaml @@ -94,8 +94,7 @@ secondary_entities: type: boolean name: lock - entity: binary_sensor - name: Tank - class: problem + translation_key: tank_full category: diagnostic dps: - id: 19 diff --git a/custom_components/tuya_local/devices/inventor_atmospherexl_dehumidifier.yaml b/custom_components/tuya_local/devices/inventor_atmospherexl_dehumidifier.yaml index 96ceeb8779..c003db6457 100644 --- a/custom_components/tuya_local/devices/inventor_atmospherexl_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/inventor_atmospherexl_dehumidifier.yaml @@ -208,8 +208,7 @@ secondary_entities: value: true - value: false - entity: binary_sensor - class: problem - name: Tank full or missing + translation_key: tank_full category: diagnostic dps: - id: 19 diff --git a/custom_components/tuya_local/devices/inventor_evaionpro_dehumidifier.yaml b/custom_components/tuya_local/devices/inventor_evaionpro_dehumidifier.yaml index 92508ff12f..8544246347 100644 --- a/custom_components/tuya_local/devices/inventor_evaionpro_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/inventor_evaionpro_dehumidifier.yaml @@ -119,8 +119,7 @@ secondary_entities: value: false - value: true - entity: binary_sensor - name: Tank Full - class: problem + translation_key: tank_full category: diagnostic dps: - id: 101 diff --git a/custom_components/tuya_local/devices/jjpro_jpd01_dehumidifier.yaml b/custom_components/tuya_local/devices/jjpro_jpd01_dehumidifier.yaml index 2a85c8e595..baf6127e19 100644 --- a/custom_components/tuya_local/devices/jjpro_jpd01_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/jjpro_jpd01_dehumidifier.yaml @@ -115,8 +115,7 @@ secondary_entities: class: measurement unit: "%" - entity: binary_sensor - name: Tank - class: problem + translation_key: tank_full category: diagnostic dps: - id: 11 diff --git a/custom_components/tuya_local/devices/jjpro_jpd02_dehumidifier.yaml b/custom_components/tuya_local/devices/jjpro_jpd02_dehumidifier.yaml index fca44068ad..62e62d6f8c 100644 --- a/custom_components/tuya_local/devices/jjpro_jpd02_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/jjpro_jpd02_dehumidifier.yaml @@ -93,8 +93,7 @@ secondary_entities: type: boolean name: lock - entity: binary_sensor - name: Tank - class: problem + translation_key: tank_full category: diagnostic dps: - id: 19 diff --git a/custom_components/tuya_local/devices/kogan_dehumidifier.yaml b/custom_components/tuya_local/devices/kogan_dehumidifier.yaml index d7fb7e7529..65023e3615 100644 --- a/custom_components/tuya_local/devices/kogan_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/kogan_dehumidifier.yaml @@ -86,8 +86,7 @@ secondary_entities: class: measurement unit: "%" - entity: binary_sensor - class: problem - name: Tank + translation_key: tank_full category: diagnostic dps: - id: 11 diff --git a/custom_components/tuya_local/devices/kyvol_ea200_humidifier.yaml b/custom_components/tuya_local/devices/kyvol_ea200_humidifier.yaml index 4af3de00e3..ac1c819080 100644 --- a/custom_components/tuya_local/devices/kyvol_ea200_humidifier.yaml +++ b/custom_components/tuya_local/devices/kyvol_ea200_humidifier.yaml @@ -54,8 +54,7 @@ primary_entity: value: 100 secondary_entities: - entity: binary_sensor - name: Tank empty - class: problem + translation_key: tank_empty category: diagnostic dps: - id: 22 diff --git a/custom_components/tuya_local/devices/probreeze_pb20.yaml b/custom_components/tuya_local/devices/probreeze_pb20.yaml index 62e4ce3c42..3dfc9dbc8e 100644 --- a/custom_components/tuya_local/devices/probreeze_pb20.yaml +++ b/custom_components/tuya_local/devices/probreeze_pb20.yaml @@ -133,10 +133,7 @@ secondary_entities: name: sensor unit: min - entity: binary_sensor - name: Tank - class: problem - icon: "mdi:cup-outline" - icon_priority: 2 + translation_key: tank_full category: diagnostic dps: - id: 11 @@ -145,6 +142,4 @@ secondary_entities: mapping: - dps_val: 8 value: true - icon: "mdi:cup-water" - icon_priority: 1 - value: false diff --git a/custom_components/tuya_local/devices/shinco_30d_dehumidifier.yaml b/custom_components/tuya_local/devices/shinco_30d_dehumidifier.yaml index 7ddd4db097..ac064a164e 100644 --- a/custom_components/tuya_local/devices/shinco_30d_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/shinco_30d_dehumidifier.yaml @@ -86,8 +86,7 @@ secondary_entities: value: true - value: false - entity: binary_sensor - name: Tank - class: problem + translation_key: tank_full category: diagnostic dps: - id: 11 diff --git a/custom_components/tuya_local/devices/stadlerform_karl_humidifier.yaml b/custom_components/tuya_local/devices/stadlerform_karl_humidifier.yaml index 9d786c58b1..2970b11ab8 100644 --- a/custom_components/tuya_local/devices/stadlerform_karl_humidifier.yaml +++ b/custom_components/tuya_local/devices/stadlerform_karl_humidifier.yaml @@ -41,8 +41,7 @@ secondary_entities: unit: "%" class: measurement - entity: binary_sensor - name: Low water - class: problem + translation_key: tank_empty category: diagnostic dps: - id: 22 diff --git a/custom_components/tuya_local/devices/suntec_coolfix_airconditioner.yaml b/custom_components/tuya_local/devices/suntec_coolfix_airconditioner.yaml index c5b830af1a..2c76dc1e8a 100644 --- a/custom_components/tuya_local/devices/suntec_coolfix_airconditioner.yaml +++ b/custom_components/tuya_local/devices/suntec_coolfix_airconditioner.yaml @@ -120,8 +120,7 @@ secondary_entities: value: false - value: true - entity: binary_sensor - name: Tank full - class: problem + translation_key: tank_full category: diagnostic dps: - id: 22 diff --git a/custom_components/tuya_local/devices/vivosun_de0003_dehumidifier.yaml b/custom_components/tuya_local/devices/vivosun_de0003_dehumidifier.yaml index 904263e52c..1a76fd36ac 100644 --- a/custom_components/tuya_local/devices/vivosun_de0003_dehumidifier.yaml +++ b/custom_components/tuya_local/devices/vivosun_de0003_dehumidifier.yaml @@ -151,10 +151,8 @@ secondary_entities: - dps_val: 24h value: 24 hours - entity: binary_sensor - class: problem - name: Tank full + translation_key: tank_full category: diagnostic - icon: "mdi:cup-water" dps: - id: 19 type: bitfield diff --git a/custom_components/tuya_local/devices/wilfa_haze_hu400bc_humidifier.yaml b/custom_components/tuya_local/devices/wilfa_haze_hu400bc_humidifier.yaml index bbc1faaf80..4c5392f7a4 100644 --- a/custom_components/tuya_local/devices/wilfa_haze_hu400bc_humidifier.yaml +++ b/custom_components/tuya_local/devices/wilfa_haze_hu400bc_humidifier.yaml @@ -194,10 +194,8 @@ secondary_entities: name: switch type: boolean - entity: binary_sensor - class: problem - name: Tank + translation_key: tank_empty category: diagnostic - icon: "mdi:cup-outline" dps: - id: 22 type: bitfield diff --git a/custom_components/tuya_local/devices/woods_cortina_airconditioner.yaml b/custom_components/tuya_local/devices/woods_cortina_airconditioner.yaml index f04772daab..553b5cea59 100644 --- a/custom_components/tuya_local/devices/woods_cortina_airconditioner.yaml +++ b/custom_components/tuya_local/devices/woods_cortina_airconditioner.yaml @@ -70,8 +70,7 @@ secondary_entities: value: false - value: true - entity: binary_sensor - name: Water tank full - class: problem + translation_key: tank_full category: diagnostic dps: - id: 22 diff --git a/custom_components/tuya_local/icons.json b/custom_components/tuya_local/icons.json index 52bc199fd1..23e4f4863b 100644 --- a/custom_components/tuya_local/icons.json +++ b/custom_components/tuya_local/icons.json @@ -6,6 +6,18 @@ "state": { "on": "mdi:snowflake-melt" } + }, + "tank_empty": { + "default": "mdi:water", + "state": { + "on": "mdi:water-alert-outline" + } + }, + "tank_full": { + "default": "mdi:water-outline", + "state": { + "on": "mdi:water-alert" + } } }, "lock": { diff --git a/custom_components/tuya_local/translations/bg.json b/custom_components/tuya_local/translations/bg.json index d4abbe6e7d..4efc371723 100644 --- a/custom_components/tuya_local/translations/bg.json +++ b/custom_components/tuya_local/translations/bg.json @@ -66,6 +66,20 @@ "off": "Нормално", "on": "Размразяване" } + }, + "tank_empty": { + "name": "Резервоар", + "state": { + "off": "OK", + "on": "Ниско" + } + }, + "tank_full": { + "name": "Резервоар", + "state": { + "off": "OK", + "on": "Пълна" + } } }, "climate": { diff --git a/custom_components/tuya_local/translations/cz.json b/custom_components/tuya_local/translations/cz.json index d3169ba0bf..3f83f42b73 100644 --- a/custom_components/tuya_local/translations/cz.json +++ b/custom_components/tuya_local/translations/cz.json @@ -66,6 +66,20 @@ "off": "Normální", "on": "Rozmrazování" } + }, + "tank_empty": { + "name": "Nádrž", + "state": { + "off": "OK", + "on": "Nízká" + } + }, + "tank_full": { + "name": "Nádrž", + "state": { + "off": "OK", + "on": "Plná" + } } }, "climate": { diff --git a/custom_components/tuya_local/translations/en.json b/custom_components/tuya_local/translations/en.json index d3100f3ec2..2b10d75fdb 100644 --- a/custom_components/tuya_local/translations/en.json +++ b/custom_components/tuya_local/translations/en.json @@ -66,6 +66,20 @@ "off": "Normal", "on": "Defrosting" } + }, + "tank_empty": { + "name": "Tank", + "state": { + "off": "OK", + "on": "Low" + } + }, + "tank_full": { + "name": "Tank", + "state": { + "off": "OK", + "on": "Full" + } } }, "climate": { diff --git a/custom_components/tuya_local/translations/es.json b/custom_components/tuya_local/translations/es.json index a254d9fff3..2f6cfe1f83 100644 --- a/custom_components/tuya_local/translations/es.json +++ b/custom_components/tuya_local/translations/es.json @@ -66,6 +66,20 @@ "off": "Normal", "on": "Deshelamiento" } + }, + "tank_empty": { + "name": "Depósito", + "state": { + "off": "OK", + "on": "Bajo" + } + }, + "tank_full": { + "name": "Depósito", + "state": { + "off": "OK", + "on": "Lleno" + } } }, "climate": { diff --git a/custom_components/tuya_local/translations/fr.json b/custom_components/tuya_local/translations/fr.json index 314ea7a484..e08e133d34 100644 --- a/custom_components/tuya_local/translations/fr.json +++ b/custom_components/tuya_local/translations/fr.json @@ -66,6 +66,20 @@ "off": "Normale", "on": "Dégivrage" } + }, + "tank_empty": { + "name": "Réservoir", + "state": { + "off": "OK", + "on": "Faible" + } + }, + "tank_full": { + "name": "Réservoir", + "state": { + "off": "OK", + "on": "Pleine" + } } }, "climate": { diff --git a/custom_components/tuya_local/translations/hu.json b/custom_components/tuya_local/translations/hu.json index c8f81d72fa..8b54070006 100644 --- a/custom_components/tuya_local/translations/hu.json +++ b/custom_components/tuya_local/translations/hu.json @@ -67,6 +67,20 @@ "off": "Normál", "on": "Leolvasztás" } + }, + "tank_empty": { + "name": "Tartály", + "state": { + "off": "OK", + "on": "Alacsony" + } + }, + "tank_full": { + "name": "Tartály", + "state": { + "off": "OK", + "on": "Teljes" + } } }, "climate": { diff --git a/custom_components/tuya_local/translations/id.json b/custom_components/tuya_local/translations/id.json index f47f6326c4..1c7b84fb0a 100644 --- a/custom_components/tuya_local/translations/id.json +++ b/custom_components/tuya_local/translations/id.json @@ -66,6 +66,20 @@ "off": "Normal", "on": "Pencairan bunga es" } + }, + "tank_empty": { + "name": "Tangki", + "state": { + "off": "Oke", + "on": "Rendah" + } + }, + "tank_full": { + "name": "Tangki", + "state": { + "off": "Oke", + "on": "Penuh" + } } }, "climate": { diff --git a/custom_components/tuya_local/translations/it.json b/custom_components/tuya_local/translations/it.json index 1cea571c6d..e3b57664ee 100644 --- a/custom_components/tuya_local/translations/it.json +++ b/custom_components/tuya_local/translations/it.json @@ -66,6 +66,20 @@ "off": "Normale", "on": "Scongelamento" } + }, + "tank_empty": { + "name": "Cisterna", + "state": { + "off": "OK", + "on": "Bassa" + } + }, + "tank_full": { + "name": "Cisterna", + "state": { + "off": "OK", + "on": "Piena" + } } }, "climate": { diff --git a/custom_components/tuya_local/translations/no-NB.json b/custom_components/tuya_local/translations/no-NB.json index 55407bf0db..24a6611c3f 100644 --- a/custom_components/tuya_local/translations/no-NB.json +++ b/custom_components/tuya_local/translations/no-NB.json @@ -66,6 +66,20 @@ "off": "Normal", "on": "Tining" } + }, + "tank_empty": { + "name": "Tank", + "state": { + "off": "OK", + "on": "Lav" + } + }, + "tank_full": { + "name": "Tank", + "state": { + "off": "OK", + "on": "Full" + } } }, "climate": { diff --git a/custom_components/tuya_local/translations/pl.json b/custom_components/tuya_local/translations/pl.json index 7ab84a9119..725fd47193 100644 --- a/custom_components/tuya_local/translations/pl.json +++ b/custom_components/tuya_local/translations/pl.json @@ -63,9 +63,23 @@ "defrost": { "name": "Rozmrażać", "state": { - "off": "Normalna", + "off": "Naladowana", "on": "Rozmrażanie" } + }, + "tank_empty": { + "name": "Zbiornik", + "state": { + "off": "OK", + "on": "Niski" + } + }, + "tank_full": { + "name": "Zbiornik", + "state": { + "off": "OK", + "on": "Pełny" + } } }, "climate": { @@ -176,7 +190,7 @@ "state_attributes": { "preset_mode": { "state": { - "normal": "Normalny", + "normal": "Naladowana", "nature": "Naturalny", "sleep": "Uśpiony", "baby": "Dziecko", diff --git a/custom_components/tuya_local/translations/pt-BR.json b/custom_components/tuya_local/translations/pt-BR.json index e47f12b230..5cecfd7376 100644 --- a/custom_components/tuya_local/translations/pt-BR.json +++ b/custom_components/tuya_local/translations/pt-BR.json @@ -66,6 +66,20 @@ "off": "Normal", "on": "Descongelar" } + }, + "tank_empty": { + "name": "Tanque", + "state": { + "off": "OK", + "on": "Baixo" + } + }, + "tank_full": { + "name": "Tanque", + "state": { + "off": "OK", + "on": "Cheio" + } } }, "climate": { diff --git a/custom_components/tuya_local/translations/ru.json b/custom_components/tuya_local/translations/ru.json index 02bbbe2dad..c843f2137e 100644 --- a/custom_components/tuya_local/translations/ru.json +++ b/custom_components/tuya_local/translations/ru.json @@ -66,6 +66,20 @@ "off": "Нормальный", "on": "Разморозка" } + }, + "tank_empty": { + "name": "Бак", + "state": { + "off": "OK", + "on": "Низкий" + } + }, + "tank_full": { + "name": "Бак", + "state": { + "off": "OK", + "on": "Полный" + } } }, "climate": { @@ -176,7 +190,7 @@ "state_attributes": { "preset_mode": { "state": { - "normal": "Обычный", + "normal": "Нормальный", "nature": "Естественный", "sleep": "Сон", "baby": "Детская комната", diff --git a/custom_components/tuya_local/translations/uk.json b/custom_components/tuya_local/translations/uk.json index b5b2bfe487..3c32b46895 100644 --- a/custom_components/tuya_local/translations/uk.json +++ b/custom_components/tuya_local/translations/uk.json @@ -63,9 +63,23 @@ "defrost": { "name": "Розморожування", "state": { - "off": "Нормальний", + "off": "Нормально", "on": "Розморожування" } + }, + "tank_empty": { + "name": "Танк", + "state": { + "off": "OK", + "on": "Низький" + } + }, + "tank_full": { + "name": "Танк", + "state": { + "off": "OK", + "on": "Повний" + } } }, "climate": { @@ -176,7 +190,7 @@ "state_attributes": { "preset_mode": { "state": { - "normal": "Нормальний", + "normal": "Нормально", "nature": "Природні", "sleep": "Сон", "baby": "Дитина", diff --git a/custom_components/tuya_local/translations/ur.json b/custom_components/tuya_local/translations/ur.json index 7050078710..eb38809403 100644 --- a/custom_components/tuya_local/translations/ur.json +++ b/custom_components/tuya_local/translations/ur.json @@ -66,6 +66,20 @@ "off": "نارمل", "on": "ڈیفروسٹنگ" } + }, + "tank_empty": { + "name": "ٹینک", + "state": { + "off": "اوکے", + "on": "کم" + } + }, + "tank_full": { + "name": "ٹینک", + "state": { + "off": "اوکے", + "on": "مکمل" + } } }, "climate": { diff --git a/tests/devices/test_eanons_humidifier.py b/tests/devices/test_eanons_humidifier.py index e48dc51d9d..b84ccf3b73 100644 --- a/tests/devices/test_eanons_humidifier.py +++ b/tests/devices/test_eanons_humidifier.py @@ -66,11 +66,12 @@ def setUp(self): ) self.setUpBasicBinarySensor( ERROR_DPS, - self.entities.get("binary_sensor_tank"), - device_class=BinarySensorDeviceClass.PROBLEM, + self.entities.get("binary_sensor_tank_empty"), testdata=(1, 0), ) - self.mark_secondary(["select_timer", "sensor_timer", "binary_sensor_tank"]) + self.mark_secondary( + ["select_timer", "sensor_timer", "binary_sensor_tank_empty"] + ) def test_supported_features(self): self.assertEqual(self.subject.supported_features, HumidifierEntityFeature.MODES) diff --git a/tests/devices/test_wilfa_haze_hu400bc_humidifier.py b/tests/devices/test_wilfa_haze_hu400bc_humidifier.py index 757ba6fe0f..bbe082fc02 100644 --- a/tests/devices/test_wilfa_haze_hu400bc_humidifier.py +++ b/tests/devices/test_wilfa_haze_hu400bc_humidifier.py @@ -50,9 +50,8 @@ def setUp(self): self.setUpSwitchable(SWITCH_DPS, self.subject) self.setUpBasicBinarySensor( ERROR_DPS, - self.entities.get("binary_sensor_tank"), + self.entities.get("binary_sensor_tank_empty"), testdata=(1, 0), - device_class=BinarySensorDeviceClass.PROBLEM, ) self.setUpMultiLights( [ @@ -134,7 +133,7 @@ def setUp(self): ) self.mark_secondary( [ - "binary_sensor_tank", + "binary_sensor_tank_empty", "light_display", "light_mood", "select_temperature_unit", diff --git a/tests/test_binary_sensor.py b/tests/test_binary_sensor.py index 6a86c9bd6b..2722d6615a 100644 --- a/tests/test_binary_sensor.py +++ b/tests/test_binary_sensor.py @@ -37,7 +37,8 @@ async def test_init_entry(hass): await async_setup_entry(hass, entry, m_add_entities) assert ( - type(hass.data[DOMAIN]["dummy"]["binary_sensor_tank"]) == TuyaLocalBinarySensor + type(hass.data[DOMAIN]["dummy"]["binary_sensor_tank_full"]) + == TuyaLocalBinarySensor ) m_add_entities.assert_called_once()