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
setup_platform
(hass, config, add_entities, discovery_info=None)
Set up the ComfoConnect fan platform.
Set up the ComfoConnect fan platform.
def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the ComfoConnect fan platform.""" ccb = hass.data[DOMAIN] sensors = [] for resource in config[CONF_RESOURCES]: sensors.append( ComfoConnectSensor( name=f"{ccb.name} {SENSOR_TYPES[resource]...
[ "def", "setup_platform", "(", "hass", ",", "config", ",", "add_entities", ",", "discovery_info", "=", "None", ")", ":", "ccb", "=", "hass", ".", "data", "[", "DOMAIN", "]", "sensors", "=", "[", "]", "for", "resource", "in", "config", "[", "CONF_RESOURCES...
[ 204, 0 ]
[ 218, 31 ]
python
en
['en', 'fr', 'en']
True
ComfoConnectSensor.__init__
(self, name, ccb: ComfoConnectBridge, sensor_type)
Initialize the ComfoConnect sensor.
Initialize the ComfoConnect sensor.
def __init__(self, name, ccb: ComfoConnectBridge, sensor_type) -> None: """Initialize the ComfoConnect sensor.""" self._ccb = ccb self._sensor_type = sensor_type self._sensor_id = SENSOR_TYPES[self._sensor_type][ATTR_ID] self._name = name
[ "def", "__init__", "(", "self", ",", "name", ",", "ccb", ":", "ComfoConnectBridge", ",", "sensor_type", ")", "->", "None", ":", "self", ".", "_ccb", "=", "ccb", "self", ".", "_sensor_type", "=", "sensor_type", "self", ".", "_sensor_id", "=", "SENSOR_TYPES"...
[ 224, 4 ]
[ 229, 25 ]
python
en
['en', 'fr', 'en']
True
ComfoConnectSensor.async_added_to_hass
(self)
Register for sensor updates.
Register for sensor updates.
async def async_added_to_hass(self): """Register for sensor updates.""" _LOGGER.debug( "Registering for sensor %s (%d)", self._sensor_type, self._sensor_id ) self.async_on_remove( async_dispatcher_connect( self.hass, SIGNAL_COMFOCON...
[ "async", "def", "async_added_to_hass", "(", "self", ")", ":", "_LOGGER", ".", "debug", "(", "\"Registering for sensor %s (%d)\"", ",", "self", ".", "_sensor_type", ",", "self", ".", "_sensor_id", ")", "self", ".", "async_on_remove", "(", "async_dispatcher_connect", ...
[ 231, 4 ]
[ 245, 9 ]
python
da
['da', 'no', 'en']
False
ComfoConnectSensor._handle_update
(self, value)
Handle update callbacks.
Handle update callbacks.
def _handle_update(self, value): """Handle update callbacks.""" _LOGGER.debug( "Handle update for sensor %s (%d): %s", self._sensor_type, self._sensor_id, value, ) self._ccb.data[self._sensor_id] = round( value * SENSOR_TYPES[se...
[ "def", "_handle_update", "(", "self", ",", "value", ")", ":", "_LOGGER", ".", "debug", "(", "\"Handle update for sensor %s (%d): %s\"", ",", "self", ".", "_sensor_type", ",", "self", ".", "_sensor_id", ",", "value", ",", ")", "self", ".", "_ccb", ".", "data"...
[ 247, 4 ]
[ 258, 39 ]
python
en
['en', 'xh', 'en']
True
ComfoConnectSensor.state
(self)
Return the state of the entity.
Return the state of the entity.
def state(self): """Return the state of the entity.""" try: return self._ccb.data[self._sensor_id] except KeyError: return None
[ "def", "state", "(", "self", ")", ":", "try", ":", "return", "self", ".", "_ccb", ".", "data", "[", "self", ".", "_sensor_id", "]", "except", "KeyError", ":", "return", "None" ]
[ 261, 4 ]
[ 266, 23 ]
python
en
['en', 'en', 'en']
True
ComfoConnectSensor.should_poll
(self)
Do not poll.
Do not poll.
def should_poll(self) -> bool: """Do not poll.""" return False
[ "def", "should_poll", "(", "self", ")", "->", "bool", ":", "return", "False" ]
[ 269, 4 ]
[ 271, 20 ]
python
en
['en', 'lb', 'en']
True
ComfoConnectSensor.unique_id
(self)
Return a unique_id for this entity.
Return a unique_id for this entity.
def unique_id(self): """Return a unique_id for this entity.""" return f"{self._ccb.unique_id}-{self._sensor_type}"
[ "def", "unique_id", "(", "self", ")", ":", "return", "f\"{self._ccb.unique_id}-{self._sensor_type}\"" ]
[ 274, 4 ]
[ 276, 59 ]
python
en
['en', 'en', 'en']
True
ComfoConnectSensor.name
(self)
Return the name of the sensor.
Return the name of the sensor.
def name(self): """Return the name of the sensor.""" return self._name
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_name" ]
[ 279, 4 ]
[ 281, 25 ]
python
en
['en', 'mi', 'en']
True
ComfoConnectSensor.icon
(self)
Return the icon to use in the frontend.
Return the icon to use in the frontend.
def icon(self): """Return the icon to use in the frontend.""" return SENSOR_TYPES[self._sensor_type][ATTR_ICON]
[ "def", "icon", "(", "self", ")", ":", "return", "SENSOR_TYPES", "[", "self", ".", "_sensor_type", "]", "[", "ATTR_ICON", "]" ]
[ 284, 4 ]
[ 286, 57 ]
python
en
['en', 'en', 'en']
True
ComfoConnectSensor.unit_of_measurement
(self)
Return the unit of measurement of this entity.
Return the unit of measurement of this entity.
def unit_of_measurement(self): """Return the unit of measurement of this entity.""" return SENSOR_TYPES[self._sensor_type][ATTR_UNIT]
[ "def", "unit_of_measurement", "(", "self", ")", ":", "return", "SENSOR_TYPES", "[", "self", ".", "_sensor_type", "]", "[", "ATTR_UNIT", "]" ]
[ 289, 4 ]
[ 291, 57 ]
python
en
['en', 'en', 'en']
True
ComfoConnectSensor.device_class
(self)
Return the device_class.
Return the device_class.
def device_class(self): """Return the device_class.""" return SENSOR_TYPES[self._sensor_type][ATTR_DEVICE_CLASS]
[ "def", "device_class", "(", "self", ")", ":", "return", "SENSOR_TYPES", "[", "self", ".", "_sensor_type", "]", "[", "ATTR_DEVICE_CLASS", "]" ]
[ 294, 4 ]
[ 296, 65 ]
python
en
['en', 'en', 'en']
True
AirlyFlowHandler.__init__
(self)
Initialize.
Initialize.
def __init__(self): """Initialize.""" self._errors = {}
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "_errors", "=", "{", "}" ]
[ 24, 4 ]
[ 26, 25 ]
python
en
['en', 'en', 'it']
False
AirlyFlowHandler.async_step_user
(self, user_input=None)
Handle a flow initialized by the user.
Handle a flow initialized by the user.
async def async_step_user(self, user_input=None): """Handle a flow initialized by the user.""" self._errors = {} websession = async_get_clientsession(self.hass) if user_input is not None: await self.async_set_unique_id( f"{user_input[CONF_LATITUDE]}-{user_in...
[ "async", "def", "async_step_user", "(", "self", ",", "user_input", "=", "None", ")", ":", "self", ".", "_errors", "=", "{", "}", "websession", "=", "async_get_clientsession", "(", "self", ".", "hass", ")", "if", "user_input", "is", "not", "None", ":", "a...
[ 28, 4 ]
[ 62, 9 ]
python
en
['en', 'en', 'en']
True
AirlyFlowHandler._show_config_form
(self, name=None, api_key=None, latitude=None, longitude=None)
Show the configuration form to edit data.
Show the configuration form to edit data.
def _show_config_form(self, name=None, api_key=None, latitude=None, longitude=None): """Show the configuration form to edit data.""" return self.async_show_form( step_id="user", data_schema=vol.Schema( { vol.Required(CONF_API_KEY, default=api_k...
[ "def", "_show_config_form", "(", "self", ",", "name", "=", "None", ",", "api_key", "=", "None", ",", "latitude", "=", "None", ",", "longitude", "=", "None", ")", ":", "return", "self", ".", "async_show_form", "(", "step_id", "=", "\"user\"", ",", "data_s...
[ 64, 4 ]
[ 81, 9 ]
python
en
['en', 'en', 'en']
True
AirlyFlowHandler._test_api_key
(self, client, api_key)
Return true if api_key is valid.
Return true if api_key is valid.
async def _test_api_key(self, client, api_key): """Return true if api_key is valid.""" with async_timeout.timeout(10): airly = Airly(api_key, client) measurements = airly.create_measurements_session_point( latitude=52.24131, longitude=20.99101 ) ...
[ "async", "def", "_test_api_key", "(", "self", ",", "client", ",", "api_key", ")", ":", "with", "async_timeout", ".", "timeout", "(", "10", ")", ":", "airly", "=", "Airly", "(", "api_key", ",", "client", ")", "measurements", "=", "airly", ".", "create_mea...
[ 83, 4 ]
[ 95, 23 ]
python
en
['en', 'mt', 'en']
True
AirlyFlowHandler._test_location
(self, client, api_key, latitude, longitude)
Return true if location is valid.
Return true if location is valid.
async def _test_location(self, client, api_key, latitude, longitude): """Return true if location is valid.""" with async_timeout.timeout(10): airly = Airly(api_key, client) measurements = airly.create_measurements_session_point( latitude=latitude, longitude=longi...
[ "async", "def", "_test_location", "(", "self", ",", "client", ",", "api_key", ",", "latitude", ",", "longitude", ")", ":", "with", "async_timeout", ".", "timeout", "(", "10", ")", ":", "airly", "=", "Airly", "(", "api_key", ",", "client", ")", "measureme...
[ 97, 4 ]
[ 110, 19 ]
python
en
['en', 'et', 'en']
True
set_default_time_zone
(time_zone: dt.tzinfo)
Set a default time zone to be used when none is specified. Async friendly.
Set a default time zone to be used when none is specified.
def set_default_time_zone(time_zone: dt.tzinfo) -> None: """Set a default time zone to be used when none is specified. Async friendly. """ global DEFAULT_TIME_ZONE # pylint: disable=global-statement # NOTE: Remove in the future in favour of typing assert isinstance(time_zone, dt.tzinfo) ...
[ "def", "set_default_time_zone", "(", "time_zone", ":", "dt", ".", "tzinfo", ")", "->", "None", ":", "global", "DEFAULT_TIME_ZONE", "# pylint: disable=global-statement", "# NOTE: Remove in the future in favour of typing", "assert", "isinstance", "(", "time_zone", ",", "dt", ...
[ 29, 0 ]
[ 39, 33 ]
python
en
['en', 'en', 'en']
True
get_time_zone
(time_zone_str: str)
Get time zone from string. Return None if unable to determine. Async friendly.
Get time zone from string. Return None if unable to determine.
def get_time_zone(time_zone_str: str) -> Optional[dt.tzinfo]: """Get time zone from string. Return None if unable to determine. Async friendly. """ try: return pytz.timezone(time_zone_str) except pytzexceptions.UnknownTimeZoneError: return None
[ "def", "get_time_zone", "(", "time_zone_str", ":", "str", ")", "->", "Optional", "[", "dt", ".", "tzinfo", "]", ":", "try", ":", "return", "pytz", ".", "timezone", "(", "time_zone_str", ")", "except", "pytzexceptions", ".", "UnknownTimeZoneError", ":", "retu...
[ 42, 0 ]
[ 50, 19 ]
python
en
['en', 'en', 'en']
True
utcnow
()
Get now in UTC time.
Get now in UTC time.
def utcnow() -> dt.datetime: """Get now in UTC time.""" return dt.datetime.now(NATIVE_UTC)
[ "def", "utcnow", "(", ")", "->", "dt", ".", "datetime", ":", "return", "dt", ".", "datetime", ".", "now", "(", "NATIVE_UTC", ")" ]
[ 53, 0 ]
[ 55, 38 ]
python
en
['en', 'en', 'en']
True
now
(time_zone: Optional[dt.tzinfo] = None)
Get now in specified time zone.
Get now in specified time zone.
def now(time_zone: Optional[dt.tzinfo] = None) -> dt.datetime: """Get now in specified time zone.""" return dt.datetime.now(time_zone or DEFAULT_TIME_ZONE)
[ "def", "now", "(", "time_zone", ":", "Optional", "[", "dt", ".", "tzinfo", "]", "=", "None", ")", "->", "dt", ".", "datetime", ":", "return", "dt", ".", "datetime", ".", "now", "(", "time_zone", "or", "DEFAULT_TIME_ZONE", ")" ]
[ 58, 0 ]
[ 60, 58 ]
python
en
['en', 'en', 'en']
True
as_utc
(dattim: dt.datetime)
Return a datetime as UTC time. Assumes datetime without tzinfo to be in the DEFAULT_TIME_ZONE.
Return a datetime as UTC time.
def as_utc(dattim: dt.datetime) -> dt.datetime: """Return a datetime as UTC time. Assumes datetime without tzinfo to be in the DEFAULT_TIME_ZONE. """ if dattim.tzinfo == UTC: return dattim if dattim.tzinfo is None: dattim = DEFAULT_TIME_ZONE.localize(dattim) # type: ignore ret...
[ "def", "as_utc", "(", "dattim", ":", "dt", ".", "datetime", ")", "->", "dt", ".", "datetime", ":", "if", "dattim", ".", "tzinfo", "==", "UTC", ":", "return", "dattim", "if", "dattim", ".", "tzinfo", "is", "None", ":", "dattim", "=", "DEFAULT_TIME_ZONE"...
[ 63, 0 ]
[ 73, 33 ]
python
en
['en', 'sk', 'en']
True
as_timestamp
(dt_value: dt.datetime)
Convert a date/time into a unix time (seconds since 1970).
Convert a date/time into a unix time (seconds since 1970).
def as_timestamp(dt_value: dt.datetime) -> float: """Convert a date/time into a unix time (seconds since 1970).""" if hasattr(dt_value, "timestamp"): parsed_dt: Optional[dt.datetime] = dt_value else: parsed_dt = parse_datetime(str(dt_value)) if parsed_dt is None: raise ValueError...
[ "def", "as_timestamp", "(", "dt_value", ":", "dt", ".", "datetime", ")", "->", "float", ":", "if", "hasattr", "(", "dt_value", ",", "\"timestamp\"", ")", ":", "parsed_dt", ":", "Optional", "[", "dt", ".", "datetime", "]", "=", "dt_value", "else", ":", ...
[ 76, 0 ]
[ 84, 32 ]
python
en
['it', 'en', 'en']
True
as_local
(dattim: dt.datetime)
Convert a UTC datetime object to local time zone.
Convert a UTC datetime object to local time zone.
def as_local(dattim: dt.datetime) -> dt.datetime: """Convert a UTC datetime object to local time zone.""" if dattim.tzinfo == DEFAULT_TIME_ZONE: return dattim if dattim.tzinfo is None: dattim = UTC.localize(dattim) return dattim.astimezone(DEFAULT_TIME_ZONE)
[ "def", "as_local", "(", "dattim", ":", "dt", ".", "datetime", ")", "->", "dt", ".", "datetime", ":", "if", "dattim", ".", "tzinfo", "==", "DEFAULT_TIME_ZONE", ":", "return", "dattim", "if", "dattim", ".", "tzinfo", "is", "None", ":", "dattim", "=", "UT...
[ 87, 0 ]
[ 94, 47 ]
python
en
['en', 'en', 'en']
True
utc_from_timestamp
(timestamp: float)
Return a UTC time from a timestamp.
Return a UTC time from a timestamp.
def utc_from_timestamp(timestamp: float) -> dt.datetime: """Return a UTC time from a timestamp.""" return UTC.localize(dt.datetime.utcfromtimestamp(timestamp))
[ "def", "utc_from_timestamp", "(", "timestamp", ":", "float", ")", "->", "dt", ".", "datetime", ":", "return", "UTC", ".", "localize", "(", "dt", ".", "datetime", ".", "utcfromtimestamp", "(", "timestamp", ")", ")" ]
[ 97, 0 ]
[ 99, 64 ]
python
en
['en', 'en', 'en']
True
start_of_local_day
( dt_or_d: Union[dt.date, dt.datetime, None] = None )
Return local datetime object of start of day from date or datetime.
Return local datetime object of start of day from date or datetime.
def start_of_local_day( dt_or_d: Union[dt.date, dt.datetime, None] = None ) -> dt.datetime: """Return local datetime object of start of day from date or datetime.""" if dt_or_d is None: date: dt.date = now().date() elif isinstance(dt_or_d, dt.datetime): date = dt_or_d.date() return D...
[ "def", "start_of_local_day", "(", "dt_or_d", ":", "Union", "[", "dt", ".", "date", ",", "dt", ".", "datetime", ",", "None", "]", "=", "None", ")", "->", "dt", ".", "datetime", ":", "if", "dt_or_d", "is", "None", ":", "date", ":", "dt", ".", "date",...
[ 102, 0 ]
[ 112, 5 ]
python
en
['en', 'en', 'en']
True
parse_datetime
(dt_str: str)
Parse a string and return a datetime.datetime. This function supports time zone offsets. When the input contains one, the output uses a timezone with a fixed offset from UTC. Raises ValueError if the input is well formatted but not a valid datetime. Returns None if the input isn't well formatted.
Parse a string and return a datetime.datetime.
def parse_datetime(dt_str: str) -> Optional[dt.datetime]: """Parse a string and return a datetime.datetime. This function supports time zone offsets. When the input contains one, the output uses a timezone with a fixed offset from UTC. Raises ValueError if the input is well formatted but not a valid da...
[ "def", "parse_datetime", "(", "dt_str", ":", "str", ")", "->", "Optional", "[", "dt", ".", "datetime", "]", ":", "try", ":", "return", "ciso8601", ".", "parse_datetime", "(", "dt_str", ")", "except", "(", "ValueError", ",", "IndexError", ")", ":", "pass"...
[ 118, 0 ]
[ 150, 29 ]
python
en
['en', 'en', 'en']
True
parse_date
(dt_str: str)
Convert a date string to a date object.
Convert a date string to a date object.
def parse_date(dt_str: str) -> Optional[dt.date]: """Convert a date string to a date object.""" try: return dt.datetime.strptime(dt_str, DATE_STR_FORMAT).date() except ValueError: # If dt_str did not match our format return None
[ "def", "parse_date", "(", "dt_str", ":", "str", ")", "->", "Optional", "[", "dt", ".", "date", "]", ":", "try", ":", "return", "dt", ".", "datetime", ".", "strptime", "(", "dt_str", ",", "DATE_STR_FORMAT", ")", ".", "date", "(", ")", "except", "Value...
[ 153, 0 ]
[ 158, 19 ]
python
en
['en', 'en', 'en']
True
parse_time
(time_str: str)
Parse a time string (00:20:00) into Time object. Return None if invalid.
Parse a time string (00:20:00) into Time object.
def parse_time(time_str: str) -> Optional[dt.time]: """Parse a time string (00:20:00) into Time object. Return None if invalid. """ parts = str(time_str).split(":") if len(parts) < 2: return None try: hour = int(parts[0]) minute = int(parts[1]) second = int(parts...
[ "def", "parse_time", "(", "time_str", ":", "str", ")", "->", "Optional", "[", "dt", ".", "time", "]", ":", "parts", "=", "str", "(", "time_str", ")", ".", "split", "(", "\":\"", ")", "if", "len", "(", "parts", ")", "<", "2", ":", "return", "None"...
[ 161, 0 ]
[ 176, 19 ]
python
en
['it', 'en', 'en']
True
get_age
(date: dt.datetime)
Take a datetime and return its "age" as a string. The age can be in second, minute, hour, day, month or year. Only the biggest unit is considered, e.g. if it's 2 days and 3 hours, "2 days" will be returned. Make sure date is not in the future, or else it won't work.
Take a datetime and return its "age" as a string.
def get_age(date: dt.datetime) -> str: """ Take a datetime and return its "age" as a string. The age can be in second, minute, hour, day, month or year. Only the biggest unit is considered, e.g. if it's 2 days and 3 hours, "2 days" will be returned. Make sure date is not in the future, or else ...
[ "def", "get_age", "(", "date", ":", "dt", ".", "datetime", ")", "->", "str", ":", "def", "formatn", "(", "number", ":", "int", ",", "unit", ":", "str", ")", "->", "str", ":", "\"\"\"Add \"unit\" if it's plural.\"\"\"", "if", "number", "==", "1", ":", "...
[ 179, 0 ]
[ 209, 48 ]
python
en
['en', 'error', 'th']
False
parse_time_expression
(parameter: Any, min_value: int, max_value: int)
Parse the time expression part and return a list of times to match.
Parse the time expression part and return a list of times to match.
def parse_time_expression(parameter: Any, min_value: int, max_value: int) -> List[int]: """Parse the time expression part and return a list of times to match.""" if parameter is None or parameter == MATCH_ALL: res = list(range(min_value, max_value + 1)) elif isinstance(parameter, str): if pa...
[ "def", "parse_time_expression", "(", "parameter", ":", "Any", ",", "min_value", ":", "int", ",", "max_value", ":", "int", ")", "->", "List", "[", "int", "]", ":", "if", "parameter", "is", "None", "or", "parameter", "==", "MATCH_ALL", ":", "res", "=", "...
[ 212, 0 ]
[ 235, 14 ]
python
en
['en', 'en', 'en']
True
find_next_time_expression_time
( now: dt.datetime, # pylint: disable=redefined-outer-name seconds: List[int], minutes: List[int], hours: List[int], )
Find the next datetime from now for which the time expression matches. The algorithm looks at each time unit separately and tries to find the next one that matches for each. If any of them would roll over, all time units below that are reset to the first matching value. Timezones are also handled (the...
Find the next datetime from now for which the time expression matches.
def find_next_time_expression_time( now: dt.datetime, # pylint: disable=redefined-outer-name seconds: List[int], minutes: List[int], hours: List[int], ) -> dt.datetime: """Find the next datetime from now for which the time expression matches. The algorithm looks at each time unit separately an...
[ "def", "find_next_time_expression_time", "(", "now", ":", "dt", ".", "datetime", ",", "# pylint: disable=redefined-outer-name", "seconds", ":", "List", "[", "int", "]", ",", "minutes", ":", "List", "[", "int", "]", ",", "hours", ":", "List", "[", "int", "]",...
[ 238, 0 ]
[ 369, 23 ]
python
en
['en', 'en', 'en']
True
setup_platform
(hass, config, add_entities, discovery_info=None)
Set up the Aladdin Connect platform.
Set up the Aladdin Connect platform.
def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Aladdin Connect platform.""" username = config[CONF_USERNAME] password = config[CONF_PASSWORD] acc = AladdinConnectClient(username, password) try: if not acc.login(): raise ValueError("Username o...
[ "def", "setup_platform", "(", "hass", ",", "config", ",", "add_entities", ",", "discovery_info", "=", "None", ")", ":", "username", "=", "config", "[", "CONF_USERNAME", "]", "password", "=", "config", "[", "CONF_PASSWORD", "]", "acc", "=", "AladdinConnectClien...
[ 41, 0 ]
[ 58, 9 ]
python
en
['en', 'da', 'en']
True
AladdinDevice.__init__
(self, acc, device)
Initialize the cover.
Initialize the cover.
def __init__(self, acc, device): """Initialize the cover.""" self._acc = acc self._device_id = device["device_id"] self._number = device["door_number"] self._name = device["name"] self._status = STATES_MAP.get(device["status"])
[ "def", "__init__", "(", "self", ",", "acc", ",", "device", ")", ":", "self", ".", "_acc", "=", "acc", "self", ".", "_device_id", "=", "device", "[", "\"device_id\"", "]", "self", ".", "_number", "=", "device", "[", "\"door_number\"", "]", "self", ".", ...
[ 64, 4 ]
[ 70, 55 ]
python
en
['en', 'en', 'en']
True
AladdinDevice.device_class
(self)
Define this cover as a garage door.
Define this cover as a garage door.
def device_class(self): """Define this cover as a garage door.""" return "garage"
[ "def", "device_class", "(", "self", ")", ":", "return", "\"garage\"" ]
[ 73, 4 ]
[ 75, 23 ]
python
en
['en', 'en', 'en']
True
AladdinDevice.supported_features
(self)
Flag supported features.
Flag supported features.
def supported_features(self): """Flag supported features.""" return SUPPORTED_FEATURES
[ "def", "supported_features", "(", "self", ")", ":", "return", "SUPPORTED_FEATURES" ]
[ 78, 4 ]
[ 80, 33 ]
python
en
['da', 'en', 'en']
True
AladdinDevice.unique_id
(self)
Return a unique ID.
Return a unique ID.
def unique_id(self): """Return a unique ID.""" return f"{self._device_id}-{self._number}"
[ "def", "unique_id", "(", "self", ")", ":", "return", "f\"{self._device_id}-{self._number}\"" ]
[ 83, 4 ]
[ 85, 50 ]
python
ca
['fr', 'ca', 'en']
False
AladdinDevice.name
(self)
Return the name of the garage door.
Return the name of the garage door.
def name(self): """Return the name of the garage door.""" return self._name
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_name" ]
[ 88, 4 ]
[ 90, 25 ]
python
en
['en', 'nl', 'en']
True
AladdinDevice.is_opening
(self)
Return if the cover is opening or not.
Return if the cover is opening or not.
def is_opening(self): """Return if the cover is opening or not.""" return self._status == STATE_OPENING
[ "def", "is_opening", "(", "self", ")", ":", "return", "self", ".", "_status", "==", "STATE_OPENING" ]
[ 93, 4 ]
[ 95, 44 ]
python
en
['en', 'en', 'en']
True
AladdinDevice.is_closing
(self)
Return if the cover is closing or not.
Return if the cover is closing or not.
def is_closing(self): """Return if the cover is closing or not.""" return self._status == STATE_CLOSING
[ "def", "is_closing", "(", "self", ")", ":", "return", "self", ".", "_status", "==", "STATE_CLOSING" ]
[ 98, 4 ]
[ 100, 44 ]
python
en
['en', 'en', 'en']
True
AladdinDevice.is_closed
(self)
Return None if status is unknown, True if closed, else False.
Return None if status is unknown, True if closed, else False.
def is_closed(self): """Return None if status is unknown, True if closed, else False.""" if self._status is None: return None return self._status == STATE_CLOSED
[ "def", "is_closed", "(", "self", ")", ":", "if", "self", ".", "_status", "is", "None", ":", "return", "None", "return", "self", ".", "_status", "==", "STATE_CLOSED" ]
[ 103, 4 ]
[ 107, 43 ]
python
en
['en', 'en', 'en']
True
AladdinDevice.close_cover
(self, **kwargs)
Issue close command to cover.
Issue close command to cover.
def close_cover(self, **kwargs): """Issue close command to cover.""" self._acc.close_door(self._device_id, self._number)
[ "def", "close_cover", "(", "self", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_acc", ".", "close_door", "(", "self", ".", "_device_id", ",", "self", ".", "_number", ")" ]
[ 109, 4 ]
[ 111, 59 ]
python
en
['en', 'en', 'en']
True
AladdinDevice.open_cover
(self, **kwargs)
Issue open command to cover.
Issue open command to cover.
def open_cover(self, **kwargs): """Issue open command to cover.""" self._acc.open_door(self._device_id, self._number)
[ "def", "open_cover", "(", "self", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_acc", ".", "open_door", "(", "self", ".", "_device_id", ",", "self", ".", "_number", ")" ]
[ 113, 4 ]
[ 115, 58 ]
python
en
['en', 'en', 'en']
True
AladdinDevice.update
(self)
Update status of cover.
Update status of cover.
def update(self): """Update status of cover.""" acc_status = self._acc.get_door_status(self._device_id, self._number) self._status = STATES_MAP.get(acc_status)
[ "def", "update", "(", "self", ")", ":", "acc_status", "=", "self", ".", "_acc", ".", "get_door_status", "(", "self", ".", "_device_id", ",", "self", ".", "_number", ")", "self", ".", "_status", "=", "STATES_MAP", ".", "get", "(", "acc_status", ")" ]
[ 117, 4 ]
[ 120, 49 ]
python
en
['en', 'en', 'en']
True
setup
(hass, config)
Set up the Egardia platform.
Set up the Egardia platform.
def setup(hass, config): """Set up the Egardia platform.""" conf = config[DOMAIN] username = conf.get(CONF_USERNAME) password = conf.get(CONF_PASSWORD) host = conf.get(CONF_HOST) port = conf.get(CONF_PORT) version = conf.get(CONF_VERSION) rs_enabled = conf.get(CONF_REPORT_SERVER_ENABLED...
[ "def", "setup", "(", "hass", ",", "config", ")", ":", "conf", "=", "config", "[", "DOMAIN", "]", "username", "=", "conf", ".", "get", "(", "CONF_USERNAME", ")", "password", "=", "conf", ".", "get", "(", "CONF_PASSWORD", ")", "host", "=", "conf", ".",...
[ 79, 0 ]
[ 138, 15 ]
python
en
['en', 'su', 'en']
True
async_setup_platform
( hass: HomeAssistantType, config: ConfigType, async_add_entities, discovery_info=None )
Set up MQTT climate device through configuration.yaml.
Set up MQTT climate device through configuration.yaml.
async def async_setup_platform( hass: HomeAssistantType, config: ConfigType, async_add_entities, discovery_info=None ): """Set up MQTT climate device through configuration.yaml.""" await async_setup_reload_service(hass, DOMAIN, PLATFORMS) await _async_setup_entity(hass, config, async_add_entities)
[ "async", "def", "async_setup_platform", "(", "hass", ":", "HomeAssistantType", ",", "config", ":", "ConfigType", ",", "async_add_entities", ",", "discovery_info", "=", "None", ")", ":", "await", "async_setup_reload_service", "(", "hass", ",", "DOMAIN", ",", "PLATF...
[ 240, 0 ]
[ 245, 63 ]
python
en
['en', 'en', 'en']
True
async_setup_entry
(hass, config_entry, async_add_entities)
Set up MQTT climate device dynamically through MQTT discovery.
Set up MQTT climate device dynamically through MQTT discovery.
async def async_setup_entry(hass, config_entry, async_add_entities): """Set up MQTT climate device dynamically through MQTT discovery.""" async def async_discover(discovery_payload): """Discover and add a MQTT climate device.""" discovery_data = discovery_payload.discovery_data try: ...
[ "async", "def", "async_setup_entry", "(", "hass", ",", "config_entry", ",", "async_add_entities", ")", ":", "async", "def", "async_discover", "(", "discovery_payload", ")", ":", "\"\"\"Discover and add a MQTT climate device.\"\"\"", "discovery_data", "=", "discovery_payload...
[ 248, 0 ]
[ 265, 5 ]
python
en
['en', 'en', 'en']
True
_async_setup_entity
( hass, config, async_add_entities, config_entry=None, discovery_data=None )
Set up the MQTT climate devices.
Set up the MQTT climate devices.
async def _async_setup_entity( hass, config, async_add_entities, config_entry=None, discovery_data=None ): """Set up the MQTT climate devices.""" async_add_entities([MqttClimate(hass, config, config_entry, discovery_data)])
[ "async", "def", "_async_setup_entity", "(", "hass", ",", "config", ",", "async_add_entities", ",", "config_entry", "=", "None", ",", "discovery_data", "=", "None", ")", ":", "async_add_entities", "(", "[", "MqttClimate", "(", "hass", ",", "config", ",", "confi...
[ 268, 0 ]
[ 272, 81 ]
python
en
['en', 'en', 'en']
True
MqttClimate.__init__
(self, hass, config, config_entry, discovery_data)
Initialize the climate device.
Initialize the climate device.
def __init__(self, hass, config, config_entry, discovery_data): """Initialize the climate device.""" self._config = config self._unique_id = config.get(CONF_UNIQUE_ID) self._sub_state = None self.hass = hass self._action = None self._aux = False self._awa...
[ "def", "__init__", "(", "self", ",", "hass", ",", "config", ",", "config_entry", ",", "discovery_data", ")", ":", "self", ".", "_config", "=", "config", "self", ".", "_unique_id", "=", "config", ".", "get", "(", "CONF_UNIQUE_ID", ")", "self", ".", "_sub_...
[ 284, 4 ]
[ 312, 72 ]
python
en
['en', 'en', 'en']
True
MqttClimate.async_added_to_hass
(self)
Handle being added to Home Assistant.
Handle being added to Home Assistant.
async def async_added_to_hass(self): """Handle being added to Home Assistant.""" await super().async_added_to_hass() await self._subscribe_topics()
[ "async", "def", "async_added_to_hass", "(", "self", ")", ":", "await", "super", "(", ")", ".", "async_added_to_hass", "(", ")", "await", "self", ".", "_subscribe_topics", "(", ")" ]
[ 314, 4 ]
[ 317, 38 ]
python
en
['en', 'en', 'en']
True
MqttClimate.discovery_update
(self, discovery_payload)
Handle updated discovery message.
Handle updated discovery message.
async def discovery_update(self, discovery_payload): """Handle updated discovery message.""" config = PLATFORM_SCHEMA(discovery_payload) self._config = config self._setup_from_config(config) await self.attributes_discovery_update(config) await self.availability_discovery_...
[ "async", "def", "discovery_update", "(", "self", ",", "discovery_payload", ")", ":", "config", "=", "PLATFORM_SCHEMA", "(", "discovery_payload", ")", "self", ".", "_config", "=", "config", "self", ".", "_setup_from_config", "(", "config", ")", "await", "self", ...
[ 319, 4 ]
[ 328, 35 ]
python
en
['en', 'en', 'en']
True
MqttClimate._setup_from_config
(self, config)
(Re)Setup the entity.
(Re)Setup the entity.
def _setup_from_config(self, config): """(Re)Setup the entity.""" self._topic = {key: config.get(key) for key in TOPIC_KEYS} # set to None in non-optimistic mode self._target_temp = ( self._current_fan_mode ) = self._current_operation = self._current_swing_mode = Non...
[ "def", "_setup_from_config", "(", "self", ",", "config", ")", ":", "self", ".", "_topic", "=", "{", "key", ":", "config", ".", "get", "(", "key", ")", "for", "key", "in", "TOPIC_KEYS", "}", "# set to None in non-optimistic mode", "self", ".", "_target_temp",...
[ 330, 4 ]
[ 373, 47 ]
python
en
['en', 'haw', 'en']
True
MqttClimate._subscribe_topics
(self)
(Re)Subscribe to topics.
(Re)Subscribe to topics.
async def _subscribe_topics(self): """(Re)Subscribe to topics.""" topics = {} qos = self._config[CONF_QOS] def add_subscription(topics, topic, msg_callback): if self._topic[topic] is not None: topics[topic] = { "topic": self._topic[topic],...
[ "async", "def", "_subscribe_topics", "(", "self", ")", ":", "topics", "=", "{", "}", "qos", "=", "self", ".", "_config", "[", "CONF_QOS", "]", "def", "add_subscription", "(", "topics", ",", "topic", ",", "msg_callback", ")", ":", "if", "self", ".", "_t...
[ 375, 4 ]
[ 562, 9 ]
python
en
['en', 'en', 'en']
True
MqttClimate.async_will_remove_from_hass
(self)
Unsubscribe when removed.
Unsubscribe when removed.
async def async_will_remove_from_hass(self): """Unsubscribe when removed.""" self._sub_state = await subscription.async_unsubscribe_topics( self.hass, self._sub_state ) await MqttAttributes.async_will_remove_from_hass(self) await MqttAvailability.async_will_remove_fro...
[ "async", "def", "async_will_remove_from_hass", "(", "self", ")", ":", "self", ".", "_sub_state", "=", "await", "subscription", ".", "async_unsubscribe_topics", "(", "self", ".", "hass", ",", "self", ".", "_sub_state", ")", "await", "MqttAttributes", ".", "async_...
[ 564, 4 ]
[ 571, 67 ]
python
en
['en', 'en', 'en']
True
MqttClimate.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" ]
[ 574, 4 ]
[ 576, 20 ]
python
en
['en', 'en', 'en']
True
MqttClimate.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._config[CONF_NAME]
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_config", "[", "CONF_NAME", "]" ]
[ 579, 4 ]
[ 581, 38 ]
python
en
['en', 'en', 'en']
True
MqttClimate.unique_id
(self)
Return a unique ID.
Return a unique ID.
def unique_id(self): """Return a unique ID.""" return self._unique_id
[ "def", "unique_id", "(", "self", ")", ":", "return", "self", ".", "_unique_id" ]
[ 584, 4 ]
[ 586, 30 ]
python
ca
['fr', 'ca', 'en']
False
MqttClimate.temperature_unit
(self)
Return the unit of measurement.
Return the unit of measurement.
def temperature_unit(self): """Return the unit of measurement.""" if self._config.get(CONF_TEMPERATURE_UNIT): return self._config.get(CONF_TEMPERATURE_UNIT) return self.hass.config.units.temperature_unit
[ "def", "temperature_unit", "(", "self", ")", ":", "if", "self", ".", "_config", ".", "get", "(", "CONF_TEMPERATURE_UNIT", ")", ":", "return", "self", ".", "_config", ".", "get", "(", "CONF_TEMPERATURE_UNIT", ")", "return", "self", ".", "hass", ".", "config...
[ 589, 4 ]
[ 593, 54 ]
python
en
['en', 'la', 'en']
True
MqttClimate.current_temperature
(self)
Return the current temperature.
Return the current temperature.
def current_temperature(self): """Return the current temperature.""" return self._current_temp
[ "def", "current_temperature", "(", "self", ")", ":", "return", "self", ".", "_current_temp" ]
[ 596, 4 ]
[ 598, 33 ]
python
en
['en', 'la', 'en']
True
MqttClimate.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_temp
[ "def", "target_temperature", "(", "self", ")", ":", "return", "self", ".", "_target_temp" ]
[ 601, 4 ]
[ 603, 32 ]
python
en
['en', 'en', 'en']
True
MqttClimate.target_temperature_low
(self)
Return the low target temperature we try to reach.
Return the low target temperature we try to reach.
def target_temperature_low(self): """Return the low target temperature we try to reach.""" return self._target_temp_low
[ "def", "target_temperature_low", "(", "self", ")", ":", "return", "self", ".", "_target_temp_low" ]
[ 606, 4 ]
[ 608, 36 ]
python
en
['en', 'en', 'en']
True
MqttClimate.target_temperature_high
(self)
Return the high target temperature we try to reach.
Return the high target temperature we try to reach.
def target_temperature_high(self): """Return the high target temperature we try to reach.""" return self._target_temp_high
[ "def", "target_temperature_high", "(", "self", ")", ":", "return", "self", ".", "_target_temp_high" ]
[ 611, 4 ]
[ 613, 37 ]
python
en
['en', 'en', 'en']
True
MqttClimate.hvac_action
(self)
Return the current running hvac operation if supported.
Return the current running hvac operation if supported.
def hvac_action(self): """Return the current running hvac operation if supported.""" return self._action
[ "def", "hvac_action", "(", "self", ")", ":", "return", "self", ".", "_action" ]
[ 616, 4 ]
[ 618, 27 ]
python
en
['en', 'en', 'en']
True
MqttClimate.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._current_operation
[ "def", "hvac_mode", "(", "self", ")", ":", "return", "self", ".", "_current_operation" ]
[ 621, 4 ]
[ 623, 38 ]
python
en
['nl', 'en', 'en']
True
MqttClimate.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._config[CONF_MODE_LIST]
[ "def", "hvac_modes", "(", "self", ")", ":", "return", "self", ".", "_config", "[", "CONF_MODE_LIST", "]" ]
[ 626, 4 ]
[ 628, 43 ]
python
en
['en', 'en', 'en']
True
MqttClimate.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 self._config[CONF_TEMP_STEP]
[ "def", "target_temperature_step", "(", "self", ")", ":", "return", "self", ".", "_config", "[", "CONF_TEMP_STEP", "]" ]
[ 631, 4 ]
[ 633, 43 ]
python
en
['en', 'en', 'en']
True
MqttClimate.preset_mode
(self)
Return preset mode.
Return preset mode.
def preset_mode(self): """Return preset mode.""" if self._hold: return self._hold if self._away: return PRESET_AWAY return PRESET_NONE
[ "def", "preset_mode", "(", "self", ")", ":", "if", "self", ".", "_hold", ":", "return", "self", ".", "_hold", "if", "self", ".", "_away", ":", "return", "PRESET_AWAY", "return", "PRESET_NONE" ]
[ 636, 4 ]
[ 642, 26 ]
python
de
['de', 'no', 'en']
False
MqttClimate.preset_modes
(self)
Return preset modes.
Return preset modes.
def preset_modes(self): """Return preset modes.""" presets = [] if (self._topic[CONF_AWAY_MODE_STATE_TOPIC] is not None) or ( self._topic[CONF_AWAY_MODE_COMMAND_TOPIC] is not None ): presets.append(PRESET_AWAY) presets.extend(self._config[CONF_HOLD_LIST]...
[ "def", "preset_modes", "(", "self", ")", ":", "presets", "=", "[", "]", "if", "(", "self", ".", "_topic", "[", "CONF_AWAY_MODE_STATE_TOPIC", "]", "is", "not", "None", ")", "or", "(", "self", ".", "_topic", "[", "CONF_AWAY_MODE_COMMAND_TOPIC", "]", "is", ...
[ 645, 4 ]
[ 659, 22 ]
python
en
['en', 'be', 'en']
True
MqttClimate.is_aux_heat
(self)
Return true if away mode is on.
Return true if away mode is on.
def is_aux_heat(self): """Return true if away mode is on.""" return self._aux
[ "def", "is_aux_heat", "(", "self", ")", ":", "return", "self", ".", "_aux" ]
[ 662, 4 ]
[ 664, 24 ]
python
en
['en', 'fy', 'en']
True
MqttClimate.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" ]
[ 667, 4 ]
[ 669, 37 ]
python
en
['en', 'fy', 'en']
True
MqttClimate.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._config[CONF_FAN_MODE_LIST]
[ "def", "fan_modes", "(", "self", ")", ":", "return", "self", ".", "_config", "[", "CONF_FAN_MODE_LIST", "]" ]
[ 672, 4 ]
[ 674, 47 ]
python
en
['en', 'en', 'en']
True
MqttClimate.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_HVAC_MODE) is not None: operation_mode = kwargs.get(ATTR_HVAC_MODE) await self.async_set_hvac_mode(operation_mode) self._set_temperature( kwargs.get(ATTR_TE...
[ "async", "def", "async_set_temperature", "(", "self", ",", "*", "*", "kwargs", ")", ":", "if", "kwargs", ".", "get", "(", "ATTR_HVAC_MODE", ")", "is", "not", "None", ":", "operation_mode", "=", "kwargs", ".", "get", "(", "ATTR_HVAC_MODE", ")", "await", "...
[ 698, 4 ]
[ 726, 35 ]
python
en
['en', 'ca', 'en']
True
MqttClimate.async_set_swing_mode
(self, swing_mode)
Set new swing mode.
Set new swing mode.
async def async_set_swing_mode(self, swing_mode): """Set new swing mode.""" if self._config[CONF_SEND_IF_OFF] or self._current_operation != HVAC_MODE_OFF: self._publish(CONF_SWING_MODE_COMMAND_TOPIC, swing_mode) if self._topic[CONF_SWING_MODE_STATE_TOPIC] is None: self._...
[ "async", "def", "async_set_swing_mode", "(", "self", ",", "swing_mode", ")", ":", "if", "self", ".", "_config", "[", "CONF_SEND_IF_OFF", "]", "or", "self", ".", "_current_operation", "!=", "HVAC_MODE_OFF", ":", "self", ".", "_publish", "(", "CONF_SWING_MODE_COMM...
[ 728, 4 ]
[ 735, 39 ]
python
en
['en', 'no', 'en']
True
MqttClimate.async_set_fan_mode
(self, fan_mode)
Set new target temperature.
Set new target temperature.
async def async_set_fan_mode(self, fan_mode): """Set new target temperature.""" if self._config[CONF_SEND_IF_OFF] or self._current_operation != HVAC_MODE_OFF: self._publish(CONF_FAN_MODE_COMMAND_TOPIC, fan_mode) if self._topic[CONF_FAN_MODE_STATE_TOPIC] is None: self._cu...
[ "async", "def", "async_set_fan_mode", "(", "self", ",", "fan_mode", ")", ":", "if", "self", ".", "_config", "[", "CONF_SEND_IF_OFF", "]", "or", "self", ".", "_current_operation", "!=", "HVAC_MODE_OFF", ":", "self", ".", "_publish", "(", "CONF_FAN_MODE_COMMAND_TO...
[ 737, 4 ]
[ 744, 39 ]
python
en
['en', 'ca', 'en']
True
MqttClimate.async_set_hvac_mode
(self, hvac_mode)
Set new operation mode.
Set new operation mode.
async def async_set_hvac_mode(self, hvac_mode) -> None: """Set new operation mode.""" if self._current_operation == HVAC_MODE_OFF and hvac_mode != HVAC_MODE_OFF: self._publish(CONF_POWER_COMMAND_TOPIC, self._config[CONF_PAYLOAD_ON]) elif self._current_operation != HVAC_MODE_OFF and h...
[ "async", "def", "async_set_hvac_mode", "(", "self", ",", "hvac_mode", ")", "->", "None", ":", "if", "self", ".", "_current_operation", "==", "HVAC_MODE_OFF", "and", "hvac_mode", "!=", "HVAC_MODE_OFF", ":", "self", ".", "_publish", "(", "CONF_POWER_COMMAND_TOPIC", ...
[ 746, 4 ]
[ 757, 39 ]
python
en
['en', 'ny', 'en']
True
MqttClimate.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" ]
[ 760, 4 ]
[ 762, 39 ]
python
en
['en', 'ig', 'en']
True
MqttClimate.swing_modes
(self)
List of available swing modes.
List of available swing modes.
def swing_modes(self): """List of available swing modes.""" return self._config[CONF_SWING_MODE_LIST]
[ "def", "swing_modes", "(", "self", ")", ":", "return", "self", ".", "_config", "[", "CONF_SWING_MODE_LIST", "]" ]
[ 765, 4 ]
[ 767, 49 ]
python
en
['en', 'en', 'en']
True
MqttClimate.async_set_preset_mode
(self, preset_mode)
Set a preset mode.
Set a preset mode.
async def async_set_preset_mode(self, preset_mode): """Set a preset mode.""" if preset_mode == self.preset_mode: return # Track if we should optimistic update the state optimistic_update = False if self._away: optimistic_update = optimistic_update or sel...
[ "async", "def", "async_set_preset_mode", "(", "self", ",", "preset_mode", ")", ":", "if", "preset_mode", "==", "self", ".", "preset_mode", ":", "return", "# Track if we should optimistic update the state", "optimistic_update", "=", "False", "if", "self", ".", "_away",...
[ 769, 4 ]
[ 790, 39 ]
python
en
['en', 'pt', 'it']
False
MqttClimate._set_away_mode
(self, state)
Set away mode. Returns if we should optimistically write the state.
Set away mode.
def _set_away_mode(self, state): """Set away mode. Returns if we should optimistically write the state. """ self._publish( CONF_AWAY_MODE_COMMAND_TOPIC, self._config[CONF_PAYLOAD_ON] if state else self._config[CONF_PAYLOAD_OFF], ) if self._topic[...
[ "def", "_set_away_mode", "(", "self", ",", "state", ")", ":", "self", ".", "_publish", "(", "CONF_AWAY_MODE_COMMAND_TOPIC", ",", "self", ".", "_config", "[", "CONF_PAYLOAD_ON", "]", "if", "state", "else", "self", ".", "_config", "[", "CONF_PAYLOAD_OFF", "]", ...
[ 792, 4 ]
[ 806, 19 ]
python
en
['en', 'su', 'en']
True
MqttClimate._set_hold_mode
(self, hold_mode)
Set hold mode. Returns if we should optimistically write the state.
Set hold mode.
def _set_hold_mode(self, hold_mode): """Set hold mode. Returns if we should optimistically write the state. """ self._publish(CONF_HOLD_COMMAND_TOPIC, hold_mode or "off") if self._topic[CONF_HOLD_STATE_TOPIC] is not None: return False self._hold = hold_mode...
[ "def", "_set_hold_mode", "(", "self", ",", "hold_mode", ")", ":", "self", ".", "_publish", "(", "CONF_HOLD_COMMAND_TOPIC", ",", "hold_mode", "or", "\"off\"", ")", "if", "self", ".", "_topic", "[", "CONF_HOLD_STATE_TOPIC", "]", "is", "not", "None", ":", "retu...
[ 808, 4 ]
[ 819, 19 ]
python
da
['da', 'zu', 'en']
False
MqttClimate.async_turn_aux_heat_on
(self)
Turn auxiliary heater on.
Turn auxiliary heater on.
async def async_turn_aux_heat_on(self): """Turn auxiliary heater on.""" self._set_aux_heat(True)
[ "async", "def", "async_turn_aux_heat_on", "(", "self", ")", ":", "self", ".", "_set_aux_heat", "(", "True", ")" ]
[ 831, 4 ]
[ 833, 32 ]
python
en
['fr', 'fi', 'en']
False
MqttClimate.async_turn_aux_heat_off
(self)
Turn auxiliary heater off.
Turn auxiliary heater off.
async def async_turn_aux_heat_off(self): """Turn auxiliary heater off.""" self._set_aux_heat(False)
[ "async", "def", "async_turn_aux_heat_off", "(", "self", ")", ":", "self", ".", "_set_aux_heat", "(", "False", ")" ]
[ 835, 4 ]
[ 837, 33 ]
python
en
['en', 'en', 'en']
True
MqttClimate.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.""" support = 0 if (self._topic[CONF_TEMP_STATE_TOPIC] is not None) or ( self._topic[CONF_TEMP_COMMAND_TOPIC] is not None ): support |= SUPPORT_TARGET_TEMPERATURE if (self._topic[CONF...
[ "def", "supported_features", "(", "self", ")", ":", "support", "=", "0", "if", "(", "self", ".", "_topic", "[", "CONF_TEMP_STATE_TOPIC", "]", "is", "not", "None", ")", "or", "(", "self", ".", "_topic", "[", "CONF_TEMP_COMMAND_TOPIC", "]", "is", "not", "N...
[ 840, 4 ]
[ 882, 22 ]
python
en
['en', 'en', 'en']
True
MqttClimate.min_temp
(self)
Return the minimum temperature.
Return the minimum temperature.
def min_temp(self): """Return the minimum temperature.""" return self._config[CONF_TEMP_MIN]
[ "def", "min_temp", "(", "self", ")", ":", "return", "self", ".", "_config", "[", "CONF_TEMP_MIN", "]" ]
[ 885, 4 ]
[ 887, 42 ]
python
en
['en', 'la', 'en']
True
MqttClimate.max_temp
(self)
Return the maximum temperature.
Return the maximum temperature.
def max_temp(self): """Return the maximum temperature.""" return self._config[CONF_TEMP_MAX]
[ "def", "max_temp", "(", "self", ")", ":", "return", "self", ".", "_config", "[", "CONF_TEMP_MAX", "]" ]
[ 890, 4 ]
[ 892, 42 ]
python
en
['en', 'la', 'en']
True
MqttClimate.precision
(self)
Return the precision of the system.
Return the precision of the system.
def precision(self): """Return the precision of the system.""" if self._config.get(CONF_PRECISION) is not None: return self._config.get(CONF_PRECISION) return super().precision
[ "def", "precision", "(", "self", ")", ":", "if", "self", ".", "_config", ".", "get", "(", "CONF_PRECISION", ")", "is", "not", "None", ":", "return", "self", ".", "_config", ".", "get", "(", "CONF_PRECISION", ")", "return", "super", "(", ")", ".", "pr...
[ 895, 4 ]
[ 899, 32 ]
python
en
['en', 'en', 'en']
True
always_patch_driver
(hk_driver)
Load the hk_driver fixture.
Load the hk_driver fixture.
def always_patch_driver(hk_driver): """Load the hk_driver fixture."""
[ "def", "always_patch_driver", "(", "hk_driver", ")", ":" ]
[ 76, 0 ]
[ 77, 37 ]
python
en
['en', 'en', 'en']
True
device_reg_fixture
(hass)
Return an empty, loaded, registry.
Return an empty, loaded, registry.
def device_reg_fixture(hass): """Return an empty, loaded, registry.""" return mock_device_registry(hass)
[ "def", "device_reg_fixture", "(", "hass", ")", ":", "return", "mock_device_registry", "(", "hass", ")" ]
[ 81, 0 ]
[ 83, 37 ]
python
en
['en', 'fy', 'en']
True
entity_reg_fixture
(hass)
Return an empty, loaded, registry.
Return an empty, loaded, registry.
def entity_reg_fixture(hass): """Return an empty, loaded, registry.""" return mock_registry(hass)
[ "def", "entity_reg_fixture", "(", "hass", ")", ":", "return", "mock_registry", "(", "hass", ")" ]
[ 87, 0 ]
[ 89, 30 ]
python
en
['en', 'fy', 'en']
True
debounce_patcher_fixture
()
Patch debounce method.
Patch debounce method.
def debounce_patcher_fixture(): """Patch debounce method.""" patcher = patch_debounce() yield patcher.start() patcher.stop()
[ "def", "debounce_patcher_fixture", "(", ")", ":", "patcher", "=", "patch_debounce", "(", ")", "yield", "patcher", ".", "start", "(", ")", "patcher", ".", "stop", "(", ")" ]
[ 93, 0 ]
[ 97, 18 ]
python
en
['en', 'nl', 'en']
True
test_setup_min
(hass)
Test async_setup with min config options.
Test async_setup with min config options.
async def test_setup_min(hass): """Test async_setup with min config options.""" entry = MockConfigEntry( domain=DOMAIN, data={CONF_NAME: BRIDGE_NAME, CONF_PORT: DEFAULT_PORT}, options={}, ) entry.add_to_hass(hass) with patch(f"{PATH_HOMEKIT}.HomeKit") as mock_homekit: ...
[ "async", "def", "test_setup_min", "(", "hass", ")", ":", "entry", "=", "MockConfigEntry", "(", "domain", "=", "DOMAIN", ",", "data", "=", "{", "CONF_NAME", ":", "BRIDGE_NAME", ",", "CONF_PORT", ":", "DEFAULT_PORT", "}", ",", "options", "=", "{", "}", ","...
[ 100, 0 ]
[ 134, 46 ]
python
en
['en', 'en', 'en']
True
test_setup_auto_start_disabled
(hass)
Test async_setup with auto start disabled and test service calls.
Test async_setup with auto start disabled and test service calls.
async def test_setup_auto_start_disabled(hass): """Test async_setup with auto start disabled and test service calls.""" entry = MockConfigEntry( domain=DOMAIN, data={CONF_NAME: "Test Name", CONF_PORT: 11111, CONF_IP_ADDRESS: "172.0.0.0"}, options={CONF_AUTO_START: False, CONF_SAFE_MODE: ...
[ "async", "def", "test_setup_auto_start_disabled", "(", "hass", ")", ":", "entry", "=", "MockConfigEntry", "(", "domain", "=", "DOMAIN", ",", "data", "=", "{", "CONF_NAME", ":", "\"Test Name\"", ",", "CONF_PORT", ":", "11111", ",", "CONF_IP_ADDRESS", ":", "\"17...
[ 137, 0 ]
[ 189, 46 ]
python
en
['en', 'en', 'en']
True
test_homekit_setup
(hass, hk_driver)
Test setup of bridge and driver.
Test setup of bridge and driver.
async def test_homekit_setup(hass, hk_driver): """Test setup of bridge and driver.""" entry = MockConfigEntry( domain=DOMAIN, data={CONF_NAME: "mock_name", CONF_PORT: 12345}, source=SOURCE_IMPORT, ) homekit = HomeKit( hass, BRIDGE_NAME, DEFAULT_PORT, ...
[ "async", "def", "test_homekit_setup", "(", "hass", ",", "hk_driver", ")", ":", "entry", "=", "MockConfigEntry", "(", "domain", "=", "DOMAIN", ",", "data", "=", "{", "CONF_NAME", ":", "\"mock_name\"", ",", "CONF_PORT", ":", "12345", "}", ",", "source", "=",...
[ 192, 0 ]
[ 236, 72 ]
python
en
['en', 'ceb', 'en']
True
test_homekit_setup_ip_address
(hass, hk_driver)
Test setup with given IP address.
Test setup with given IP address.
async def test_homekit_setup_ip_address(hass, hk_driver): """Test setup with given IP address.""" entry = MockConfigEntry( domain=DOMAIN, data={CONF_NAME: "mock_name", CONF_PORT: 12345}, source=SOURCE_IMPORT, ) homekit = HomeKit( hass, BRIDGE_NAME, DEFAULT...
[ "async", "def", "test_homekit_setup_ip_address", "(", "hass", ",", "hk_driver", ")", ":", "entry", "=", "MockConfigEntry", "(", "domain", "=", "DOMAIN", ",", "data", "=", "{", "CONF_NAME", ":", "\"mock_name\"", ",", "CONF_PORT", ":", "12345", "}", ",", "sour...
[ 239, 0 ]
[ 275, 5 ]
python
en
['en', 'en', 'en']
True
test_homekit_setup_advertise_ip
(hass, hk_driver)
Test setup with given IP address to advertise.
Test setup with given IP address to advertise.
async def test_homekit_setup_advertise_ip(hass, hk_driver): """Test setup with given IP address to advertise.""" entry = MockConfigEntry( domain=DOMAIN, data={CONF_NAME: "mock_name", CONF_PORT: 12345}, source=SOURCE_IMPORT, ) homekit = HomeKit( hass, BRIDGE_NAME, ...
[ "async", "def", "test_homekit_setup_advertise_ip", "(", "hass", ",", "hk_driver", ")", ":", "entry", "=", "MockConfigEntry", "(", "domain", "=", "DOMAIN", ",", "data", "=", "{", "CONF_NAME", ":", "\"mock_name\"", ",", "CONF_PORT", ":", "12345", "}", ",", "so...
[ 278, 0 ]
[ 314, 5 ]
python
en
['en', 'en', 'en']
True
test_homekit_setup_safe_mode
(hass, hk_driver)
Test if safe_mode flag is set.
Test if safe_mode flag is set.
async def test_homekit_setup_safe_mode(hass, hk_driver): """Test if safe_mode flag is set.""" entry = MockConfigEntry( domain=DOMAIN, data={CONF_NAME: "mock_name", CONF_PORT: 12345}, source=SOURCE_IMPORT, ) homekit = HomeKit( hass, BRIDGE_NAME, DEFAULT_POR...
[ "async", "def", "test_homekit_setup_safe_mode", "(", "hass", ",", "hk_driver", ")", ":", "entry", "=", "MockConfigEntry", "(", "domain", "=", "DOMAIN", ",", "data", "=", "{", "CONF_NAME", ":", "\"mock_name\"", ",", "CONF_PORT", ":", "12345", "}", ",", "sourc...
[ 317, 0 ]
[ 339, 43 ]
python
en
['en', 'da', 'en']
True
test_homekit_add_accessory
(hass)
Add accessory if config exists and get_acc returns an accessory.
Add accessory if config exists and get_acc returns an accessory.
async def test_homekit_add_accessory(hass): """Add accessory if config exists and get_acc returns an accessory.""" entry = await async_init_integration(hass) homekit = HomeKit( hass, None, None, None, lambda entity_id: True, {}, DEFAULT_SAFE_MODE, ...
[ "async", "def", "test_homekit_add_accessory", "(", "hass", ")", ":", "entry", "=", "await", "async_init_integration", "(", "hass", ")", "homekit", "=", "HomeKit", "(", "hass", ",", "None", ",", "None", ",", "None", ",", "lambda", "entity_id", ":", "True", ...
[ 342, 0 ]
[ 376, 59 ]
python
en
['en', 'en', 'en']
True
test_homekit_remove_accessory
(hass)
Remove accessory from bridge.
Remove accessory from bridge.
async def test_homekit_remove_accessory(hass): """Remove accessory from bridge.""" entry = await async_init_integration(hass) homekit = HomeKit( hass, None, None, None, lambda entity_id: True, {}, DEFAULT_SAFE_MODE, HOMEKIT_MODE_BRIDGE, ...
[ "async", "def", "test_homekit_remove_accessory", "(", "hass", ")", ":", "entry", "=", "await", "async_init_integration", "(", "hass", ")", "homekit", "=", "HomeKit", "(", "hass", ",", "None", ",", "None", ",", "None", ",", "lambda", "entity_id", ":", "True",...
[ 379, 0 ]
[ 401, 44 ]
python
en
['en', 'it', 'en']
True
test_homekit_entity_filter
(hass)
Test the entity filter.
Test the entity filter.
async def test_homekit_entity_filter(hass): """Test the entity filter.""" entry = await async_init_integration(hass) entity_filter = generate_filter(["cover"], ["demo.test"], [], []) homekit = HomeKit( hass, None, None, None, entity_filter, {}, DE...
[ "async", "def", "test_homekit_entity_filter", "(", "hass", ")", ":", "entry", "=", "await", "async_init_integration", "(", "hass", ")", "entity_filter", "=", "generate_filter", "(", "[", "\"cover\"", "]", ",", "[", "\"demo.test\"", "]", ",", "[", "]", ",", "...
[ 404, 0 ]
[ 436, 43 ]
python
en
['en', 'en', 'en']
True
test_homekit_entity_glob_filter
(hass)
Test the entity filter.
Test the entity filter.
async def test_homekit_entity_glob_filter(hass): """Test the entity filter.""" entry = await async_init_integration(hass) entity_filter = generate_filter( ["cover"], ["demo.test"], [], [], ["*.included_*"], ["*.excluded_*"] ) homekit = HomeKit( hass, None, None, ...
[ "async", "def", "test_homekit_entity_glob_filter", "(", "hass", ")", ":", "entry", "=", "await", "async_init_integration", "(", "hass", ")", "entity_filter", "=", "generate_filter", "(", "[", "\"cover\"", "]", ",", "[", "\"demo.test\"", "]", ",", "[", "]", ","...
[ 439, 0 ]
[ 478, 33 ]
python
en
['en', 'en', 'en']
True
test_homekit_start
(hass, hk_driver, device_reg, debounce_patcher)
Test HomeKit start method.
Test HomeKit start method.
async def test_homekit_start(hass, hk_driver, device_reg, debounce_patcher): """Test HomeKit start method.""" entry = await async_init_integration(hass) pin = b"123-45-678" homekit = HomeKit( hass, None, None, None, {}, {}, DEFAULT_SAFE_MODE, ...
[ "async", "def", "test_homekit_start", "(", "hass", ",", "hk_driver", ",", "device_reg", ",", "debounce_patcher", ")", ":", "entry", "=", "await", "async_init_integration", "(", "hass", ")", "pin", "=", "b\"123-45-678\"", "homekit", "=", "HomeKit", "(", "hass", ...
[ 481, 0 ]
[ 567, 39 ]
python
en
['en', 'et', 'en']
True