1) Give a description of the problem
Checking light on/off subscribes to each device and causes extra events for every device tested on each button press. i.e. if I have a button that controls two switches, I get two extra events caused by changing the level of the lights.
2) What is the expected behaviour?
I only want the button events to be subscribed. The piston works perfectly except for the extra device events. It allows a simple button to provide four different states for my lights (Off, 1%, 50%, 100%) with the switch statement cases for âpushedâ (on/off), âdoubleâ (50%), and âheldâ (100%).
3) What is happening/not happening?
The piston fires multiple times in rapid succession. Removing only the âif on/offâ for each device prevents subscribing to those extra device events, but then doesnât allow me to check the switch before setting the level. Testing the $currentEventAttribute avoids the switch statement if itâs not the button event (only needed because of the switch events). Is there an alternate test I can do?
**4) Post a Green Snapshot of the piston![image|45x37]
5) Attach logs after turning logging level to Full
8/18/2019, 10:09:33 PM +895ms
+2ms âReceived event [Office Desk Lamp].switch = off with a delay of 85ms
+109ms âRuntime (41556 bytes) successfully initialized in 49ms (v0.3.10e.20190628) (105ms)
+110ms ââExecution stage started
+129ms ââ$currentEventAttribute is switch
+133ms ââExecuted virtual command log (5ms)
+141ms ââExecuted virtual command setState (1ms)
+143ms ââExecution stage complete. (34ms)
+144ms âEvent processed successfully (144ms)
8/18/2019, 10:09:33 PM +457ms
+1ms âReceived event [Office Couch Lamp].switch = off with a delay of 115ms
+107ms âRuntime (41556 bytes) successfully initialized in 51ms (v0.3.10e.20190628) (104ms)
+108ms ââExecution stage started
+125ms ââ$currentEventAttribute is switch
+128ms ââExecuted virtual command log (4ms)
+135ms ââExecuted virtual command setState (1ms)
+137ms ââExecution stage complete. (29ms)
+138ms âEvent processed successfully (138ms)
8/18/2019, 10:09:32 PM +1ms
+1ms âReceived event [Allenâs Button].button = pushed with a delay of 87ms
+110ms âRuntime (41547 bytes) successfully initialized in 51ms (v0.3.10e.20190628) (108ms)
+111ms ââExecution stage started
+161ms ââExecuted [Office Couch Lamp].setLevel (15ms)
+175ms ââExecuted [Office Desk Lamp].setLevel (13ms)
+186ms ââ$currentEventAttribute is button
+190ms ââExecuted virtual command log (4ms)
+193ms ââExecuted virtual command setState (1ms)
+195ms ââExecution stage complete. (84ms)
+196ms âEvent processed successfully (197ms)
8/18/2019, 10:09:19 PM +993ms
+0ms âStarting piston⌠(v0.3.10e.20190628)
+228ms ââSubscribing to devicesâŚ
+270ms ââSubscribing to Allenâs Button.buttonâŚ
+286ms ââSubscribing to Office Couch Lamp.switchâŚ
+301ms ââSubscribing to Office Desk Lamp.switchâŚ
+383ms ââFinished subscribing (175ms)
+470ms âPiston successfully started (470ms)