Bump version to 0.1.51, fix chat input focus loss, and update card version
This commit is contained in:
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
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.51] - 2026-02-23
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed chat input focus loss while typing by preventing unnecessary card re-renders on frequent Home Assistant state updates.
|
||||||
|
|
||||||
## [0.1.50] - 2026-02-21
|
## [0.1.50] - 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.50"
|
_CARD_URL = f"{_CARD_STATIC_URL}?v=0.1.51"
|
||||||
|
|
||||||
OpenClawConfigEntry = ConfigEntry
|
OpenClawConfigEntry = ConfigEntry
|
||||||
|
|
||||||
|
|||||||
@@ -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.50",
|
"version": "0.1.51",
|
||||||
"dependencies": ["conversation"],
|
"dependencies": ["conversation"],
|
||||||
"after_dependencies": ["hassio", "lovelace"]
|
"after_dependencies": ["hassio", "lovelace"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
* + subscribes to openclaw_message_received events.
|
* + subscribes to openclaw_message_received events.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const CARD_VERSION = "0.3.9";
|
const CARD_VERSION = "0.3.10";
|
||||||
|
|
||||||
// Max time (ms) to show the thinking indicator before falling back to an error
|
// Max time (ms) to show the thinking indicator before falling back to an error
|
||||||
const THINKING_TIMEOUT_MS = 120_000;
|
const THINKING_TIMEOUT_MS = 120_000;
|
||||||
@@ -94,6 +94,7 @@ class OpenClawChatCard extends HTMLElement {
|
|||||||
this._assistAutoStopTimer = null;
|
this._assistAutoStopTimer = null;
|
||||||
this._lastAssistantEventSignature = null;
|
this._lastAssistantEventSignature = null;
|
||||||
this._autoScrollPinned = true;
|
this._autoScrollPinned = true;
|
||||||
|
this._lastHassRenderSignature = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── HA card interface ───────────────────────────────────────────────
|
// ── HA card interface ───────────────────────────────────────────────
|
||||||
@@ -126,12 +127,36 @@ class OpenClawChatCard extends HTMLElement {
|
|||||||
set hass(hass) {
|
set hass(hass) {
|
||||||
const firstSet = !this._hass;
|
const firstSet = !this._hass;
|
||||||
this._hass = hass;
|
this._hass = hass;
|
||||||
|
const currentSignature = this._getHassRenderSignature(hass);
|
||||||
if (firstSet) {
|
if (firstSet) {
|
||||||
this._subscribeToEvents();
|
this._subscribeToEvents();
|
||||||
this._syncHistoryFromBackend();
|
this._syncHistoryFromBackend();
|
||||||
this._loadIntegrationSettings();
|
this._loadIntegrationSettings();
|
||||||
}
|
}
|
||||||
this._render();
|
if (firstSet || currentSignature !== this._lastHassRenderSignature) {
|
||||||
|
this._lastHassRenderSignature = currentSignature;
|
||||||
|
this._render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_getHassRenderSignature(hass) {
|
||||||
|
const states = hass?.states || {};
|
||||||
|
const stateEntries = Object.entries(states);
|
||||||
|
|
||||||
|
const statusEntity =
|
||||||
|
states["sensor.openclaw_status"] ||
|
||||||
|
stateEntries.find(([entityId]) => entityId.startsWith("sensor.openclaw_status"))?.[1] ||
|
||||||
|
null;
|
||||||
|
|
||||||
|
const binaryEntity =
|
||||||
|
states["binary_sensor.openclaw_connected"] ||
|
||||||
|
stateEntries.find(([entityId]) => entityId.startsWith("binary_sensor.openclaw_connected"))?.[1] ||
|
||||||
|
null;
|
||||||
|
|
||||||
|
const status = String(statusEntity?.state || "").toLowerCase();
|
||||||
|
const connectedState = String(binaryEntity?.state || "").toLowerCase();
|
||||||
|
|
||||||
|
return `${status}|${connectedState}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
_getGatewayConnectionState() {
|
_getGatewayConnectionState() {
|
||||||
|
|||||||
@@ -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.50";
|
const src = "/openclaw/openclaw-chat-card.js?v=0.1.51";
|
||||||
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