So maybe it’s legal to call luup.call_action with the above service ID and action, device ID 0, and parameters { DeviceNum=45 } (or your target device to delete)?
Maybe luup.attr_set on the “device_num_parent” attr?
These are all guesses, and I’m sure you would prefer an official answer…
Any idea how to set the ip variable when creating device(s) with luup.chdev.append ?
I tried to use the parameter in which you can provide a list of variable+value, but I have no idea what service id is attached to this variable “ip”. So I tried without providing the service id and the variable was not set.
[quote=“lolodomo, post:4, topic:174555”]Any idea how to set the ip variable when creating device(s) with luup.chdev.append ?
I tried to use the parameter in which you can provide a list of variable+value, but I have no idea what service id is attached to this variable “ip”. So I tried without providing the service id and the variable was not set.[/quote]
Do you mean the attribute as opposed to variable? Attributes like model, ip, mac, etc., are different from variables, and you have to use the attr_get and attr_set for those. In my code I check/set them after luup.chdev.* calls are done, but I would like to be able to set them on device creation, but don’t know if that’s possible.
[quote=“watou, post:5, topic:174555”][quote=“lolodomo, post:4, topic:174555”]Any idea how to set the ip variable when creating device(s) with luup.chdev.append ?
I tried to use the parameter in which you can provide a list of variable+value, but I have no idea what service id is attached to this variable “ip”. So I tried without providing the service id and the variable was not set.[/quote]
Do you mean the attribute as opposed to variable? Attributes like model, ip, mac, etc., are different from variables, and you have to use the attr_get and attr_set for those. In my code I check/set them after luup.chdev.* calls are done, but I would like to be able to set them on device creation, but don’t know if that’s possible.
watou[/quote]
Ok, thank you, so we have to first create the devices and only in a second timle (after sync - reload) set the attributes.
Do you know if attr_set triggers a reload ?
In the plugin I’m working on, it doesn’t appear to trigger a reload when I make calls like this (after the child devices were created and it reloaded):
if luup.attr_get("category_num", child) ~= "5" then
luup.attr_set("category_num", "5", child)
end
if luup.attr_get("model", child) ~= modelNumber then
luup.attr_set("model", modelNumber, child)
end