I've been trying to delete units in a plugin using the example given here: Developing a Python plugin
Code: Select all
Devices["test_device"].Unit[1].Delete()
Devices["test_device"].Unit[2].Delete()
Code: Select all
2022-04-24 16:26:25.865 testplug: onStop called
2022-04-24 16:26:25.865 Status: testplug: Stop directive received.
2022-04-24 16:26:25.865 Error: testplug: Call to function 'onStop' failed, exception details:
2022-04-24 16:26:25.867 Error: testplug: Traceback (most recent call last):
2022-04-24 16:26:25.867 Error: testplug: File "/home/pi/domoticz/plugins/domoticz-test-plugin/plugin.py", line 107, in onStop
2022-04-24 16:26:25.867 Error: testplug: _plugin.onStop()
2022-04-24 16:26:25.867 Error: testplug: File "/home/pi/domoticz/plugins/domoticz-test-plugin/plugin.py", line 74, in onStop
2022-04-24 16:26:25.867 Error: testplug: Devices["test_device"].Unit[1].Delete()
2022-04-24 16:26:25.867 Error: testplug: AttributeError: 'DomoticzEx.Device' object has no attribute 'Unit'