Skip to content

Commit 5f0d779

Browse files
committed
Implement SonarQube suggestion, add explanatory comment
1 parent 3ce925f commit 5f0d779

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugwise/helper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ def _get_regulation_mode(
543543
appliance, entity_id, "regulation_mode_control_functionality"
544544
)
545545
) is not None:
546+
# Below line needs to be here to set the boolean for older Adam firmware - for testing only
546547
self._cooling_enabled = mode == "cooling"
547548
if self._reg_allowed_modes:
548549
data["select_regulation_mode"] = mode
@@ -559,10 +560,9 @@ def _get_gateway_mode(
559560
mode := self._get_actuator_mode(
560561
appliance, entity_id, "gateway_mode_control_functionality"
561562
)
562-
) is not None:
563-
if self._gw_allowed_modes:
564-
data["select_gateway_mode"] = mode
565-
self._count += 1
563+
) is not None and self._gw_allowed_modes:
564+
data["select_gateway_mode"] = mode
565+
self._count += 1
566566

567567
def _get_gateway_outdoor_temp(self, entity_id: str, data: GwEntityData) -> None:
568568
"""Adam & Anna: the Smile outdoor_temperature is present in the Home location."""

0 commit comments

Comments
 (0)