How can I update a switch status on the dashboard

So I need to change the color of this button to red when it is pressed and to green when it is released
Dashboard button doesn't have more events available than click (mouse down and mouse up both must happen to fire event). With one public event only you can not have momentary button behavior.

But there is always a way to do it Momentary button on Dashboard