Get power settings.
504858
async def get_power_settings(self) -> List[Setting]:
        """"""
        return [
            Setting.make(**x)
            for x in await self.services["system"]["getPowerSettings"]({})
        ]
846234
def get_power_metrics
      chassis = rest_get('/redfish/v1/Chassis/')
      chassis_uri = response_handler(chassis)['links']['Member'][0]['href']
      power_metrics_uri = response_handler(rest_get(chassis_uri))['links']['PowerMetrics']['href']
      response = rest_get(power_metrics_uri)
      metrics = response_handler(response)
      power_supplies = []
      metrics['PowerSupplies'].each do |ps|
        power_supply = {
          'LineInputVoltage' => ps['LineInputVoltage'],
          'LineInputVoltageType' => ps['LineInputVoltageType'],
          'PowerCapacityWatts' => ps['PowerCapacityWatts'],
          'PowerSupplyType' => ps['PowerSupplyType'],
          'Health' => ps['Status']['Health'],
          'State' => ps['Status']['State']
        }
        power_supplies.push(power_supply)
      end
      {
        @host => {
          'PowerCapacityWatts' => metrics['PowerCapacityWatts'],
          'PowerConsumedWatts' => metrics['PowerConsumedWatts'],
          'PowerSupplies' => power_supplies
        }
      }
    end
1290619
def get_providing_power_source_type(self):
        
        power_status = SYSTEM_POWER_STATUS()
        if not GetSystemPowerStatus(pointer(power_status)):
            raise WinError()
        return POWER_TYPE_MAP[power_status.ACLineStatus]
1015473
def get_settings(self):
    '''
    '''
    config = self._load_config_user()
    if self.name in config:
        return config[self.name]
362667
def power(self):
        """"""
        power = self._state['powerUsage']
        return PowerUsage(power.get('avgDayValue'),
                          power.get('avgValue'),
                          power.get('dayCost'),
                          power.get('dayUsage'),
                          power.get('isSmart'),
                          power.get('meterReading'),
                          power.get('value'),
                          power.get('meterReadingLow'),
                          power.get('dayLowUsage'))
540055
def set_host_power(self, power):
        
        power = power.upper()
        if (power is not None) and (power not in POWER_STATE):
            msg = ("Invalid input '%(pow)s'. "
                   "The expected input is ON or OFF." %
                   {'pow': power})
            raise exception.IloInvalidInputError(msg)

        # Check current power status, do not act if it's in requested state.
        cur_status = self.get_host_power_status()

        if cur_status == power:
            LOG.debug(self._("Node is already in '%(power)s' power state."),
                      {'power': power})
            return
        if power == 'ON' and 'PROLIANT BL' in self.get_product_name().upper():
            self._retry_until_powered_on(power)
        else:
            self._perform_power_op(POWER_STATE[power])
685265
def get_current():
    """"""
    global current
    if exists( SETTINGSFILE ):
        f = open( SETTINGSFILE ).read()
        current = re.findall('config[^\s]+.+', f)[1].split('/')[-1]
        return current
    else:
        return "** Not Set **"
662179
def c(self):
        """"""
        if self._client is None:
            self._parse_settings()
            self._client = Rumetr(**self.settings)
        return self._client
1133426
def get_installed_power(self):
        

        """
        for wind_farm in self.wind_farms:
            wind_farm.installed_power = wind_farm.get_installed_power()
        return sum(wind_farm.installed_power for wind_farm in self.wind_farms)
758473
def get_settings(self):
        
        uri = "{}/settings".format(self.data["uri"])
        return self._helper.do_get(uri)
655658
def get_battery_state():
        
        energy_now = float(100.0)
        power_now = float(100.0)
        energy_full = float(100.0)
        return energy_full, energy_now, power_now
180217
def power_on(self, si, logger, session, vm_uuid, resource_fullname):
        
        logger.info('retrieving vm by uuid: {0}'.format(vm_uuid))
        vm = self.pv_service.find_by_uuid(si, vm_uuid)

        if vm.summary.runtime.powerState == 'poweredOn':
            logger.info('vm already powered on')
            task_result = 'Already powered on'
        else:
            logger.info('powering on vm')
            task = vm.PowerOn()
            task_result = self.synchronous_task_waiter.wait_for_task(task=task,
                                                                     logger=logger,
                                                                     action_name='Power On')

        return task_result
1109478
def device_state_attributes(self):
        """"""
        attr = {}
        attr['active_time'] = self.smartplug.active_time
        attr['voltage'] = self.smartplug.voltage
        attr['active_time'] = self.smartplug.active_time
        attr['weekly_energy_total'] = self.smartplug.weekly_energy_total
        attr['monthly_energy_total'] = self.smartplug.monthly_energy_total
        attr['yearly_energy_total'] = self.smartplug.yearly_energy_total
        return attr
1194867
def get_power(self):
        """"""
        power_dict = self.get_power_all()
        for device in power_dict.keys():
            power_dict[device] = float(power_dict[device]) / 1000.0
        return power_dict
36750
def power(dev, mode):
    '''
    
    '''
    if dev not in address_():
        raise CommandExecutionError('Invalid dev passed to bluetooth.power')

    if mode == 'on' or mode is True:
        state = 'up'
        mode = 'on'
    else:
        state = 'down'
        mode = 'off'
    cmd = 'hciconfig {0} {1}'.format(dev, state)
    __salt__['cmd.run'](cmd).splitlines()
    info = address_()
    if info[dev]['power'] == mode:
        return True
    return False
794910
async def get_power_parameters_for(
            cls, system_ids: typing.Sequence[str]):
        
        if len(system_ids) == 0:
            return {}
        data = await cls._handler.power_parameters(id=system_ids)
        return data
957712
private function _power()
    {
        if (isset($this->_buf['Power'])) foreach ($this->_buf['Power'] as $name=>$value) {
            $dev = new SensorDevice();
            $dev->setName($name);
            $dev->setValue($value);
            $this->mbinfo->setMbPower($dev);
        }
    }