Skip to content

Commit

Permalink
2022.9.6 (#78916)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Sep 22, 2022
2 parents a411cd9 + 7be5fde commit b4f1683
Show file tree
Hide file tree
Showing 85 changed files with 5,420 additions and 4,368 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ env:
CACHE_VERSION: 1
PIP_CACHE_VERSION: 1
HA_SHORT_VERSION: 2022.9
DEFAULT_PYTHON: 3.9
DEFAULT_PYTHON: 3.9.14
ALL_PYTHON_VERSIONS: "['3.9.14', '3.10.7']"
PRE_COMMIT_CACHE: ~/.cache/pre-commit
PIP_CACHE: /tmp/pip-cache
SQLALCHEMY_WARN_20: 1
Expand All @@ -46,6 +47,7 @@ jobs:
pre-commit_cache_key: ${{ steps.generate_pre-commit_cache_key.outputs.key }}
python_cache_key: ${{ steps.generate_python_cache_key.outputs.key }}
requirements: ${{ steps.core.outputs.requirements }}
python_versions: ${{ steps.info.outputs.python_versions }}
test_full_suite: ${{ steps.info.outputs.test_full_suite }}
test_group_count: ${{ steps.info.outputs.test_group_count }}
test_groups: ${{ steps.info.outputs.test_groups }}
Expand Down Expand Up @@ -143,6 +145,8 @@ jobs:
fi
# Output & sent to GitHub Actions
echo "python_versions: ${ALL_PYTHON_VERSIONS}"
echo "::set-output name=python_versions::${ALL_PYTHON_VERSIONS}"
echo "test_full_suite: ${test_full_suite}"
echo "::set-output name=test_full_suite::${test_full_suite}"
echo "integrations_glob: ${integrations_glob}"
Expand Down Expand Up @@ -463,7 +467,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
python-version: ["3.9", "3.10"]
python-version: ${{ fromJSON(needs.info.outputs.python_versions) }}
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
Expand All @@ -483,18 +487,18 @@ jobs:
with:
path: venv
key: >-
${{ runner.os }}-${{ matrix.python-version }}-${{
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Restore pip wheel cache
if: steps.cache-venv.outputs.cache-hit != 'true'
uses: actions/[email protected]
with:
path: ${{ env.PIP_CACHE }}
key: >-
${{ runner.os }}-${{ matrix.python-version }}-${{
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
steps.generate-pip-key.outputs.key }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-${{ env.PIP_CACHE_VERSION }}-${{ env.HA_SHORT_VERSION }}-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-pip-${{ env.PIP_CACHE_VERSION }}-${{ env.HA_SHORT_VERSION }}-
- name: Install additional OS dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand Down Expand Up @@ -541,7 +545,7 @@ jobs:
with:
path: venv
key: >-
${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-${{
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -573,7 +577,7 @@ jobs:
with:
path: venv
key: >-
${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-${{
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -606,7 +610,7 @@ jobs:
with:
path: venv
key: >-
${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-${{
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -650,7 +654,7 @@ jobs:
with:
path: venv
key: >-
${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-${{
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -682,7 +686,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
python-version: ${{ fromJson(needs.info.outputs.python_versions) }}
name: Run pip check ${{ matrix.python-version }}
steps:
- name: Check out code from GitHub
Expand All @@ -698,7 +702,7 @@ jobs:
with:
path: venv
key: >-
${{ runner.os }}-${{ matrix.python-version }}-${{
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -729,7 +733,7 @@ jobs:
fail-fast: false
matrix:
group: ${{ fromJson(needs.info.outputs.test_groups) }}
python-version: ["3.9", "3.10"]
python-version: ${{ fromJson(needs.info.outputs.python_versions) }}
name: >-
Run tests Python ${{ matrix.python-version }} (${{ matrix.group }})
steps:
Expand All @@ -751,7 +755,7 @@ jobs:
uses: actions/[email protected]
with:
path: venv
key: ${{ runner.os }}-${{ matrix.python-version }}-${{
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/bluetooth/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class AdapterDetails(TypedDict, total=False):

address: str
sw_version: str
hw_version: str
hw_version: str | None
passive_scan: bool


Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/bluetooth/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
APPLE_START_BYTES_WANTED: Final = {APPLE_DEVICE_ID_START_BYTE, APPLE_HOMEKIT_START_BYTE}

RSSI_SWITCH_THRESHOLD = 6
NO_RSSI_VALUE = -1000

_LOGGER = logging.getLogger(__name__)

Expand All @@ -83,7 +84,7 @@ def _prefer_previous_adv(
STALE_ADVERTISEMENT_SECONDS,
)
return False
if new.device.rssi - RSSI_SWITCH_THRESHOLD > old.device.rssi:
if new.device.rssi - RSSI_SWITCH_THRESHOLD > (old.device.rssi or NO_RSSI_VALUE):
# If new advertisement is RSSI_SWITCH_THRESHOLD more, the new one is preferred
if new.source != old.source:
_LOGGER.debug(
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/bluetooth/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"bleak-retry-connector==1.17.1",
"bluetooth-adapters==0.4.1",
"bluetooth-auto-recovery==0.3.3",
"dbus-fast==1.4.0"
"dbus-fast==1.5.1"
],
"codeowners": ["@bdraco"],
"config_flow": true,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/bluetooth/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async def async_get_bluetooth_adapters() -> dict[str, AdapterDetails]:
adapters[adapter] = AdapterDetails(
address=adapter1["Address"],
sw_version=adapter1["Name"], # This is actually the BlueZ version
hw_version=adapter1["Modalias"],
hw_version=adapter1.get("Modalias"),
passive_scan="org.bluez.AdvertisementMonitorManager1" in details,
)
return adapters
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/bmw_connected_drive/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"domain": "bmw_connected_drive",
"name": "BMW Connected Drive",
"documentation": "https://www.home-assistant.io/integrations/bmw_connected_drive",
"requirements": ["bimmer_connected==0.10.2"],
"requirements": ["bimmer_connected==0.10.4"],
"codeowners": ["@gerard33", "@rikroe"],
"config_flow": true,
"iot_class": "cloud_polling",
Expand Down
6 changes: 5 additions & 1 deletion homeassistant/components/bond/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Config flow for Bond integration."""
from __future__ import annotations

import asyncio
import contextlib
from http import HTTPStatus
import logging
Expand Down Expand Up @@ -83,7 +84,10 @@ async def _async_try_automatic_configure(self) -> None:
instead ask them to manually enter the token.
"""
host = self._discovered[CONF_HOST]
if not (token := await async_get_token(self.hass, host)):
try:
if not (token := await async_get_token(self.hass, host)):
return
except asyncio.TimeoutError:
return

self._discovered[CONF_ACCESS_TOKEN] = token
Expand Down
2 changes: 0 additions & 2 deletions homeassistant/components/google_assistant/trait.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,6 @@ def query_attributes(self):
brightness = self.state.attributes.get(light.ATTR_BRIGHTNESS)
if brightness is not None:
response["brightness"] = round(100 * (brightness / 255))
else:
response["brightness"] = 0

return response

Expand Down
10 changes: 8 additions & 2 deletions homeassistant/components/guardian/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ def _async_update_from_latest_data(self) -> None:
)

async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn the valve off (closed)."""
"""Turn the switch off."""
if not self._attr_is_on:
return

try:
async with self._client:
await self._client.valve.close()
Expand All @@ -103,7 +106,10 @@ async def async_turn_off(self, **kwargs: Any) -> None:
self.async_write_ha_state()

async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the valve on (open)."""
"""Turn the switch on."""
if self._attr_is_on:
return

try:
async with self._client:
await self._client.valve.open()
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/homekit_controller/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "HomeKit Controller",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/homekit_controller",
"requirements": ["aiohomekit==1.5.9"],
"requirements": ["aiohomekit==1.5.12"],
"zeroconf": ["_hap._tcp.local.", "_hap._udp.local."],
"bluetooth": [{ "manufacturer_id": 76, "manufacturer_data_start": [6] }],
"dependencies": ["bluetooth", "zeroconf"],
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/imap/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"domain": "imap",
"name": "IMAP",
"documentation": "https://www.home-assistant.io/integrations/imap",
"requirements": ["aioimaplib==1.0.0"],
"requirements": ["aioimaplib==1.0.1"],
"codeowners": [],
"iot_class": "cloud_push",
"loggers": ["aioimaplib"]
Expand Down
Loading

0 comments on commit b4f1683

Please sign in to comment.