Deleting units in DomoticzEx framework
Posted: Sunday 24 April 2022 16:28
Hi,
I've been trying to delete units in a plugin using the example given here: Developing a Python plugin
The 2 units were created before so they do exist. This results in the error:
What am I doing wrong? Running latest beta on RPi 3 with Buster, python 3.7.x
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'