Skip to content

Commit

Permalink
Merge pull request #2733 from alandtse/dev
Browse files Browse the repository at this point in the history
chore: release 2024-12-08
  • Loading branch information
alandtse authored Dec 8, 2024
2 parents 9fb4691 + d63113e commit 5e708b9
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/

RUN pipx install poetry
WORKDIR /workspace
COPY pyproject.toml poetry.lock ./
# RUN poetry update
COPY pyproject.toml poetry.lock .pre-commit-config.yaml ./
RUN poetry update

# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
# COPY requirements.txt /tmp/pip-tmp/
Expand Down
9 changes: 7 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
"vscode": {
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
"extensions": ["ms-python.python", "ms-python.vscode-pylance"]
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-azuretools.vscode-docker",
"github.vscode-github-actions"
]
}
},

Expand All @@ -29,7 +34,7 @@

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",

"postCreateCommand": "poetry update && poetry run pre-commit install",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"runArgs": ["--userns=keep-id"],
"containerUser": "vscode",
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repos:
- id: check-yaml
exclude: ^recipes/.*
repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0

# --- Commit msg checks ---
- hooks:
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"python.testing.pytestArgs": [],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
10 changes: 10 additions & 0 deletions custom_components/alexa_media/alexa_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ def is_local(appliance: dict[str, Any]) -> bool:
There is probably a better way to prevent that, but this works.
"""

if appliance.get("manufacturerName") == "t0bst4r":
# Home-Assistant-Matter-Hub is a new add-on (2024-10-27) which exposes selected
# HA entities to Alexa as Matter devices connected locally via Amazon Echo.
# "connectedVia" is not None so they need to be ignored to prevent duplicating them back into HA.
_LOGGER.debug(
'alexa_entity is_local: Return False for Home-Assistant-Matter-Hub manufacturer: "%s"',
appliance.get("manufacturerName"),
)
return False

if appliance.get("connectedVia"):
# connectedVia is a flag that determines which Echo devices holds the connection. Its blank for
# skill derived devices and includes an Echo name for zigbee and local devices.
Expand Down
50 changes: 25 additions & 25 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ black = { version = ">=21.12b0", allow-prereleases = true }
pre-commit = ">=2.11.1"
prospector = { extras = ["with_all"], version = ">=1.8.3" }
pytest-cov = "*"
safety = ">1.8.7"
safety = ">=3.2.9"
pytest = ">6.2.2"
codespell = ">2.0.0"
yamllint = ">1.26.0"
Expand Down

0 comments on commit 5e708b9

Please sign in to comment.