- make sure we have custom provider before calling the update,
replace old check in the update function
- fix race condition in the provider function, causing complete lock-up of
lights controls (triggered by sending light updates very fast. for example,
using arrow keys with the webui sliders; ref. #2424)
- rework state change functions to work using loop() func instead of a
pair of scheduled functions. we should not go out-of-sync now, and it
also avoids forcibly creating std::func object each invocation
- rework other providers to be more in line with custom callbacks -
introduce state, value and update calls as a common way to handle lights
- correctly handle state change when turning OFF and ON
- update tuya to store the last state, never send channel values when OFF (ref. #2424)