Skip to content

Commit efb98b3

Browse files
committed
Add 'high' mode to humidifier capabilities and presentation
- Updated humidifierMode_capability.json to include 'high' mode in the list of operational modes. - Enhanced humidifierMode_presentation.json to reflect 'high' mode with appropriate key and value pairs. - Modified profile_builder.lua to accommodate changes in mode mapping for improved profile logic.
1 parent aaea3d0 commit efb98b3

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

xiaomi-miot/custom_capabilities/humidifierMode_capability.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"auto",
2626
"silent",
2727
"medium",
28+
"high",
2829
"favorite"
2930
]
3031
},
@@ -51,6 +52,7 @@
5152
"auto",
5253
"silent",
5354
"medium",
55+
"high",
5456
"favorite"
5557
]
5658
}
@@ -105,6 +107,10 @@
105107
"command": "medium",
106108
"value": "medium"
107109
},
110+
{
111+
"command": "high",
112+
"value": "high"
113+
},
108114
{
109115
"command": "favorite",
110116
"value": "favorite"
@@ -141,6 +147,7 @@
141147
"auto",
142148
"silent",
143149
"medium",
150+
"high",
144151
"favorite"
145152
]
146153
}
@@ -203,6 +210,11 @@
203210
"name": "medium",
204211
"sensitive": false
205212
},
213+
"high": {
214+
"arguments": [],
215+
"name": "high",
216+
"sensitive": false
217+
},
206218
"favorite": {
207219
"arguments": [],
208220
"name": "favorite",
@@ -240,6 +252,7 @@
240252
"auto",
241253
"silent",
242254
"medium",
255+
"high",
243256
"favorite"
244257
]
245258
}

xiaomi-miot/custom_capabilities/humidifierMode_presentation.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@
6767
"value": "Medium",
6868
"type": "active"
6969
},
70+
{
71+
"key": "high",
72+
"value": "High",
73+
"type": "active"
74+
},
7075
{
7176
"key": "favorite",
7277
"value": "Favorite",
@@ -138,6 +143,11 @@
138143
"value": "Medium",
139144
"type": "active"
140145
},
146+
{
147+
"key": "high",
148+
"value": "High",
149+
"type": "active"
150+
},
141151
{
142152
"key": "favorite",
143153
"value": "Favorite",
@@ -215,6 +225,11 @@
215225
"value": "Medium",
216226
"type": "active"
217227
},
228+
{
229+
"key": "high",
230+
"value": "High",
231+
"type": "active"
232+
},
218233
{
219234
"key": "favorite",
220235
"value": "Favorite",
@@ -293,6 +308,11 @@
293308
"value": "Medium",
294309
"type": "active"
295310
},
311+
{
312+
"key": "high",
313+
"value": "High",
314+
"type": "active"
315+
},
296316
{
297317
"key": "favorite",
298318
"value": "Favorite",

xiaomi-miot/src/profile_builder.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ function M.get_profile_for_model(model)
3434
if not has_target_humidity and not has_mode then
3535
return "xiaomi-humidifier-only-th"
3636
-- Check if temperature is supported (and has target_humidity or mode)
37-
elseif (spec.properties and spec.properties.temperature) or (spec.property_map and spec.property_map.temperature) then
37+
elseif (spec.properties and spec.properties.temperature) or
38+
(spec.property_map and (spec.property_map.temperature or spec.property_map.temp_dec)) then
3839
return "xiaomi-humidifier-temp"
3940
end
4041
end

0 commit comments

Comments
 (0)