updated devicestate test for device state changes