Skip to content

Commit e0074a3

Browse files
committed
Add extra guarding for gateway
1 parent 43f8245 commit e0074a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugwise/helper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ def _get_actuator_mode(
523523
524524
Collect the requested gateway mode.
525525
"""
526-
if not (self.check_name(ADAM) and entity_id == self._gateway_id):
526+
if not (entity_id == self._gateway_id and self.check_name(ADAM)):
527527
return None
528528

529529
if (search := search_actuator_functionalities(appliance, key)) is not None:
@@ -538,7 +538,7 @@ def _get_regulation_mode(
538538
539539
Adam: collect the gateway regulation_mode.
540540
"""
541-
if self._reg_allowed_modes:
541+
if entity_id == self._gateway_id and self._reg_allowed_modes:
542542
if (
543543
mode := self._get_actuator_mode(
544544
appliance, entity_id, "regulation_mode_control_functionality"
@@ -559,7 +559,7 @@ def _get_gateway_mode(
559559
560560
Adam: collect the gateway mode.
561561
"""
562-
if self._gw_allowed_modes:
562+
if entity_id == self._gateway_id and self._gw_allowed_modes:
563563
if (
564564
mode := self._get_actuator_mode(
565565
appliance, entity_id, "gateway_mode_control_functionality"

0 commit comments

Comments
 (0)