-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into roborock_new_sensors
- Loading branch information
Showing
153 changed files
with
2,320 additions
and
1,458 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ env: | |
CACHE_VERSION: 5 | ||
PIP_CACHE_VERSION: 4 | ||
MYPY_CACHE_VERSION: 4 | ||
BLACK_CACHE_VERSION: 1 | ||
HA_SHORT_VERSION: "2023.10" | ||
DEFAULT_PYTHON: "3.11" | ||
ALL_PYTHON_VERSIONS: "['3.11']" | ||
|
@@ -55,6 +56,7 @@ env: | |
POSTGRESQL_VERSIONS: "['postgres:12.14','postgres:15.2']" | ||
PRE_COMMIT_CACHE: ~/.cache/pre-commit | ||
PIP_CACHE: /tmp/pip-cache | ||
BLACK_CACHE: /tmp/black-cache | ||
SQLALCHEMY_WARN_20: 1 | ||
PYTHONASYNCIODEBUG: 1 | ||
HASS_CI: 1 | ||
|
@@ -229,7 +231,7 @@ jobs: | |
check-latest: true | ||
- name: Restore base Python virtual environment | ||
id: cache-venv | ||
uses: actions/[email protected].1 | ||
uses: actions/[email protected].2 | ||
with: | ||
path: venv | ||
key: >- | ||
|
@@ -244,7 +246,7 @@ jobs: | |
pip install "$(cat requirements_test.txt | grep pre-commit)" | ||
- name: Restore pre-commit environment from cache | ||
id: cache-precommit | ||
uses: actions/[email protected].1 | ||
uses: actions/[email protected].2 | ||
with: | ||
path: ${{ env.PRE_COMMIT_CACHE }} | ||
lookup-only: true | ||
|
@@ -272,9 +274,16 @@ jobs: | |
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
check-latest: true | ||
- name: Generate partial black restore key | ||
id: generate-black-key | ||
run: | | ||
black_version=$(cat requirements_test_pre_commit.txt | grep black | cut -d '=' -f 3) | ||
echo "version=$black_version" >> $GITHUB_OUTPUT | ||
echo "key=black-${{ env.BLACK_CACHE_VERSION }}-$black_version-${{ | ||
env.HA_SHORT_VERSION }}-$(date -u '+%Y-%m-%dT%H:%M:%s')" >> $GITHUB_OUTPUT | ||
- name: Restore base Python virtual environment | ||
id: cache-venv | ||
uses: actions/cache/[email protected].1 | ||
uses: actions/cache/[email protected].2 | ||
with: | ||
path: venv | ||
fail-on-cache-miss: true | ||
|
@@ -283,21 +292,35 @@ jobs: | |
needs.info.outputs.pre-commit_cache_key }} | ||
- name: Restore pre-commit environment from cache | ||
id: cache-precommit | ||
uses: actions/cache/[email protected].1 | ||
uses: actions/cache/[email protected].2 | ||
with: | ||
path: ${{ env.PRE_COMMIT_CACHE }} | ||
fail-on-cache-miss: true | ||
key: >- | ||
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ | ||
needs.info.outputs.pre-commit_cache_key }} | ||
- name: Restore black cache | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ env.BLACK_CACHE }} | ||
key: >- | ||
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ | ||
steps.generate-black-key.outputs.key }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ steps.python.outputs.python-version }}-black-${{ | ||
env.BLACK_CACHE_VERSION }}-${{ steps.generate-black-key.outputs.version }}-${{ | ||
env.HA_SHORT_VERSION }}- | ||
- name: Run black (fully) | ||
if: needs.info.outputs.test_full_suite == 'true' | ||
env: | ||
BLACK_CACHE_DIR: ${{ env.BLACK_CACHE }} | ||
run: | | ||
. venv/bin/activate | ||
pre-commit run --hook-stage manual black --all-files --show-diff-on-failure | ||
- name: Run black (partially) | ||
if: needs.info.outputs.test_full_suite == 'false' | ||
shell: bash | ||
env: | ||
BLACK_CACHE_DIR: ${{ env.BLACK_CACHE }} | ||
run: | | ||
. venv/bin/activate | ||
shopt -s globstar | ||
|
@@ -320,7 +343,7 @@ jobs: | |
check-latest: true | ||
- name: Restore base Python virtual environment | ||
id: cache-venv | ||
uses: actions/cache/[email protected].1 | ||
uses: actions/cache/[email protected].2 | ||
with: | ||
path: venv | ||
fail-on-cache-miss: true | ||
|
@@ -329,7 +352,7 @@ jobs: | |
needs.info.outputs.pre-commit_cache_key }} | ||
- name: Restore pre-commit environment from cache | ||
id: cache-precommit | ||
uses: actions/cache/[email protected].1 | ||
uses: actions/cache/[email protected].2 | ||
with: | ||
path: ${{ env.PRE_COMMIT_CACHE }} | ||
fail-on-cache-miss: true | ||
|
@@ -369,7 +392,7 @@ jobs: | |
check-latest: true | ||
- name: Restore base Python virtual environment | ||
id: cache-venv | ||
uses: actions/cache/[email protected].1 | ||
uses: actions/cache/[email protected].2 | ||
with: | ||
path: venv | ||
fail-on-cache-miss: true | ||
|
@@ -378,7 +401,7 @@ jobs: | |
needs.info.outputs.pre-commit_cache_key }} | ||
- name: Restore pre-commit environment from cache | ||
id: cache-precommit | ||
uses: actions/cache/[email protected].1 | ||
uses: actions/cache/[email protected].2 | ||
with: | ||
path: ${{ env.PRE_COMMIT_CACHE }} | ||
fail-on-cache-miss: true | ||
|
@@ -468,7 +491,7 @@ jobs: | |
env.HA_SHORT_VERSION }}-$(date -u '+%Y-%m-%dT%H:%M:%s')" >> $GITHUB_OUTPUT | ||
- name: Restore base Python virtual environment | ||
id: cache-venv | ||
uses: actions/[email protected].1 | ||
uses: actions/[email protected].2 | ||
with: | ||
path: venv | ||
lookup-only: true | ||
|
@@ -477,7 +500,7 @@ jobs: | |
needs.info.outputs.python_cache_key }} | ||
- name: Restore pip wheel cache | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
uses: actions/[email protected].1 | ||
uses: actions/[email protected].2 | ||
with: | ||
path: ${{ env.PIP_CACHE }} | ||
key: >- | ||
|
@@ -531,7 +554,7 @@ jobs: | |
check-latest: true | ||
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment | ||
id: cache-venv | ||
uses: actions/cache/[email protected].1 | ||
uses: actions/cache/[email protected].2 | ||
with: | ||
path: venv | ||
fail-on-cache-miss: true | ||
|
@@ -563,7 +586,7 @@ jobs: | |
check-latest: true | ||
- name: Restore base Python virtual environment | ||
id: cache-venv | ||
uses: actions/cache/[email protected].1 | ||
uses: actions/cache/[email protected].2 | ||
with: | ||
path: venv | ||
fail-on-cache-miss: true | ||
|
@@ -596,7 +619,7 @@ jobs: | |
check-latest: true | ||
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment | ||
id: cache-venv | ||
uses: actions/cache/[email protected].1 | ||
uses: actions/cache/[email protected].2 | ||
with: | ||
path: venv | ||
fail-on-cache-miss: true | ||
|
@@ -647,15 +670,15 @@ jobs: | |
env.HA_SHORT_VERSION }}-$(date -u '+%Y-%m-%dT%H:%M:%s')" >> $GITHUB_OUTPUT | ||
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment | ||
id: cache-venv | ||
uses: actions/cache/[email protected].1 | ||
uses: actions/cache/[email protected].2 | ||
with: | ||
path: venv | ||
fail-on-cache-miss: true | ||
key: >- | ||
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ | ||
needs.info.outputs.python_cache_key }} | ||
- name: Restore mypy cache | ||
uses: actions/[email protected].1 | ||
uses: actions/[email protected].2 | ||
with: | ||
path: .mypy_cache | ||
key: >- | ||
|
@@ -722,7 +745,7 @@ jobs: | |
check-latest: true | ||
- name: Restore full Python ${{ matrix.python-version }} virtual environment | ||
id: cache-venv | ||
uses: actions/cache/[email protected].1 | ||
uses: actions/cache/[email protected].2 | ||
with: | ||
path: venv | ||
fail-on-cache-miss: true | ||
|
@@ -874,7 +897,7 @@ jobs: | |
check-latest: true | ||
- name: Restore full Python ${{ matrix.python-version }} virtual environment | ||
id: cache-venv | ||
uses: actions/cache/[email protected].1 | ||
uses: actions/cache/[email protected].2 | ||
with: | ||
path: venv | ||
fail-on-cache-miss: true | ||
|
@@ -998,7 +1021,7 @@ jobs: | |
check-latest: true | ||
- name: Restore full Python ${{ matrix.python-version }} virtual environment | ||
id: cache-venv | ||
uses: actions/cache/[email protected].1 | ||
uses: actions/cache/[email protected].2 | ||
with: | ||
path: venv | ||
fail-on-cache-miss: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"""Diagnostics support for Aladdin Connect.""" | ||
from __future__ import annotations | ||
|
||
from typing import Any | ||
|
||
from AIOAladdinConnect import AladdinConnectClient | ||
|
||
from homeassistant.components.diagnostics import async_redact_data | ||
from homeassistant.config_entries import ConfigEntry | ||
from homeassistant.core import HomeAssistant | ||
|
||
from .const import DOMAIN | ||
|
||
TO_REDACT = {"serial", "device_id"} | ||
|
||
|
||
async def async_get_config_entry_diagnostics( | ||
hass: HomeAssistant, | ||
config_entry: ConfigEntry, | ||
) -> dict[str, Any]: | ||
"""Return diagnostics for a config entry.""" | ||
|
||
acc: AladdinConnectClient = hass.data[DOMAIN][config_entry.entry_id] | ||
|
||
diagnostics_data = { | ||
"doors": async_redact_data(acc.doors, TO_REDACT), | ||
} | ||
|
||
return diagnostics_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.