homebridge-ac-freedom 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config.schema.json +0 -9
- package/package.json +1 -1
- package/src/ac-accessory.js +16 -11
package/config.schema.json
CHANGED
|
@@ -83,15 +83,6 @@
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
|
-
"hvacModes": {
|
|
87
|
-
"title": "Enabled HVAC Modes",
|
|
88
|
-
"type": "object",
|
|
89
|
-
"properties": {
|
|
90
|
-
"auto": { "title": "Auto", "type": "boolean", "default": true },
|
|
91
|
-
"cool": { "title": "Cool", "type": "boolean", "default": true },
|
|
92
|
-
"heat": { "title": "Heat", "type": "boolean", "default": true }
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
86
|
"presets": {
|
|
96
87
|
"title": "Enabled Preset Modes (shown as switches in climate card)",
|
|
97
88
|
"type": "object",
|
package/package.json
CHANGED
package/src/ac-accessory.js
CHANGED
|
@@ -94,7 +94,6 @@ class AcFreedomAccessory {
|
|
|
94
94
|
|| this.accessory.addService(this.Service.HeaterCooler, this.config.name);
|
|
95
95
|
|
|
96
96
|
const C = this.Characteristic;
|
|
97
|
-
const hvac = this.config.hvacModes || { auto: true, cool: true, heat: true };
|
|
98
97
|
|
|
99
98
|
// Active (on/off)
|
|
100
99
|
this.heaterCooler.getCharacteristic(C.Active)
|
|
@@ -115,15 +114,15 @@ class AcFreedomAccessory {
|
|
|
115
114
|
}
|
|
116
115
|
});
|
|
117
116
|
|
|
118
|
-
// Target state (auto/heat/cool)
|
|
119
|
-
const validStates = [];
|
|
120
|
-
if (hvac.auto) validStates.push(C.TargetHeaterCoolerState.AUTO);
|
|
121
|
-
if (hvac.heat) validStates.push(C.TargetHeaterCoolerState.HEAT);
|
|
122
|
-
if (hvac.cool) validStates.push(C.TargetHeaterCoolerState.COOL);
|
|
123
|
-
if (validStates.length === 0) validStates.push(C.TargetHeaterCoolerState.AUTO);
|
|
124
|
-
|
|
117
|
+
// Target state – all HVAC modes always enabled (auto/heat/cool)
|
|
125
118
|
this.heaterCooler.getCharacteristic(C.TargetHeaterCoolerState)
|
|
126
|
-
.setProps({
|
|
119
|
+
.setProps({
|
|
120
|
+
validValues: [
|
|
121
|
+
C.TargetHeaterCoolerState.AUTO,
|
|
122
|
+
C.TargetHeaterCoolerState.HEAT,
|
|
123
|
+
C.TargetHeaterCoolerState.COOL,
|
|
124
|
+
],
|
|
125
|
+
})
|
|
127
126
|
.onGet(() => {
|
|
128
127
|
switch (this.state.mode) {
|
|
129
128
|
case CLOUD_MODE.HEAT: return C.TargetHeaterCoolerState.HEAT;
|
|
@@ -180,9 +179,15 @@ class AcFreedomAccessory {
|
|
|
180
179
|
}
|
|
181
180
|
|
|
182
181
|
// ── Reorder linked services ───────────────────────────────────
|
|
183
|
-
// Remove cached linked services from the accessory
|
|
184
|
-
// re-added in the correct display order:
|
|
182
|
+
// Remove cached linked services from both the accessory and the
|
|
183
|
+
// HeaterCooler so they are re-added in the correct display order:
|
|
184
|
+
// Fan → Presets → Display.
|
|
185
185
|
reorderLinkedServices() {
|
|
186
|
+
// Clear HeaterCooler's linked services list to reset display order
|
|
187
|
+
if (this.heaterCooler.linkedServices) {
|
|
188
|
+
this.heaterCooler.linkedServices = [];
|
|
189
|
+
}
|
|
190
|
+
|
|
186
191
|
const ids = [
|
|
187
192
|
{ type: this.Service.Fanv2, subtype: 'fan' },
|
|
188
193
|
{ type: this.Service.Switch, subtype: 'sleep' },
|