Fix `can not` typo (#87254)

pull/87274/head
epenet 2023-02-03 11:37:16 +01:00 committed by GitHub
parent b8a1f87073
commit 810367b757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 35 additions and 35 deletions

View File

@ -155,7 +155,7 @@ class AxisNetworkDevice:
Called when config entry is updated.
This is a static method because a class method (bound method),
can not be used with weak references.
cannot be used with weak references.
"""
device: AxisNetworkDevice = hass.data[AXIS_DOMAIN][entry.entry_id]
device.api.config.host = device.host

View File

@ -168,7 +168,7 @@ class BuienradarCam(Camera):
# get lock, check iff loading, await notification if loading
async with self._condition:
# can not be tested - mocked http response returns immediately
# cannot be tested - mocked http response returns immediately
if self._loading:
_LOGGER.debug("already loading - waiting for notification")
await self._condition.wait()

View File

@ -12,7 +12,7 @@
}
},
"error": {
"resolve_failed": "This host can not be resolved",
"resolve_failed": "This host cannot be resolved",
"connection_timeout": "Timeout when connecting to this host",
"connection_refused": "Connection refused when connecting to host"
},

View File

@ -72,7 +72,7 @@ class LegacySubscriptionRepairFlow(RepairsFlow):
async def _async_wait_for_plan_change() -> None:
flow_manager = repairs_flow_manager(self.hass)
# We can not get here without a flow manager
# We cannot get here without a flow manager
assert flow_manager is not None
retries = 0

View File

@ -235,7 +235,7 @@ class DeconzGateway:
) -> None:
"""Handle signals of config entry being updated.
This is a static method because a class method (bound method), can not be used with weak references.
This is a static method because a class method (bound method), cannot be used with weak references.
Causes for this is either discovery updating host address or config entry options changing.
"""
gateway = get_gateway_from_config_entry(hass, entry)

View File

@ -36,7 +36,7 @@ from .const import DISPATCH_DETECTION, DOMAIN
class UnableToConnect(HomeAssistantError):
"""Exception to indicate that we can not connect to device."""
"""Exception to indicate that we cannot connect to device."""
PLATFORMS = [

View File

@ -310,7 +310,7 @@ class GeniusZone(GeniusEntity):
# pylint: disable=protected-access
if mode == "footprint" and not self._zone._has_pir:
raise TypeError(
f"'{self.entity_id}' can not support footprint mode (it has no PIR)"
f"'{self.entity_id}' cannot support footprint mode (it has no PIR)"
)
await self._zone.set_mode(mode)

View File

@ -177,7 +177,7 @@ class GroupedHueLight(HueBaseEntity, LightEntity):
if flash is not None:
await self.async_set_flash(flash)
# flash can not be sent with other commands at the same time
# flash cannot be sent with other commands at the same time
return
await self.bridge.async_request_call(

View File

@ -208,7 +208,7 @@ class HueLight(HueBaseEntity, LightEntity):
if flash is not None:
await self.async_set_flash(flash)
# flash can not be sent with other commands at the same time or result will be flaky
# flash cannot be sent with other commands at the same time or result will be flaky
# Hue's default behavior is that a light returns to its previous state for short
# flash (identify) and the light is kept turned on for long flash (breathe effect)
# Why is this flash alert/effect hidden in the turn_on/off commands ?
@ -232,7 +232,7 @@ class HueLight(HueBaseEntity, LightEntity):
if flash is not None:
await self.async_set_flash(flash)
# flash can not be sent with other commands at the same time or result will be flaky
# flash cannot be sent with other commands at the same time or result will be flaky
# Hue's default behavior is that a light returns to its previous state for short
# flash (identify) and the light is kept turned on for long flash (breathe effect)
return

View File

@ -295,7 +295,7 @@ def _generate_event_to_json(conf: dict) -> Callable[[Event], dict[str, Any] | No
key = f"{key}_"
# Prevent column data errors in influxDB.
# For each value we try to cast it as float
# But if we can not do it we store the value
# But if we cannot do it we store the value
# as string add "_str" postfix to the field key
try:
json[INFLUX_CONF_FIELDS][key] = float(value)

View File

@ -87,7 +87,7 @@ def struct_validator(config: dict[str, Any]) -> dict[str, Any]:
raise vol.Invalid(error)
if not structure:
error = (
f"Error in sensor {name}. The `{CONF_STRUCTURE}` field can not be empty"
f"Error in sensor {name}. The `{CONF_STRUCTURE}` field cannot be empty"
)
raise vol.Invalid(error)
try:

View File

@ -108,7 +108,7 @@ def valid_publish_topic(topic: Any) -> str:
"""Validate that we can publish using this MQTT topic."""
validated_topic = valid_topic(topic)
if "+" in validated_topic or "#" in validated_topic:
raise vol.Invalid("Wildcards can not be used in topic names")
raise vol.Invalid("Wildcards cannot be used in topic names")
return validated_topic

View File

@ -26,7 +26,7 @@ class ONVIFBaseEntity(Entity):
MAC address is not always available, and given the number
of non-conformant ONVIF devices we have historically supported,
we can not guarantee serial number either. Due to this, we have
we cannot guarantee serial number either. Due to this, we have
adopted an either/or approach in the config entry setup, and can
guarantee that one or the other will be populated.
See: https://github.com/home-assistant/core/issues/35883

View File

@ -115,7 +115,7 @@ class RaspyRFMSwitch(SwitchEntity):
@property
def assumed_state(self):
"""Return True when the current state can not be queried."""
"""Return True when the current state cannot be queried."""
return True
@property

View File

@ -770,7 +770,7 @@ class Recorder(threading.Thread):
_LOGGER.warning(
"Database queue backlog reached more than 90% of maximum queue "
"length while waiting for backup to finish; recorder will now "
"resume writing to database. The backup can not be trusted and "
"resume writing to database. The backup cannot be trusted and "
"must be restarted"
)
task.queue_overflow = True

View File

@ -224,7 +224,7 @@ def _normalize_states(
hass.data[WARN_UNSUPPORTED_UNIT].add(entity_id)
_LOGGER.warning(
(
"The unit of %s (%s) can not be converted to the unit of"
"The unit of %s (%s) cannot be converted to the unit of"
" previously compiled statistics (%s). Generation of long term"
" statistics will be suppressed unless the unit changes back to"
" %s or a compatible unit. Go to %s to fix this"
@ -475,7 +475,7 @@ def _compile_statistics( # noqa: C901
hass.data[WARN_UNSTABLE_UNIT].add(entity_id)
_LOGGER.warning(
(
"The unit of %s (%s) can not be converted to the unit of"
"The unit of %s (%s) cannot be converted to the unit of"
" previously compiled statistics (%s). Generation of long"
" term statistics will be suppressed unless the unit"
" changes back to %s or a compatible unit. Go to %s to fix"

View File

@ -345,7 +345,7 @@ class SoundTouchMediaPlayer(MediaPlayerEntity):
"""
Remove slave(s) from and existing zone (multi-room).
Zone must already exist and slaves array can not be empty.
Zone must already exist and slaves array cannot be empty.
Note: If removing last slave, the zone will be deleted and you'll have
to create a new one. You will not be able to add a new slave anymore
@ -370,7 +370,7 @@ class SoundTouchMediaPlayer(MediaPlayerEntity):
"""
Add slave(s) to and existing zone (multi-room).
Zone must already exist and slaves array can not be empty.
Zone must already exist and slaves array cannot be empty.
:param slaves:slaves to add

View File

@ -131,7 +131,7 @@ def setup(hass: HomeAssistant, config: ConfigType) -> bool:
if key in out_event["fields"]:
key = f"{key}_"
# For each value we try to cast it as float
# But if we can not do it we store the value
# But if we cannot do it we store the value
# as string
try:
out_event["fields"][key] = float(value)

View File

@ -21,7 +21,7 @@
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
"unknown": "[%key:common::config_flow::error::unknown%]",
"bulb_time_out": "Can not connect to the bulb. Maybe the bulb is offline or a wrong IP was entered. Please turn on the light and try again!",
"no_wiz_light": "The bulb can not be connected via WiZ Platform integration.",
"no_wiz_light": "The bulb cannot be connected via WiZ Platform integration.",
"no_ip": "Not a valid IP address."
},
"abort": {

View File

@ -123,7 +123,7 @@ def setup(hass: HomeAssistant, config: ConfigType) -> bool:
for key, value in state.attributes.items():
# For each value we try to cast it as float
# But if we can not do it we store the value
# But if we cannot do it we store the value
# as string
attribute_id = f"{entity_id}/{key}"
try:

View File

@ -207,7 +207,7 @@ class RequiredParameterMissing(HomeAssistantError):
class DependencyError(HomeAssistantError):
"""Raised when dependencies can not be setup."""
"""Raised when dependencies cannot be setup."""
def __init__(self, failed_dependencies: list[str]) -> None:
"""Initialize error."""

View File

@ -303,7 +303,7 @@ def entity_id_or_uuid(value: Any) -> str:
def _entity_ids(value: str | list, allow_uuid: bool) -> list[str]:
"""Help validate entity IDs or UUIDs."""
if value is None:
raise vol.Invalid("Entity IDs can not be None")
raise vol.Invalid("Entity IDs cannot be None")
if isinstance(value, str):
value = [ent_id.strip() for ent_id in value.split(",")]

View File

@ -233,6 +233,6 @@ async def test_retries_after_error(aioclient_mock, hass, hass_client):
resp_2 = await client.get("/api/camera_proxy/camera.buienradar_51_5288505_400216")
assert aioclient_mock.call_count == 1
# Binary text can not be added as body to `aioclient_mock.get(text=...)`,
# Binary text cannot be added as body to `aioclient_mock.get(text=...)`,
# while `resp.read()` returns bytes, encode the value.
assert (await resp_2.read()) == b"DEADBEEF"

View File

@ -29,7 +29,7 @@ async def test_config_flow(hass):
async def test_already_configured(hass):
"""Test we can not add a second config flow."""
"""Test we cannot add a second config flow."""
MockConfigEntry(domain=DOMAIN).add_to_hass(hass)
result = await hass.config_entries.flow.async_init(

View File

@ -213,7 +213,7 @@ async def test_config_sensor(hass, mock_modbus):
},
]
},
f"Error in sensor {TEST_ENTITY_NAME}. The `structure` field can not be empty",
f"Error in sensor {TEST_ENTITY_NAME}. The `structure` field cannot be empty",
),
(
{

View File

@ -1944,7 +1944,7 @@ def test_compile_hourly_statistics_changing_units_1(
):
"""Test compiling hourly statistics where units change from one hour to the next.
This tests the case where the recorder can not convert between the units.
This tests the case where the recorder cannot convert between the units.
"""
zero = dt_util.utcnow()
hass = hass_recorder()
@ -1970,7 +1970,7 @@ def test_compile_hourly_statistics_changing_units_1(
do_adhoc_statistics(hass, start=zero)
wait_recording_done(hass)
assert "can not be converted to the unit of previously" not in caplog.text
assert "cannot be converted to the unit of previously" not in caplog.text
statistic_ids = list_statistic_ids(hass)
assert statistic_ids == [
{
@ -2003,7 +2003,7 @@ def test_compile_hourly_statistics_changing_units_1(
do_adhoc_statistics(hass, start=zero + timedelta(minutes=10))
wait_recording_done(hass)
assert (
f"The unit of sensor.test1 ({state_unit2}) can not be converted to the unit of "
f"The unit of sensor.test1 ({state_unit2}) cannot be converted to the unit of "
f"previously compiled statistics ({state_unit})" in caplog.text
)
statistic_ids = list_statistic_ids(hass)
@ -2388,7 +2388,7 @@ def test_compile_hourly_statistics_equivalent_units_1(
do_adhoc_statistics(hass, start=zero)
wait_recording_done(hass)
assert "can not be converted to the unit of previously" not in caplog.text
assert "cannot be converted to the unit of previously" not in caplog.text
statistic_ids = list_statistic_ids(hass)
assert statistic_ids == [
{
@ -3472,7 +3472,7 @@ async def test_validate_unit_change_convertible(
"""Test validate_statistics.
This tests what happens if a sensor is first recorded in a unit which supports unit
conversion, and the unit is then changed to a unit which can and can not be
conversion, and the unit is then changed to a unit which can and cannot be
converted to the original unit.
The test also asserts that the sensor's device class is ignored.
@ -3671,7 +3671,7 @@ async def test_validate_statistics_unit_change_no_device_class(
"""Test validate_statistics.
This tests what happens if a sensor is first recorded in a unit which supports unit
conversion, and the unit is then changed to a unit which can and can not be
conversion, and the unit is then changed to a unit which can and cannot be
converted to the original unit.
"""
id = 1

View File

@ -22,7 +22,7 @@ from homeassistant.util.json import (
# Test data that can be saved as JSON
TEST_JSON_A = {"a": 1, "B": "two"}
TEST_JSON_B = {"a": "one", "B": 2}
# Test data that can not be loaded as JSON
# Test data that cannot be loaded as JSON
TEST_BAD_SERIALIED = "THIS IS NOT JSON\n"
TMP_DIR = None