Hardware Dimmer

I think the OP’s point was that it’s not atomic. Personally, it doesn’t seem that important to get a mathematically correct answer if two people are adjusting the brightness simultaneously. But I understand the sentiment, given how much time at my day job I used to spend tracking down errors caused by non-thread-safe code.

Ummm… the bulbs are inherently stateful, and they are actually in the best position to be able to do atomic updates to their own state.

Edit: Now that I think about it, I can see why incremental updates in the bulb wouldn’t work so well, since the protocol is unreliable. Although you can ask for an acknowledgement, if the acknowledgement doesn’t arrive, you don’t know if the request was lost, or only the acknowledgement was lost. This is similar to the problem I mentioned previously. Or to put it more succinctly, incremental updates are non-idempotent.