Skip to content

Commit 051b51c

Browse files
committed
fix: re-implement #98
1 parent 2bcafd3 commit 051b51c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/tado.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -308,15 +308,17 @@ export class Tado extends BaseTado {
308308
}
309309

310310
if (zone_capabilities.type == "AIR_CONDITIONING") {
311+
const ac_capability = zone_capabilities.FAN || zone_capabilities.AUTO;
312+
311313
if (ac_mode) {
312314
config.setting.mode = ac_mode.toUpperCase() as ACMode;
313315
}
314316

315-
if (verticalSwing) {
317+
if (verticalSwing && ac_capability.verticalSwing) {
316318
config.setting.verticalSwing = verticalSwing;
317319
}
318320

319-
if (horizontalSwing) {
321+
if (horizontalSwing && ac_capability.horizontalSwing) {
320322
config.setting.horizontalSwing = horizontalSwing;
321323
}
322324

@@ -331,7 +333,7 @@ export class Tado extends BaseTado {
331333
}
332334

333335
if (fan_speed && config.setting.mode?.toLowerCase() != "dry") {
334-
if ((zone_capabilities.FAN || zone_capabilities.AUTO).fanLevel !== undefined) {
336+
if (ac_capability.fanLevel !== undefined) {
335337
config.setting.fanLevel = fan_speed.toUpperCase() as FanLevel;
336338
} else {
337339
config.setting.fanSpeed = fan_speed.toUpperCase() as FanSpeed;

0 commit comments

Comments
 (0)