[z2001] Use enum for rest state

(cleaned version of 4e14493)

(based on commit [s1604] - db5bc89)