Skip to content

Commit 6a74567

Browse files
committed
Optimize
1 parent 18bbb0f commit 6a74567

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

plugwise/smile.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -541,11 +541,9 @@ async def _set_preset_legacy(self, preset: str) -> None:
541541
"""Set the given Preset on the relevant Thermostat - from DOMAIN_OBJECTS."""
542542
locator = f'rule/directives/when/then[@icon="{preset}"].../.../...'
543543
rule = self._domain_objects.find(locator)
544-
545-
uri = RULES
546544
data = f'<rules><rule id="{rule.attrib["id"]}"><active>true</active></rule></rules>'
547545

548-
await self._request(uri, method="put", data=data)
546+
await self._request(RULES, method="put", data=data)
549547

550548
async def set_preset(self, loc_id: str, preset: str) -> None:
551549
"""Set the given Preset on the relevant Thermostat - from LOCATIONS."""
@@ -666,6 +664,4 @@ async def set_regulation_mode(self, mode: str) -> None:
666664

667665
async def delete_notification(self) -> None:
668666
"""Delete the active Plugwise Notification."""
669-
uri = NOTIFICATIONS
670-
671-
await self._request(uri, method="delete")
667+
await self._request(NOTIFICATIONS, method="delete")

0 commit comments

Comments
 (0)