In the extended plugin framework there is a create function for devices, like
DomoticzEx.Unit(Name="Kilo Watts", DeviceID="Power", Unit=16, TypeName="kWh").Create()
This function however will fail if "accept new devices" is set to false in the domoticz settings. So how can check in the code if this function succeeded?
I'm looking for something like:
Code: Select all
result=DomoticzEx.Unit(Name="Kilo Watts", DeviceID="Power", Unit=16, TypeName="kWh").Create()
if result=true:
#Handle code after device was created
else:
#handle code for a not created device