I have a driver using a 3 second call_with_delay and my function is being executed twice in rapid succession:
2021-11-03T03:36:31.556893621+00:00 TRACE Web Requestor Received event with handler unnamed oneshot
2021-11-03T03:36:31.563551073+00:00 INFO Web Requestor <Device: 0537166c-6364-4e02-87f9-dd28fef404dd (Web Requestor Released)> emitting event: {"component_id":"main","capability_id":"partyvoice23922.webrequestselect","attribute_id":"selection","state":{"value":" "}}
2021-11-03T03:36:31.654148682+00:00 TRACE Web Requestor Received event with handler unnamed oneshot
2021-11-03T03:36:31.660198414+00:00 INFO Web Requestor <Device: 0537166c-6364-4e02-87f9-dd28fef404dd (Web Requestor Released)> emitting event: {"component_id":"main","capability_id":"partyvoice23922.webrequestselect","attribute_id":"selection","state":{"value":" "}}
driver:call_with_delay(3, clearmsg)
local function clearmsg ()
webreqDriver:get_devices()[1]:emit_event(cap_select.selection(' '))
end
Follow up to my post above. I think this is related to a previous problem I have come across where I start getting duplicate execution of routines in drivers. It hasn’t happened in a couple weeks, but it started again last night, with the first thing I noticed resulted in the post above. But subsequent to that I started seeing duplicate behavior across multiple drivers: for example, creating one device, but getting two. Sending one LAN message once, but it getting sent twice. I find that re-booting the hub is necessary to stop the duplicates. And that is what I’ve done this morning, and the problem has cleared up, including the one i reported above.
Once I rebooted my hub this morning it has not happened since.
It seems that this duplication issue gets triggered typically as a result of a lot of driver deletes, adds, and updates when I’m in a fast and furious iterative development phase. Something on the hub gets messed up. But at least I know the cure!