<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def disconnect(self):
 """ Disconnect from connected hardware. """

        old_api = object.__getattribute__(self, '_api')
        new_api = API.build_hardware_simulator(
            loop=old_api._loop,
            config=copy.copy(old_api.config))
        setattr(self, '_api', new_api)