Write a class that simulates a simple device. The device has two states: "switched on" and "switched off" and two buttons: "on" and "off". Use the provided template of the Device class and write the code to simulate the following behavior:
- The initial state of the device is "switched off".
- When the device is switched off and the "on" button is pressed, print
Switching on - When the device is switched off and the "off" button is pressed, print
Boop! - When the device is switched on and the "on" button is pressed, print
Beep! - When the device is switched on and the "off" button is pressed, print
Switching off
Apply the State design pattern to solve this task.