Check if a measurement actually has states before iterating.
Add states for button events - doesn't handle action types, yet.