Merge "Moves DeviceState from the server to the client side." into main