Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions homeassistant/components/discord/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ async def async_send_message(self, message, **kwargs):
images.append(image)
else:
_LOGGER.warning("Image not found: %s", image)

# pylint: disable=unused-variable
@discord_bot.event
async def on_ready():
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/group/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def _mean_int(*args):

def _mean_tuple(*args):
"""Return the mean values along the columns of the supplied values."""
return tuple(sum(l) / len(l) for l in zip(*args))
return tuple(sum(x) / len(x) for x in zip(*args))


def _reduce_attribute(
Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/streamlabswater/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ def setup(hass, config):
"Streamlabs Water Monitor auto-detected location_id=%s", location_id
)
else:
location = next((l for l in locations if location_id == l["locationId"]), None)
location = next(
(loc for loc in locations if location_id == loc["locationId"]), None
)
if location is None:
_LOGGER.error("Supplied location_id is invalid")
return False
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/wunderlist/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def create_task(self, call):
def _list_by_name(self, name):
"""Return a list ID by name."""
lists = self._client.get_lists()
tmp = [l for l in lists if l["title"] == name]
tmp = [lst for lst in lists if lst["title"] == name]
if tmp:
return tmp[0]["id"]
return None
2 changes: 1 addition & 1 deletion homeassistant/components/zha/core/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def mean_int(*args):

def mean_tuple(*args):
"""Return the mean values along the columns of the supplied values."""
return tuple(sum(l) / len(l) for l in zip(*args))
return tuple(sum(x) / len(x) for x in zip(*args))


def reduce_attribute(
Expand Down
2 changes: 1 addition & 1 deletion script/scaffold/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def print_relevant_docs(template: str, info: Info) -> None:
print()

print(
f"The next step is to look at the files and deal with all areas marked as TODO."
"The next step is to look at the files and deal with all areas marked as TODO."
)

if "extra" in data:
Expand Down
4 changes: 2 additions & 2 deletions tests/components/geo_json_events/test_geo_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ async def test_setup_race_condition(hass):

# Set up some mock feed entries for this test.
mock_entry_1 = _generate_mock_feed_entry("1234", "Title 1", 15.5, (-31.0, 150.0))
delete_signal = f"geo_json_events_delete_1234"
update_signal = f"geo_json_events_update_1234"
delete_signal = "geo_json_events_delete_1234"
update_signal = "geo_json_events_update_1234"

# Patching 'utcnow' to gain more control over the timed update.
utcnow = dt_util.utcnow()
Expand Down
2 changes: 1 addition & 1 deletion tests/components/huawei_lte/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ async def test_success(hass, login_requests_mock):
login_requests_mock.request(
ANY,
f"{FIXTURE_USER_INPUT[CONF_URL]}api/user/login",
text=f"<response>OK</response>",
text="<response>OK</response>",
)
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}, data=FIXTURE_USER_INPUT
Expand Down
4 changes: 2 additions & 2 deletions tests/components/minecraft_server/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ def __init__(self):

USER_INPUT_PORT_TOO_SMALL = {
CONF_NAME: DEFAULT_NAME,
CONF_HOST: f"mc.dummyserver.com:1023",
CONF_HOST: "mc.dummyserver.com:1023",
}

USER_INPUT_PORT_TOO_LARGE = {
CONF_NAME: DEFAULT_NAME,
CONF_HOST: f"mc.dummyserver.com:65536",
CONF_HOST: "mc.dummyserver.com:65536",
}

SRV_RECORDS = asyncio.Future()
Expand Down
4 changes: 2 additions & 2 deletions tests/components/ssdp/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def test_scan_not_all_present(hass, aioclient_mock):
"""Test match fails if some specified attributes are not present."""
aioclient_mock.get(
"http://1.1.1.1",
text=f"""
text="""
<root>
<device>
<deviceType>Paulus</deviceType>
Expand Down Expand Up @@ -96,7 +96,7 @@ async def test_scan_not_all_match(hass, aioclient_mock):
"""Test match fails if some specified attribute values differ."""
aioclient_mock.get(
"http://1.1.1.1",
text=f"""
text="""
<root>
<device>
<deviceType>Paulus</deviceType>
Expand Down
2 changes: 1 addition & 1 deletion tests/components/system_log/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ async def test_remove_older_logs(hass, hass_client):

def log_msg(nr=2):
"""Log an error at same line."""
_LOGGER.error(f"error message %s", nr)
_LOGGER.error("error message %s", nr)


async def test_dedup_logs(hass, hass_client):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ def init(empty=False):
if empty
else {
"arm_code": MockAlarm(
name=f"Alarm arm code",
name="Alarm arm code",
code_arm_required=True,
unique_id="unique_arm_code",
),
"no_arm_code": MockAlarm(
name=f"Alarm no arm code",
name="Alarm no arm code",
code_arm_required=False,
unique_id="unique_no_arm_code",
),
Expand Down
16 changes: 8 additions & 8 deletions tests/testing_config/custom_components/test/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,29 @@ def init(empty=False):
if empty
else [
MockCover(
name=f"Simple cover",
name="Simple cover",
is_on=True,
unique_id=f"unique_cover",
unique_id="unique_cover",
supports_tilt=False,
),
MockCover(
name=f"Set position cover",
name="Set position cover",
is_on=True,
unique_id=f"unique_set_pos_cover",
unique_id="unique_set_pos_cover",
current_cover_position=50,
supports_tilt=False,
),
MockCover(
name=f"Set tilt position cover",
name="Set tilt position cover",
is_on=True,
unique_id=f"unique_set_pos_tilt_cover",
unique_id="unique_set_pos_tilt_cover",
current_cover_tilt_position=50,
supports_tilt=True,
),
MockCover(
name=f"Tilt cover",
name="Tilt cover",
is_on=True,
unique_id=f"unique_tilt_cover",
unique_id="unique_tilt_cover",
supports_tilt=True,
),
]
Expand Down
4 changes: 2 additions & 2 deletions tests/testing_config/custom_components/test/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ def init(empty=False):
if empty
else {
"support_open": MockLock(
name=f"Support open Lock",
name="Support open Lock",
is_locked=True,
supported_features=SUPPORT_OPEN,
unique_id="unique_support_open",
),
"no_support_open": MockLock(
name=f"No support open Lock",
name="No support open Lock",
is_locked=True,
supported_features=0,
unique_id="unique_no_support_open",
Expand Down