Page 1 of 1

Strange behavior with ExtraTaskSettings.TaskDeviceName

Posted: 14 Jul 2018, 02:47
by ThomasB
I've noticed an unusual behavior of the global ExtraTaskSettings.TaskDeviceName var. I expect it to match the name of the Plugin that is in scope. It normally is, except for the PLUGIN_WRITE state.

When a write action is being process the ExtraTaskSettings.TaskDeviceName is unpredictable. It is always the name of a define device, but not always the correct one. What I mean is that when a PLUGIN_WRITE event is being processed by Device A, the ExtraTaskSettings.TaskDeviceName within the WRITE case state is sometimes the name of Device B or Device C, and so on.

Is this normal behavior? If it is, how can I get the correct name of the plugin while in its PLUGIN_WRITE state?

- Thomas

Re: Strange behavior with ExtraTaskSettings.TaskDeviceName

Posted: 14 Jul 2018, 11:22
by TD-er
That sounds like a serious bug, or at least a potential flaw which could cause a lot of issues.

Can you add an issue for it on ESPeasy?
I was already looking into that part of the code this morning, when looking at your Nextion code and it already got my attention since the names used in those functions to load/store settings may lead to confusion. (and I don't like confusion ;) )

Re: Strange behavior with ExtraTaskSettings.TaskDeviceName

Posted: 14 Jul 2018, 19:23
by ThomasB
Thanks for helping out. Case #1574 has been opened.
- Thomas