File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed
Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -250,12 +250,25 @@ 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- )
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 ()
259272 await self .call_request (APPLIANCES , method = "post" , data = data )
260273 return
261274
You can’t perform that action at this time.
0 commit comments