Update version to 0.1.44 and fix chat-card settings sync, wake-word disable reliability, and browser voice listening status
This commit is contained in:
@@ -2,6 +2,13 @@
|
|||||||
|
|
||||||
All notable changes to the OpenClaw Home Assistant Integration will be documented in this file.
|
All notable changes to the OpenClaw Home Assistant Integration will be documented in this file.
|
||||||
|
|
||||||
|
## [0.1.44] - 2026-02-21
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed chat-card settings sync to always read latest integration options instead of a potentially stale cached config entry.
|
||||||
|
- Wake-word disable now applies reliably after unchecking in integration options.
|
||||||
|
- Browser voice listening status now only shows wake-word requirement when wake word is actually enabled.
|
||||||
|
|
||||||
## [0.1.43] - 2026-02-21
|
## [0.1.43] - 2026-02-21
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ _CARD_PATH = Path(__file__).parent / "www" / _CARD_FILENAME
|
|||||||
# URL at which the card JS is served (registered via register_static_path)
|
# URL at which the card JS is served (registered via register_static_path)
|
||||||
_CARD_STATIC_URL = f"/openclaw/{_CARD_FILENAME}"
|
_CARD_STATIC_URL = f"/openclaw/{_CARD_FILENAME}"
|
||||||
# Versioned URL used for Lovelace resource registration to avoid stale browser cache
|
# Versioned URL used for Lovelace resource registration to avoid stale browser cache
|
||||||
_CARD_URL = f"{_CARD_STATIC_URL}?v=0.1.43"
|
_CARD_URL = f"{_CARD_STATIC_URL}?v=0.1.44"
|
||||||
|
|
||||||
OpenClawConfigEntry = ConfigEntry
|
OpenClawConfigEntry = ConfigEntry
|
||||||
|
|
||||||
@@ -151,6 +151,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: OpenClawConfigEntry) ->
|
|||||||
"coordinator": coordinator,
|
"coordinator": coordinator,
|
||||||
"addon_config_path": addon_config_path,
|
"addon_config_path": addon_config_path,
|
||||||
"entry": entry,
|
"entry": entry,
|
||||||
|
"entry_id": entry.entry_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
# First data fetch — if it fails the coordinator marks entities unavailable
|
# First data fetch — if it fails the coordinator marks entities unavailable
|
||||||
@@ -386,8 +387,7 @@ def _async_register_services(hass: HomeAssistant) -> None:
|
|||||||
|
|
||||||
client: OpenClawApiClient = entry_data["client"]
|
client: OpenClawApiClient = entry_data["client"]
|
||||||
coordinator: OpenClawCoordinator = entry_data["coordinator"]
|
coordinator: OpenClawCoordinator = entry_data["coordinator"]
|
||||||
entry: ConfigEntry = entry_data["entry"]
|
options = _get_entry_options(hass, entry_data)
|
||||||
options = entry.options
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
include_context = options.get(
|
include_context = options.get(
|
||||||
@@ -573,6 +573,25 @@ def _get_first_entry_data(hass: HomeAssistant) -> dict[str, Any] | None:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _get_entry_options(hass: HomeAssistant, entry_data: dict[str, Any]) -> dict[str, Any]:
|
||||||
|
"""Return latest config entry options for an integration entry data payload."""
|
||||||
|
latest_entry: ConfigEntry | None = None
|
||||||
|
|
||||||
|
entry_id = entry_data.get("entry_id")
|
||||||
|
if isinstance(entry_id, str):
|
||||||
|
latest_entry = hass.config_entries.async_get_entry(entry_id)
|
||||||
|
|
||||||
|
if latest_entry is None:
|
||||||
|
cached_entry = entry_data.get("entry")
|
||||||
|
cached_entry_id = getattr(cached_entry, "entry_id", None)
|
||||||
|
if isinstance(cached_entry_id, str):
|
||||||
|
latest_entry = hass.config_entries.async_get_entry(cached_entry_id) or cached_entry
|
||||||
|
elif isinstance(cached_entry, ConfigEntry):
|
||||||
|
latest_entry = cached_entry
|
||||||
|
|
||||||
|
return latest_entry.options if latest_entry else {}
|
||||||
|
|
||||||
|
|
||||||
def _extract_text_recursive(value: Any, depth: int = 0) -> str | None:
|
def _extract_text_recursive(value: Any, depth: int = 0) -> str | None:
|
||||||
"""Recursively extract assistant text from nested response payloads."""
|
"""Recursively extract assistant text from nested response payloads."""
|
||||||
if depth > 8:
|
if depth > 8:
|
||||||
@@ -793,7 +812,7 @@ def _async_register_websocket_api(hass: HomeAssistant) -> None:
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Return frontend-related integration settings."""
|
"""Return frontend-related integration settings."""
|
||||||
entry_data = _get_first_entry_data(hass)
|
entry_data = _get_first_entry_data(hass)
|
||||||
options = entry_data.get("entry").options if entry_data and entry_data.get("entry") else {}
|
options = _get_entry_options(hass, entry_data) if entry_data else {}
|
||||||
connection.send_result(
|
connection.send_result(
|
||||||
msg["id"],
|
msg["id"],
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"issue_tracker": "https://github.com/techartdev/OpenClawHomeAssistant/issues",
|
"issue_tracker": "https://github.com/techartdev/OpenClawHomeAssistant/issues",
|
||||||
"requirements": [],
|
"requirements": [],
|
||||||
"version": "0.1.43",
|
"version": "0.1.44",
|
||||||
"dependencies": ["conversation"],
|
"dependencies": ["conversation"],
|
||||||
"after_dependencies": ["hassio", "lovelace"]
|
"after_dependencies": ["hassio", "lovelace"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ class OpenClawChatCard extends HTMLElement {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this._wakeWordEnabled = !!result?.wake_word_enabled;
|
this._wakeWordEnabled = this._coerceBoolean(result?.wake_word_enabled, false);
|
||||||
this._wakeWord = (result?.wake_word || "hey openclaw").toString().trim().toLowerCase();
|
this._wakeWord = (result?.wake_word || "hey openclaw").toString().trim().toLowerCase();
|
||||||
this._allowBraveWebSpeechIntegration = !!result?.allow_brave_webspeech;
|
this._allowBraveWebSpeechIntegration = !!result?.allow_brave_webspeech;
|
||||||
this._voiceProviderIntegration =
|
this._voiceProviderIntegration =
|
||||||
@@ -543,6 +543,17 @@ class OpenClawChatCard extends HTMLElement {
|
|||||||
return languageMap[cleaned] || `${cleaned}-${cleaned.toUpperCase()}`;
|
return languageMap[cleaned] || `${cleaned}-${cleaned.toUpperCase()}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_coerceBoolean(value, fallback = false) {
|
||||||
|
if (typeof value === "boolean") return value;
|
||||||
|
if (typeof value === "number") return value !== 0;
|
||||||
|
if (typeof value === "string") {
|
||||||
|
const normalized = value.trim().toLowerCase();
|
||||||
|
if (["true", "1", "yes", "on"].includes(normalized)) return true;
|
||||||
|
if (["false", "0", "no", "off", ""].includes(normalized)) return false;
|
||||||
|
}
|
||||||
|
return fallback;
|
||||||
|
}
|
||||||
|
|
||||||
_getSpeechRecognitionLanguage() {
|
_getSpeechRecognitionLanguage() {
|
||||||
if (this._speechLangOverride) {
|
if (this._speechLangOverride) {
|
||||||
return this._speechLangOverride;
|
return this._speechLangOverride;
|
||||||
@@ -1024,7 +1035,9 @@ class OpenClawChatCard extends HTMLElement {
|
|||||||
this._recognition.continuous = this._isVoiceMode;
|
this._recognition.continuous = this._isVoiceMode;
|
||||||
this._recognition.lang = this._getSpeechRecognitionLanguage();
|
this._recognition.lang = this._getSpeechRecognitionLanguage();
|
||||||
this._voiceStatus = this._isVoiceMode
|
this._voiceStatus = this._isVoiceMode
|
||||||
|
? this._wakeWordEnabled
|
||||||
? `Listening (${this._recognition.lang}, wake word: ${this._wakeWord || "hey openclaw"})`
|
? `Listening (${this._recognition.lang}, wake word: ${this._wakeWord || "hey openclaw"})`
|
||||||
|
: `Listening (${this._recognition.lang})`
|
||||||
: `Listening (${this._recognition.lang})…`;
|
: `Listening (${this._recognition.lang})…`;
|
||||||
|
|
||||||
this._recognition.onresult = (event) => {
|
this._recognition.onresult = (event) => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
if (!customElements.get("openclaw-chat-card")) {
|
if (!customElements.get("openclaw-chat-card")) {
|
||||||
const src = "/openclaw/openclaw-chat-card.js?v=0.1.43";
|
const src = "/openclaw/openclaw-chat-card.js?v=0.1.44";
|
||||||
console.info("OpenClaw loader importing", src);
|
console.info("OpenClaw loader importing", src);
|
||||||
await import(src);
|
await import(src);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user