File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -241,12 +241,22 @@ async def set_switch_state(
241241
242242 if model == "lock" :
243243 state = "false" if state == "off" else "true"
244+ appliance = self ._appliances .find (f'appliance[@id="{ appl_id } "]' )
245+ appl_name = appliance .find ("name" ).text
246+ appl_type = appliance .find ("type" ).text
247+ data = (
248+ f'<appliances><appliance id="{ appl_id } "><name><![CDATA[{ appl_name } ]></name>'
249+ f"<description><![CDATA[]]></description><type><![CDATA[{ appl_type } ]]></type><actuator_functionalities>"
250+ "<relay_functionality><lock>true</lock></relay_functionality></actuator_functionalities></appliance></appliances>"
251+ )
252+ await self .call_request (APPLIANCES , method = "post" , data = data )
253+ return
244254
245255 if members is not None :
246256 return await self ._set_groupswitch_member_state (members , state , switch )
247257
248258 data = f"<{ switch .func_type } ><state>{ state } </state></{ switch .func_type } >"
249- uri = f"{ APPLIANCES } ;id={ appl_id } /{ model } "
259+ uri = f"{ APPLIANCES } ;id={ appl_id } /relay "
250260
251261 if model == "relay" :
252262 locator = (
You can’t perform that action at this time.
0 commit comments