DigiGuy42, thanks for the reply. Following your advice I attempted to reload the yaml file using this piece of code:
fd = open(os.path.join("WEB/python", "dia.yml"), "r")
SettingsBase.load(self, fd, "yaml")
This indeed calls the ‘apply_settings’ method of each driver, and it appears to work fine. However, the driver I’m using for my zigbee device (Massa M3) sets its configuration at startup in the xbee device configuration blocks and so it ignores my changes, meaning that it does not reconfigure the device to use the new ‘reading interval’.
I thought of restarting the driver, so I tried to call stop() and start() on the device driver like so:
deviceDriverManager = self._coreServices.get_service("device_driver_manager")
deviceDriver = deviceDriverManager.instance_get("1-1-1023") #1-1-1023 is the instance name
But it doesn’t work, there seems to be some bugs in there. This is what I get:
Exception in thread Thread-3:
Traceback (most recent call last):
File “./threading.py”, line 442, in __bootstrap
File “./threading.py”, line 607, in run
File “C:\dev\digi\itraxDigi\custom_services\itrax_comm_service.py”, line 192, in run
File “C:\Program Files\Digi\DigiPython\Dia\Dia_1.3.18\src\devices\vendors\massa\massa_m3.py”, line 418, in stop
File “C:\Program Files\Digi\DigiPython\Dia\Dia_1.3.18\src\devices\xbee\xbee_device_manager\xbee_device_manager.py”, line 588, in xbee_device_unregister
File “C:\dev\digi\itraxDigi\custom_devices\itrax_xbee_device_manager.py”, line 7, in xbee_device_instance_event_spec_remove
File “C:\Program Files\Digi\DigiPython\Dia\Dia_1.3.18\src\devices\xbee\xbee_device_manager\xbee_device_manager.py”, line 685, in xbee_device_event_spec_remove
XBeeDeviceManagerEventSpecNotFound: event specification not found
So I have 2 questions:
- Is it supposed to work in the first place?
- If I want to submit patches to the Digi python dev team, how do I proceed (I did my homework and fixed some of the issues, though now I’m stuck)?
Edit: forgot to mention, I use DIA 1.3.18