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
ConfigEntrySomfyApi.refresh_tokens
( self, )
Refresh and return new Somfy tokens using Home Assistant OAuth2 session.
Refresh and return new Somfy tokens using Home Assistant OAuth2 session.
def refresh_tokens( self, ) -> Dict[str, Union[str, int]]: """Refresh and return new Somfy tokens using Home Assistant OAuth2 session.""" run_coroutine_threadsafe( self.session.async_ensure_token_valid(), self.hass.loop ).result() return self.session.token
[ "def", "refresh_tokens", "(", "self", ",", ")", "->", "Dict", "[", "str", ",", "Union", "[", "str", ",", "int", "]", "]", ":", "run_coroutine_threadsafe", "(", "self", ".", "session", ".", "async_ensure_token_valid", "(", ")", ",", "self", ".", "hass", ...
[ 27, 4 ]
[ 35, 33 ]
python
en
['en', 'en', 'en']
True
async_setup_intents
(hass)
Set up the Shopping List intents.
Set up the Shopping List intents.
async def async_setup_intents(hass): """Set up the Shopping List intents.""" intent.async_register(hass, AddItemIntent()) intent.async_register(hass, ListTopItemsIntent())
[ "async", "def", "async_setup_intents", "(", "hass", ")", ":", "intent", ".", "async_register", "(", "hass", ",", "AddItemIntent", "(", ")", ")", "intent", ".", "async_register", "(", "hass", ",", "ListTopItemsIntent", "(", ")", ")" ]
[ 10, 0 ]
[ 13, 53 ]
python
en
['en', 'en', 'en']
True
AddItemIntent.async_handle
(self, intent_obj)
Handle the intent.
Handle the intent.
async def async_handle(self, intent_obj): """Handle the intent.""" slots = self.async_validate_slots(intent_obj.slots) item = slots["item"]["value"] await intent_obj.hass.data[DOMAIN].async_add(item) response = intent_obj.create_response() response.async_set_speech(f"I'v...
[ "async", "def", "async_handle", "(", "self", ",", "intent_obj", ")", ":", "slots", "=", "self", ".", "async_validate_slots", "(", "intent_obj", ".", "slots", ")", "item", "=", "slots", "[", "\"item\"", "]", "[", "\"value\"", "]", "await", "intent_obj", "."...
[ 22, 4 ]
[ 31, 23 ]
python
en
['en', 'en', 'en']
True
ListTopItemsIntent.async_handle
(self, intent_obj)
Handle the intent.
Handle the intent.
async def async_handle(self, intent_obj): """Handle the intent.""" items = intent_obj.hass.data[DOMAIN].items[-5:] response = intent_obj.create_response() if not items: response.async_set_speech("There are no items on your shopping list") else: response.a...
[ "async", "def", "async_handle", "(", "self", ",", "intent_obj", ")", ":", "items", "=", "intent_obj", ".", "hass", ".", "data", "[", "DOMAIN", "]", ".", "items", "[", "-", "5", ":", "]", "response", "=", "intent_obj", ".", "create_response", "(", ")", ...
[ 40, 4 ]
[ 54, 23 ]
python
en
['en', 'en', 'en']
True
async_setup_entry
(hass, config_entry, async_add_entities)
Set up Tasmota light dynamically through discovery.
Set up Tasmota light dynamically through discovery.
async def async_setup_entry(hass, config_entry, async_add_entities): """Set up Tasmota light dynamically through discovery.""" @callback def async_discover(tasmota_entity, discovery_hash): """Discover and add a Tasmota light.""" async_add_entities( [TasmotaLight(tasmota_entity=t...
[ "async", "def", "async_setup_entry", "(", "hass", ",", "config_entry", ",", "async_add_entities", ")", ":", "@", "callback", "def", "async_discover", "(", "tasmota_entity", ",", "discovery_hash", ")", ":", "\"\"\"Discover and add a Tasmota light.\"\"\"", "async_add_entiti...
[ 37, 0 ]
[ 53, 5 ]
python
en
['en', 'en', 'en']
True
TasmotaLight.__init__
(self, **kwds)
Initialize Tasmota light.
Initialize Tasmota light.
def __init__(self, **kwds): """Initialize Tasmota light.""" self._state = False self._supported_features = 0 self._brightness = None self._color_temp = None self._effect = None self._hs = None self._white_value = None self._flash_times = None ...
[ "def", "__init__", "(", "self", ",", "*", "*", "kwds", ")", ":", "self", ".", "_state", "=", "False", "self", ".", "_supported_features", "=", "0", "self", ".", "_brightness", "=", "None", "self", ".", "_color_temp", "=", "None", "self", ".", "_effect"...
[ 63, 4 ]
[ 80, 33 ]
python
en
['en', 'zu', 'it']
False
TasmotaLight.discovery_update
(self, update, write_state=True)
Handle updated discovery message.
Handle updated discovery message.
async def discovery_update(self, update, write_state=True): """Handle updated discovery message.""" await super().discovery_update(update, write_state=False) self._setup_from_entity() self.async_write_ha_state()
[ "async", "def", "discovery_update", "(", "self", ",", "update", ",", "write_state", "=", "True", ")", ":", "await", "super", "(", ")", ".", "discovery_update", "(", "update", ",", "write_state", "=", "False", ")", "self", ".", "_setup_from_entity", "(", ")...
[ 82, 4 ]
[ 86, 35 ]
python
en
['en', 'en', 'en']
True
TasmotaLight._setup_from_entity
(self)
(Re)Setup the entity.
(Re)Setup the entity.
def _setup_from_entity(self): """(Re)Setup the entity.""" supported_features = 0 light_type = self._tasmota_entity.light_type if light_type != LIGHT_TYPE_NONE: supported_features |= SUPPORT_BRIGHTNESS supported_features |= SUPPORT_TRANSITION if light_typ...
[ "def", "_setup_from_entity", "(", "self", ")", ":", "supported_features", "=", "0", "light_type", "=", "self", ".", "_tasmota_entity", ".", "light_type", "if", "light_type", "!=", "LIGHT_TYPE_NONE", ":", "supported_features", "|=", "SUPPORT_BRIGHTNESS", "supported_fea...
[ 88, 4 ]
[ 107, 53 ]
python
en
['en', 'haw', 'en']
True
TasmotaLight.state_updated
(self, state, **kwargs)
Handle state updates.
Handle state updates.
def state_updated(self, state, **kwargs): """Handle state updates.""" self._state = state attributes = kwargs.get("attributes") if attributes: if "brightness" in attributes: brightness = float(attributes["brightness"]) percent_bright = brightne...
[ "def", "state_updated", "(", "self", ",", "state", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_state", "=", "state", "attributes", "=", "kwargs", ".", "get", "(", "\"attributes\"", ")", "if", "attributes", ":", "if", "\"brightness\"", "in", "attrib...
[ 110, 4 ]
[ 135, 35 ]
python
en
['en', 'en', 'en']
True
TasmotaLight.brightness
(self)
Return the brightness of this light between 0..255.
Return the brightness of this light between 0..255.
def brightness(self): """Return the brightness of this light between 0..255.""" return self._brightness
[ "def", "brightness", "(", "self", ")", ":", "return", "self", ".", "_brightness" ]
[ 138, 4 ]
[ 140, 31 ]
python
en
['en', 'en', 'en']
True
TasmotaLight.color_temp
(self)
Return the color temperature in mired.
Return the color temperature in mired.
def color_temp(self): """Return the color temperature in mired.""" return self._color_temp
[ "def", "color_temp", "(", "self", ")", ":", "return", "self", ".", "_color_temp" ]
[ 143, 4 ]
[ 145, 31 ]
python
en
['en', 'en', 'en']
True
TasmotaLight.min_mireds
(self)
Return the coldest color_temp that this light supports.
Return the coldest color_temp that this light supports.
def min_mireds(self): """Return the coldest color_temp that this light supports.""" return self._tasmota_entity.min_mireds
[ "def", "min_mireds", "(", "self", ")", ":", "return", "self", ".", "_tasmota_entity", ".", "min_mireds" ]
[ 148, 4 ]
[ 150, 46 ]
python
en
['en', 'en', 'en']
True
TasmotaLight.max_mireds
(self)
Return the warmest color_temp that this light supports.
Return the warmest color_temp that this light supports.
def max_mireds(self): """Return the warmest color_temp that this light supports.""" return self._tasmota_entity.max_mireds
[ "def", "max_mireds", "(", "self", ")", ":", "return", "self", ".", "_tasmota_entity", ".", "max_mireds" ]
[ 153, 4 ]
[ 155, 46 ]
python
en
['en', 'en', 'en']
True
TasmotaLight.effect
(self)
Return the current effect.
Return the current effect.
def effect(self): """Return the current effect.""" return self._effect
[ "def", "effect", "(", "self", ")", ":", "return", "self", ".", "_effect" ]
[ 158, 4 ]
[ 160, 27 ]
python
en
['en', 'en', 'en']
True
TasmotaLight.effect_list
(self)
Return the list of supported effects.
Return the list of supported effects.
def effect_list(self): """Return the list of supported effects.""" return self._tasmota_entity.effect_list
[ "def", "effect_list", "(", "self", ")", ":", "return", "self", ".", "_tasmota_entity", ".", "effect_list" ]
[ 163, 4 ]
[ 165, 47 ]
python
en
['en', 'en', 'en']
True
TasmotaLight.hs_color
(self)
Return the hs color value.
Return the hs color value.
def hs_color(self): """Return the hs color value.""" return self._hs
[ "def", "hs_color", "(", "self", ")", ":", "return", "self", ".", "_hs" ]
[ 168, 4 ]
[ 170, 23 ]
python
en
['en', 'en', 'en']
True
TasmotaLight.white_value
(self)
Return the white property.
Return the white property.
def white_value(self): """Return the white property.""" return self._white_value
[ "def", "white_value", "(", "self", ")", ":", "return", "self", ".", "_white_value" ]
[ 173, 4 ]
[ 175, 32 ]
python
en
['en', 'en', 'en']
True
TasmotaLight.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._state
[ "def", "is_on", "(", "self", ")", ":", "return", "self", ".", "_state" ]
[ 178, 4 ]
[ 180, 26 ]
python
en
['en', 'fy', 'en']
True
TasmotaLight.supported_features
(self)
Flag supported features.
Flag supported features.
def supported_features(self): """Flag supported features.""" return self._supported_features
[ "def", "supported_features", "(", "self", ")", ":", "return", "self", ".", "_supported_features" ]
[ 183, 4 ]
[ 185, 39 ]
python
en
['da', 'en', 'en']
True
TasmotaLight.async_turn_on
(self, **kwargs)
Turn the entity on.
Turn the entity on.
async def async_turn_on(self, **kwargs): """Turn the entity on.""" supported_features = self._supported_features attributes = {} if ATTR_HS_COLOR in kwargs and supported_features & SUPPORT_COLOR: hs_color = kwargs[ATTR_HS_COLOR] attributes["color"] = {} ...
[ "async", "def", "async_turn_on", "(", "self", ",", "*", "*", "kwargs", ")", ":", "supported_features", "=", "self", ".", "_supported_features", "attributes", "=", "{", "}", "if", "ATTR_HS_COLOR", "in", "kwargs", "and", "supported_features", "&", "SUPPORT_COLOR",...
[ 187, 4 ]
[ 227, 56 ]
python
en
['en', 'en', 'en']
True
TasmotaLight.async_turn_off
(self, **kwargs)
Turn the entity off.
Turn the entity off.
async def async_turn_off(self, **kwargs): """Turn the entity off.""" attributes = {"state": "OFF"} if ATTR_TRANSITION in kwargs: attributes["transition"] = kwargs[ATTR_TRANSITION] self._tasmota_entity.set_state(False, attributes)
[ "async", "def", "async_turn_off", "(", "self", ",", "*", "*", "kwargs", ")", ":", "attributes", "=", "{", "\"state\"", ":", "\"OFF\"", "}", "if", "ATTR_TRANSITION", "in", "kwargs", ":", "attributes", "[", "\"transition\"", "]", "=", "kwargs", "[", "ATTR_TR...
[ 229, 4 ]
[ 236, 57 ]
python
en
['en', 'en', 'en']
True
has_all_unique_names
(value)
Validate that printers have an unique name.
Validate that printers have an unique name.
def has_all_unique_names(value): """Validate that printers have an unique name.""" names = [util_slugify(printer[CONF_NAME]) for printer in value] vol.Schema(vol.Unique())(names) return value
[ "def", "has_all_unique_names", "(", "value", ")", ":", "names", "=", "[", "util_slugify", "(", "printer", "[", "CONF_NAME", "]", ")", "for", "printer", "in", "value", "]", "vol", ".", "Schema", "(", "vol", ".", "Unique", "(", ")", ")", "(", "names", ...
[ 103, 0 ]
[ 107, 16 ]
python
en
['en', 'en', 'en']
True
setup
(hass, config)
Set up the Repetier Server component.
Set up the Repetier Server component.
def setup(hass, config): """Set up the Repetier Server component.""" hass.data[REPETIER_API] = {} for repetier in config[DOMAIN]: _LOGGER.debug("Repetier server config %s", repetier[CONF_HOST]) url = "http://{}".format(repetier[CONF_HOST]) port = repetier[CONF_PORT] api_key...
[ "def", "setup", "(", "hass", ",", "config", ")", ":", "hass", ".", "data", "[", "REPETIER_API", "]", "=", "{", "}", "for", "repetier", "in", "config", "[", "DOMAIN", "]", ":", "_LOGGER", ".", "debug", "(", "\"Repetier server config %s\"", ",", "repetier"...
[ 162, 0 ]
[ 187, 15 ]
python
en
['en', 'en', 'en']
True
PrinterAPI.__init__
(self, hass, client, printers, sensors, conf_name, config)
Set up instance.
Set up instance.
def __init__(self, hass, client, printers, sensors, conf_name, config): """Set up instance.""" self._hass = hass self._client = client self.printers = printers self.sensors = sensors self.conf_name = conf_name self.config = config self._known_entities = se...
[ "def", "__init__", "(", "self", ",", "hass", ",", "client", ",", "printers", ",", "sensors", ",", "conf_name", ",", "config", ")", ":", "self", ".", "_hass", "=", "hass", "self", ".", "_client", "=", "client", "self", ".", "printers", "=", "printers", ...
[ 193, 4 ]
[ 201, 36 ]
python
en
['en', 'da', 'en']
True
PrinterAPI.get_data
(self, printer_id, sensor_type, temp_id)
Get data from the state cache.
Get data from the state cache.
def get_data(self, printer_id, sensor_type, temp_id): """Get data from the state cache.""" printer = self.printers[printer_id] methods = API_PRINTER_METHODS[sensor_type] for prop, offline in methods["offline"].items(): state = getattr(printer, prop) if state == of...
[ "def", "get_data", "(", "self", ",", "printer_id", ",", "sensor_type", ",", "temp_id", ")", ":", "printer", "=", "self", ".", "printers", "[", "printer_id", "]", "methods", "=", "API_PRINTER_METHODS", "[", "sensor_type", "]", "for", "prop", ",", "offline", ...
[ 203, 4 ]
[ 222, 19 ]
python
en
['en', 'en', 'en']
True
PrinterAPI.update
(self, now=None)
Update the state cache from the printer API.
Update the state cache from the printer API.
def update(self, now=None): """Update the state cache from the printer API.""" for printer in self.printers: printer.get_data() self._load_entities() dispatcher_send(self._hass, UPDATE_SIGNAL)
[ "def", "update", "(", "self", ",", "now", "=", "None", ")", ":", "for", "printer", "in", "self", ".", "printers", ":", "printer", ".", "get_data", "(", ")", "self", ".", "_load_entities", "(", ")", "dispatcher_send", "(", "self", ".", "_hass", ",", "...
[ 224, 4 ]
[ 229, 50 ]
python
en
['en', 'en', 'en']
True
test_form
(hass)
Test we get the form.
Test we get the form.
async def test_form(hass): """Test we get the form.""" await setup.async_setup_component(hass, "persistent_notification", {}) result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} ) assert result["type"] == "form" assert result["errors...
[ "async", "def", "test_form", "(", "hass", ")", ":", "await", "setup", ".", "async_setup_component", "(", "hass", ",", "\"persistent_notification\"", ",", "{", "}", ")", "result", "=", "await", "hass", ".", "config_entries", ".", "flow", ".", "async_init", "(...
[ 8, 0 ]
[ 44, 48 ]
python
en
['en', 'en', 'en']
True
test_form_invalid_auth
(hass)
Test we handle invalid auth.
Test we handle invalid auth.
async def test_form_invalid_auth(hass): """Test we handle invalid auth.""" result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} ) with patch( "homeassistant.components.NEW_DOMAIN.config_flow.PlaceholderHub.authenticate", side...
[ "async", "def", "test_form_invalid_auth", "(", "hass", ")", ":", "result", "=", "await", "hass", ".", "config_entries", ".", "flow", ".", "async_init", "(", "DOMAIN", ",", "context", "=", "{", "\"source\"", ":", "config_entries", ".", "SOURCE_USER", "}", ")"...
[ 47, 0 ]
[ 67, 56 ]
python
en
['en', 'en', 'en']
True
test_form_cannot_connect
(hass)
Test we handle cannot connect error.
Test we handle cannot connect error.
async def test_form_cannot_connect(hass): """Test we handle cannot connect error.""" result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} ) with patch( "homeassistant.components.NEW_DOMAIN.config_flow.PlaceholderHub.authenticate", ...
[ "async", "def", "test_form_cannot_connect", "(", "hass", ")", ":", "result", "=", "await", "hass", ".", "config_entries", ".", "flow", ".", "async_init", "(", "DOMAIN", ",", "context", "=", "{", "\"source\"", ":", "config_entries", ".", "SOURCE_USER", "}", "...
[ 70, 0 ]
[ 90, 58 ]
python
en
['en', 'en', 'en']
True
setup_platform
(hass, config, add_entities, discovery_info=None)
Set up the XS1 switch platform.
Set up the XS1 switch platform.
def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the XS1 switch platform.""" actuators = hass.data[COMPONENT_DOMAIN][ACTUATORS] switch_entities = [] for actuator in actuators: if (actuator.type() == ActuatorType.SWITCH) or ( actuator.type() == ActuatorT...
[ "def", "setup_platform", "(", "hass", ",", "config", ",", "add_entities", ",", "discovery_info", "=", "None", ")", ":", "actuators", "=", "hass", ".", "data", "[", "COMPONENT_DOMAIN", "]", "[", "ACTUATORS", "]", "switch_entities", "=", "[", "]", "for", "ac...
[ 9, 0 ]
[ 20, 33 ]
python
en
['en', 'cs', 'en']
True
XS1SwitchEntity.name
(self)
Return the name of the device if any.
Return the name of the device if any.
def name(self): """Return the name of the device if any.""" return self.device.name()
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "device", ".", "name", "(", ")" ]
[ 27, 4 ]
[ 29, 33 ]
python
en
['en', 'en', 'en']
True
XS1SwitchEntity.is_on
(self)
Return true if switch is on.
Return true if switch is on.
def is_on(self): """Return true if switch is on.""" return self.device.value() == 100
[ "def", "is_on", "(", "self", ")", ":", "return", "self", ".", "device", ".", "value", "(", ")", "==", "100" ]
[ 32, 4 ]
[ 34, 41 ]
python
en
['en', 'fy', 'en']
True
XS1SwitchEntity.turn_on
(self, **kwargs)
Turn the device on.
Turn the device on.
def turn_on(self, **kwargs): """Turn the device on.""" self.device.turn_on()
[ "def", "turn_on", "(", "self", ",", "*", "*", "kwargs", ")", ":", "self", ".", "device", ".", "turn_on", "(", ")" ]
[ 36, 4 ]
[ 38, 29 ]
python
en
['en', 'en', 'en']
True
XS1SwitchEntity.turn_off
(self, **kwargs)
Turn the device off.
Turn the device off.
def turn_off(self, **kwargs): """Turn the device off.""" self.device.turn_off()
[ "def", "turn_off", "(", "self", ",", "*", "*", "kwargs", ")", ":", "self", ".", "device", ".", "turn_off", "(", ")" ]
[ 40, 4 ]
[ 42, 30 ]
python
en
['en', 'en', 'en']
True
async_setup_entry
(hass, entry, async_add_entities)
Set up Neato switch with config entry.
Set up Neato switch with config entry.
async def async_setup_entry(hass, entry, async_add_entities): """Set up Neato switch with config entry.""" dev = [] neato = hass.data.get(NEATO_LOGIN) for robot in hass.data[NEATO_ROBOTS]: for type_name in SWITCH_TYPES: dev.append(NeatoConnectedSwitch(neato, robot, type_name)) i...
[ "async", "def", "async_setup_entry", "(", "hass", ",", "entry", ",", "async_add_entities", ")", ":", "dev", "=", "[", "]", "neato", "=", "hass", ".", "data", ".", "get", "(", "NEATO_LOGIN", ")", "for", "robot", "in", "hass", ".", "data", "[", "NEATO_RO...
[ 20, 0 ]
[ 32, 33 ]
python
en
['en', 'en', 'en']
True
NeatoConnectedSwitch.__init__
(self, neato, robot, switch_type)
Initialize the Neato Connected switches.
Initialize the Neato Connected switches.
def __init__(self, neato, robot, switch_type): """Initialize the Neato Connected switches.""" self.type = switch_type self.robot = robot self._available = neato.logged_in if neato is not None else False self._robot_name = f"{self.robot.name} {SWITCH_TYPES[self.type][0]}" ...
[ "def", "__init__", "(", "self", ",", "neato", ",", "robot", ",", "switch_type", ")", ":", "self", ".", "type", "=", "switch_type", "self", ".", "robot", "=", "robot", "self", ".", "_available", "=", "neato", ".", "logged_in", "if", "neato", "is", "not"...
[ 38, 4 ]
[ 47, 46 ]
python
en
['en', 'en', 'en']
True
NeatoConnectedSwitch.update
(self)
Update the states of Neato switches.
Update the states of Neato switches.
def update(self): """Update the states of Neato switches.""" _LOGGER.debug("Running Neato switch update for '%s'", self.entity_id) try: self._state = self.robot.state except NeatoRobotException as ex: if self._available: # Print only once when available ...
[ "def", "update", "(", "self", ")", ":", "_LOGGER", ".", "debug", "(", "\"Running Neato switch update for '%s'\"", ",", "self", ".", "entity_id", ")", "try", ":", "self", ".", "_state", "=", "self", ".", "robot", ".", "state", "except", "NeatoRobotException", ...
[ 49, 4 ]
[ 73, 13 ]
python
en
['en', 'en', 'en']
True
NeatoConnectedSwitch.name
(self)
Return the name of the switch.
Return the name of the switch.
def name(self): """Return the name of the switch.""" return self._robot_name
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_robot_name" ]
[ 76, 4 ]
[ 78, 31 ]
python
en
['en', 'en', 'en']
True
NeatoConnectedSwitch.available
(self)
Return True if entity is available.
Return True if entity is available.
def available(self): """Return True if entity is available.""" return self._available
[ "def", "available", "(", "self", ")", ":", "return", "self", ".", "_available" ]
[ 81, 4 ]
[ 83, 30 ]
python
en
['en', 'en', 'en']
True
NeatoConnectedSwitch.unique_id
(self)
Return a unique ID.
Return a unique ID.
def unique_id(self): """Return a unique ID.""" return self._robot_serial
[ "def", "unique_id", "(", "self", ")", ":", "return", "self", ".", "_robot_serial" ]
[ 86, 4 ]
[ 88, 33 ]
python
ca
['fr', 'ca', 'en']
False
NeatoConnectedSwitch.is_on
(self)
Return true if switch is on.
Return true if switch is on.
def is_on(self): """Return true if switch is on.""" if self.type == SWITCH_TYPE_SCHEDULE: if self._schedule_state == STATE_ON: return True return False
[ "def", "is_on", "(", "self", ")", ":", "if", "self", ".", "type", "==", "SWITCH_TYPE_SCHEDULE", ":", "if", "self", ".", "_schedule_state", "==", "STATE_ON", ":", "return", "True", "return", "False" ]
[ 91, 4 ]
[ 96, 24 ]
python
en
['en', 'fy', 'en']
True
NeatoConnectedSwitch.device_info
(self)
Device info for neato robot.
Device info for neato robot.
def device_info(self): """Device info for neato robot.""" return {"identifiers": {(NEATO_DOMAIN, self._robot_serial)}}
[ "def", "device_info", "(", "self", ")", ":", "return", "{", "\"identifiers\"", ":", "{", "(", "NEATO_DOMAIN", ",", "self", ".", "_robot_serial", ")", "}", "}" ]
[ 99, 4 ]
[ 101, 68 ]
python
it
['it', 'en', 'it']
True
NeatoConnectedSwitch.turn_on
(self, **kwargs)
Turn the switch on.
Turn the switch on.
def turn_on(self, **kwargs): """Turn the switch on.""" if self.type == SWITCH_TYPE_SCHEDULE: try: self.robot.enable_schedule() except NeatoRobotException as ex: _LOGGER.error( "Neato switch connection error '%s': %s", self.entit...
[ "def", "turn_on", "(", "self", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "type", "==", "SWITCH_TYPE_SCHEDULE", ":", "try", ":", "self", ".", "robot", ".", "enable_schedule", "(", ")", "except", "NeatoRobotException", "as", "ex", ":", "_LOGGER...
[ 103, 4 ]
[ 111, 17 ]
python
en
['en', 'en', 'en']
True
NeatoConnectedSwitch.turn_off
(self, **kwargs)
Turn the switch off.
Turn the switch off.
def turn_off(self, **kwargs): """Turn the switch off.""" if self.type == SWITCH_TYPE_SCHEDULE: try: self.robot.disable_schedule() except NeatoRobotException as ex: _LOGGER.error( "Neato switch connection error '%s': %s", self.en...
[ "def", "turn_off", "(", "self", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "type", "==", "SWITCH_TYPE_SCHEDULE", ":", "try", ":", "self", ".", "robot", ".", "disable_schedule", "(", ")", "except", "NeatoRobotException", "as", "ex", ":", "_LOGG...
[ 113, 4 ]
[ 121, 17 ]
python
en
['en', 'en', 'en']
True
setup_comp
(hass)
Set up demo component.
Set up demo component.
async def setup_comp(hass): """Set up demo component.""" hass.config.units = IMPERIAL_SYSTEM assert await async_setup_component( hass, water_heater.DOMAIN, {"water_heater": {"platform": "demo"}} ) await hass.async_block_till_done()
[ "async", "def", "setup_comp", "(", "hass", ")", ":", "hass", ".", "config", ".", "units", "=", "IMPERIAL_SYSTEM", "assert", "await", "async_setup_component", "(", "hass", ",", "water_heater", ".", "DOMAIN", ",", "{", "\"water_heater\"", ":", "{", "\"platform\"...
[ 15, 0 ]
[ 21, 38 ]
python
en
['en', 'da', 'en']
True
test_setup_params
(hass)
Test the initial parameters.
Test the initial parameters.
async def test_setup_params(hass): """Test the initial parameters.""" state = hass.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("temperature") == 119 assert state.attributes.get("away_mode") == "off" assert state.attributes.get("operation_mode") == "eco"
[ "async", "def", "test_setup_params", "(", "hass", ")", ":", "state", "=", "hass", ".", "states", ".", "get", "(", "ENTITY_WATER_HEATER", ")", "assert", "state", ".", "attributes", ".", "get", "(", "\"temperature\"", ")", "==", "119", "assert", "state", "."...
[ 24, 0 ]
[ 29, 58 ]
python
en
['en', 'en', 'en']
True
test_default_setup_params
(hass)
Test the setup with default parameters.
Test the setup with default parameters.
async def test_default_setup_params(hass): """Test the setup with default parameters.""" state = hass.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("min_temp") == 110 assert state.attributes.get("max_temp") == 140
[ "async", "def", "test_default_setup_params", "(", "hass", ")", ":", "state", "=", "hass", ".", "states", ".", "get", "(", "ENTITY_WATER_HEATER", ")", "assert", "state", ".", "attributes", ".", "get", "(", "\"min_temp\"", ")", "==", "110", "assert", "state", ...
[ 32, 0 ]
[ 36, 50 ]
python
en
['en', 'en', 'en']
True
test_set_only_target_temp_bad_attr
(hass)
Test setting the target temperature without required attribute.
Test setting the target temperature without required attribute.
async def test_set_only_target_temp_bad_attr(hass): """Test setting the target temperature without required attribute.""" state = hass.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("temperature") == 119 with pytest.raises(vol.Invalid): await common.async_set_temperature(hass, None,...
[ "async", "def", "test_set_only_target_temp_bad_attr", "(", "hass", ")", ":", "state", "=", "hass", ".", "states", ".", "get", "(", "ENTITY_WATER_HEATER", ")", "assert", "state", ".", "attributes", ".", "get", "(", "\"temperature\"", ")", "==", "119", "with", ...
[ 39, 0 ]
[ 45, 53 ]
python
en
['en', 'en', 'en']
True
test_set_only_target_temp
(hass)
Test the setting of the target temperature.
Test the setting of the target temperature.
async def test_set_only_target_temp(hass): """Test the setting of the target temperature.""" state = hass.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("temperature") == 119 await common.async_set_temperature(hass, 110, ENTITY_WATER_HEATER) state = hass.states.get(ENTITY_WATER_HEATER) ...
[ "async", "def", "test_set_only_target_temp", "(", "hass", ")", ":", "state", "=", "hass", ".", "states", ".", "get", "(", "ENTITY_WATER_HEATER", ")", "assert", "state", ".", "attributes", ".", "get", "(", "\"temperature\"", ")", "==", "119", "await", "common...
[ 48, 0 ]
[ 54, 53 ]
python
en
['en', 'en', 'en']
True
test_set_operation_bad_attr_and_state
(hass)
Test setting operation mode without required attribute. Also check the state.
Test setting operation mode without required attribute.
async def test_set_operation_bad_attr_and_state(hass): """Test setting operation mode without required attribute. Also check the state. """ state = hass.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("operation_mode") == "eco" assert state.state == "eco" with pytest.raises(vol....
[ "async", "def", "test_set_operation_bad_attr_and_state", "(", "hass", ")", ":", "state", "=", "hass", ".", "states", ".", "get", "(", "ENTITY_WATER_HEATER", ")", "assert", "state", ".", "attributes", ".", "get", "(", "\"operation_mode\"", ")", "==", "\"eco\"", ...
[ 57, 0 ]
[ 69, 31 ]
python
en
['en', 'en', 'en']
True
test_set_operation
(hass)
Test setting of new operation mode.
Test setting of new operation mode.
async def test_set_operation(hass): """Test setting of new operation mode.""" state = hass.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("operation_mode") == "eco" assert state.state == "eco" await common.async_set_operation_mode(hass, "electric", ENTITY_WATER_HEATER) state = hass....
[ "async", "def", "test_set_operation", "(", "hass", ")", ":", "state", "=", "hass", ".", "states", ".", "get", "(", "ENTITY_WATER_HEATER", ")", "assert", "state", ".", "attributes", ".", "get", "(", "\"operation_mode\"", ")", "==", "\"eco\"", "assert", "state...
[ 72, 0 ]
[ 80, 36 ]
python
en
['en', 'en', 'en']
True
test_set_away_mode_bad_attr
(hass)
Test setting the away mode without required attribute.
Test setting the away mode without required attribute.
async def test_set_away_mode_bad_attr(hass): """Test setting the away mode without required attribute.""" state = hass.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("away_mode") == "off" with pytest.raises(vol.Invalid): await common.async_set_away_mode(hass, None, ENTITY_WATER_HEAT...
[ "async", "def", "test_set_away_mode_bad_attr", "(", "hass", ")", ":", "state", "=", "hass", ".", "states", ".", "get", "(", "ENTITY_WATER_HEATER", ")", "assert", "state", ".", "attributes", ".", "get", "(", "\"away_mode\"", ")", "==", "\"off\"", "with", "pyt...
[ 83, 0 ]
[ 89, 53 ]
python
en
['en', 'en', 'en']
True
test_set_away_mode_on
(hass)
Test setting the away mode on/true.
Test setting the away mode on/true.
async def test_set_away_mode_on(hass): """Test setting the away mode on/true.""" await common.async_set_away_mode(hass, True, ENTITY_WATER_HEATER) state = hass.states.get(ENTITY_WATER_HEATER) assert state.attributes.get("away_mode") == "on"
[ "async", "def", "test_set_away_mode_on", "(", "hass", ")", ":", "await", "common", ".", "async_set_away_mode", "(", "hass", ",", "True", ",", "ENTITY_WATER_HEATER", ")", "state", "=", "hass", ".", "states", ".", "get", "(", "ENTITY_WATER_HEATER", ")", "assert"...
[ 92, 0 ]
[ 96, 52 ]
python
en
['en', 'en', 'en']
True
test_set_away_mode_off
(hass)
Test setting the away mode off/false.
Test setting the away mode off/false.
async def test_set_away_mode_off(hass): """Test setting the away mode off/false.""" await common.async_set_away_mode(hass, False, ENTITY_WATER_HEATER_CELSIUS) state = hass.states.get(ENTITY_WATER_HEATER_CELSIUS) assert state.attributes.get("away_mode") == "off"
[ "async", "def", "test_set_away_mode_off", "(", "hass", ")", ":", "await", "common", ".", "async_set_away_mode", "(", "hass", ",", "False", ",", "ENTITY_WATER_HEATER_CELSIUS", ")", "state", "=", "hass", ".", "states", ".", "get", "(", "ENTITY_WATER_HEATER_CELSIUS",...
[ 99, 0 ]
[ 103, 53 ]
python
en
['en', 'sm', 'en']
True
test_set_only_target_temp_with_convert
(hass)
Test the setting of the target temperature.
Test the setting of the target temperature.
async def test_set_only_target_temp_with_convert(hass): """Test the setting of the target temperature.""" state = hass.states.get(ENTITY_WATER_HEATER_CELSIUS) assert state.attributes.get("temperature") == 113 await common.async_set_temperature(hass, 114, ENTITY_WATER_HEATER_CELSIUS) state = hass.sta...
[ "async", "def", "test_set_only_target_temp_with_convert", "(", "hass", ")", ":", "state", "=", "hass", ".", "states", ".", "get", "(", "ENTITY_WATER_HEATER_CELSIUS", ")", "assert", "state", ".", "attributes", ".", "get", "(", "\"temperature\"", ")", "==", "113",...
[ 106, 0 ]
[ 112, 53 ]
python
en
['en', 'en', 'en']
True
ensure_pin
(value)
Check if valid pin and coerce to string.
Check if valid pin and coerce to string.
def ensure_pin(value): """Check if valid pin and coerce to string.""" if value is None: raise vol.Invalid("pin value is None") if PIN_TO_ZONE.get(str(value)) is None: raise vol.Invalid("pin not valid") return str(value)
[ "def", "ensure_pin", "(", "value", ")", ":", "if", "value", "is", "None", ":", "raise", "vol", ".", "Invalid", "(", "\"pin value is None\"", ")", "if", "PIN_TO_ZONE", ".", "get", "(", "str", "(", "value", ")", ")", "is", "None", ":", "raise", "vol", ...
[ 71, 0 ]
[ 79, 21 ]
python
en
['en', 'en', 'en']
True
ensure_zone
(value)
Check if valid zone and coerce to string.
Check if valid zone and coerce to string.
def ensure_zone(value): """Check if valid zone and coerce to string.""" if value is None: raise vol.Invalid("zone value is None") if str(value) not in ZONES is None: raise vol.Invalid("zone not valid") return str(value)
[ "def", "ensure_zone", "(", "value", ")", ":", "if", "value", "is", "None", ":", "raise", "vol", ".", "Invalid", "(", "\"zone value is None\"", ")", "if", "str", "(", "value", ")", "not", "in", "ZONES", "is", "None", ":", "raise", "vol", ".", "Invalid",...
[ 82, 0 ]
[ 90, 21 ]
python
en
['en', 'en', 'en']
True
import_device_validator
(config)
Validate zones and reformat for import.
Validate zones and reformat for import.
def import_device_validator(config): """Validate zones and reformat for import.""" config = copy.deepcopy(config) io_cfgs = {} # Replace pins with zones for conf_platform, conf_io in ( (CONF_BINARY_SENSORS, CONF_IO_BIN), (CONF_SENSORS, CONF_IO_DIG), (CONF_SWITCHES, CONF_IO_SW...
[ "def", "import_device_validator", "(", "config", ")", ":", "config", "=", "copy", ".", "deepcopy", "(", "config", ")", "io_cfgs", "=", "{", "}", "# Replace pins with zones", "for", "conf_platform", ",", "conf_io", "in", "(", "(", "CONF_BINARY_SENSORS", ",", "C...
[ 93, 0 ]
[ 121, 17 ]
python
en
['en', 'en', 'en']
True
import_validator
(config)
Reformat for import.
Reformat for import.
def import_validator(config): """Reformat for import.""" config = copy.deepcopy(config) # push api_host into device configs for device in config.get(CONF_DEVICES, []): device[CONF_API_HOST] = config.get(CONF_API_HOST, "") return config
[ "def", "import_validator", "(", "config", ")", ":", "config", "=", "copy", ".", "deepcopy", "(", "config", ")", "# push api_host into device configs", "for", "device", "in", "config", ".", "get", "(", "CONF_DEVICES", ",", "[", "]", ")", ":", "device", "[", ...
[ 124, 0 ]
[ 132, 17 ]
python
en
['da', 'en', 'en']
True
async_setup
(hass: HomeAssistant, config: dict)
Set up the Konnected platform.
Set up the Konnected platform.
async def async_setup(hass: HomeAssistant, config: dict): """Set up the Konnected platform.""" cfg = config.get(DOMAIN) if cfg is None: cfg = {} if DOMAIN not in hass.data: hass.data[DOMAIN] = { CONF_ACCESS_TOKEN: cfg.get(CONF_ACCESS_TOKEN), CONF_API_HOST: cfg.ge...
[ "async", "def", "async_setup", "(", "hass", ":", "HomeAssistant", ",", "config", ":", "dict", ")", ":", "cfg", "=", "config", ".", "get", "(", "DOMAIN", ")", "if", "cfg", "is", "None", ":", "cfg", "=", "{", "}", "if", "DOMAIN", "not", "in", "hass",...
[ 223, 0 ]
[ 250, 15 ]
python
en
['en', 'da', 'en']
True
async_setup_entry
(hass: HomeAssistant, entry: ConfigEntry)
Set up panel from a config entry.
Set up panel from a config entry.
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): """Set up panel from a config entry.""" client = AlarmPanel(hass, entry) # creates a panel data store in hass.data[DOMAIN][CONF_DEVICES] await client.async_save_data() # if the cfg entry was created we know we could connect to th...
[ "async", "def", "async_setup_entry", "(", "hass", ":", "HomeAssistant", ",", "entry", ":", "ConfigEntry", ")", ":", "client", "=", "AlarmPanel", "(", "hass", ",", "entry", ")", "# creates a panel data store in hass.data[DOMAIN][CONF_DEVICES]", "await", "client", ".", ...
[ 253, 0 ]
[ 272, 15 ]
python
en
['en', 'en', 'en']
True
async_unload_entry
(hass: HomeAssistant, entry: ConfigEntry)
Unload a config entry.
Unload a config entry.
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry): """Unload a config entry.""" unload_ok = all( await asyncio.gather( *[ hass.config_entries.async_forward_entry_unload(entry, component) for component in PLATFORMS ] ) ...
[ "async", "def", "async_unload_entry", "(", "hass", ":", "HomeAssistant", ",", "entry", ":", "ConfigEntry", ")", ":", "unload_ok", "=", "all", "(", "await", "asyncio", ".", "gather", "(", "*", "[", "hass", ".", "config_entries", ".", "async_forward_entry_unload...
[ 275, 0 ]
[ 292, 20 ]
python
en
['en', 'es', 'en']
True
async_entry_updated
(hass: HomeAssistant, entry: ConfigEntry)
Reload the config entry when options change.
Reload the config entry when options change.
async def async_entry_updated(hass: HomeAssistant, entry: ConfigEntry): """Reload the config entry when options change.""" await hass.config_entries.async_reload(entry.entry_id)
[ "async", "def", "async_entry_updated", "(", "hass", ":", "HomeAssistant", ",", "entry", ":", "ConfigEntry", ")", ":", "await", "hass", ".", "config_entries", ".", "async_reload", "(", "entry", ".", "entry_id", ")" ]
[ 295, 0 ]
[ 297, 58 ]
python
en
['en', 'en', 'en']
True
KonnectedView.__init__
(self)
Initialize the view.
Initialize the view.
def __init__(self): """Initialize the view."""
[ "def", "__init__", "(", "self", ")", ":" ]
[ 307, 4 ]
[ 308, 34 ]
python
en
['en', 'en', 'en']
True
KonnectedView.binary_value
(state, activation)
Return binary value for GPIO based on state and activation.
Return binary value for GPIO based on state and activation.
def binary_value(state, activation): """Return binary value for GPIO based on state and activation.""" if activation == STATE_HIGH: return 1 if state == STATE_ON else 0 return 0 if state == STATE_ON else 1
[ "def", "binary_value", "(", "state", ",", "activation", ")", ":", "if", "activation", "==", "STATE_HIGH", ":", "return", "1", "if", "state", "==", "STATE_ON", "else", "0", "return", "0", "if", "state", "==", "STATE_ON", "else", "1" ]
[ 311, 4 ]
[ 315, 44 ]
python
en
['en', 'en', 'en']
True
KonnectedView.update_sensor
(self, request: Request, device_id)
Process a put or post.
Process a put or post.
async def update_sensor(self, request: Request, device_id) -> Response: """Process a put or post.""" hass = request.app["hass"] data = hass.data[DOMAIN] auth = request.headers.get(AUTHORIZATION) tokens = [] if hass.data[DOMAIN].get(CONF_ACCESS_TOKEN): tokens....
[ "async", "def", "update_sensor", "(", "self", ",", "request", ":", "Request", ",", "device_id", ")", "->", "Response", ":", "hass", "=", "request", ".", "app", "[", "\"hass\"", "]", "data", "=", "hass", ".", "data", "[", "DOMAIN", "]", "auth", "=", "...
[ 317, 4 ]
[ 381, 38 ]
python
en
['en', 'en', 'en']
True
KonnectedView.get
(self, request: Request, device_id)
Return the current binary state of a switch.
Return the current binary state of a switch.
async def get(self, request: Request, device_id) -> Response: """Return the current binary state of a switch.""" hass = request.app["hass"] data = hass.data[DOMAIN] device = data[CONF_DEVICES].get(device_id) if not device: return self.json_message( f"...
[ "async", "def", "get", "(", "self", ",", "request", ":", "Request", ",", "device_id", ")", "->", "Response", ":", "hass", "=", "request", ".", "app", "[", "\"hass\"", "]", "data", "=", "hass", ".", "data", "[", "DOMAIN", "]", "device", "=", "data", ...
[ 383, 4 ]
[ 442, 30 ]
python
en
['en', 'en', 'en']
True
KonnectedView.put
(self, request: Request, device_id)
Receive a sensor update via PUT request and async set state.
Receive a sensor update via PUT request and async set state.
async def put(self, request: Request, device_id) -> Response: """Receive a sensor update via PUT request and async set state.""" return await self.update_sensor(request, device_id)
[ "async", "def", "put", "(", "self", ",", "request", ":", "Request", ",", "device_id", ")", "->", "Response", ":", "return", "await", "self", ".", "update_sensor", "(", "request", ",", "device_id", ")" ]
[ 444, 4 ]
[ 446, 59 ]
python
en
['en', 'en', 'en']
True
KonnectedView.post
(self, request: Request, device_id)
Receive a sensor update via POST request and async set state.
Receive a sensor update via POST request and async set state.
async def post(self, request: Request, device_id) -> Response: """Receive a sensor update via POST request and async set state.""" return await self.update_sensor(request, device_id)
[ "async", "def", "post", "(", "self", ",", "request", ":", "Request", ",", "device_id", ")", "->", "Response", ":", "return", "await", "self", ".", "update_sensor", "(", "request", ",", "device_id", ")" ]
[ 448, 4 ]
[ 450, 59 ]
python
en
['en', 'en', 'en']
True
init
(empty=False)
Initialize the platform with entities.
Initialize the platform with entities.
def init(empty=False): """Initialize the platform with entities.""" global ENTITIES ENTITIES = ( {} if empty else { "support_open": MockLock( name="Support open Lock", is_locked=True, supported_features=SUPPORT_OPEN, ...
[ "def", "init", "(", "empty", "=", "False", ")", ":", "global", "ENTITIES", "ENTITIES", "=", "(", "{", "}", "if", "empty", "else", "{", "\"support_open\"", ":", "MockLock", "(", "name", "=", "\"Support open Lock\"", ",", "is_locked", "=", "True", ",", "su...
[ 12, 0 ]
[ 33, 5 ]
python
en
['en', 'en', 'en']
True
async_setup_platform
( hass, config, async_add_entities_callback, discovery_info=None )
Return mock entities.
Return mock entities.
async def async_setup_platform( hass, config, async_add_entities_callback, discovery_info=None ): """Return mock entities.""" async_add_entities_callback(list(ENTITIES.values()))
[ "async", "def", "async_setup_platform", "(", "hass", ",", "config", ",", "async_add_entities_callback", ",", "discovery_info", "=", "None", ")", ":", "async_add_entities_callback", "(", "list", "(", "ENTITIES", ".", "values", "(", ")", ")", ")" ]
[ 36, 0 ]
[ 40, 56 ]
python
af
['nl', 'af', 'en']
False
MockLock.is_locked
(self)
Return true if the lock is locked.
Return true if the lock is locked.
def is_locked(self): """Return true if the lock is locked.""" return self._handle("is_locked")
[ "def", "is_locked", "(", "self", ")", ":", "return", "self", ".", "_handle", "(", "\"is_locked\"", ")" ]
[ 47, 4 ]
[ 49, 40 ]
python
en
['en', 'mt', 'en']
True
MockLock.supported_features
(self)
Return the class of this sensor.
Return the class of this sensor.
def supported_features(self): """Return the class of this sensor.""" return self._handle("supported_features")
[ "def", "supported_features", "(", "self", ")", ":", "return", "self", ".", "_handle", "(", "\"supported_features\"", ")" ]
[ 52, 4 ]
[ 54, 49 ]
python
en
['en', 'en', 'en']
True
async_setup_platform
(hass, config, async_add_entities, discovery_info=None)
Set up the Demo climate devices.
Set up the Demo climate devices.
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up the Demo climate devices.""" async_add_entities( [ DemoClimate( unique_id="climate_1", name="HeatPump", target_temperature=68, unit...
[ "async", "def", "async_setup_platform", "(", "hass", ",", "config", ",", "async_add_entities", ",", "discovery_info", "=", "None", ")", ":", "async_add_entities", "(", "[", "DemoClimate", "(", "unique_id", "=", "\"climate_1\"", ",", "name", "=", "\"HeatPump\"", ...
[ 28, 0 ]
[ 88, 5 ]
python
en
['en', 'en', 'en']
True
async_setup_entry
(hass, config_entry, async_add_entities)
Set up the Demo climate devices config entry.
Set up the Demo climate devices config entry.
async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the Demo climate devices config entry.""" await async_setup_platform(hass, {}, async_add_entities)
[ "async", "def", "async_setup_entry", "(", "hass", ",", "config_entry", ",", "async_add_entities", ")", ":", "await", "async_setup_platform", "(", "hass", ",", "{", "}", ",", "async_add_entities", ")" ]
[ 91, 0 ]
[ 93, 60 ]
python
en
['en', 'en', 'en']
True
DemoClimate.__init__
( self, unique_id, name, target_temperature, unit_of_measurement, preset, current_temperature, fan_mode, target_humidity, current_humidity, swing_mode, hvac_mode, hvac_action, aux, target_temp_high, ...
Initialize the climate device.
Initialize the climate device.
def __init__( self, unique_id, name, target_temperature, unit_of_measurement, preset, current_temperature, fan_mode, target_humidity, current_humidity, swing_mode, hvac_mode, hvac_action, aux, target_...
[ "def", "__init__", "(", "self", ",", "unique_id", ",", "name", ",", "target_temperature", ",", "unit_of_measurement", ",", "preset", ",", "current_temperature", ",", "fan_mode", ",", "target_humidity", ",", "current_humidity", ",", "swing_mode", ",", "hvac_mode", ...
[ 99, 4 ]
[ 153, 54 ]
python
en
['en', 'en', 'en']
True
DemoClimate.device_info
(self)
Return device info.
Return device info.
def device_info(self): """Return device info.""" return { "identifiers": { # Serial numbers are unique identifiers within a specific domain (DOMAIN, self.unique_id) }, "name": self.name, }
[ "def", "device_info", "(", "self", ")", ":", "return", "{", "\"identifiers\"", ":", "{", "# Serial numbers are unique identifiers within a specific domain", "(", "DOMAIN", ",", "self", ".", "unique_id", ")", "}", ",", "\"name\"", ":", "self", ".", "name", ",", "...
[ 156, 4 ]
[ 164, 9 ]
python
en
['es', 'hr', 'en']
False
DemoClimate.unique_id
(self)
Return the unique id.
Return the unique id.
def unique_id(self): """Return the unique id.""" return self._unique_id
[ "def", "unique_id", "(", "self", ")", ":", "return", "self", ".", "_unique_id" ]
[ 167, 4 ]
[ 169, 30 ]
python
en
['en', 'la', 'en']
True
DemoClimate.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 self._support_flags
[ "def", "supported_features", "(", "self", ")", ":", "return", "self", ".", "_support_flags" ]
[ 172, 4 ]
[ 174, 34 ]
python
en
['en', 'en', 'en']
True
DemoClimate.should_poll
(self)
Return the polling state.
Return the polling state.
def should_poll(self): """Return the polling state.""" return False
[ "def", "should_poll", "(", "self", ")", ":", "return", "False" ]
[ 177, 4 ]
[ 179, 20 ]
python
en
['en', 'en', 'en']
True
DemoClimate.name
(self)
Return the name of the climate device.
Return the name of the climate device.
def name(self): """Return the name of the climate device.""" return self._name
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_name" ]
[ 182, 4 ]
[ 184, 25 ]
python
en
['en', 'en', 'en']
True
DemoClimate.temperature_unit
(self)
Return the unit of measurement.
Return the unit of measurement.
def temperature_unit(self): """Return the unit of measurement.""" return self._unit_of_measurement
[ "def", "temperature_unit", "(", "self", ")", ":", "return", "self", ".", "_unit_of_measurement" ]
[ 187, 4 ]
[ 189, 40 ]
python
en
['en', 'la', 'en']
True
DemoClimate.current_temperature
(self)
Return the current temperature.
Return the current temperature.
def current_temperature(self): """Return the current temperature.""" return self._current_temperature
[ "def", "current_temperature", "(", "self", ")", ":", "return", "self", ".", "_current_temperature" ]
[ 192, 4 ]
[ 194, 40 ]
python
en
['en', 'la', 'en']
True
DemoClimate.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._target_temperature
[ "def", "target_temperature", "(", "self", ")", ":", "return", "self", ".", "_target_temperature" ]
[ 197, 4 ]
[ 199, 39 ]
python
en
['en', 'en', 'en']
True
DemoClimate.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.""" return self._target_temperature_high
[ "def", "target_temperature_high", "(", "self", ")", ":", "return", "self", ".", "_target_temperature_high" ]
[ 202, 4 ]
[ 204, 44 ]
python
en
['en', 'en', 'en']
True
DemoClimate.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.""" return self._target_temperature_low
[ "def", "target_temperature_low", "(", "self", ")", ":", "return", "self", ".", "_target_temperature_low" ]
[ 207, 4 ]
[ 209, 43 ]
python
en
['en', 'en', 'en']
True
DemoClimate.current_humidity
(self)
Return the current humidity.
Return the current humidity.
def current_humidity(self): """Return the current humidity.""" return self._current_humidity
[ "def", "current_humidity", "(", "self", ")", ":", "return", "self", ".", "_current_humidity" ]
[ 212, 4 ]
[ 214, 37 ]
python
en
['en', 'en', 'en']
True
DemoClimate.target_humidity
(self)
Return the humidity we try to reach.
Return the humidity we try to reach.
def target_humidity(self): """Return the humidity we try to reach.""" return self._target_humidity
[ "def", "target_humidity", "(", "self", ")", ":", "return", "self", ".", "_target_humidity" ]
[ 217, 4 ]
[ 219, 36 ]
python
en
['en', 'en', 'en']
True
DemoClimate.hvac_action
(self)
Return current operation ie. heat, cool, idle.
Return current operation ie. heat, cool, idle.
def hvac_action(self): """Return current operation ie. heat, cool, idle.""" return self._hvac_action
[ "def", "hvac_action", "(", "self", ")", ":", "return", "self", ".", "_hvac_action" ]
[ 222, 4 ]
[ 224, 32 ]
python
en
['nl', 'en', 'en']
True
DemoClimate.hvac_mode
(self)
Return hvac target hvac state.
Return hvac target hvac state.
def hvac_mode(self): """Return hvac target hvac state.""" return self._hvac_mode
[ "def", "hvac_mode", "(", "self", ")", ":", "return", "self", ".", "_hvac_mode" ]
[ 227, 4 ]
[ 229, 30 ]
python
en
['en', 'hi-Latn', 'ru']
False
DemoClimate.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" ]
[ 232, 4 ]
[ 234, 31 ]
python
en
['en', 'en', 'en']
True
DemoClimate.preset_mode
(self)
Return preset mode.
Return preset mode.
def preset_mode(self): """Return preset mode.""" return self._preset
[ "def", "preset_mode", "(", "self", ")", ":", "return", "self", ".", "_preset" ]
[ 237, 4 ]
[ 239, 27 ]
python
de
['de', 'no', 'en']
False
DemoClimate.preset_modes
(self)
Return preset modes.
Return preset modes.
def preset_modes(self): """Return preset modes.""" return self._preset_modes
[ "def", "preset_modes", "(", "self", ")", ":", "return", "self", ".", "_preset_modes" ]
[ 242, 4 ]
[ 244, 33 ]
python
en
['en', 'be', 'en']
True
DemoClimate.is_aux_heat
(self)
Return true if aux heat is on.
Return true if aux heat is on.
def is_aux_heat(self): """Return true if aux heat is on.""" return self._aux
[ "def", "is_aux_heat", "(", "self", ")", ":", "return", "self", ".", "_aux" ]
[ 247, 4 ]
[ 249, 24 ]
python
fr
['fr', 'fy', 'fr']
True
DemoClimate.fan_mode
(self)
Return the fan setting.
Return the fan setting.
def fan_mode(self): """Return the fan setting.""" return self._current_fan_mode
[ "def", "fan_mode", "(", "self", ")", ":", "return", "self", ".", "_current_fan_mode" ]
[ 252, 4 ]
[ 254, 37 ]
python
en
['en', 'fy', 'en']
True
DemoClimate.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._fan_modes
[ "def", "fan_modes", "(", "self", ")", ":", "return", "self", ".", "_fan_modes" ]
[ 257, 4 ]
[ 259, 30 ]
python
en
['en', 'en', 'en']
True
DemoClimate.swing_mode
(self)
Return the swing setting.
Return the swing setting.
def swing_mode(self): """Return the swing setting.""" return self._current_swing_mode
[ "def", "swing_mode", "(", "self", ")", ":", "return", "self", ".", "_current_swing_mode" ]
[ 262, 4 ]
[ 264, 39 ]
python
en
['en', 'ig', 'en']
True
DemoClimate.swing_modes
(self)
List of available swing modes.
List of available swing modes.
def swing_modes(self): """List of available swing modes.""" return self._swing_modes
[ "def", "swing_modes", "(", "self", ")", ":", "return", "self", ".", "_swing_modes" ]
[ 267, 4 ]
[ 269, 32 ]
python
en
['en', 'en', 'en']
True
DemoClimate.async_set_temperature
(self, **kwargs)
Set new target temperatures.
Set new target temperatures.
async def async_set_temperature(self, **kwargs): """Set new target temperatures.""" if kwargs.get(ATTR_TEMPERATURE) is not None: self._target_temperature = kwargs.get(ATTR_TEMPERATURE) if ( kwargs.get(ATTR_TARGET_TEMP_HIGH) is not None and kwargs.get(ATTR_TARG...
[ "async", "def", "async_set_temperature", "(", "self", ",", "*", "*", "kwargs", ")", ":", "if", "kwargs", ".", "get", "(", "ATTR_TEMPERATURE", ")", "is", "not", "None", ":", "self", ".", "_target_temperature", "=", "kwargs", ".", "get", "(", "ATTR_TEMPERATU...
[ 271, 4 ]
[ 281, 35 ]
python
en
['en', 'ca', 'en']
True
DemoClimate.async_set_humidity
(self, humidity)
Set new humidity level.
Set new humidity level.
async def async_set_humidity(self, humidity): """Set new humidity level.""" self._target_humidity = humidity self.async_write_ha_state()
[ "async", "def", "async_set_humidity", "(", "self", ",", "humidity", ")", ":", "self", ".", "_target_humidity", "=", "humidity", "self", ".", "async_write_ha_state", "(", ")" ]
[ 283, 4 ]
[ 286, 35 ]
python
en
['en', 'sr', 'en']
True