Change code style to match XS format.

Update frontend state when device hot unplugged.