Skip to content

Commit 6a30c51

Browse files
committed
Fix
1 parent 84f79c5 commit 6a30c51

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

plugwise/legacy/smile.py

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -250,25 +250,19 @@ async def set_switch_state(
250250
appliance = self._appliances.find(f'appliance[@id="{appl_id}"]')
251251
appl_name = appliance.find("name").text
252252
appl_type = appliance.find("type").text
253-
- data = (
254-
- f'<appliances><appliance id="{appl_id}"><name><![CDATA[{appl_name}]]></name>'
255-
- f"<description><![CDATA[]]></description><type><![CDATA[{appl_type}]]></type>"
256-
- f"<{switch.actuator}><{switch.func_type}><lock>{state}</lock></{switch.func_type}></{switch.actuator}>"
257-
- "</appliance></appliances>"
258-
- )
259-
+ data = f'''
260-
+ <appliances>
261-
+ <appliance id="{appl_id}">
262-
+ <name><![CDATA[{appl_name}]]></name>
263-
+ <description><![CDATA[]]></description>
264-
+ <type><![CDATA[{appl_type}]]></type>
265-
+ <{switch.actuator}>
266-
+ <{switch.func_type}>
267-
+ <lock>{state}</lock>
268-
+ </{switch.func_type}>
269-
+ </{switch.actuator}>
270-
+ </appliance>
271-
+ </appliances>'''.strip()
253+
data = f'''
254+
<appliances>
255+
<appliance id="{appl_id}">
256+
<name><![CDATA[{appl_name}]]></name>
257+
<description><![CDATA[]]></description>
258+
<type><![CDATA[{appl_type}]]></type>
259+
<{switch.actuator}>
260+
<{switch.func_type}>
261+
<lock>{state}</lock>
262+
</{switch.func_type}>
263+
</{switch.actuator}>
264+
</appliance>
265+
</appliances>'''.strip()
272266
await self.call_request(APPLIANCES, method="post", data=data)
273267
return
274268

0 commit comments

Comments
 (0)