Search is not available for this dataset
identifier
stringlengths
1
155
parameters
stringlengths
2
6.09k
docstring
stringlengths
11
63.4k
docstring_summary
stringlengths
0
63.4k
function
stringlengths
29
99.8k
function_tokens
list
start_point
list
end_point
list
language
stringclasses
1 value
docstring_language
stringlengths
2
7
docstring_language_predictions
stringlengths
18
23
is_langid_reliable
stringclasses
2 values
FinTsClient.client
(self)
Get the client object. As the fints library is stateless, there is not benefit in caching the client objects. If that ever changes, consider caching the client object and also think about potential concurrency problems.
Get the client object.
def client(self): """Get the client object. As the fints library is stateless, there is not benefit in caching the client objects. If that ever changes, consider caching the client object and also think about potential concurrency problems. """ return FinTS3PinTanClient...
[ "def", "client", "(", "self", ")", ":", "return", "FinTS3PinTanClient", "(", "self", ".", "_credentials", ".", "blz", ",", "self", ".", "_credentials", ".", "login", ",", "self", ".", "_credentials", ".", "pin", ",", "self", ".", "_credentials", ".", "ur...
[ 116, 4 ]
[ 129, 9 ]
python
en
['en', 'en', 'en']
True
FinTsClient.detect_accounts
(self)
Identify the accounts of the bank.
Identify the accounts of the bank.
def detect_accounts(self): """Identify the accounts of the bank.""" balance_accounts = [] holdings_accounts = [] for account in self.client.get_sepa_accounts(): try: self.client.get_balance(account) balance_accounts.append(account) ...
[ "def", "detect_accounts", "(", "self", ")", ":", "balance_accounts", "=", "[", "]", "holdings_accounts", "=", "[", "]", "for", "account", "in", "self", ".", "client", ".", "get_sepa_accounts", "(", ")", ":", "try", ":", "self", ".", "client", ".", "get_b...
[ 131, 4 ]
[ 153, 50 ]
python
en
['en', 'en', 'en']
True
FinTsAccount.__init__
(self, client: FinTsClient, account, name: str)
Initialize a FinTs balance account.
Initialize a FinTs balance account.
def __init__(self, client: FinTsClient, account, name: str) -> None: """Initialize a FinTs balance account.""" self._client = client self._account = account self._name = name self._balance: float = None self._currency: str = None
[ "def", "__init__", "(", "self", ",", "client", ":", "FinTsClient", ",", "account", ",", "name", ":", "str", ")", "->", "None", ":", "self", ".", "_client", "=", "client", "self", ".", "_account", "=", "account", "self", ".", "_name", "=", "name", "se...
[ 163, 4 ]
[ 169, 34 ]
python
en
['en', 'en', 'en']
True
FinTsAccount.update
(self)
Get the current balance and currency for the account.
Get the current balance and currency for the account.
def update(self) -> None: """Get the current balance and currency for the account.""" bank = self._client.client balance = bank.get_balance(self._account) self._balance = balance.amount.amount self._currency = balance.amount.currency _LOGGER.debug("updated balance of acco...
[ "def", "update", "(", "self", ")", "->", "None", ":", "bank", "=", "self", ".", "_client", ".", "client", "balance", "=", "bank", ".", "get_balance", "(", "self", ".", "_account", ")", "self", ".", "_balance", "=", "balance", ".", "amount", ".", "amo...
[ 171, 4 ]
[ 177, 65 ]
python
en
['en', 'en', 'en']
True
FinTsAccount.name
(self)
Friendly name of the sensor.
Friendly name of the sensor.
def name(self) -> str: """Friendly name of the sensor.""" return self._name
[ "def", "name", "(", "self", ")", "->", "str", ":", "return", "self", ".", "_name" ]
[ 180, 4 ]
[ 182, 25 ]
python
en
['en', 'en', 'en']
True
FinTsAccount.state
(self)
Return the balance of the account as state.
Return the balance of the account as state.
def state(self) -> float: """Return the balance of the account as state.""" return self._balance
[ "def", "state", "(", "self", ")", "->", "float", ":", "return", "self", ".", "_balance" ]
[ 185, 4 ]
[ 187, 28 ]
python
en
['en', 'en', 'en']
True
FinTsAccount.unit_of_measurement
(self)
Use the currency as unit of measurement.
Use the currency as unit of measurement.
def unit_of_measurement(self) -> str: """Use the currency as unit of measurement.""" return self._currency
[ "def", "unit_of_measurement", "(", "self", ")", "->", "str", ":", "return", "self", ".", "_currency" ]
[ 190, 4 ]
[ 192, 29 ]
python
en
['en', 'en', 'en']
True
FinTsAccount.device_state_attributes
(self)
Additional attributes of the sensor.
Additional attributes of the sensor.
def device_state_attributes(self) -> dict: """Additional attributes of the sensor.""" attributes = {ATTR_ACCOUNT: self._account.iban, ATTR_ACCOUNT_TYPE: "balance"} if self._client.name: attributes[ATTR_BANK] = self._client.name return attributes
[ "def", "device_state_attributes", "(", "self", ")", "->", "dict", ":", "attributes", "=", "{", "ATTR_ACCOUNT", ":", "self", ".", "_account", ".", "iban", ",", "ATTR_ACCOUNT_TYPE", ":", "\"balance\"", "}", "if", "self", ".", "_client", ".", "name", ":", "at...
[ 195, 4 ]
[ 200, 25 ]
python
en
['en', 'en', 'en']
True
FinTsAccount.icon
(self)
Set the icon for the sensor.
Set the icon for the sensor.
def icon(self) -> str: """Set the icon for the sensor.""" return ICON
[ "def", "icon", "(", "self", ")", "->", "str", ":", "return", "ICON" ]
[ 203, 4 ]
[ 205, 19 ]
python
en
['en', 'en', 'en']
True
FinTsHoldingsAccount.__init__
(self, client: FinTsClient, account, name: str)
Initialize a FinTs holdings account.
Initialize a FinTs holdings account.
def __init__(self, client: FinTsClient, account, name: str) -> None: """Initialize a FinTs holdings account.""" self._client = client self._name = name self._account = account self._holdings = [] self._total: float = None
[ "def", "__init__", "(", "self", ",", "client", ":", "FinTsClient", ",", "account", ",", "name", ":", "str", ")", "->", "None", ":", "self", ".", "_client", "=", "client", "self", ".", "_name", "=", "name", "self", ".", "_account", "=", "account", "se...
[ 215, 4 ]
[ 221, 33 ]
python
en
['en', 'en', 'en']
True
FinTsHoldingsAccount.update
(self)
Get the current holdings for the account.
Get the current holdings for the account.
def update(self) -> None: """Get the current holdings for the account.""" bank = self._client.client self._holdings = bank.get_holdings(self._account) self._total = sum(h.total_value for h in self._holdings)
[ "def", "update", "(", "self", ")", "->", "None", ":", "bank", "=", "self", ".", "_client", ".", "client", "self", ".", "_holdings", "=", "bank", ".", "get_holdings", "(", "self", ".", "_account", ")", "self", ".", "_total", "=", "sum", "(", "h", "....
[ 223, 4 ]
[ 227, 64 ]
python
en
['en', 'en', 'en']
True
FinTsHoldingsAccount.state
(self)
Return total market value as state.
Return total market value as state.
def state(self) -> float: """Return total market value as state.""" return self._total
[ "def", "state", "(", "self", ")", "->", "float", ":", "return", "self", ".", "_total" ]
[ 230, 4 ]
[ 232, 26 ]
python
en
['en', 'en', 'en']
True
FinTsHoldingsAccount.icon
(self)
Set the icon for the sensor.
Set the icon for the sensor.
def icon(self) -> str: """Set the icon for the sensor.""" return ICON
[ "def", "icon", "(", "self", ")", "->", "str", ":", "return", "ICON" ]
[ 235, 4 ]
[ 237, 19 ]
python
en
['en', 'en', 'en']
True
FinTsHoldingsAccount.device_state_attributes
(self)
Additional attributes of the sensor. Lists each holding of the account with the current value.
Additional attributes of the sensor.
def device_state_attributes(self) -> dict: """Additional attributes of the sensor. Lists each holding of the account with the current value. """ attributes = { ATTR_ACCOUNT: self._account.accountnumber, ATTR_ACCOUNT_TYPE: "holdings", } if self._cl...
[ "def", "device_state_attributes", "(", "self", ")", "->", "dict", ":", "attributes", "=", "{", "ATTR_ACCOUNT", ":", "self", ".", "_account", ".", "accountnumber", ",", "ATTR_ACCOUNT_TYPE", ":", "\"holdings\"", ",", "}", "if", "self", ".", "_client", ".", "na...
[ 240, 4 ]
[ 259, 25 ]
python
en
['en', 'en', 'en']
True
FinTsHoldingsAccount.name
(self)
Friendly name of the sensor.
Friendly name of the sensor.
def name(self) -> str: """Friendly name of the sensor.""" return self._name
[ "def", "name", "(", "self", ")", "->", "str", ":", "return", "self", ".", "_name" ]
[ 262, 4 ]
[ 264, 25 ]
python
en
['en', 'en', 'en']
True
FinTsHoldingsAccount.unit_of_measurement
(self)
Get the unit of measurement. Hardcoded to EUR, as the library does not provide the currency for the holdings. And as FinTS is only used in Germany, most accounts will be in EUR anyways.
Get the unit of measurement.
def unit_of_measurement(self) -> str: """Get the unit of measurement. Hardcoded to EUR, as the library does not provide the currency for the holdings. And as FinTS is only used in Germany, most accounts will be in EUR anyways. """ return "EUR"
[ "def", "unit_of_measurement", "(", "self", ")", "->", "str", ":", "return", "\"EUR\"" ]
[ 267, 4 ]
[ 274, 20 ]
python
en
['en', 'fr', 'en']
True
accuracy
(output, target, topk=(1,))
Computes the precision@k for the specified values of k
Computes the precision
def accuracy(output, target, topk=(1,)): """ Computes the precision@k for the specified values of k """ maxk = max(topk) batch_size = target.size(0) _, pred = output.topk(maxk, 1, True, True) pred = pred.t() # one-hot case if target.ndimension() > 1: target = target.max(1)[1] c...
[ "def", "accuracy", "(", "output", ",", "target", ",", "topk", "=", "(", "1", ",", ")", ")", ":", "maxk", "=", "max", "(", "topk", ")", "batch_size", "=", "target", ".", "size", "(", "0", ")", "_", ",", "pred", "=", "output", ".", "topk", "(", ...
[ 63, 0 ]
[ 80, 14 ]
python
en
['en', 'en', 'en']
True
async_setup_entry
(hass, config_entry, async_add_entities)
Add climate entities for a config entry.
Add climate entities for a config entry.
async def async_setup_entry(hass, config_entry, async_add_entities): """Add climate entities for a config entry.""" ac_capabilities = [ Capability.air_conditioner_mode, Capability.air_conditioner_fan_mode, Capability.switch, Capability.temperature_measurement, Capability....
[ "async", "def", "async_setup_entry", "(", "hass", ",", "config_entry", ",", "async_add_entities", ")", ":", "ac_capabilities", "=", "[", "Capability", ".", "air_conditioner_mode", ",", "Capability", ".", "air_conditioner_fan_mode", ",", "Capability", ".", "switch", ...
[ 83, 0 ]
[ 102, 38 ]
python
en
['en', 'en', 'en']
True
get_capabilities
(capabilities: Sequence[str])
Return all capabilities supported if minimum required are present.
Return all capabilities supported if minimum required are present.
def get_capabilities(capabilities: Sequence[str]) -> Optional[Sequence[str]]: """Return all capabilities supported if minimum required are present.""" supported = [ Capability.air_conditioner_mode, Capability.demand_response_load_control, Capability.air_conditioner_fan_mode, Capa...
[ "def", "get_capabilities", "(", "capabilities", ":", "Sequence", "[", "str", "]", ")", "->", "Optional", "[", "Sequence", "[", "str", "]", "]", ":", "supported", "=", "[", "Capability", ".", "air_conditioner_mode", ",", "Capability", ".", "demand_response_load...
[ 105, 0 ]
[ 144, 15 ]
python
en
['en', 'en', 'en']
True
SmartThingsThermostat.__init__
(self, device)
Init the class.
Init the class.
def __init__(self, device): """Init the class.""" super().__init__(device) self._supported_features = self._determine_features() self._hvac_mode = None self._hvac_modes = None
[ "def", "__init__", "(", "self", ",", "device", ")", ":", "super", "(", ")", ".", "__init__", "(", "device", ")", "self", ".", "_supported_features", "=", "self", ".", "_determine_features", "(", ")", "self", ".", "_hvac_mode", "=", "None", "self", ".", ...
[ 150, 4 ]
[ 155, 31 ]
python
en
['en', 'en', 'en']
True
SmartThingsThermostat.async_set_fan_mode
(self, fan_mode)
Set new target fan mode.
Set new target fan mode.
async def async_set_fan_mode(self, fan_mode): """Set new target fan mode.""" await self._device.set_thermostat_fan_mode(fan_mode, set_status=True) # State is set optimistically in the command above, therefore update # the entity state ahead of receiving the confirming push updates ...
[ "async", "def", "async_set_fan_mode", "(", "self", ",", "fan_mode", ")", ":", "await", "self", ".", "_device", ".", "set_thermostat_fan_mode", "(", "fan_mode", ",", "set_status", "=", "True", ")", "# State is set optimistically in the command above, therefore update", "...
[ 165, 4 ]
[ 171, 49 ]
python
en
['sv', 'fy', 'en']
False
SmartThingsThermostat.async_set_hvac_mode
(self, hvac_mode)
Set new target operation mode.
Set new target operation mode.
async def async_set_hvac_mode(self, hvac_mode): """Set new target operation mode.""" mode = STATE_TO_MODE[hvac_mode] await self._device.set_thermostat_mode(mode, set_status=True) # State is set optimistically in the command above, therefore update # the entity state ahead of rec...
[ "async", "def", "async_set_hvac_mode", "(", "self", ",", "hvac_mode", ")", ":", "mode", "=", "STATE_TO_MODE", "[", "hvac_mode", "]", "await", "self", ".", "_device", ".", "set_thermostat_mode", "(", "mode", ",", "set_status", "=", "True", ")", "# State is set ...
[ 173, 4 ]
[ 180, 49 ]
python
en
['nl', 'en', 'en']
True
SmartThingsThermostat.async_set_temperature
(self, **kwargs)
Set new operation mode and target temperatures.
Set new operation mode and target temperatures.
async def async_set_temperature(self, **kwargs): """Set new operation mode and target temperatures.""" # Operation state operation_state = kwargs.get(ATTR_HVAC_MODE) if operation_state: mode = STATE_TO_MODE[operation_state] await self._device.set_thermostat_mode(m...
[ "async", "def", "async_set_temperature", "(", "self", ",", "*", "*", "kwargs", ")", ":", "# Operation state", "operation_state", "=", "kwargs", ".", "get", "(", "ATTR_HVAC_MODE", ")", "if", "operation_state", ":", "mode", "=", "STATE_TO_MODE", "[", "operation_st...
[ 182, 4 ]
[ 218, 49 ]
python
en
['en', 'en', 'en']
True
SmartThingsThermostat.async_update
(self)
Update the attributes of the climate device.
Update the attributes of the climate device.
async def async_update(self): """Update the attributes of the climate device.""" thermostat_mode = self._device.status.thermostat_mode self._hvac_mode = MODE_TO_STATE.get(thermostat_mode) if self._hvac_mode is None: _LOGGER.debug( "Device %s (%s) returned an i...
[ "async", "def", "async_update", "(", "self", ")", ":", "thermostat_mode", "=", "self", ".", "_device", ".", "status", ".", "thermostat_mode", "self", ".", "_hvac_mode", "=", "MODE_TO_STATE", ".", "get", "(", "thermostat_mode", ")", "if", "self", ".", "_hvac_...
[ 220, 4 ]
[ 253, 38 ]
python
en
['en', 'en', 'en']
True
SmartThingsThermostat.current_humidity
(self)
Return the current humidity.
Return the current humidity.
def current_humidity(self): """Return the current humidity.""" return self._device.status.humidity
[ "def", "current_humidity", "(", "self", ")", ":", "return", "self", ".", "_device", ".", "status", ".", "humidity" ]
[ 256, 4 ]
[ 258, 43 ]
python
en
['en', 'en', 'en']
True
SmartThingsThermostat.current_temperature
(self)
Return the current temperature.
Return the current temperature.
def current_temperature(self): """Return the current temperature.""" return self._device.status.temperature
[ "def", "current_temperature", "(", "self", ")", ":", "return", "self", ".", "_device", ".", "status", ".", "temperature" ]
[ 261, 4 ]
[ 263, 46 ]
python
en
['en', 'la', 'en']
True
SmartThingsThermostat.fan_mode
(self)
Return the fan setting.
Return the fan setting.
def fan_mode(self): """Return the fan setting.""" return self._device.status.thermostat_fan_mode
[ "def", "fan_mode", "(", "self", ")", ":", "return", "self", ".", "_device", ".", "status", ".", "thermostat_fan_mode" ]
[ 266, 4 ]
[ 268, 54 ]
python
en
['en', 'fy', 'en']
True
SmartThingsThermostat.fan_modes
(self)
Return the list of available fan modes.
Return the list of available fan modes.
def fan_modes(self): """Return the list of available fan modes.""" return self._device.status.supported_thermostat_fan_modes
[ "def", "fan_modes", "(", "self", ")", ":", "return", "self", ".", "_device", ".", "status", ".", "supported_thermostat_fan_modes" ]
[ 271, 4 ]
[ 273, 65 ]
python
en
['en', 'en', 'en']
True
SmartThingsThermostat.hvac_action
(self)
Return the current running hvac operation if supported.
Return the current running hvac operation if supported.
def hvac_action(self) -> Optional[str]: """Return the current running hvac operation if supported.""" return OPERATING_STATE_TO_ACTION.get( self._device.status.thermostat_operating_state )
[ "def", "hvac_action", "(", "self", ")", "->", "Optional", "[", "str", "]", ":", "return", "OPERATING_STATE_TO_ACTION", ".", "get", "(", "self", ".", "_device", ".", "status", ".", "thermostat_operating_state", ")" ]
[ 276, 4 ]
[ 280, 9 ]
python
en
['en', 'en', 'en']
True
SmartThingsThermostat.hvac_mode
(self)
Return current operation ie. heat, cool, idle.
Return current operation ie. heat, cool, idle.
def hvac_mode(self): """Return current operation ie. heat, cool, idle.""" return self._hvac_mode
[ "def", "hvac_mode", "(", "self", ")", ":", "return", "self", ".", "_hvac_mode" ]
[ 283, 4 ]
[ 285, 30 ]
python
en
['nl', 'en', 'en']
True
SmartThingsThermostat.hvac_modes
(self)
Return the list of available operation modes.
Return the list of available operation modes.
def hvac_modes(self): """Return the list of available operation modes.""" return self._hvac_modes
[ "def", "hvac_modes", "(", "self", ")", ":", "return", "self", ".", "_hvac_modes" ]
[ 288, 4 ]
[ 290, 31 ]
python
en
['en', 'en', 'en']
True
SmartThingsThermostat.supported_features
(self)
Return the supported features.
Return the supported features.
def supported_features(self): """Return the supported features.""" return self._supported_features
[ "def", "supported_features", "(", "self", ")", ":", "return", "self", ".", "_supported_features" ]
[ 293, 4 ]
[ 295, 39 ]
python
en
['en', 'en', 'en']
True
SmartThingsThermostat.target_temperature
(self)
Return the temperature we try to reach.
Return the temperature we try to reach.
def target_temperature(self): """Return the temperature we try to reach.""" if self.hvac_mode == HVAC_MODE_COOL: return self._device.status.cooling_setpoint if self.hvac_mode == HVAC_MODE_HEAT: return self._device.status.heating_setpoint return None
[ "def", "target_temperature", "(", "self", ")", ":", "if", "self", ".", "hvac_mode", "==", "HVAC_MODE_COOL", ":", "return", "self", ".", "_device", ".", "status", ".", "cooling_setpoint", "if", "self", ".", "hvac_mode", "==", "HVAC_MODE_HEAT", ":", "return", ...
[ 298, 4 ]
[ 304, 19 ]
python
en
['en', 'en', 'en']
True
SmartThingsThermostat.target_temperature_high
(self)
Return the highbound target temperature we try to reach.
Return the highbound target temperature we try to reach.
def target_temperature_high(self): """Return the highbound target temperature we try to reach.""" if self.hvac_mode == HVAC_MODE_HEAT_COOL: return self._device.status.cooling_setpoint return None
[ "def", "target_temperature_high", "(", "self", ")", ":", "if", "self", ".", "hvac_mode", "==", "HVAC_MODE_HEAT_COOL", ":", "return", "self", ".", "_device", ".", "status", ".", "cooling_setpoint", "return", "None" ]
[ 307, 4 ]
[ 311, 19 ]
python
en
['en', 'en', 'en']
True
SmartThingsThermostat.target_temperature_low
(self)
Return the lowbound target temperature we try to reach.
Return the lowbound target temperature we try to reach.
def target_temperature_low(self): """Return the lowbound target temperature we try to reach.""" if self.hvac_mode == HVAC_MODE_HEAT_COOL: return self._device.status.heating_setpoint return None
[ "def", "target_temperature_low", "(", "self", ")", ":", "if", "self", ".", "hvac_mode", "==", "HVAC_MODE_HEAT_COOL", ":", "return", "self", ".", "_device", ".", "status", ".", "heating_setpoint", "return", "None" ]
[ 314, 4 ]
[ 318, 19 ]
python
en
['en', 'en', 'en']
True
SmartThingsThermostat.temperature_unit
(self)
Return the unit of measurement.
Return the unit of measurement.
def temperature_unit(self): """Return the unit of measurement.""" return UNIT_MAP.get(self._device.status.attributes[Attribute.temperature].unit)
[ "def", "temperature_unit", "(", "self", ")", ":", "return", "UNIT_MAP", ".", "get", "(", "self", ".", "_device", ".", "status", ".", "attributes", "[", "Attribute", ".", "temperature", "]", ".", "unit", ")" ]
[ 321, 4 ]
[ 323, 87 ]
python
en
['en', 'la', 'en']
True
SmartThingsAirConditioner.__init__
(self, device)
Init the class.
Init the class.
def __init__(self, device): """Init the class.""" super().__init__(device) self._hvac_modes = None
[ "def", "__init__", "(", "self", ",", "device", ")", ":", "super", "(", ")", ".", "__init__", "(", "device", ")", "self", ".", "_hvac_modes", "=", "None" ]
[ 329, 4 ]
[ 332, 31 ]
python
en
['en', 'en', 'en']
True
SmartThingsAirConditioner.async_set_fan_mode
(self, fan_mode)
Set new target fan mode.
Set new target fan mode.
async def async_set_fan_mode(self, fan_mode): """Set new target fan mode.""" await self._device.set_fan_mode(fan_mode, set_status=True) # State is set optimistically in the command above, therefore update # the entity state ahead of receiving the confirming push updates self.asyn...
[ "async", "def", "async_set_fan_mode", "(", "self", ",", "fan_mode", ")", ":", "await", "self", ".", "_device", ".", "set_fan_mode", "(", "fan_mode", ",", "set_status", "=", "True", ")", "# State is set optimistically in the command above, therefore update", "# the entit...
[ 334, 4 ]
[ 339, 35 ]
python
en
['sv', 'fy', 'en']
False
SmartThingsAirConditioner.async_set_hvac_mode
(self, hvac_mode)
Set new target operation mode.
Set new target operation mode.
async def async_set_hvac_mode(self, hvac_mode): """Set new target operation mode.""" if hvac_mode == HVAC_MODE_OFF: await self.async_turn_off() return tasks = [] # Turn on the device if it's off before setting mode. if not self._device.status.switch: ...
[ "async", "def", "async_set_hvac_mode", "(", "self", ",", "hvac_mode", ")", ":", "if", "hvac_mode", "==", "HVAC_MODE_OFF", ":", "await", "self", ".", "async_turn_off", "(", ")", "return", "tasks", "=", "[", "]", "# Turn on the device if it's off before setting mode."...
[ 341, 4 ]
[ 358, 35 ]
python
en
['nl', 'en', 'en']
True
SmartThingsAirConditioner.async_set_temperature
(self, **kwargs)
Set new target temperature.
Set new target temperature.
async def async_set_temperature(self, **kwargs): """Set new target temperature.""" tasks = [] # operation mode operation_mode = kwargs.get(ATTR_HVAC_MODE) if operation_mode: if operation_mode == HVAC_MODE_OFF: tasks.append(self._device.switch_off(set_s...
[ "async", "def", "async_set_temperature", "(", "self", ",", "*", "*", "kwargs", ")", ":", "tasks", "=", "[", "]", "# operation mode", "operation_mode", "=", "kwargs", ".", "get", "(", "ATTR_HVAC_MODE", ")", "if", "operation_mode", ":", "if", "operation_mode", ...
[ 360, 4 ]
[ 379, 35 ]
python
en
['en', 'ca', 'en']
True
SmartThingsAirConditioner.async_turn_on
(self)
Turn device on.
Turn device on.
async def async_turn_on(self): """Turn device on.""" await self._device.switch_on(set_status=True) # State is set optimistically in the command above, therefore update # the entity state ahead of receiving the confirming push updates self.async_write_ha_state()
[ "async", "def", "async_turn_on", "(", "self", ")", ":", "await", "self", ".", "_device", ".", "switch_on", "(", "set_status", "=", "True", ")", "# State is set optimistically in the command above, therefore update", "# the entity state ahead of receiving the confirming push upd...
[ 381, 4 ]
[ 386, 35 ]
python
en
['es', 'en', 'en']
True
SmartThingsAirConditioner.async_turn_off
(self)
Turn device off.
Turn device off.
async def async_turn_off(self): """Turn device off.""" await self._device.switch_off(set_status=True) # State is set optimistically in the command above, therefore update # the entity state ahead of receiving the confirming push updates self.async_write_ha_state()
[ "async", "def", "async_turn_off", "(", "self", ")", ":", "await", "self", ".", "_device", ".", "switch_off", "(", "set_status", "=", "True", ")", "# State is set optimistically in the command above, therefore update", "# the entity state ahead of receiving the confirming push u...
[ 388, 4 ]
[ 393, 35 ]
python
en
['en', 'en', 'en']
True
SmartThingsAirConditioner.async_update
(self)
Update the calculated fields of the AC.
Update the calculated fields of the AC.
async def async_update(self): """Update the calculated fields of the AC.""" modes = {HVAC_MODE_OFF} for mode in self._device.status.supported_ac_modes: state = AC_MODE_TO_STATE.get(mode) if state is not None: modes.add(state) else: ...
[ "async", "def", "async_update", "(", "self", ")", ":", "modes", "=", "{", "HVAC_MODE_OFF", "}", "for", "mode", "in", "self", ".", "_device", ".", "status", ".", "supported_ac_modes", ":", "state", "=", "AC_MODE_TO_STATE", ".", "get", "(", "mode", ")", "i...
[ 395, 4 ]
[ 409, 38 ]
python
en
['en', 'en', 'en']
True
SmartThingsAirConditioner.current_temperature
(self)
Return the current temperature.
Return the current temperature.
def current_temperature(self): """Return the current temperature.""" return self._device.status.temperature
[ "def", "current_temperature", "(", "self", ")", ":", "return", "self", ".", "_device", ".", "status", ".", "temperature" ]
[ 412, 4 ]
[ 414, 46 ]
python
en
['en', 'la', 'en']
True
SmartThingsAirConditioner.device_state_attributes
(self)
Return device specific state attributes. Include attributes from the Demand Response Load Control (drlc) and Power Consumption capabilities.
Return device specific state attributes.
def device_state_attributes(self): """ Return device specific state attributes. Include attributes from the Demand Response Load Control (drlc) and Power Consumption capabilities. """ attributes = [ "drlc_status_duration", "drlc_status_level", ...
[ "def", "device_state_attributes", "(", "self", ")", ":", "attributes", "=", "[", "\"drlc_status_duration\"", ",", "\"drlc_status_level\"", ",", "\"drlc_status_start\"", ",", "\"drlc_status_override\"", ",", "\"power_consumption_start\"", ",", "\"power_consumption_power\"", ",...
[ 417, 4 ]
[ 439, 31 ]
python
en
['en', 'error', 'th']
False
SmartThingsAirConditioner.fan_mode
(self)
Return the fan setting.
Return the fan setting.
def fan_mode(self): """Return the fan setting.""" return self._device.status.fan_mode
[ "def", "fan_mode", "(", "self", ")", ":", "return", "self", ".", "_device", ".", "status", ".", "fan_mode" ]
[ 442, 4 ]
[ 444, 43 ]
python
en
['en', 'fy', 'en']
True
SmartThingsAirConditioner.fan_modes
(self)
Return the list of available fan modes.
Return the list of available fan modes.
def fan_modes(self): """Return the list of available fan modes.""" return self._device.status.supported_ac_fan_modes
[ "def", "fan_modes", "(", "self", ")", ":", "return", "self", ".", "_device", ".", "status", ".", "supported_ac_fan_modes" ]
[ 447, 4 ]
[ 449, 57 ]
python
en
['en', 'en', 'en']
True
SmartThingsAirConditioner.hvac_mode
(self)
Return current operation ie. heat, cool, idle.
Return current operation ie. heat, cool, idle.
def hvac_mode(self): """Return current operation ie. heat, cool, idle.""" if not self._device.status.switch: return HVAC_MODE_OFF return AC_MODE_TO_STATE.get(self._device.status.air_conditioner_mode)
[ "def", "hvac_mode", "(", "self", ")", ":", "if", "not", "self", ".", "_device", ".", "status", ".", "switch", ":", "return", "HVAC_MODE_OFF", "return", "AC_MODE_TO_STATE", ".", "get", "(", "self", ".", "_device", ".", "status", ".", "air_conditioner_mode", ...
[ 452, 4 ]
[ 456, 77 ]
python
en
['nl', 'en', 'en']
True
SmartThingsAirConditioner.hvac_modes
(self)
Return the list of available operation modes.
Return the list of available operation modes.
def hvac_modes(self): """Return the list of available operation modes.""" return self._hvac_modes
[ "def", "hvac_modes", "(", "self", ")", ":", "return", "self", ".", "_hvac_modes" ]
[ 459, 4 ]
[ 461, 31 ]
python
en
['en', 'en', 'en']
True
SmartThingsAirConditioner.supported_features
(self)
Return the supported features.
Return the supported features.
def supported_features(self): """Return the supported features.""" return SUPPORT_TARGET_TEMPERATURE | SUPPORT_FAN_MODE
[ "def", "supported_features", "(", "self", ")", ":", "return", "SUPPORT_TARGET_TEMPERATURE", "|", "SUPPORT_FAN_MODE" ]
[ 464, 4 ]
[ 466, 60 ]
python
en
['en', 'en', 'en']
True
SmartThingsAirConditioner.target_temperature
(self)
Return the temperature we try to reach.
Return the temperature we try to reach.
def target_temperature(self): """Return the temperature we try to reach.""" return self._device.status.cooling_setpoint
[ "def", "target_temperature", "(", "self", ")", ":", "return", "self", ".", "_device", ".", "status", ".", "cooling_setpoint" ]
[ 469, 4 ]
[ 471, 51 ]
python
en
['en', 'en', 'en']
True
SmartThingsAirConditioner.temperature_unit
(self)
Return the unit of measurement.
Return the unit of measurement.
def temperature_unit(self): """Return the unit of measurement.""" return UNIT_MAP.get(self._device.status.attributes[Attribute.temperature].unit)
[ "def", "temperature_unit", "(", "self", ")", ":", "return", "UNIT_MAP", ".", "get", "(", "self", ".", "_device", ".", "status", ".", "attributes", "[", "Attribute", ".", "temperature", "]", ".", "unit", ")" ]
[ 474, 4 ]
[ 476, 87 ]
python
en
['en', 'la', 'en']
True
turn_on
(hass, entity_id=ENTITY_MATCH_ALL)
Turn all or specified vacuum on.
Turn all or specified vacuum on.
def turn_on(hass, entity_id=ENTITY_MATCH_ALL): """Turn all or specified vacuum on.""" hass.add_job(async_turn_on, hass, entity_id)
[ "def", "turn_on", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "hass", ".", "add_job", "(", "async_turn_on", ",", "hass", ",", "entity_id", ")" ]
[ 31, 0 ]
[ 33, 48 ]
python
en
['en', 'en', 'en']
True
async_turn_on
(hass, entity_id=ENTITY_MATCH_ALL)
Turn all or specified vacuum on.
Turn all or specified vacuum on.
async def async_turn_on(hass, entity_id=ENTITY_MATCH_ALL): """Turn all or specified vacuum on.""" data = {ATTR_ENTITY_ID: entity_id} if entity_id else None await hass.services.async_call(DOMAIN, SERVICE_TURN_ON, data, blocking=True)
[ "async", "def", "async_turn_on", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "data", "=", "{", "ATTR_ENTITY_ID", ":", "entity_id", "}", "if", "entity_id", "else", "None", "await", "hass", ".", "services", ".", "async_call", "(", "DOMAIN...
[ 36, 0 ]
[ 39, 80 ]
python
en
['en', 'en', 'en']
True
turn_off
(hass, entity_id=ENTITY_MATCH_ALL)
Turn all or specified vacuum off.
Turn all or specified vacuum off.
def turn_off(hass, entity_id=ENTITY_MATCH_ALL): """Turn all or specified vacuum off.""" hass.add_job(async_turn_off, hass, entity_id)
[ "def", "turn_off", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "hass", ".", "add_job", "(", "async_turn_off", ",", "hass", ",", "entity_id", ")" ]
[ 43, 0 ]
[ 45, 49 ]
python
en
['en', 'en', 'en']
True
async_turn_off
(hass, entity_id=ENTITY_MATCH_ALL)
Turn all or specified vacuum off.
Turn all or specified vacuum off.
async def async_turn_off(hass, entity_id=ENTITY_MATCH_ALL): """Turn all or specified vacuum off.""" data = {ATTR_ENTITY_ID: entity_id} if entity_id else None await hass.services.async_call(DOMAIN, SERVICE_TURN_OFF, data, blocking=True)
[ "async", "def", "async_turn_off", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "data", "=", "{", "ATTR_ENTITY_ID", ":", "entity_id", "}", "if", "entity_id", "else", "None", "await", "hass", ".", "services", ".", "async_call", "(", "DOMAI...
[ 48, 0 ]
[ 51, 81 ]
python
en
['en', 'en', 'en']
True
toggle
(hass, entity_id=ENTITY_MATCH_ALL)
Toggle all or specified vacuum.
Toggle all or specified vacuum.
def toggle(hass, entity_id=ENTITY_MATCH_ALL): """Toggle all or specified vacuum.""" hass.add_job(async_toggle, hass, entity_id)
[ "def", "toggle", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "hass", ".", "add_job", "(", "async_toggle", ",", "hass", ",", "entity_id", ")" ]
[ 55, 0 ]
[ 57, 47 ]
python
en
['en', 'en', 'en']
True
async_toggle
(hass, entity_id=ENTITY_MATCH_ALL)
Toggle all or specified vacuum.
Toggle all or specified vacuum.
async def async_toggle(hass, entity_id=ENTITY_MATCH_ALL): """Toggle all or specified vacuum.""" data = {ATTR_ENTITY_ID: entity_id} if entity_id else None await hass.services.async_call(DOMAIN, SERVICE_TOGGLE, data, blocking=True)
[ "async", "def", "async_toggle", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "data", "=", "{", "ATTR_ENTITY_ID", ":", "entity_id", "}", "if", "entity_id", "else", "None", "await", "hass", ".", "services", ".", "async_call", "(", "DOMAIN"...
[ 60, 0 ]
[ 63, 79 ]
python
en
['en', 'en', 'en']
True
locate
(hass, entity_id=ENTITY_MATCH_ALL)
Locate all or specified vacuum.
Locate all or specified vacuum.
def locate(hass, entity_id=ENTITY_MATCH_ALL): """Locate all or specified vacuum.""" hass.add_job(async_locate, hass, entity_id)
[ "def", "locate", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "hass", ".", "add_job", "(", "async_locate", ",", "hass", ",", "entity_id", ")" ]
[ 67, 0 ]
[ 69, 47 ]
python
en
['en', 'en', 'en']
True
async_locate
(hass, entity_id=ENTITY_MATCH_ALL)
Locate all or specified vacuum.
Locate all or specified vacuum.
async def async_locate(hass, entity_id=ENTITY_MATCH_ALL): """Locate all or specified vacuum.""" data = {ATTR_ENTITY_ID: entity_id} if entity_id else None await hass.services.async_call(DOMAIN, SERVICE_LOCATE, data, blocking=True)
[ "async", "def", "async_locate", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "data", "=", "{", "ATTR_ENTITY_ID", ":", "entity_id", "}", "if", "entity_id", "else", "None", "await", "hass", ".", "services", ".", "async_call", "(", "DOMAIN"...
[ 72, 0 ]
[ 75, 79 ]
python
en
['en', 'en', 'en']
True
clean_spot
(hass, entity_id=ENTITY_MATCH_ALL)
Tell all or specified vacuum to perform a spot clean-up.
Tell all or specified vacuum to perform a spot clean-up.
def clean_spot(hass, entity_id=ENTITY_MATCH_ALL): """Tell all or specified vacuum to perform a spot clean-up.""" hass.add_job(async_clean_spot, hass, entity_id)
[ "def", "clean_spot", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "hass", ".", "add_job", "(", "async_clean_spot", ",", "hass", ",", "entity_id", ")" ]
[ 79, 0 ]
[ 81, 51 ]
python
en
['en', 'en', 'en']
True
async_clean_spot
(hass, entity_id=ENTITY_MATCH_ALL)
Tell all or specified vacuum to perform a spot clean-up.
Tell all or specified vacuum to perform a spot clean-up.
async def async_clean_spot(hass, entity_id=ENTITY_MATCH_ALL): """Tell all or specified vacuum to perform a spot clean-up.""" data = {ATTR_ENTITY_ID: entity_id} if entity_id else None await hass.services.async_call(DOMAIN, SERVICE_CLEAN_SPOT, data, blocking=True)
[ "async", "def", "async_clean_spot", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "data", "=", "{", "ATTR_ENTITY_ID", ":", "entity_id", "}", "if", "entity_id", "else", "None", "await", "hass", ".", "services", ".", "async_call", "(", "DOM...
[ 84, 0 ]
[ 87, 83 ]
python
en
['en', 'en', 'en']
True
return_to_base
(hass, entity_id=ENTITY_MATCH_ALL)
Tell all or specified vacuum to return to base.
Tell all or specified vacuum to return to base.
def return_to_base(hass, entity_id=ENTITY_MATCH_ALL): """Tell all or specified vacuum to return to base.""" hass.add_job(async_return_to_base, hass, entity_id)
[ "def", "return_to_base", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "hass", ".", "add_job", "(", "async_return_to_base", ",", "hass", ",", "entity_id", ")" ]
[ 91, 0 ]
[ 93, 55 ]
python
en
['en', 'en', 'en']
True
async_return_to_base
(hass, entity_id=ENTITY_MATCH_ALL)
Tell all or specified vacuum to return to base.
Tell all or specified vacuum to return to base.
async def async_return_to_base(hass, entity_id=ENTITY_MATCH_ALL): """Tell all or specified vacuum to return to base.""" data = {ATTR_ENTITY_ID: entity_id} if entity_id else None await hass.services.async_call(DOMAIN, SERVICE_RETURN_TO_BASE, data, blocking=True)
[ "async", "def", "async_return_to_base", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "data", "=", "{", "ATTR_ENTITY_ID", ":", "entity_id", "}", "if", "entity_id", "else", "None", "await", "hass", ".", "services", ".", "async_call", "(", ...
[ 96, 0 ]
[ 99, 87 ]
python
en
['en', 'en', 'en']
True
start_pause
(hass, entity_id=ENTITY_MATCH_ALL)
Tell all or specified vacuum to start or pause the current task.
Tell all or specified vacuum to start or pause the current task.
def start_pause(hass, entity_id=ENTITY_MATCH_ALL): """Tell all or specified vacuum to start or pause the current task.""" hass.add_job(async_start_pause, hass, entity_id)
[ "def", "start_pause", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "hass", ".", "add_job", "(", "async_start_pause", ",", "hass", ",", "entity_id", ")" ]
[ 103, 0 ]
[ 105, 52 ]
python
en
['en', 'en', 'en']
True
async_start_pause
(hass, entity_id=ENTITY_MATCH_ALL)
Tell all or specified vacuum to start or pause the current task.
Tell all or specified vacuum to start or pause the current task.
async def async_start_pause(hass, entity_id=ENTITY_MATCH_ALL): """Tell all or specified vacuum to start or pause the current task.""" data = {ATTR_ENTITY_ID: entity_id} if entity_id else None await hass.services.async_call(DOMAIN, SERVICE_START_PAUSE, data, blocking=True)
[ "async", "def", "async_start_pause", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "data", "=", "{", "ATTR_ENTITY_ID", ":", "entity_id", "}", "if", "entity_id", "else", "None", "await", "hass", ".", "services", ".", "async_call", "(", "DO...
[ 108, 0 ]
[ 111, 84 ]
python
en
['en', 'en', 'en']
True
start
(hass, entity_id=ENTITY_MATCH_ALL)
Tell all or specified vacuum to start or resume the current task.
Tell all or specified vacuum to start or resume the current task.
def start(hass, entity_id=ENTITY_MATCH_ALL): """Tell all or specified vacuum to start or resume the current task.""" hass.add_job(async_start, hass, entity_id)
[ "def", "start", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "hass", ".", "add_job", "(", "async_start", ",", "hass", ",", "entity_id", ")" ]
[ 115, 0 ]
[ 117, 46 ]
python
en
['en', 'en', 'en']
True
async_start
(hass, entity_id=ENTITY_MATCH_ALL)
Tell all or specified vacuum to start or resume the current task.
Tell all or specified vacuum to start or resume the current task.
async def async_start(hass, entity_id=ENTITY_MATCH_ALL): """Tell all or specified vacuum to start or resume the current task.""" data = {ATTR_ENTITY_ID: entity_id} if entity_id else None await hass.services.async_call(DOMAIN, SERVICE_START, data, blocking=True)
[ "async", "def", "async_start", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "data", "=", "{", "ATTR_ENTITY_ID", ":", "entity_id", "}", "if", "entity_id", "else", "None", "await", "hass", ".", "services", ".", "async_call", "(", "DOMAIN",...
[ 120, 0 ]
[ 123, 78 ]
python
en
['en', 'en', 'en']
True
pause
(hass, entity_id=ENTITY_MATCH_ALL)
Tell all or the specified vacuum to pause the current task.
Tell all or the specified vacuum to pause the current task.
def pause(hass, entity_id=ENTITY_MATCH_ALL): """Tell all or the specified vacuum to pause the current task.""" hass.add_job(async_pause, hass, entity_id)
[ "def", "pause", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "hass", ".", "add_job", "(", "async_pause", ",", "hass", ",", "entity_id", ")" ]
[ 127, 0 ]
[ 129, 46 ]
python
en
['en', 'en', 'en']
True
async_pause
(hass, entity_id=ENTITY_MATCH_ALL)
Tell all or the specified vacuum to pause the current task.
Tell all or the specified vacuum to pause the current task.
async def async_pause(hass, entity_id=ENTITY_MATCH_ALL): """Tell all or the specified vacuum to pause the current task.""" data = {ATTR_ENTITY_ID: entity_id} if entity_id else None await hass.services.async_call(DOMAIN, SERVICE_PAUSE, data, blocking=True)
[ "async", "def", "async_pause", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "data", "=", "{", "ATTR_ENTITY_ID", ":", "entity_id", "}", "if", "entity_id", "else", "None", "await", "hass", ".", "services", ".", "async_call", "(", "DOMAIN",...
[ 132, 0 ]
[ 135, 78 ]
python
en
['en', 'en', 'en']
True
stop
(hass, entity_id=ENTITY_MATCH_ALL)
Stop all or specified vacuum.
Stop all or specified vacuum.
def stop(hass, entity_id=ENTITY_MATCH_ALL): """Stop all or specified vacuum.""" hass.add_job(async_stop, hass, entity_id)
[ "def", "stop", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "hass", ".", "add_job", "(", "async_stop", ",", "hass", ",", "entity_id", ")" ]
[ 139, 0 ]
[ 141, 45 ]
python
en
['en', 'en', 'en']
True
async_stop
(hass, entity_id=ENTITY_MATCH_ALL)
Stop all or specified vacuum.
Stop all or specified vacuum.
async def async_stop(hass, entity_id=ENTITY_MATCH_ALL): """Stop all or specified vacuum.""" data = {ATTR_ENTITY_ID: entity_id} if entity_id else None await hass.services.async_call(DOMAIN, SERVICE_STOP, data, blocking=True)
[ "async", "def", "async_stop", "(", "hass", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "data", "=", "{", "ATTR_ENTITY_ID", ":", "entity_id", "}", "if", "entity_id", "else", "None", "await", "hass", ".", "services", ".", "async_call", "(", "DOMAIN", ...
[ 144, 0 ]
[ 147, 77 ]
python
en
['en', 'en', 'en']
True
set_fan_speed
(hass, fan_speed, entity_id=ENTITY_MATCH_ALL)
Set fan speed for all or specified vacuum.
Set fan speed for all or specified vacuum.
def set_fan_speed(hass, fan_speed, entity_id=ENTITY_MATCH_ALL): """Set fan speed for all or specified vacuum.""" hass.add_job(async_set_fan_speed, hass, fan_speed, entity_id)
[ "def", "set_fan_speed", "(", "hass", ",", "fan_speed", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "hass", ".", "add_job", "(", "async_set_fan_speed", ",", "hass", ",", "fan_speed", ",", "entity_id", ")" ]
[ 151, 0 ]
[ 153, 65 ]
python
en
['en', 'en', 'en']
True
async_set_fan_speed
(hass, fan_speed, entity_id=ENTITY_MATCH_ALL)
Set fan speed for all or specified vacuum.
Set fan speed for all or specified vacuum.
async def async_set_fan_speed(hass, fan_speed, entity_id=ENTITY_MATCH_ALL): """Set fan speed for all or specified vacuum.""" data = {ATTR_ENTITY_ID: entity_id} if entity_id else {} data[ATTR_FAN_SPEED] = fan_speed await hass.services.async_call(DOMAIN, SERVICE_SET_FAN_SPEED, data, blocking=True)
[ "async", "def", "async_set_fan_speed", "(", "hass", ",", "fan_speed", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "data", "=", "{", "ATTR_ENTITY_ID", ":", "entity_id", "}", "if", "entity_id", "else", "{", "}", "data", "[", "ATTR_FAN_SPEED", "]", "="...
[ 156, 0 ]
[ 160, 86 ]
python
en
['en', 'en', 'en']
True
send_command
(hass, command, params=None, entity_id=ENTITY_MATCH_ALL)
Send command to all or specified vacuum.
Send command to all or specified vacuum.
def send_command(hass, command, params=None, entity_id=ENTITY_MATCH_ALL): """Send command to all or specified vacuum.""" hass.add_job(async_send_command, hass, command, params, entity_id)
[ "def", "send_command", "(", "hass", ",", "command", ",", "params", "=", "None", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "hass", ".", "add_job", "(", "async_send_command", ",", "hass", ",", "command", ",", "params", ",", "entity_id", ")" ]
[ 164, 0 ]
[ 166, 70 ]
python
en
['en', 'en', 'en']
True
async_send_command
(hass, command, params=None, entity_id=ENTITY_MATCH_ALL)
Send command to all or specified vacuum.
Send command to all or specified vacuum.
async def async_send_command(hass, command, params=None, entity_id=ENTITY_MATCH_ALL): """Send command to all or specified vacuum.""" data = {ATTR_ENTITY_ID: entity_id} if entity_id else {} data[ATTR_COMMAND] = command if params is not None: data[ATTR_PARAMS] = params await hass.services.asyn...
[ "async", "def", "async_send_command", "(", "hass", ",", "command", ",", "params", "=", "None", ",", "entity_id", "=", "ENTITY_MATCH_ALL", ")", ":", "data", "=", "{", "ATTR_ENTITY_ID", ":", "entity_id", "}", "if", "entity_id", "else", "{", "}", "data", "[",...
[ 169, 0 ]
[ 175, 85 ]
python
en
['en', 'en', 'en']
True
setup_platform
(hass, config, add_entities, discovery_info=None)
Set up the ITach connection and devices.
Set up the ITach connection and devices.
def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the ITach connection and devices.""" itachip2ir = pyitachip2ir.ITachIP2IR( config.get(CONF_MAC), config.get(CONF_HOST), int(config.get(CONF_PORT)) ) if not itachip2ir.ready(CONNECT_TIMEOUT): _LOGGER.error("Un...
[ "def", "setup_platform", "(", "hass", ",", "config", ",", "add_entities", ",", "discovery_info", "=", "None", ")", ":", "itachip2ir", "=", "pyitachip2ir", ".", "ITachIP2IR", "(", "config", ".", "get", "(", "CONF_MAC", ")", ",", "config", ".", "get", "(", ...
[ 65, 0 ]
[ 93, 15 ]
python
en
['en', 'en', 'en']
True
ITachIP2IRRemote.__init__
(self, itachip2ir, name, ir_count)
Initialize device.
Initialize device.
def __init__(self, itachip2ir, name, ir_count): """Initialize device.""" self.itachip2ir = itachip2ir self._power = False self._name = name or DEVICE_DEFAULT_NAME self._ir_count = ir_count or DEFAULT_IR_COUNT
[ "def", "__init__", "(", "self", ",", "itachip2ir", ",", "name", ",", "ir_count", ")", ":", "self", ".", "itachip2ir", "=", "itachip2ir", "self", ".", "_power", "=", "False", "self", ".", "_name", "=", "name", "or", "DEVICE_DEFAULT_NAME", "self", ".", "_i...
[ 99, 4 ]
[ 104, 53 ]
python
en
['fr', 'en', 'en']
False
ITachIP2IRRemote.name
(self)
Return the name of the device.
Return the name of the device.
def name(self): """Return the name of the device.""" return self._name
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_name" ]
[ 107, 4 ]
[ 109, 25 ]
python
en
['en', 'en', 'en']
True
ITachIP2IRRemote.is_on
(self)
Return true if device is on.
Return true if device is on.
def is_on(self): """Return true if device is on.""" return self._power
[ "def", "is_on", "(", "self", ")", ":", "return", "self", ".", "_power" ]
[ 112, 4 ]
[ 114, 26 ]
python
en
['en', 'fy', 'en']
True
ITachIP2IRRemote.turn_on
(self, **kwargs)
Turn the device on.
Turn the device on.
def turn_on(self, **kwargs): """Turn the device on.""" self._power = True self.itachip2ir.send(self._name, "ON", self._ir_count) self.schedule_update_ha_state()
[ "def", "turn_on", "(", "self", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_power", "=", "True", "self", ".", "itachip2ir", ".", "send", "(", "self", ".", "_name", ",", "\"ON\"", ",", "self", ".", "_ir_count", ")", "self", ".", "schedule_update_...
[ 116, 4 ]
[ 120, 39 ]
python
en
['en', 'en', 'en']
True
ITachIP2IRRemote.turn_off
(self, **kwargs)
Turn the device off.
Turn the device off.
def turn_off(self, **kwargs): """Turn the device off.""" self._power = False self.itachip2ir.send(self._name, "OFF", self._ir_count) self.schedule_update_ha_state()
[ "def", "turn_off", "(", "self", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_power", "=", "False", "self", ".", "itachip2ir", ".", "send", "(", "self", ".", "_name", ",", "\"OFF\"", ",", "self", ".", "_ir_count", ")", "self", ".", "schedule_upda...
[ 122, 4 ]
[ 126, 39 ]
python
en
['en', 'en', 'en']
True
ITachIP2IRRemote.send_command
(self, command, **kwargs)
Send a command to one device.
Send a command to one device.
def send_command(self, command, **kwargs): """Send a command to one device.""" num_repeats = kwargs.get(ATTR_NUM_REPEATS, DEFAULT_NUM_REPEATS) for single_command in command: self.itachip2ir.send( self._name, single_command, self._ir_count * num_repeats )
[ "def", "send_command", "(", "self", ",", "command", ",", "*", "*", "kwargs", ")", ":", "num_repeats", "=", "kwargs", ".", "get", "(", "ATTR_NUM_REPEATS", ",", "DEFAULT_NUM_REPEATS", ")", "for", "single_command", "in", "command", ":", "self", ".", "itachip2ir...
[ 128, 4 ]
[ 134, 13 ]
python
en
['en', 'en', 'en']
True
ITachIP2IRRemote.update
(self)
Update the device.
Update the device.
def update(self): """Update the device.""" self.itachip2ir.update()
[ "def", "update", "(", "self", ")", ":", "self", ".", "itachip2ir", ".", "update", "(", ")" ]
[ 136, 4 ]
[ 138, 32 ]
python
en
['en', 'en', 'en']
True
IssuedAmount.canonical_zero_serial
(self)
Returns canonical format for zero (a special case): - "Not XRP" bit = 1 - Everything else is zeroes - Arguably this means it's canonically written as "negative zero" because the encoding usually uses 1 for positive.
Returns canonical format for zero (a special case): - "Not XRP" bit = 1 - Everything else is zeroes - Arguably this means it's canonically written as "negative zero" because the encoding usually uses 1 for positive.
def canonical_zero_serial(self): """ Returns canonical format for zero (a special case): - "Not XRP" bit = 1 - Everything else is zeroes - Arguably this means it's canonically written as "negative zero" because the encoding usually uses 1 for positive. """ ...
[ "def", "canonical_zero_serial", "(", "self", ")", ":", "return", "(", "0x8000000000000000", ")", ".", "to_bytes", "(", "8", ",", "byteorder", "=", "\"big\"", ",", "signed", "=", "False", ")" ]
[ 54, 4 ]
[ 62, 78 ]
python
en
['en', 'error', 'th']
False
_get_temperature_range_from_state
(state, unit, default_min, default_max)
Calculate the temperature range from a state.
Calculate the temperature range from a state.
def _get_temperature_range_from_state(state, unit, default_min, default_max): """Calculate the temperature range from a state.""" min_temp = state.attributes.get(ATTR_MIN_TEMP) if min_temp: min_temp = round(temperature_to_homekit(min_temp, unit) * 2) / 2 else: min_temp = default_min ...
[ "def", "_get_temperature_range_from_state", "(", "state", ",", "unit", ",", "default_min", ",", "default_max", ")", ":", "min_temp", "=", "state", ".", "attributes", ".", "get", "(", "ATTR_MIN_TEMP", ")", "if", "min_temp", ":", "min_temp", "=", "round", "(", ...
[ 586, 0 ]
[ 607, 29 ]
python
en
['en', 'en', 'en']
True
async_setup_entry
(hass, config_entry, async_add_entities)
Create the Elk-M1 thermostat platform.
Create the Elk-M1 thermostat platform.
async def async_setup_entry(hass, config_entry, async_add_entities): """Create the Elk-M1 thermostat platform.""" elk_data = hass.data[DOMAIN][config_entry.entry_id] entities = [] elk = elk_data["elk"] create_elk_entities( elk_data, elk.thermostats, "thermostat", ElkThermostat, entities ...
[ "async", "def", "async_setup_entry", "(", "hass", ",", "config_entry", ",", "async_add_entities", ")", ":", "elk_data", "=", "hass", ".", "data", "[", "DOMAIN", "]", "[", "config_entry", ".", "entry_id", "]", "entities", "=", "[", "]", "elk", "=", "elk_dat...
[ 30, 0 ]
[ 38, 38 ]
python
en
['en', 'da', 'en']
True
ElkThermostat.__init__
(self, element, elk, elk_data)
Initialize climate entity.
Initialize climate entity.
def __init__(self, element, elk, elk_data): """Initialize climate entity.""" super().__init__(element, elk, elk_data) self._state = None
[ "def", "__init__", "(", "self", ",", "element", ",", "elk", ",", "elk_data", ")", ":", "super", "(", ")", ".", "__init__", "(", "element", ",", "elk", ",", "elk_data", ")", "self", ".", "_state", "=", "None" ]
[ 44, 4 ]
[ 47, 26 ]
python
en
['es', 'en', 'it']
False
ElkThermostat.supported_features
(self)
Return the list of supported features.
Return the list of supported features.
def supported_features(self): """Return the list of supported features.""" return SUPPORT_FAN_MODE | SUPPORT_AUX_HEAT | SUPPORT_TARGET_TEMPERATURE_RANGE
[ "def", "supported_features", "(", "self", ")", ":", "return", "SUPPORT_FAN_MODE", "|", "SUPPORT_AUX_HEAT", "|", "SUPPORT_TARGET_TEMPERATURE_RANGE" ]
[ 50, 4 ]
[ 52, 85 ]
python
en
['en', 'en', 'en']
True
ElkThermostat.temperature_unit
(self)
Return the temperature unit.
Return the temperature unit.
def temperature_unit(self): """Return the temperature unit.""" return self._temperature_unit
[ "def", "temperature_unit", "(", "self", ")", ":", "return", "self", ".", "_temperature_unit" ]
[ 55, 4 ]
[ 57, 37 ]
python
en
['en', 'la', 'en']
True
ElkThermostat.current_temperature
(self)
Return the current temperature.
Return the current temperature.
def current_temperature(self): """Return the current temperature.""" return self._element.current_temp
[ "def", "current_temperature", "(", "self", ")", ":", "return", "self", ".", "_element", ".", "current_temp" ]
[ 60, 4 ]
[ 62, 41 ]
python
en
['en', 'la', 'en']
True
ElkThermostat.target_temperature
(self)
Return the temperature we are trying to reach.
Return the temperature we are trying to reach.
def target_temperature(self): """Return the temperature we are trying to reach.""" if (self._element.mode == ThermostatMode.HEAT.value) or ( self._element.mode == ThermostatMode.EMERGENCY_HEAT.value ): return self._element.heat_setpoint if self._element.mode == Th...
[ "def", "target_temperature", "(", "self", ")", ":", "if", "(", "self", ".", "_element", ".", "mode", "==", "ThermostatMode", ".", "HEAT", ".", "value", ")", "or", "(", "self", ".", "_element", ".", "mode", "==", "ThermostatMode", ".", "EMERGENCY_HEAT", "...
[ 65, 4 ]
[ 73, 19 ]
python
en
['en', 'en', 'en']
True
ElkThermostat.target_temperature_high
(self)
Return the high target temperature.
Return the high target temperature.
def target_temperature_high(self): """Return the high target temperature.""" return self._element.cool_setpoint
[ "def", "target_temperature_high", "(", "self", ")", ":", "return", "self", ".", "_element", ".", "cool_setpoint" ]
[ 76, 4 ]
[ 78, 42 ]
python
en
['en', 'id', 'en']
True
ElkThermostat.target_temperature_low
(self)
Return the low target temperature.
Return the low target temperature.
def target_temperature_low(self): """Return the low target temperature.""" return self._element.heat_setpoint
[ "def", "target_temperature_low", "(", "self", ")", ":", "return", "self", ".", "_element", ".", "heat_setpoint" ]
[ 81, 4 ]
[ 83, 42 ]
python
en
['en', 'id', 'en']
True
ElkThermostat.target_temperature_step
(self)
Return the supported step of target temperature.
Return the supported step of target temperature.
def target_temperature_step(self): """Return the supported step of target temperature.""" return 1
[ "def", "target_temperature_step", "(", "self", ")", ":", "return", "1" ]
[ 86, 4 ]
[ 88, 16 ]
python
en
['en', 'en', 'en']
True
ElkThermostat.current_humidity
(self)
Return the current humidity.
Return the current humidity.
def current_humidity(self): """Return the current humidity.""" return self._element.humidity
[ "def", "current_humidity", "(", "self", ")", ":", "return", "self", ".", "_element", ".", "humidity" ]
[ 91, 4 ]
[ 93, 37 ]
python
en
['en', 'en', 'en']
True
ElkThermostat.hvac_mode
(self)
Return current operation ie. heat, cool, idle.
Return current operation ie. heat, cool, idle.
def hvac_mode(self): """Return current operation ie. heat, cool, idle.""" return self._state
[ "def", "hvac_mode", "(", "self", ")", ":", "return", "self", ".", "_state" ]
[ 96, 4 ]
[ 98, 26 ]
python
en
['nl', 'en', 'en']
True
ElkThermostat.hvac_modes
(self)
Return the list of available operation modes.
Return the list of available operation modes.
def hvac_modes(self): """Return the list of available operation modes.""" return SUPPORT_HVAC
[ "def", "hvac_modes", "(", "self", ")", ":", "return", "SUPPORT_HVAC" ]
[ 101, 4 ]
[ 103, 27 ]
python
en
['en', 'en', 'en']
True
ElkThermostat.precision
(self)
Return the precision of the system.
Return the precision of the system.
def precision(self): """Return the precision of the system.""" return PRECISION_WHOLE
[ "def", "precision", "(", "self", ")", ":", "return", "PRECISION_WHOLE" ]
[ 106, 4 ]
[ 108, 30 ]
python
en
['en', 'en', 'en']
True
ElkThermostat.is_aux_heat
(self)
Return if aux heater is on.
Return if aux heater is on.
def is_aux_heat(self): """Return if aux heater is on.""" return self._element.mode == ThermostatMode.EMERGENCY_HEAT.value
[ "def", "is_aux_heat", "(", "self", ")", ":", "return", "self", ".", "_element", ".", "mode", "==", "ThermostatMode", ".", "EMERGENCY_HEAT", ".", "value" ]
[ 111, 4 ]
[ 113, 72 ]
python
fr
['fr', 'en', 'fr']
True