Implemented a common way to assign device status depending on event