Skip to content

Commit 957c9f2

Browse files
committed
Ruffed
1 parent 610d5e5 commit 957c9f2

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

plugwise/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,7 @@ async def set_temperature_offset(self, dev_id: str, offset: float) -> None:
408408
f"Failed to set temperature offset: {str(exc)}"
409409
) from exc # pragma no cover
410410

411-
async def set_switch_state(
412-
self, appl_id: str, model: str, state: str
413-
) -> bool:
411+
async def set_switch_state(self, appl_id: str, model: str, state: str) -> bool:
414412
"""Set the given State of the relevant Switch.
415413
416414
Return the result:
@@ -422,9 +420,7 @@ async def set_switch_state(
422420
raise PlugwiseError("Invalid state supplied to set_switch_state")
423421

424422
try:
425-
return await self._smile_api.set_switch_state(
426-
appl_id, model, state
427-
)
423+
return await self._smile_api.set_switch_state(appl_id, model, state)
428424
except ConnectionFailedError as exc:
429425
raise ConnectionFailedError(
430426
f"Failed to set switch state: {str(exc)}"

plugwise/legacy/smile.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,7 @@ async def set_schedule_state(
215215
uri = f"{RULES};id={schedule_rule_id}"
216216
await self.call_request(uri, method="put", data=data)
217217

218-
async def set_switch_state(
219-
self, appl_id: str, model: str, state: str
220-
) -> bool:
218+
async def set_switch_state(self, appl_id: str, model: str, state: str) -> bool:
221219
"""Set the given state of the relevant switch.
222220
223221
For individual switches, sets the state directly.

plugwise/smile.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,7 @@ def determine_contexts(self, loc_id: str, state: str, sched_id: str) -> str:
393393

394394
return str(etree.tostring(contexts, encoding="unicode").rstrip())
395395

396-
async def set_switch_state(
397-
self, appl_id: str, model: str, state: str
398-
) -> bool:
396+
async def set_switch_state(self, appl_id: str, model: str, state: str) -> bool:
399397
"""Set the given state of the relevant Switch.
400398
401399
For individual switches, sets the state directly.

tests/test_init.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,9 +621,7 @@ async def tinker_reboot(self, api, unhappy=False):
621621
return False
622622

623623
@pytest.mark.asyncio
624-
async def tinker_switch(
625-
self, api, dev_id=None, model="relay", unhappy=False
626-
):
624+
async def tinker_switch(self, api, dev_id=None, model="relay", unhappy=False):
627625
"""Turn a Switch on and off to test functionality."""
628626
_LOGGER.info("Asserting modifying settings for switch devices:")
629627
_LOGGER.info("- Devices (%s):", dev_id)

0 commit comments

Comments
 (0)