Skip to content

Commit e543f11

Browse files
authored
Merge pull request #327 from jwillemsen/jwi-testfanmodes
Extend logging and added test for checking fanmodes
2 parents eada847 + a2e0fb2 commit e543f11

File tree

4 files changed

+2404
-4
lines changed

4 files changed

+2404
-4
lines changed

custom_components/daikin_onecta/climate.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -445,12 +445,17 @@ def get_fan_mode(self):
445445
if mode == FANMODE_FIXED:
446446
fsm = fan_speed.get("modes")
447447
if fsm is not None:
448-
_LOGGER.info("FSM %s", fsm)
449448
fixedModes = fsm[mode]
450449
fan_mode = str(fixedModes["value"])
451450
else:
452451
fan_mode = mode
453452

453+
_LOGGER.info(
454+
"Device '%s' has fan mode '%s'",
455+
self._device.name,
456+
fan_mode,
457+
)
458+
454459
return fan_mode
455460

456461
def get_fan_modes(self):
@@ -466,11 +471,9 @@ def get_fan_modes(self):
466471
if fan_speed is not None:
467472
_LOGGER.info("Found fanspeed %s", fan_speed)
468473
for c in fan_speed["currentMode"]["values"]:
469-
_LOGGER.info("Device '%s' found fan mode %s", self._device.name, c)
470474
if c == FANMODE_FIXED:
471475
fsm = fan_speed.get("modes")
472476
if fsm is not None:
473-
_LOGGER.info("Device '%s' found fixed %s", self._device.name, fsm)
474477
fixedModes = fsm[c]
475478
min_val = int(fixedModes["minValue"])
476479
max_val = int(fixedModes["maxValue"])
@@ -480,12 +483,18 @@ def get_fan_modes(self):
480483
else:
481484
fan_modes.append(c)
482485

486+
_LOGGER.info(
487+
"Device '%s' has fan modes '%s'",
488+
self._device.name,
489+
fan_modes,
490+
)
491+
483492
return fan_modes
484493

485494
async def async_set_fan_mode(self, fan_mode):
486495
"""Set the fan mode"""
487496
_LOGGER.debug(
488-
"Device '%s' request to set fan_mode to %s",
497+
"Device '%s' request to set fan_mode to '%s'",
489498
self._device.name,
490499
fan_mode,
491500
)

0 commit comments

Comments
 (0)