Skip to content

Commit 47c423b

Browse files
committed
Merge master into fix/search-truncation-indicator
Resolved conflicts by combining: - PR #394: domain_filter before fuzzy search (filter entities BEFORE search) - PR #393: truncation indicator with tuple unpacking (return total count) Removed obsolete post-filtering code from commit 6949325 since domain filtering now happens before search, making post-filtering unnecessary.
2 parents 6949325 + 2cc7536 commit 47c423b

14 files changed

Lines changed: 667 additions & 111 deletions

File tree

.github/workflows/renovate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
uses: actions/checkout@v6
3232

3333
- name: Self-hosted Renovate
34-
uses: renovatebot/github-action@v44.2.2
34+
uses: renovatebot/github-action@v44.2.3
3535
with:
3636
configurationFile: renovate.json
3737
token: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,110 @@
22

33
<!-- version list -->
44

5+
## [Unreleased]
6+
7+
### BREAKING CHANGES
8+
9+
- **Label Management Redesign** ([#396](https://github.com/homeassistant-ai/ha-mcp/issues/396))
10+
- **Removed:** `ha_assign_label` tool
11+
- **Added:** `ha_manage_entity_labels` tool with three operations:
12+
- `add`: Append labels to existing labels (new functionality)
13+
- `remove`: Remove specific labels, preserve others (new functionality)
14+
- `set`: Replace all labels (same as old `ha_assign_label` behavior)
15+
- **New:** Bulk operations support - pass list of entity_ids
16+
- **Fixed:** Entity registry corruption from repeated operations
17+
18+
**Migration Guide:**
19+
```python
20+
# Old way (ha_assign_label)
21+
ha_assign_label(entity_id="light.bedroom", labels=["label1", "label2"])
22+
23+
# New way (same behavior with "set")
24+
ha_manage_entity_labels(entity_id="light.bedroom", operation="set", labels=["label1", "label2"])
25+
26+
# New functionality - add labels
27+
ha_manage_entity_labels(entity_id="light.bedroom", operation="add", labels=["new_label"])
28+
29+
# New functionality - remove labels
30+
ha_manage_entity_labels(entity_id="light.bedroom", operation="remove", labels=["old_label"])
31+
32+
# New functionality - bulk operations
33+
ha_manage_entity_labels(
34+
entity_id=["light.bedroom", "light.kitchen", "switch.porch"],
35+
operation="add",
36+
labels=["outdoor"],
37+
parallel=True
38+
)
39+
```
40+
41+
## v5.1.0 (2026-01-06)
42+
43+
### Bug Fixes
44+
45+
- Preserve 'conditions' (plural) in choose/if blocks (#388)
46+
([#388](https://github.com/homeassistant-ai/ha-mcp/pull/388),
47+
[`89c082b`](https://github.com/homeassistant-ai/ha-mcp/commit/89c082b6aba1d92ebd4a5678a6d9de1f75d70830))
48+
49+
- Resolve WebSocket race conditions and improve error handling (#378)
50+
([#378](https://github.com/homeassistant-ai/ha-mcp/pull/378),
51+
[`521e3b0`](https://github.com/homeassistant-ai/ha-mcp/commit/521e3b01ff0108ed78a5be3b614e17fc50321c11))
52+
53+
### Build System
54+
55+
- **deps**: Bump astral-sh/uv (#390) ([#390](https://github.com/homeassistant-ai/ha-mcp/pull/390),
56+
[`b218dc8`](https://github.com/homeassistant-ai/ha-mcp/commit/b218dc853f2930ea88faaff15f4882b26c4eae2c))
57+
58+
### Chores
59+
60+
- **addon**: Sync changelog for Home Assistant add-on [skip ci]
61+
([`b62d25b`](https://github.com/homeassistant-ai/ha-mcp/commit/b62d25b7efad05d3c75b530260773ddd0a90d45b))
62+
63+
### Continuous Integration
64+
65+
- **deps**: Bump renovatebot/github-action from 44.2.1 to 44.2.2 (#372)
66+
([#372](https://github.com/homeassistant-ai/ha-mcp/pull/372),
67+
[`6d7b085`](https://github.com/homeassistant-ai/ha-mcp/commit/6d7b08501a18a5170bd63d706e86ec6064733052))
68+
69+
- **deps**: Bump renovatebot/github-action from 44.2.2 to 44.2.3 (#389)
70+
([#389](https://github.com/homeassistant-ai/ha-mcp/pull/389),
71+
[`84102d2`](https://github.com/homeassistant-ai/ha-mcp/commit/84102d2515ff64ff90899c8abff2b9334d675dc2))
72+
73+
### Documentation
74+
75+
- Add PR execution philosophy and final reporting guidelines
76+
([`b6a5473`](https://github.com/homeassistant-ai/ha-mcp/commit/b6a547365ad03cf1518af56a757b780b2bfc880c))
77+
78+
- Add sponsor badge, community section, and star history
79+
([`2fe299b`](https://github.com/homeassistant-ai/ha-mcp/commit/2fe299bb8815a08fd488489ab151454005b3c7d0))
80+
81+
- Add workflow for implementing improvements in separate PRs
82+
([`dd6aafc`](https://github.com/homeassistant-ai/ha-mcp/commit/dd6aafc62055c9cd92fe71fa68929b2f6c00fbcc))
83+
84+
- Change sponsor badge to blueviolet
85+
([`1a1102f`](https://github.com/homeassistant-ai/ha-mcp/commit/1a1102f8694d4127eeb7af6e9cbaaea419d36646))
86+
87+
- Change sponsor emoji from heart to coffee
88+
([`8f026df`](https://github.com/homeassistant-ai/ha-mcp/commit/8f026dfedf76de7d3788a42ae444c0bb6de64fd2))
89+
90+
- Clarify PR workflow with explicit comment checking
91+
([`d9d6b35`](https://github.com/homeassistant-ai/ha-mcp/commit/d9d6b354dec479d2c0e9a2f327442cd6c5f9d9d7))
92+
93+
- Simplify ha_call_service docstring (117→34 lines) (#379)
94+
([#379](https://github.com/homeassistant-ai/ha-mcp/pull/379),
95+
[`decdd92`](https://github.com/homeassistant-ai/ha-mcp/commit/decdd927e3bff0ae93c148070010949bec273513))
96+
97+
- Update sponsor badge text and color
98+
([`939a09e`](https://github.com/homeassistant-ai/ha-mcp/commit/939a09eb67e7797d561090fe26a3db8279764b0d))
99+
100+
### Features
101+
102+
- Update issue-to-pr-resolver agent with PR execution philosophy
103+
([`075b64a`](https://github.com/homeassistant-ai/ha-mcp/commit/075b64aa25010e3482aeda2e7ccc0a13f1e166e1))
104+
105+
- Update pr-checker agent with PR execution philosophy
106+
([`80bf518`](https://github.com/homeassistant-ai/ha-mcp/commit/80bf51896f4738f910ac68ab193e55bd19e1b393))
107+
108+
5109
## v5.0.6 (2025-12-28)
6110

7111
### Bug Fixes

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Python 3.13 - Security support until 2029-10
44
# uv version pinned - Dependabot will create PRs for updates
55

6-
FROM ghcr.io/astral-sh/uv:0.9.18-python3.13-bookworm-slim
6+
FROM ghcr.io/astral-sh/uv:0.9.21-python3.13-bookworm-slim
77

88
LABEL org.opencontainers.image.title="Home Assistant MCP Server" \
99
org.opencontainers.image.description="AI assistant integration for Home Assistant via Model Context Protocol" \

homeassistant-addon/CHANGELOG.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,74 @@
22

33
<!-- version list -->
44

5+
## v5.1.0 (2026-01-06)
6+
7+
### Bug Fixes
8+
9+
- Preserve 'conditions' (plural) in choose/if blocks (#388)
10+
([#388](https://github.com/homeassistant-ai/ha-mcp/pull/388),
11+
[`89c082b`](https://github.com/homeassistant-ai/ha-mcp/commit/89c082b6aba1d92ebd4a5678a6d9de1f75d70830))
12+
13+
- Resolve WebSocket race conditions and improve error handling (#378)
14+
([#378](https://github.com/homeassistant-ai/ha-mcp/pull/378),
15+
[`521e3b0`](https://github.com/homeassistant-ai/ha-mcp/commit/521e3b01ff0108ed78a5be3b614e17fc50321c11))
16+
17+
### Build System
18+
19+
- **deps**: Bump astral-sh/uv (#390) ([#390](https://github.com/homeassistant-ai/ha-mcp/pull/390),
20+
[`b218dc8`](https://github.com/homeassistant-ai/ha-mcp/commit/b218dc853f2930ea88faaff15f4882b26c4eae2c))
21+
22+
### Chores
23+
24+
- **addon**: Sync changelog for Home Assistant add-on [skip ci]
25+
([`b62d25b`](https://github.com/homeassistant-ai/ha-mcp/commit/b62d25b7efad05d3c75b530260773ddd0a90d45b))
26+
27+
### Continuous Integration
28+
29+
- **deps**: Bump renovatebot/github-action from 44.2.1 to 44.2.2 (#372)
30+
([#372](https://github.com/homeassistant-ai/ha-mcp/pull/372),
31+
[`6d7b085`](https://github.com/homeassistant-ai/ha-mcp/commit/6d7b08501a18a5170bd63d706e86ec6064733052))
32+
33+
- **deps**: Bump renovatebot/github-action from 44.2.2 to 44.2.3 (#389)
34+
([#389](https://github.com/homeassistant-ai/ha-mcp/pull/389),
35+
[`84102d2`](https://github.com/homeassistant-ai/ha-mcp/commit/84102d2515ff64ff90899c8abff2b9334d675dc2))
36+
37+
### Documentation
38+
39+
- Add PR execution philosophy and final reporting guidelines
40+
([`b6a5473`](https://github.com/homeassistant-ai/ha-mcp/commit/b6a547365ad03cf1518af56a757b780b2bfc880c))
41+
42+
- Add sponsor badge, community section, and star history
43+
([`2fe299b`](https://github.com/homeassistant-ai/ha-mcp/commit/2fe299bb8815a08fd488489ab151454005b3c7d0))
44+
45+
- Add workflow for implementing improvements in separate PRs
46+
([`dd6aafc`](https://github.com/homeassistant-ai/ha-mcp/commit/dd6aafc62055c9cd92fe71fa68929b2f6c00fbcc))
47+
48+
- Change sponsor badge to blueviolet
49+
([`1a1102f`](https://github.com/homeassistant-ai/ha-mcp/commit/1a1102f8694d4127eeb7af6e9cbaaea419d36646))
50+
51+
- Change sponsor emoji from heart to coffee
52+
([`8f026df`](https://github.com/homeassistant-ai/ha-mcp/commit/8f026dfedf76de7d3788a42ae444c0bb6de64fd2))
53+
54+
- Clarify PR workflow with explicit comment checking
55+
([`d9d6b35`](https://github.com/homeassistant-ai/ha-mcp/commit/d9d6b354dec479d2c0e9a2f327442cd6c5f9d9d7))
56+
57+
- Simplify ha_call_service docstring (117→34 lines) (#379)
58+
([#379](https://github.com/homeassistant-ai/ha-mcp/pull/379),
59+
[`decdd92`](https://github.com/homeassistant-ai/ha-mcp/commit/decdd927e3bff0ae93c148070010949bec273513))
60+
61+
- Update sponsor badge text and color
62+
([`939a09e`](https://github.com/homeassistant-ai/ha-mcp/commit/939a09eb67e7797d561090fe26a3db8279764b0d))
63+
64+
### Features
65+
66+
- Update issue-to-pr-resolver agent with PR execution philosophy
67+
([`075b64a`](https://github.com/homeassistant-ai/ha-mcp/commit/075b64aa25010e3482aeda2e7ccc0a13f1e166e1))
68+
69+
- Update pr-checker agent with PR execution philosophy
70+
([`80bf518`](https://github.com/homeassistant-ai/ha-mcp/commit/80bf51896f4738f910ac68ab193e55bd19e1b393))
71+
72+
573
## v5.0.6 (2025-12-28)
674

775
### Bug Fixes

homeassistant-addon/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "Home Assistant MCP Server"
22
description: "AI assistant integration for Home Assistant via Model Context Protocol (MCP)"
3-
version: "5.0.6"
3+
version: "5.1.0"
44
slug: "ha_mcp"
55
url: "https://github.com/homeassistant-ai/ha-mcp"
66
arch:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "ha-mcp"
7-
version = "5.0.6"
7+
version = "5.1.0"
88
description = "Home Assistant MCP Server - Complete control of Home Assistant through MCP"
99
readme = "README.md"
1010
requires-python = ">=3.13,<3.14"

src/ha_mcp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
through REST API and WebSocket integration with 20+ enhanced tools.
66
"""
77

8-
__version__ = "5.0.6"
8+
__version__ = "5.1.0"
99
__author__ = "Julien"
1010
__license__ = "MIT"
1111

src/ha_mcp/tools/smart_search.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(
3636
self.fuzzy_searcher = create_fuzzy_searcher(threshold=fuzzy_threshold)
3737

3838
async def smart_entity_search(
39-
self, query: str, limit: int = 10, include_attributes: bool = False
39+
self, query: str, limit: int = 10, include_attributes: bool = False, domain_filter: str | None = None
4040
) -> dict[str, Any]:
4141
"""
4242
Advanced entity search with fuzzy matching and typo tolerance.
@@ -45,6 +45,7 @@ async def smart_entity_search(
4545
query: Search query (can be partial, with typos)
4646
limit: Maximum number of results
4747
include_attributes: Whether to include full entity attributes
48+
domain_filter: Optional domain to filter entities before search (e.g., "light", "sensor")
4849
4950
Returns:
5051
Dictionary with search results and metadata
@@ -53,6 +54,14 @@ async def smart_entity_search(
5354
# Get all entities
5455
entities = await self.client.get_states()
5556

57+
# Filter by domain BEFORE fuzzy search if domain_filter provided
58+
# This ensures fuzzy search only looks at entities in the target domain
59+
if domain_filter:
60+
entities = [
61+
e for e in entities
62+
if e.get("entity_id", "").startswith(f"{domain_filter}.")
63+
]
64+
5665
# Perform fuzzy search - returns (limited_results, total_count)
5766
matches, total_matches = self.fuzzy_searcher.search_entities(entities, query, limit)
5867

0 commit comments

Comments
 (0)