Skip to content

Commit b1edc9c

Browse files
bouwewfrenck
andauthored
Apply suggestions from code review
Co-authored-by: Franck Nijhof <[email protected]>
1 parent 0c81427 commit b1edc9c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

plugwise/smile.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def _device_data_climate(self, details, device_data) -> dict[str, Any]:
164164

165165
# Operation mode: auto, heat, cool
166166
device_data["mode"] = "auto"
167-
schedule_status: bool = False
167+
schedule_status = False
168168
if sel_schema != "None":
169169
schedule_status = True
170170
if not schedule_status:
@@ -308,8 +308,8 @@ async def _smile_detect_legacy(self, result, dsmrmain) -> tuple[str, str]:
308308
anna: etree | None = result.find('.//appliance[type="thermostat"]')
309309
# Fake insert version assuming Anna
310310
# couldn't find another way to identify as legacy Anna
311-
version: str = "1.8.0"
312-
model: str = "smile_thermo"
311+
version = "1.8.0"
312+
model = "smile_thermo"
313313
if anna is None:
314314
# P1 legacy:
315315
if dsmrmain is not None:
@@ -503,20 +503,20 @@ async def set_schedule_state(self, loc_id: str, name: str, state: str) -> bool:
503503
return False
504504

505505
schema_rule_id: str = next(iter(schema_rule))
506-
info: str = ""
506+
info = ""
507507
if state == "on":
508508
info = f'<context><zone><location id="{loc_id}" /></zone></context>'
509509

510-
template: str = (
510+
template = (
511511
'<template tag="zone_preset_based_on_time_and_presence_with_override" />'
512512
)
513513
if self.smile_name != "Adam":
514-
locator: str = f'.//*[@id="{schema_rule_id}"]/template'
514+
locator = f'.//*[@id="{schema_rule_id}"]/template'
515515
template_id = self._domain_objects.find(locator).attrib["id"]
516-
template: str = f'<template id="{template_id}" />'
516+
template = f'<template id="{template_id}" />'
517517

518-
uri: str = f"{RULES};id={schema_rule_id}"
519-
data: str = (
518+
uri = f"{RULES};id={schema_rule_id}"
519+
data = (
520520
f'<rules><rule id="{schema_rule_id}"><name><![CDATA[{name}]]></name>'
521521
f"{template}<contexts>{info}</contexts></rule></rules>"
522522
)
@@ -531,7 +531,7 @@ async def _set_preset_legacy(self, preset) -> bool:
531531
if (rule := self._domain_objects.find(locator)) is None:
532532
return False
533533

534-
uri: str = f"{RULES}"
534+
uri = RULES
535535
data: str = f'<rules><rule id="{rule.attrib["id"]}"><active>true</active></rule></rules>'
536536

537537
await self._request(uri, method="put", data=data)
@@ -635,7 +635,7 @@ async def set_switch_state(
635635

636636
async def delete_notification(self) -> bool:
637637
"""Delete the active Plugwise Notification."""
638-
uri: str = f"{NOTIFICATIONS}"
638+
uri = NOTIFICATIONS
639639

640640
await self._request(uri, method="delete")
641641
return True

0 commit comments

Comments
 (0)