Skip to content

Commit 8f82526

Browse files
author
techartdev
committed
Bump version to 0.1.51, fix chat input focus loss, and update card version
1 parent 7a8c0ae commit 8f82526

5 files changed

Lines changed: 35 additions & 5 deletions

File tree

CHANGELOG.md

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

33
All notable changes to the OpenClaw Home Assistant Integration will be documented in this file.
44

5+
## [0.1.51] - 2026-02-23
6+
7+
### Fixed
8+
- Fixed chat input focus loss while typing by preventing unnecessary card re-renders on frequent Home Assistant state updates.
9+
510
## [0.1.50] - 2026-02-21
611

712
### Fixed

custom_components/openclaw/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
# URL at which the card JS is served (registered via register_static_path)
9393
_CARD_STATIC_URL = f"/openclaw/{_CARD_FILENAME}"
9494
# Versioned URL used for Lovelace resource registration to avoid stale browser cache
95-
_CARD_URL = f"{_CARD_STATIC_URL}?v=0.1.50"
95+
_CARD_URL = f"{_CARD_STATIC_URL}?v=0.1.51"
9696

9797
OpenClawConfigEntry = ConfigEntry
9898

custom_components/openclaw/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"iot_class": "local_polling",
99
"issue_tracker": "https://github.com/techartdev/OpenClawHomeAssistant/issues",
1010
"requirements": [],
11-
"version": "0.1.50",
11+
"version": "0.1.51",
1212
"dependencies": ["conversation"],
1313
"after_dependencies": ["hassio", "lovelace"]
1414
}

custom_components/openclaw/www/openclaw-chat-card.js

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* + subscribes to openclaw_message_received events.
1414
*/
1515

16-
const CARD_VERSION = "0.3.9";
16+
const CARD_VERSION = "0.3.10";
1717

1818
// Max time (ms) to show the thinking indicator before falling back to an error
1919
const THINKING_TIMEOUT_MS = 120_000;
@@ -94,6 +94,7 @@ class OpenClawChatCard extends HTMLElement {
9494
this._assistAutoStopTimer = null;
9595
this._lastAssistantEventSignature = null;
9696
this._autoScrollPinned = true;
97+
this._lastHassRenderSignature = null;
9798
}
9899

99100
// ── HA card interface ───────────────────────────────────────────────
@@ -126,12 +127,36 @@ class OpenClawChatCard extends HTMLElement {
126127
set hass(hass) {
127128
const firstSet = !this._hass;
128129
this._hass = hass;
130+
const currentSignature = this._getHassRenderSignature(hass);
129131
if (firstSet) {
130132
this._subscribeToEvents();
131133
this._syncHistoryFromBackend();
132134
this._loadIntegrationSettings();
133135
}
134-
this._render();
136+
if (firstSet || currentSignature !== this._lastHassRenderSignature) {
137+
this._lastHassRenderSignature = currentSignature;
138+
this._render();
139+
}
140+
}
141+
142+
_getHassRenderSignature(hass) {
143+
const states = hass?.states || {};
144+
const stateEntries = Object.entries(states);
145+
146+
const statusEntity =
147+
states["sensor.openclaw_status"] ||
148+
stateEntries.find(([entityId]) => entityId.startsWith("sensor.openclaw_status"))?.[1] ||
149+
null;
150+
151+
const binaryEntity =
152+
states["binary_sensor.openclaw_connected"] ||
153+
stateEntries.find(([entityId]) => entityId.startsWith("binary_sensor.openclaw_connected"))?.[1] ||
154+
null;
155+
156+
const status = String(statusEntity?.state || "").toLowerCase();
157+
const connectedState = String(binaryEntity?.state || "").toLowerCase();
158+
159+
return `${status}|${connectedState}`;
135160
}
136161

137162
_getGatewayConnectionState() {

www/openclaw-chat-card.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(async () => {
22
try {
33
if (!customElements.get("openclaw-chat-card")) {
4-
const src = "/openclaw/openclaw-chat-card.js?v=0.1.50";
4+
const src = "/openclaw/openclaw-chat-card.js?v=0.1.51";
55
console.info("OpenClaw loader importing", src);
66
await import(src);
77
}

0 commit comments

Comments
 (0)