File tree Expand file tree Collapse file tree 1 file changed +13
-19
lines changed Expand file tree Collapse file tree 1 file changed +13
-19
lines changed Original file line number Diff line number Diff line change @@ -250,25 +250,19 @@ async def set_switch_state(
250
250
appliance = self ._appliances .find (f'appliance[@id="{ appl_id } "]' )
251
251
appl_name = appliance .find ("name" ).text
252
252
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 ()
272
266
await self .call_request (APPLIANCES , method = "post" , data = data )
273
267
return
274
268
You can’t perform that action at this time.
0 commit comments