code: def restore_state(self, state):
          
  
          super(EmulatedPeripheralTile, self).restore_state(state)
  
          self.debug_mode = state.get('debug_mode', False)
          self.run_level = state.get('run_level', None)
  
          if state.get('app_started', False):
              self._hosted_app_running.set()
docs: Restore the current state of this emulated object.
  
          Args:
              state (dict): A previously dumped state produced by dump_state.