Spelling fixes (#51642)

pull/51747/head
Ville Skyttä 2021-06-11 14:35:03 +03:00 committed by GitHub
parent be0d9d185b
commit 7d03b02192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
40 changed files with 115 additions and 115 deletions

View File

@ -98,7 +98,7 @@ class ResponseSwitch(SwitchEntity):
return attr return attr
async def async_turn_on(self, **kwargs) -> None: async def async_turn_on(self, **kwargs) -> None:
"""Send Acknowlegde response status.""" """Send Acknowledge response status."""
await self.async_set_response(True) await self.async_set_response(True)
async def async_turn_off(self, **kwargs) -> None: async def async_turn_off(self, **kwargs) -> None:

View File

@ -1,4 +1,4 @@
"""AVM FRITZ!Box connectivitiy sensor.""" """AVM FRITZ!Box connectivity sensor."""
import logging import logging
from fritzconnection.core.exceptions import FritzConnectionException from fritzconnection.core.exceptions import FritzConnectionException

View File

@ -8,7 +8,7 @@ from fritzconnection.lib.fritzphonebook import FritzPhonebook
from homeassistant.util import Throttle from homeassistant.util import Throttle
from .const import REGEX_NUMBER, UNKOWN_NAME from .const import REGEX_NUMBER, UNKNOWN_NAME
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -61,13 +61,13 @@ class FritzBoxPhonebook:
"""Return a name for a given phone number.""" """Return a name for a given phone number."""
number = re.sub(REGEX_NUMBER, "", str(number)) number = re.sub(REGEX_NUMBER, "", str(number))
if self.number_dict is None: if self.number_dict is None:
return UNKOWN_NAME return UNKNOWN_NAME
if number in self.number_dict: if number in self.number_dict:
return self.number_dict[number] return self.number_dict[number]
if not self.prefixes: if not self.prefixes:
return UNKOWN_NAME return UNKNOWN_NAME
for prefix in self.prefixes: for prefix in self.prefixes:
with suppress(KeyError): with suppress(KeyError):

View File

@ -19,7 +19,7 @@ FRITZ_ATTR_NAME = "name"
FRITZ_ATTR_SERIAL_NUMBER = "NewSerialNumber" FRITZ_ATTR_SERIAL_NUMBER = "NewSerialNumber"
FRITZ_SERVICE_DEVICE_INFO = "DeviceInfo" FRITZ_SERVICE_DEVICE_INFO = "DeviceInfo"
UNKOWN_NAME = "unknown" UNKNOWN_NAME = "unknown"
SERIAL_NUMBER = "serial_number" SERIAL_NUMBER = "serial_number"
REGEX_NUMBER = r"[^\d\+]" REGEX_NUMBER = r"[^\d\+]"

View File

@ -42,7 +42,7 @@ from .const import (
STATE_IDLE, STATE_IDLE,
STATE_RINGING, STATE_RINGING,
STATE_TALKING, STATE_TALKING,
UNKOWN_NAME, UNKNOWN_NAME,
) )
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -193,7 +193,7 @@ class FritzBoxCallSensor(SensorEntity):
def number_to_name(self, number): def number_to_name(self, number):
"""Return a name for a given phone number.""" """Return a name for a given phone number."""
if self._fritzbox_phonebook is None: if self._fritzbox_phonebook is None:
return UNKOWN_NAME return UNKNOWN_NAME
return self._fritzbox_phonebook.get_name(number) return self._fritzbox_phonebook.get_name(number)
def update(self): def update(self):

View File

@ -106,7 +106,7 @@ def async_enable_report_state(hass: HomeAssistant, google_config: AbstractConfig
"""Check if the serialized data has changed.""" """Check if the serialized data has changed."""
return old_extra_arg != new_extra_arg return old_extra_arg != new_extra_arg
async def inital_report(_now): async def initial_report(_now):
"""Report initially all states.""" """Report initially all states."""
nonlocal unsub, checker nonlocal unsub, checker
entities = {} entities = {}
@ -140,7 +140,7 @@ def async_enable_report_state(hass: HomeAssistant, google_config: AbstractConfig
MATCH_ALL, async_entity_state_listener MATCH_ALL, async_entity_state_listener
) )
unsub = async_call_later(hass, INITIAL_REPORT_DELAY, inital_report) unsub = async_call_later(hass, INITIAL_REPORT_DELAY, initial_report)
@callback @callback
def unsub_all(): def unsub_all():

View File

@ -1,4 +1,4 @@
"""Support for the Hive sesnors.""" """Support for the Hive sensors."""
from datetime import timedelta from datetime import timedelta

View File

@ -20,7 +20,7 @@ class HomePlusControlOAuth2Implementation(
subscription_key (str): Subscription key obtained from the API provider. subscription_key (str): Subscription key obtained from the API provider.
authorize_url (str): Authorization URL initiate authentication flow. authorize_url (str): Authorization URL initiate authentication flow.
token_url (str): URL to retrieve access/refresh tokens. token_url (str): URL to retrieve access/refresh tokens.
name (str): Name of the implementation (appears in the HomeAssitant GUI). name (str): Name of the implementation (appears in the HomeAssistant GUI).
""" """
def __init__( def __init__(

View File

@ -59,7 +59,7 @@ from . import ( # noqa: F401
from .accessories import HomeBridge, HomeDriver, get_accessory from .accessories import HomeBridge, HomeDriver, get_accessory
from .aidmanager import AccessoryAidStorage from .aidmanager import AccessoryAidStorage
from .const import ( from .const import (
ATTR_INTERGRATION, ATTR_INTEGRATION,
ATTR_MANUFACTURER, ATTR_MANUFACTURER,
ATTR_MODEL, ATTR_MODEL,
ATTR_SOFTWARE_VERSION, ATTR_SOFTWARE_VERSION,
@ -767,9 +767,9 @@ class HomeKit:
integration = await async_get_integration( integration = await async_get_integration(
self.hass, ent_reg_ent.platform self.hass, ent_reg_ent.platform
) )
ent_cfg[ATTR_INTERGRATION] = integration.name ent_cfg[ATTR_INTEGRATION] = integration.name
except IntegrationNotFound: except IntegrationNotFound:
ent_cfg[ATTR_INTERGRATION] = ent_reg_ent.platform ent_cfg[ATTR_INTEGRATION] = ent_reg_ent.platform
class HomeKitPairingQRView(HomeAssistantView): class HomeKitPairingQRView(HomeAssistantView):

View File

@ -42,7 +42,7 @@ from homeassistant.util.decorator import Registry
from .const import ( from .const import (
ATTR_DISPLAY_NAME, ATTR_DISPLAY_NAME,
ATTR_INTERGRATION, ATTR_INTEGRATION,
ATTR_MANUFACTURER, ATTR_MANUFACTURER,
ATTR_MODEL, ATTR_MODEL,
ATTR_SOFTWARE_VERSION, ATTR_SOFTWARE_VERSION,
@ -221,8 +221,8 @@ class HomeAccessory(Accessory):
if ATTR_MANUFACTURER in self.config: if ATTR_MANUFACTURER in self.config:
manufacturer = self.config[ATTR_MANUFACTURER] manufacturer = self.config[ATTR_MANUFACTURER]
elif ATTR_INTERGRATION in self.config: elif ATTR_INTEGRATION in self.config:
manufacturer = self.config[ATTR_INTERGRATION].replace("_", " ").title() manufacturer = self.config[ATTR_INTEGRATION].replace("_", " ").title()
else: else:
manufacturer = f"{MANUFACTURER} {domain}".title() manufacturer = f"{MANUFACTURER} {domain}".title()
if ATTR_MODEL in self.config: if ATTR_MODEL in self.config:

View File

@ -21,7 +21,7 @@ AUDIO_CODEC_COPY = "copy"
# #### Attributes #### # #### Attributes ####
ATTR_DISPLAY_NAME = "display_name" ATTR_DISPLAY_NAME = "display_name"
ATTR_VALUE = "value" ATTR_VALUE = "value"
ATTR_INTERGRATION = "platform" ATTR_INTEGRATION = "platform"
ATTR_MANUFACTURER = "manufacturer" ATTR_MANUFACTURER = "manufacturer"
ATTR_MODEL = "model" ATTR_MODEL = "model"
ATTR_SOFTWARE_VERSION = "sw_version" ATTR_SOFTWARE_VERSION = "sw_version"

View File

@ -91,9 +91,9 @@ def hd_position_to_hass(hd_position):
return round((hd_position / MAX_POSITION) * 100) return round((hd_position / MAX_POSITION) * 100)
def hass_position_to_hd(hass_positon): def hass_position_to_hd(hass_position):
"""Convert hass position to hunter douglas position.""" """Convert hass position to hunter douglas position."""
return int(hass_positon / 100 * MAX_POSITION) return int(hass_position / 100 * MAX_POSITION)
class PowerViewShade(ShadeEntity, CoverEntity): class PowerViewShade(ShadeEntity, CoverEntity):

View File

@ -180,7 +180,7 @@ class ISYNodeEntity(ISYEntity):
await self._node.send_cmd(command, value, unit_of_measurement, parameters) await self._node.send_cmd(command, value, unit_of_measurement, parameters)
async def async_get_zwave_parameter(self, parameter): async def async_get_zwave_parameter(self, parameter):
"""Repsond to an entity service command to request a Z-Wave device parameter from the ISY.""" """Respond to an entity service command to request a Z-Wave device parameter from the ISY."""
if not hasattr(self._node, "protocol") or self._node.protocol != PROTO_ZWAVE: if not hasattr(self._node, "protocol") or self._node.protocol != PROTO_ZWAVE:
raise HomeAssistantError( raise HomeAssistantError(
f"Invalid service call: cannot request Z-Wave Parameter for non-Z-Wave device {self.entity_id}" f"Invalid service call: cannot request Z-Wave Parameter for non-Z-Wave device {self.entity_id}"
@ -188,7 +188,7 @@ class ISYNodeEntity(ISYEntity):
await self._node.get_zwave_parameter(parameter) await self._node.get_zwave_parameter(parameter)
async def async_set_zwave_parameter(self, parameter, value, size): async def async_set_zwave_parameter(self, parameter, value, size):
"""Repsond to an entity service command to set a Z-Wave device parameter via the ISY.""" """Respond to an entity service command to set a Z-Wave device parameter via the ISY."""
if not hasattr(self._node, "protocol") or self._node.protocol != PROTO_ZWAVE: if not hasattr(self._node, "protocol") or self._node.protocol != PROTO_ZWAVE:
raise HomeAssistantError( raise HomeAssistantError(
f"Invalid service call: cannot set Z-Wave Parameter for non-Z-Wave device {self.entity_id}" f"Invalid service call: cannot set Z-Wave Parameter for non-Z-Wave device {self.entity_id}"
@ -197,7 +197,7 @@ class ISYNodeEntity(ISYEntity):
await self._node.get_zwave_parameter(parameter) await self._node.get_zwave_parameter(parameter)
async def async_rename_node(self, name): async def async_rename_node(self, name):
"""Repsond to an entity service command to rename a node on the ISY.""" """Respond to an entity service command to rename a node on the ISY."""
await self._node.rename(name) await self._node.rename(name)

View File

@ -54,7 +54,7 @@ COUNTRYCODE_NAMES = {
"LU": "Luxembourg", "LU": "Luxembourg",
"MT": "Malta", "MT": "Malta",
"MX": "Mexico", "MX": "Mexico",
"MY": "Maylasia", "MY": "Maylasia", # spelling error compatibility with pyps4_2ndscreen.media_art.COUNTRIES
"NI": "Nicaragua", "NI": "Nicaragua",
"NL": "Nederland", "NL": "Nederland",
"NO": "Norway", "NO": "Norway",

View File

@ -35,7 +35,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
) -> None: ) -> None:
"""Update the values of the controller.""" """Update the values of the controller."""
if controller.option_allow_bandwidth_sensors: if controller.option_allow_bandwidth_sensors:
add_bandwith_entities(controller, async_add_entities, clients) add_bandwidth_entities(controller, async_add_entities, clients)
if controller.option_allow_uptime_sensors: if controller.option_allow_uptime_sensors:
add_uptime_entities(controller, async_add_entities, clients) add_uptime_entities(controller, async_add_entities, clients)
@ -49,7 +49,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
@callback @callback
def add_bandwith_entities(controller, async_add_entities, clients): def add_bandwidth_entities(controller, async_add_entities, clients):
"""Add new sensor entities from the controller.""" """Add new sensor entities from the controller."""
sensors = [] sensors = []

View File

@ -43,7 +43,7 @@ class HaServiceBrowser(ServiceBrowser):
# As the list of zeroconf names we watch for grows, each additional # As the list of zeroconf names we watch for grows, each additional
# ServiceBrowser would process all the A and AAAA updates on the network. # ServiceBrowser would process all the A and AAAA updates on the network.
# #
# To avoid overwhemling the system we pre-filter here and only process # To avoid overwhelming the system we pre-filter here and only process
# DNSPointers for the configured record name (type) # DNSPointers for the configured record name (type)
# #
if record.name not in self.types or not isinstance(record, DNSPointer): if record.name not in self.types or not isinstance(record, DNSPointer):

View File

@ -305,7 +305,7 @@ async def test_ssdp_already_configured_host(hass: HomeAssistant, fc_class_mock):
async def test_ssdp_already_configured_host_uuid(hass: HomeAssistant, fc_class_mock): async def test_ssdp_already_configured_host_uuid(hass: HomeAssistant, fc_class_mock):
"""Test starting a flow from discovery with a laready configured uuid.""" """Test starting a flow from discovery with an already configured uuid."""
mock_config = MockConfigEntry( mock_config = MockConfigEntry(
domain=DOMAIN, domain=DOMAIN,

View File

@ -132,7 +132,7 @@ def requests_mock_credentials_check(requests_mock):
@pytest.fixture @pytest.fixture
def requests_mock_truck_response(requests_mock_credentials_check): def requests_mock_truck_response(requests_mock_credentials_check):
"""Return a requests_mock for truck respones.""" """Return a requests_mock for truck response."""
modes = [ROUTE_MODE_FASTEST, TRAVEL_MODE_TRUCK, TRAFFIC_MODE_DISABLED] modes = [ROUTE_MODE_FASTEST, TRAVEL_MODE_TRUCK, TRAFFIC_MODE_DISABLED]
response_url = _build_mock_url( response_url = _build_mock_url(
",".join([TRUCK_ORIGIN_LATITUDE, TRUCK_ORIGIN_LONGITUDE]), ",".join([TRUCK_ORIGIN_LATITUDE, TRUCK_ORIGIN_LONGITUDE]),
@ -147,7 +147,7 @@ def requests_mock_truck_response(requests_mock_credentials_check):
@pytest.fixture @pytest.fixture
def requests_mock_car_disabled_response(requests_mock_credentials_check): def requests_mock_car_disabled_response(requests_mock_credentials_check):
"""Return a requests_mock for truck respones.""" """Return a requests_mock for truck response."""
modes = [ROUTE_MODE_FASTEST, TRAVEL_MODE_CAR, TRAFFIC_MODE_DISABLED] modes = [ROUTE_MODE_FASTEST, TRAVEL_MODE_CAR, TRAFFIC_MODE_DISABLED]
response_url = _build_mock_url( response_url = _build_mock_url(
",".join([CAR_ORIGIN_LATITUDE, CAR_ORIGIN_LONGITUDE]), ",".join([CAR_ORIGIN_LATITUDE, CAR_ORIGIN_LONGITUDE]),

View File

@ -13,7 +13,7 @@ from homeassistant.components.homekit.accessories import (
) )
from homeassistant.components.homekit.const import ( from homeassistant.components.homekit.const import (
ATTR_DISPLAY_NAME, ATTR_DISPLAY_NAME,
ATTR_INTERGRATION, ATTR_INTEGRATION,
ATTR_MANUFACTURER, ATTR_MANUFACTURER,
ATTR_MODEL, ATTR_MODEL,
ATTR_SOFTWARE_VERSION, ATTR_SOFTWARE_VERSION,
@ -106,7 +106,7 @@ async def test_home_accessory(hass, hk_driver):
ATTR_MODEL: "Awesome", ATTR_MODEL: "Awesome",
ATTR_MANUFACTURER: "Lux Brands", ATTR_MANUFACTURER: "Lux Brands",
ATTR_SOFTWARE_VERSION: "0.4.3", ATTR_SOFTWARE_VERSION: "0.4.3",
ATTR_INTERGRATION: "luxe", ATTR_INTEGRATION: "luxe",
}, },
) )
assert acc3.available is False assert acc3.available is False

View File

@ -77,7 +77,7 @@ async def test_aid_generation(hass, device_reg, entity_reg):
aid_storage.delete_aid(get_system_unique_id(light_ent)) aid_storage.delete_aid(get_system_unique_id(light_ent))
aid_storage.delete_aid(get_system_unique_id(light_ent2)) aid_storage.delete_aid(get_system_unique_id(light_ent2))
aid_storage.delete_aid(get_system_unique_id(remote_ent)) aid_storage.delete_aid(get_system_unique_id(remote_ent))
aid_storage.delete_aid("non-existant-one") aid_storage.delete_aid("non-existent-one")
for _ in range(0, 2): for _ in range(0, 2):
assert ( assert (

View File

@ -7,7 +7,7 @@ import homeassistant.components.climate as climate
import homeassistant.components.cover as cover import homeassistant.components.cover as cover
from homeassistant.components.homekit.accessories import TYPES, get_accessory from homeassistant.components.homekit.accessories import TYPES, get_accessory
from homeassistant.components.homekit.const import ( from homeassistant.components.homekit.const import (
ATTR_INTERGRATION, ATTR_INTEGRATION,
CONF_FEATURE_LIST, CONF_FEATURE_LIST,
FEATURE_ON_OFF, FEATURE_ON_OFF,
TYPE_FAUCET, TYPE_FAUCET,
@ -66,7 +66,7 @@ def test_customize_options(config, name):
"""Test with customized options.""" """Test with customized options."""
mock_type = Mock() mock_type = Mock()
conf = config.copy() conf = config.copy()
conf[ATTR_INTERGRATION] = "platform_name" conf[ATTR_INTEGRATION] = "platform_name"
with patch.dict(TYPES, {"Light": mock_type}): with patch.dict(TYPES, {"Light": mock_type}):
entity_state = State("light.demo", "on") entity_state = State("light.demo", "on")
get_accessory(None, None, entity_state, 2, conf) get_accessory(None, None, entity_state, 2, conf)

View File

@ -241,7 +241,7 @@ async def test_setup_config_entry_dynamic_instances(hass: HomeAssistant) -> None
assert hass.states.get(TEST_ENTITY_ID_3) is not None assert hass.states.get(TEST_ENTITY_ID_3) is not None
async def test_light_basic_properies(hass: HomeAssistant) -> None: async def test_light_basic_properties(hass: HomeAssistant) -> None:
"""Test the basic properties.""" """Test the basic properties."""
client = create_mock_client() client = create_mock_client()
await setup_test_config_entry(hass, hyperion_client=client) await setup_test_config_entry(hass, hyperion_client=client)

View File

@ -313,7 +313,7 @@ async def test_config_failure(hass, config_ext):
async def test_state_matches_query_result( async def test_state_matches_query_result(
hass, mock_client, config_ext, queries, set_query_mock, make_resultset hass, mock_client, config_ext, queries, set_query_mock, make_resultset
): ):
"""Test state of sensor matches respone from query api.""" """Test state of sensor matches response from query api."""
set_query_mock(mock_client, return_value=make_resultset(42)) set_query_mock(mock_client, return_value=make_resultset(42))
sensors = await _setup(hass, config_ext, queries, ["sensor.test"]) sensors = await _setup(hass, config_ext, queries, ["sensor.test"])
@ -344,7 +344,7 @@ async def test_state_matches_query_result(
async def test_state_matches_first_query_result_for_multiple_return( async def test_state_matches_first_query_result_for_multiple_return(
hass, caplog, mock_client, config_ext, queries, set_query_mock, make_resultset hass, caplog, mock_client, config_ext, queries, set_query_mock, make_resultset
): ):
"""Test state of sensor matches respone from query api.""" """Test state of sensor matches response from query api."""
set_query_mock(mock_client, return_value=make_resultset(42, "not used")) set_query_mock(mock_client, return_value=make_resultset(42, "not used"))
sensors = await _setup(hass, config_ext, queries, ["sensor.test"]) sensors = await _setup(hass, config_ext, queries, ["sensor.test"])
@ -370,7 +370,7 @@ async def test_state_matches_first_query_result_for_multiple_return(
async def test_state_for_no_results( async def test_state_for_no_results(
hass, caplog, mock_client, config_ext, queries, set_query_mock hass, caplog, mock_client, config_ext, queries, set_query_mock
): ):
"""Test state of sensor matches respone from query api.""" """Test state of sensor matches response from query api."""
set_query_mock(mock_client) set_query_mock(mock_client)
sensors = await _setup(hass, config_ext, queries, ["sensor.test"]) sensors = await _setup(hass, config_ext, queries, ["sensor.test"])

View File

@ -28,7 +28,7 @@ async def test_unload_entry(hass):
assert DOMAIN not in hass.data assert DOMAIN not in hass.data
async def test_unkown_error(hass, caplog): async def test_unknown_error(hass, caplog):
"""Test unload for Kraken.""" """Test unload for Kraken."""
with patch( with patch(
"pykrakenapi.KrakenAPI.get_tradable_asset_pairs", "pykrakenapi.KrakenAPI.get_tradable_asset_pairs",

View File

@ -12,7 +12,7 @@ from tests.common import MockConfigEntry
async def setup_mikrotik_entry(hass, **kwargs): async def setup_mikrotik_entry(hass, **kwargs):
"""Set up Mikrotik intergation successfully.""" """Set up Mikrotik integration successfully."""
support_wireless = kwargs.get("support_wireless", True) support_wireless = kwargs.get("support_wireless", True)
dhcp_data = kwargs.get("dhcp_data", DHCP_DATA) dhcp_data = kwargs.get("dhcp_data", DHCP_DATA)
wireless_data = kwargs.get("wireless_data", WIRELESS_DATA) wireless_data = kwargs.get("wireless_data", WIRELESS_DATA)

View File

@ -87,7 +87,7 @@ async def test_user_flow_bad_dsn(hass: HomeAssistant) -> None:
assert result2.get("errors") == {"base": "bad_dsn"} assert result2.get("errors") == {"base": "bad_dsn"}
async def test_user_flow_unkown_exception(hass: HomeAssistant) -> None: async def test_user_flow_unknown_exception(hass: HomeAssistant) -> None:
"""Test we handle any unknown exception error.""" """Test we handle any unknown exception error."""
result = await hass.config_entries.flow.async_init( result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER} DOMAIN, context={"source": SOURCE_USER}

View File

@ -119,7 +119,7 @@ async def test_scan_match_upnp_devicedesc(hass, aioclient_mock, key):
"location": "http://1.1.1.1", "location": "http://1.1.1.1",
} }
mock_init = await _async_run_mocked_scan(hass, mock_ssdp_response, mock_get_ssdp) mock_init = await _async_run_mocked_scan(hass, mock_ssdp_response, mock_get_ssdp)
# If we get duplicate respones, ensure we only look it up once # If we get duplicate response, ensure we only look it up once
assert len(aioclient_mock.mock_calls) == 1 assert len(aioclient_mock.mock_calls) == 1
assert len(mock_init.mock_calls) == 1 assert len(mock_init.mock_calls) == 1
assert mock_init.mock_calls[0][1][0] == "mock-domain" assert mock_init.mock_calls[0][1][0] == "mock-domain"
@ -363,11 +363,11 @@ async def test_scan_with_registered_callback(hass, aioclient_mock, caplog):
"x-rincon-bootseq": "55", "x-rincon-bootseq": "55",
"ext": "", "ext": "",
} }
not_matching_intergration_callbacks = [] not_matching_integration_callbacks = []
intergration_match_all_callbacks = [] integration_match_all_callbacks = []
intergration_match_all_not_present_callbacks = [] integration_match_all_not_present_callbacks = []
intergration_callbacks = [] integration_callbacks = []
intergration_callbacks_from_cache = [] integration_callbacks_from_cache = []
match_any_callbacks = [] match_any_callbacks = []
@callback @callback
@ -375,24 +375,24 @@ async def test_scan_with_registered_callback(hass, aioclient_mock, caplog):
raise ValueError raise ValueError
@callback @callback
def _async_intergration_callbacks(info): def _async_integration_callbacks(info):
intergration_callbacks.append(info) integration_callbacks.append(info)
@callback @callback
def _async_intergration_match_all_callbacks(info): def _async_integration_match_all_callbacks(info):
intergration_match_all_callbacks.append(info) integration_match_all_callbacks.append(info)
@callback @callback
def _async_intergration_match_all_not_present_callbacks(info): def _async_integration_match_all_not_present_callbacks(info):
intergration_match_all_not_present_callbacks.append(info) integration_match_all_not_present_callbacks.append(info)
@callback @callback
def _async_intergration_callbacks_from_cache(info): def _async_integration_callbacks_from_cache(info):
intergration_callbacks_from_cache.append(info) integration_callbacks_from_cache.append(info)
@callback @callback
def _async_not_matching_intergration_callbacks(info): def _async_not_matching_integration_callbacks(info):
not_matching_intergration_callbacks.append(info) not_matching_integration_callbacks.append(info)
@callback @callback
def _async_match_any_callbacks(info): def _async_match_any_callbacks(info):
@ -422,22 +422,22 @@ async def test_scan_with_registered_callback(hass, aioclient_mock, caplog):
ssdp.async_register_callback(hass, _async_exception_callbacks, {}) ssdp.async_register_callback(hass, _async_exception_callbacks, {})
ssdp.async_register_callback( ssdp.async_register_callback(
hass, hass,
_async_intergration_callbacks, _async_integration_callbacks,
{"st": "mock-st"}, {"st": "mock-st"},
) )
ssdp.async_register_callback( ssdp.async_register_callback(
hass, hass,
_async_intergration_match_all_callbacks, _async_integration_match_all_callbacks,
{"x-rincon-bootseq": MATCH_ALL}, {"x-rincon-bootseq": MATCH_ALL},
) )
ssdp.async_register_callback( ssdp.async_register_callback(
hass, hass,
_async_intergration_match_all_not_present_callbacks, _async_integration_match_all_not_present_callbacks,
{"x-not-there": MATCH_ALL}, {"x-not-there": MATCH_ALL},
) )
ssdp.async_register_callback( ssdp.async_register_callback(
hass, hass,
_async_not_matching_intergration_callbacks, _async_not_matching_integration_callbacks,
{"st": "not-match-mock-st"}, {"st": "not-match-mock-st"},
) )
ssdp.async_register_callback( ssdp.async_register_callback(
@ -448,7 +448,7 @@ async def test_scan_with_registered_callback(hass, aioclient_mock, caplog):
async_fire_time_changed(hass, dt_util.utcnow() + timedelta(seconds=200)) async_fire_time_changed(hass, dt_util.utcnow() + timedelta(seconds=200))
ssdp.async_register_callback( ssdp.async_register_callback(
hass, hass,
_async_intergration_callbacks_from_cache, _async_integration_callbacks_from_cache,
{"st": "mock-st"}, {"st": "mock-st"},
) )
await hass.async_block_till_done() await hass.async_block_till_done()
@ -459,13 +459,13 @@ async def test_scan_with_registered_callback(hass, aioclient_mock, caplog):
await hass.async_block_till_done() await hass.async_block_till_done()
assert hass.state == CoreState.running assert hass.state == CoreState.running
assert len(intergration_callbacks) == 3 assert len(integration_callbacks) == 3
assert len(intergration_callbacks_from_cache) == 3 assert len(integration_callbacks_from_cache) == 3
assert len(intergration_match_all_callbacks) == 3 assert len(integration_match_all_callbacks) == 3
assert len(intergration_match_all_not_present_callbacks) == 0 assert len(integration_match_all_not_present_callbacks) == 0
assert len(match_any_callbacks) == 3 assert len(match_any_callbacks) == 3
assert len(not_matching_intergration_callbacks) == 0 assert len(not_matching_integration_callbacks) == 0
assert intergration_callbacks[0] == { assert integration_callbacks[0] == {
ssdp.ATTR_UPNP_DEVICE_TYPE: "Paulus", ssdp.ATTR_UPNP_DEVICE_TYPE: "Paulus",
ssdp.ATTR_SSDP_EXT: "", ssdp.ATTR_SSDP_EXT: "",
ssdp.ATTR_SSDP_LOCATION: "http://1.1.1.1", ssdp.ATTR_SSDP_LOCATION: "http://1.1.1.1",
@ -503,11 +503,11 @@ async def test_unsolicited_ssdp_registered_callback(hass, aioclient_mock, caplog
"x-rincon-variant": "1", "x-rincon-variant": "1",
"household.smartspeaker.audio": "Sonos_v3294823948542543534", "household.smartspeaker.audio": "Sonos_v3294823948542543534",
} }
intergration_callbacks = [] integration_callbacks = []
@callback @callback
def _async_intergration_callbacks(info): def _async_integration_callbacks(info):
intergration_callbacks.append(info) integration_callbacks.append(info)
def _generate_fake_ssdp_listener(*args, **kwargs): def _generate_fake_ssdp_listener(*args, **kwargs):
listener = SSDPListener(*args, **kwargs) listener = SSDPListener(*args, **kwargs)
@ -532,7 +532,7 @@ async def test_unsolicited_ssdp_registered_callback(hass, aioclient_mock, caplog
await hass.async_block_till_done() await hass.async_block_till_done()
ssdp.async_register_callback( ssdp.async_register_callback(
hass, hass,
_async_intergration_callbacks, _async_integration_callbacks,
{"nts": "ssdp:alive", "x-rincon-bootseq": MATCH_ALL}, {"nts": "ssdp:alive", "x-rincon-bootseq": MATCH_ALL},
) )
await hass.async_block_till_done() await hass.async_block_till_done()
@ -546,9 +546,9 @@ async def test_unsolicited_ssdp_registered_callback(hass, aioclient_mock, caplog
assert hass.state == CoreState.running assert hass.state == CoreState.running
assert ( assert (
len(intergration_callbacks) == 2 len(integration_callbacks) == 2
) # unsolicited callbacks without st are not cached ) # unsolicited callbacks without st are not cached
assert intergration_callbacks[0] == { assert integration_callbacks[0] == {
"UDN": "uuid:RINCON_1111BB963FD801400", "UDN": "uuid:RINCON_1111BB963FD801400",
"bootid.upnp.org": "250", "bootid.upnp.org": "250",
"deviceType": "Paulus", "deviceType": "Paulus",
@ -589,11 +589,11 @@ async def test_scan_second_hit(hass, aioclient_mock, caplog):
} }
) )
mock_get_ssdp = {"mock-domain": [{"st": "mock-st"}]} mock_get_ssdp = {"mock-domain": [{"st": "mock-st"}]}
intergration_callbacks = [] integration_callbacks = []
@callback @callback
def _async_intergration_callbacks(info): def _async_integration_callbacks(info):
intergration_callbacks.append(info) integration_callbacks.append(info)
def _generate_fake_ssdp_listener(*args, **kwargs): def _generate_fake_ssdp_listener(*args, **kwargs):
listener = SSDPListener(*args, **kwargs) listener = SSDPListener(*args, **kwargs)
@ -622,7 +622,7 @@ async def test_scan_second_hit(hass, aioclient_mock, caplog):
await hass.async_block_till_done() await hass.async_block_till_done()
remove = ssdp.async_register_callback( remove = ssdp.async_register_callback(
hass, hass,
_async_intergration_callbacks, _async_integration_callbacks,
{"st": "mock-st"}, {"st": "mock-st"},
) )
hass.bus.async_fire(EVENT_HOMEASSISTANT_STARTED) hass.bus.async_fire(EVENT_HOMEASSISTANT_STARTED)
@ -635,8 +635,8 @@ async def test_scan_second_hit(hass, aioclient_mock, caplog):
async_fire_time_changed(hass, dt_util.utcnow() + timedelta(seconds=200)) async_fire_time_changed(hass, dt_util.utcnow() + timedelta(seconds=200))
await hass.async_block_till_done() await hass.async_block_till_done()
assert len(intergration_callbacks) == 2 assert len(integration_callbacks) == 2
assert intergration_callbacks[0] == { assert integration_callbacks[0] == {
ssdp.ATTR_UPNP_DEVICE_TYPE: "Paulus", ssdp.ATTR_UPNP_DEVICE_TYPE: "Paulus",
ssdp.ATTR_SSDP_EXT: "", ssdp.ATTR_SSDP_EXT: "",
ssdp.ATTR_SSDP_LOCATION: "http://1.1.1.1", ssdp.ATTR_SSDP_LOCATION: "http://1.1.1.1",

View File

@ -34,7 +34,7 @@ async def test_show_setup_form(hass):
assert result["step_id"] == "user" assert result["step_id"] == "user"
async def test_flow_successfull(hass): async def test_flow_successful(hass):
"""Test with required fields only.""" """Test with required fields only."""
with patch( with patch(
"aiosyncthing.system.System.status", return_value={"myID": "server-id"} "aiosyncthing.system.System.status", return_value={"myID": "server-id"}

View File

@ -296,7 +296,7 @@ async def test_error_on_connection_failure(hass, conn_error):
assert result["errors"] == {"base": "cannot_connect"} assert result["errors"] == {"base": "cannot_connect"}
async def test_error_on_unknwon_error(hass, unknown_error): async def test_error_on_unknown_error(hass, unknown_error):
"""Test when connection to host fails.""" """Test when connection to host fails."""
flow = init_config_flow(hass) flow = init_config_flow(hass)

View File

@ -65,7 +65,7 @@ def new_simple_controller_config(
setup_callback: SetupCallback = None, setup_callback: SetupCallback = None,
legacy_entity_unique_id=False, legacy_entity_unique_id=False,
) -> ControllerConfig: ) -> ControllerConfig:
"""Create simple contorller config.""" """Create simple controller config."""
return ControllerConfig( return ControllerConfig(
config=config or {CONF_CONTROLLER: "http://127.0.0.1:123"}, config=config or {CONF_CONTROLLER: "http://127.0.0.1:123"},
options=options, options=options,

View File

@ -41,7 +41,7 @@ MOCK_SSDP_DISCOVERY_INFO_P_B = {
ATTR_UPNP_SERIAL: UPNP_SERIAL, ATTR_UPNP_SERIAL: UPNP_SERIAL,
} }
MOCK_SSDP_DISCOVERY_INFO_WRONG_MANUFACTORER = { MOCK_SSDP_DISCOVERY_INFO_WRONG_MANUFACTURER = {
ATTR_SSDP_LOCATION: SSDP_LOCATION, ATTR_SSDP_LOCATION: SSDP_LOCATION,
ATTR_UPNP_MANUFACTURER: UPNP_MANUFACTURER_NOT_WILIGHT, ATTR_UPNP_MANUFACTURER: UPNP_MANUFACTURER_NOT_WILIGHT,
ATTR_UPNP_MODEL_NAME: UPNP_MODEL_NAME_P_B, ATTR_UPNP_MODEL_NAME: UPNP_MODEL_NAME_P_B,
@ -49,7 +49,7 @@ MOCK_SSDP_DISCOVERY_INFO_WRONG_MANUFACTORER = {
ATTR_UPNP_SERIAL: ATTR_UPNP_SERIAL, ATTR_UPNP_SERIAL: ATTR_UPNP_SERIAL,
} }
MOCK_SSDP_DISCOVERY_INFO_MISSING_MANUFACTORER = { MOCK_SSDP_DISCOVERY_INFO_MISSING_MANUFACTURER = {
ATTR_SSDP_LOCATION: SSDP_LOCATION, ATTR_SSDP_LOCATION: SSDP_LOCATION,
ATTR_UPNP_MODEL_NAME: UPNP_MODEL_NAME_P_B, ATTR_UPNP_MODEL_NAME: UPNP_MODEL_NAME_P_B,
ATTR_UPNP_MODEL_NUMBER: UPNP_MODEL_NUMBER, ATTR_UPNP_MODEL_NUMBER: UPNP_MODEL_NUMBER,

View File

@ -21,9 +21,9 @@ from tests.common import MockConfigEntry
from tests.components.wilight import ( from tests.components.wilight import (
CONF_COMPONENTS, CONF_COMPONENTS,
HOST, HOST,
MOCK_SSDP_DISCOVERY_INFO_MISSING_MANUFACTORER, MOCK_SSDP_DISCOVERY_INFO_MISSING_MANUFACTURER,
MOCK_SSDP_DISCOVERY_INFO_P_B, MOCK_SSDP_DISCOVERY_INFO_P_B,
MOCK_SSDP_DISCOVERY_INFO_WRONG_MANUFACTORER, MOCK_SSDP_DISCOVERY_INFO_WRONG_MANUFACTURER,
UPNP_MODEL_NAME_P_B, UPNP_MODEL_NAME_P_B,
UPNP_SERIAL, UPNP_SERIAL,
WILIGHT_ID, WILIGHT_ID,
@ -71,7 +71,7 @@ async def test_show_ssdp_form(hass: HomeAssistant) -> None:
async def test_ssdp_not_wilight_abort_1(hass: HomeAssistant) -> None: async def test_ssdp_not_wilight_abort_1(hass: HomeAssistant) -> None:
"""Test that the ssdp aborts not_wilight.""" """Test that the ssdp aborts not_wilight."""
discovery_info = MOCK_SSDP_DISCOVERY_INFO_WRONG_MANUFACTORER.copy() discovery_info = MOCK_SSDP_DISCOVERY_INFO_WRONG_MANUFACTURER.copy()
result = await hass.config_entries.flow.async_init( result = await hass.config_entries.flow.async_init(
DOMAIN, context={CONF_SOURCE: SOURCE_SSDP}, data=discovery_info DOMAIN, context={CONF_SOURCE: SOURCE_SSDP}, data=discovery_info
) )
@ -83,7 +83,7 @@ async def test_ssdp_not_wilight_abort_1(hass: HomeAssistant) -> None:
async def test_ssdp_not_wilight_abort_2(hass: HomeAssistant) -> None: async def test_ssdp_not_wilight_abort_2(hass: HomeAssistant) -> None:
"""Test that the ssdp aborts not_wilight.""" """Test that the ssdp aborts not_wilight."""
discovery_info = MOCK_SSDP_DISCOVERY_INFO_MISSING_MANUFACTORER.copy() discovery_info = MOCK_SSDP_DISCOVERY_INFO_MISSING_MANUFACTURER.copy()
result = await hass.config_entries.flow.async_init( result = await hass.config_entries.flow.async_init(
DOMAIN, context={CONF_SOURCE: SOURCE_SSDP}, data=discovery_info DOMAIN, context={CONF_SOURCE: SOURCE_SSDP}, data=discovery_info
) )

View File

@ -113,7 +113,7 @@ async def test_config_flow_user_success(hass):
async def test_config_flow_user_multiple_success(hass): async def test_config_flow_user_multiple_success(hass):
"""Test a successful config flow initialized by the user with multiple gateways discoverd.""" """Test a successful config flow initialized by the user with multiple gateways discovered."""
result = await hass.config_entries.flow.async_init( result = await hass.config_entries.flow.async_init(
const.DOMAIN, context={"source": config_entries.SOURCE_USER} const.DOMAIN, context={"source": config_entries.SOURCE_USER}
) )
@ -249,7 +249,7 @@ async def test_config_flow_user_host_mac_success(hass):
async def test_config_flow_user_discovery_error(hass): async def test_config_flow_user_discovery_error(hass):
"""Test a failed config flow initialized by the user with no gateways discoverd.""" """Test a failed config flow initialized by the user with no gateways discovered."""
result = await hass.config_entries.flow.async_init( result = await hass.config_entries.flow.async_init(
const.DOMAIN, context={"source": config_entries.SOURCE_USER} const.DOMAIN, context={"source": config_entries.SOURCE_USER}
) )

View File

@ -115,8 +115,8 @@ def mirobo_is_got_error_fixture():
mock_vacuum.timer.return_value = [mock_timer_1, mock_timer_2] mock_vacuum.timer.return_value = [mock_timer_1, mock_timer_2]
with patch("homeassistant.components.xiaomi_miio.vacuum.Vacuum") as mock_vaccum_cls: with patch("homeassistant.components.xiaomi_miio.vacuum.Vacuum") as mock_vacuum_cls:
mock_vaccum_cls.return_value = mock_vacuum mock_vacuum_cls.return_value = mock_vacuum
yield mock_vacuum yield mock_vacuum
@ -143,8 +143,8 @@ def mirobo_old_speeds_fixture(request):
mock_vacuum.fan_speed_presets.return_value = request.param mock_vacuum.fan_speed_presets.return_value = request.param
mock_vacuum.status().fanspeed = list(request.param.values())[0] mock_vacuum.status().fanspeed = list(request.param.values())[0]
with patch("homeassistant.components.xiaomi_miio.vacuum.Vacuum") as mock_vaccum_cls: with patch("homeassistant.components.xiaomi_miio.vacuum.Vacuum") as mock_vacuum_cls:
mock_vaccum_cls.return_value = mock_vacuum mock_vacuum_cls.return_value = mock_vacuum
yield mock_vacuum yield mock_vacuum
@ -189,8 +189,8 @@ def mirobo_is_on_fixture():
mock_vacuum.timer.return_value = [mock_timer_1, mock_timer_2] mock_vacuum.timer.return_value = [mock_timer_1, mock_timer_2]
with patch("homeassistant.components.xiaomi_miio.vacuum.Vacuum") as mock_vaccum_cls: with patch("homeassistant.components.xiaomi_miio.vacuum.Vacuum") as mock_vacuum_cls:
mock_vaccum_cls.return_value = mock_vacuum mock_vacuum_cls.return_value = mock_vacuum
yield mock_vacuum yield mock_vacuum

View File

@ -192,7 +192,7 @@ async def test_check_available_unsuccessful(
assert basic_ch.read_attributes.await_args[0][0] == ["manufacturer"] assert basic_ch.read_attributes.await_args[0][0] == ["manufacturer"]
assert zha_device.available is True assert zha_device.available is True
# not even trying to update, device is unavailble # not even trying to update, device is unavailable
_send_time_changed(hass, 91) _send_time_changed(hass, 91)
await hass.async_block_till_done() await hass.async_block_till_done()
assert basic_ch.read_attributes.await_count == 2 assert basic_ch.read_attributes.await_count == 2

View File

@ -1034,7 +1034,7 @@ async def test_state_attribute(hass):
}, },
) )
hass.states.async_set("sensor.temperature", 100, {"unkown_attr": 200}) hass.states.async_set("sensor.temperature", 100, {"unknown_attr": 200})
with pytest.raises(ConditionError): with pytest.raises(ConditionError):
test(hass) test(hass)
@ -1330,7 +1330,7 @@ async def test_numeric_state_attribute(hass):
}, },
) )
hass.states.async_set("sensor.temperature", 100, {"unkown_attr": 10}) hass.states.async_set("sensor.temperature", 100, {"unknown_attr": 10})
with pytest.raises(ConditionError): with pytest.raises(ConditionError):
assert test(hass) assert test(hass)

View File

@ -15,7 +15,7 @@ async def test_extract_frame_integration(caplog, mock_integration_frame):
assert found_frame == mock_integration_frame assert found_frame == mock_integration_frame
async def test_extract_frame_integration_with_excluded_intergration(caplog): async def test_extract_frame_integration_with_excluded_integration(caplog):
"""Test extracting the current frame from integration context.""" """Test extracting the current frame from integration context."""
correct_frame = Mock( correct_frame = Mock(
filename="/home/dev/homeassistant/components/mdns/light.py", filename="/home/dev/homeassistant/components/mdns/light.py",

View File

@ -477,7 +477,7 @@ async def test_stop_no_wait(hass, count):
# Can't assert just yet because we haven't verified stopping works yet. # Can't assert just yet because we haven't verified stopping works yet.
# If assert fails we can hang test if async_stop doesn't work. # If assert fails we can hang test if async_stop doesn't work.
script_was_runing = script_obj.is_running script_was_running = script_obj.is_running
were_no_events = len(events) == 0 were_no_events = len(events) == 0
# Begin the process of stopping the script (which should stop all runs), and then # Begin the process of stopping the script (which should stop all runs), and then
@ -487,7 +487,7 @@ async def test_stop_no_wait(hass, count):
await hass.async_block_till_done() await hass.async_block_till_done()
assert script_was_runing assert script_was_running
assert were_no_events assert were_no_events
assert not script_obj.is_running assert not script_obj.is_running
assert len(events) == 0 assert len(events) == 0
@ -1189,8 +1189,8 @@ async def test_wait_template_with_utcnow(hass):
start_time = dt_util.utcnow().replace(minute=1) + timedelta(hours=48) start_time = dt_util.utcnow().replace(minute=1) + timedelta(hours=48)
try: try:
non_maching_time = start_time.replace(hour=3) non_matching_time = start_time.replace(hour=3)
with patch("homeassistant.util.dt.utcnow", return_value=non_maching_time): with patch("homeassistant.util.dt.utcnow", return_value=non_matching_time):
hass.async_create_task(script_obj.async_run(context=Context())) hass.async_create_task(script_obj.async_run(context=Context()))
await asyncio.wait_for(wait_started_flag.wait(), 1) await asyncio.wait_for(wait_started_flag.wait(), 1)
assert script_obj.is_running assert script_obj.is_running
@ -1221,17 +1221,17 @@ async def test_wait_template_with_utcnow_no_match(hass):
timed_out = False timed_out = False
try: try:
non_maching_time = start_time.replace(hour=3) non_matching_time = start_time.replace(hour=3)
with patch("homeassistant.util.dt.utcnow", return_value=non_maching_time): with patch("homeassistant.util.dt.utcnow", return_value=non_matching_time):
hass.async_create_task(script_obj.async_run(context=Context())) hass.async_create_task(script_obj.async_run(context=Context()))
await asyncio.wait_for(wait_started_flag.wait(), 1) await asyncio.wait_for(wait_started_flag.wait(), 1)
assert script_obj.is_running assert script_obj.is_running
second_non_maching_time = start_time.replace(hour=4) second_non_matching_time = start_time.replace(hour=4)
with patch( with patch(
"homeassistant.util.dt.utcnow", return_value=second_non_maching_time "homeassistant.util.dt.utcnow", return_value=second_non_matching_time
): ):
async_fire_time_changed(hass, second_non_maching_time) async_fire_time_changed(hass, second_non_matching_time)
with timeout(0.1): with timeout(0.1):
await hass.async_block_till_done() await hass.async_block_till_done()

View File

@ -2499,7 +2499,7 @@ async def test_no_result_parsing(hass):
async def test_is_static_still_ast_evals(hass): async def test_is_static_still_ast_evals(hass):
"""Test is_static still convers to native type.""" """Test is_static still converts to native type."""
tpl = template.Template("[1, 2]", hass) tpl = template.Template("[1, 2]", hass)
assert tpl.is_static assert tpl.is_static
assert tpl.async_render() == [1, 2] assert tpl.async_render() == [1, 2]

View File

@ -1971,7 +1971,7 @@ async def test__async_current_entries_does_not_skip_ignore_non_user(hass, manage
assert len(mock_setup_entry.mock_calls) == 0 assert len(mock_setup_entry.mock_calls) == 0
async def test__async_current_entries_explict_skip_ignore(hass, manager): async def test__async_current_entries_explicit_skip_ignore(hass, manager):
"""Test that _async_current_entries can explicitly include ignore.""" """Test that _async_current_entries can explicitly include ignore."""
hass.config.components.add("comp") hass.config.components.add("comp")
entry = MockConfigEntry( entry = MockConfigEntry(
@ -2010,7 +2010,7 @@ async def test__async_current_entries_explict_skip_ignore(hass, manager):
assert p_entry.data == {"token": "supersecret"} assert p_entry.data == {"token": "supersecret"}
async def test__async_current_entries_explict_include_ignore(hass, manager): async def test__async_current_entries_explicit_include_ignore(hass, manager):
"""Test that _async_current_entries can explicitly include ignore.""" """Test that _async_current_entries can explicitly include ignore."""
hass.config.components.add("comp") hass.config.components.add("comp")
entry = MockConfigEntry( entry = MockConfigEntry(