Skip to content

Commit 050940e

Browse files
authored
Merge pull request #36 from Yokosa/main
Adding support for the new product "nhj2j7su" in the category "wk". Improved display of entity name translations.
2 parents a07568d + aeb87b4 commit 050940e

File tree

6 files changed

+57
-12
lines changed

6 files changed

+57
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The integration works locally, but connection to Tuya BLE device requires device
3939
+ Smart Lock (product_id 'ludzroix'), first attempt to support for now.
4040

4141
* Climate (category_id 'wk')
42-
+ Thermostatic Radiator Valve (product_id 'drlajpqc'), first attempt to support for now.
42+
+ Thermostatic Radiator Valve (product_ids 'drlajpqc', 'nhj2j7su'), first attempt to support for now.
4343

4444
## Support project
4545

custom_components/tuya_ble/climate.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ class TuyaBLECategoryClimateMapping:
6868
mapping: dict[str, TuyaBLECategoryClimateMapping] = {
6969
"wk": TuyaBLECategoryClimateMapping(
7070
products={
71-
"drlajpqc": [
71+
**dict.fromkeys(
72+
[
73+
"drlajpqc",
74+
"nhj2j7su",
75+
], # Thermostatic Radiator Valve
76+
[
7277
# Thermostatic Radiator Valve
7378
# - [x] 8 - Window
7479
# - [x] 10 - Antifreeze
@@ -119,8 +124,9 @@ class TuyaBLECategoryClimateMapping:
119124
target_temperature_dp_id=103,
120125
target_temperature_min=5.0,
121126
target_temperature_max=30.0,
122-
),
123-
],
127+
),
128+
],
129+
),
124130
},
125131
),
126132
}

custom_components/tuya_ble/devices.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,14 @@ class TuyaBLECategoryInfo:
252252
),
253253
"wk": TuyaBLECategoryInfo(
254254
products={
255-
"drlajpqc": TuyaBLEProductInfo( # device product_id
255+
**dict.fromkeys(
256+
[
257+
"drlajpqc",
258+
"nhj2j7su",
259+
], # device product_id
260+
TuyaBLEProductInfo(
256261
name="Thermostatic Radiator Valve",
262+
),
257263
),
258264
},
259265
),

custom_components/tuya_ble/number.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,12 @@ class TuyaBLECategoryNumberMapping:
229229
),
230230
"wk": TuyaBLECategoryNumberMapping(
231231
products={
232-
"drlajpqc": [ # Thermostatic Radiator Valve
232+
**dict.fromkeys(
233+
[
234+
"drlajpqc",
235+
"nhj2j7su",
236+
], # Thermostatic Radiator Valve
237+
[
233238
TuyaBLENumberMapping(
234239
dp_id=27,
235240
description=NumberEntityDescription(
@@ -241,9 +246,10 @@ class TuyaBLECategoryNumberMapping:
241246
native_step=1,
242247
entity_category=EntityCategory.CONFIG,
243248
entity_registry_enabled_default=True,
249+
),
244250
),
245-
),
246-
],
251+
],
252+
),
247253
},
248254
),
249255
"wsdcg": TuyaBLECategoryNumberMapping(

custom_components/tuya_ble/switch.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,12 @@ class TuyaBLECategorySwitchMapping:
162162
),
163163
"wk": TuyaBLECategorySwitchMapping(
164164
products={
165-
"drlajpqc": [ # Thermostatic Radiator Valve
165+
**dict.fromkeys(
166+
[
167+
"drlajpqc",
168+
"nhj2j7su",
169+
], # Thermostatic Radiator Valve
170+
[
166171
TuyaBLESwitchMapping(
167172
dp_id=8,
168173
description=SwitchEntityDescription(
@@ -215,9 +220,10 @@ class TuyaBLECategorySwitchMapping:
215220
icon="mdi:calendar-clock",
216221
entity_category=EntityCategory.CONFIG,
217222
entity_registry_enabled_default=True,
223+
),
218224
),
219-
),
220-
],
225+
],
226+
),
221227
},
222228
),
223229
"wsdcg": TuyaBLECategorySwitchMapping(

custom_components/tuya_ble/translations/en.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
},
5353
"up_position": {
5454
"name": "Up position"
55+
},
56+
"temperature_calibration": {
57+
"name": "Temperature calibration"
5558
}
5659
},
5760
"select": {
@@ -127,7 +130,25 @@
127130
},
128131
"switch": {
129132
"name": "Switch"
130-
}
133+
},
134+
"window_check": {
135+
"name": "Window check"
136+
},
137+
"antifreeze": {
138+
"name": "Antifreeze"
139+
},
140+
"child_lock": {
141+
"name": "Child lock"
142+
},
143+
"water_scale_proof": {
144+
"name": "Water scale proof"
145+
},
146+
"programming_mode": {
147+
"name": "Programming mode"
148+
},
149+
"programming_switch": {
150+
"name": "Programming switch"
151+
}
131152
}
132153
},
133154
"options": {

0 commit comments

Comments
 (0)