parameters: (self, enabled, timeout=None, retries=None)
docstring: Enables or disables charging on the device.
  
      Args:
        enabled: A boolean indicating whether charging should be enabled or
          disabled.
        timeout: timeout in seconds
        retries: number of retries
docstring_summary: Enables or disables charging on the device.
docstring_tokens: Enables or disables charging on the device .
function: def SetCharging(self, enabled, timeout=None, retries=None):
      """Enables or disables charging on the device.
  
      Args:
        enabled: A boolean indicating whether charging should be enabled or
          disabled.
        timeout: timeout in seconds
        retries: number of retries
      """
      if self.GetCharging() == enabled:
        logger.warning('Device charging already in expected state: %s', enabled)
        return
  
      self._DiscoverDeviceProfile()
      if enabled:
        if self._cache['profile']['enable_command']:
          self._HardwareSetCharging(enabled)
        else:
          logger.info('Unable to enable charging via hardware. '
                      'Falling back to software enabling.')
          self.EnableBatteryUpdates()
      else:
        if self._cache['profile']['enable_command']:
          self._ClearPowerData()
          self._HardwareSetCharging(enabled)
        else:
          logger.info('Unable to disable charging via hardware. '
                       'Falling back to software disabling.')
          self.DisableBatteryUpdates()
function_tokens: def SetCharging ( self , enabled , timeout = None , retries = None ) : if self . GetCharging ( ) == enabled : logger . warning ( 'Device charging already in expected state: %s' , enabled ) return self . _DiscoverDeviceProfile ( ) if enabled : if self . _cache [ 'profile' ] [ 'enable_command' ] : self . _HardwareSetCharging ( enabled ) else : logger . info ( 'Unable to enable charging via hardware. ' 'Falling back to software enabling.' ) self . EnableBatteryUpdates ( ) else : if self . _cache [ 'profile' ] [ 'enable_command' ] : self . _ClearPowerData ( ) self . _HardwareSetCharging ( enabled ) else : logger . info ( 'Unable to disable charging via hardware. ' 'Falling back to software disabling.' ) self . DisableBatteryUpdates ( )