fix(ignore): Fix passive states not updating in frontend (#27532)

This commit is contained in:
Koen Kanters
2025-05-28 19:28:52 +02:00
committed by GitHub
parent 00dda245e4
commit a289f981bf
2 changed files with 18 additions and 4 deletions
+1 -1
View File
@@ -221,7 +221,7 @@ export class Frontend extends Extension {
} else {
// PublishEntityState
topic = data.entity.name;
payload = data.payload;
payload = data.message;
}
for (const client of this.wss.clients) {
+17 -3
View File
@@ -230,6 +230,7 @@ describe("Extension: Frontend", () => {
mockWSClient.readyState = "open";
mockWS.clients.push(mockWSClient);
await mockWSEvents.connection(mockWSClient);
devices.bulb_color.linkquality = 20;
const allTopics = mockWSClient.send.mock.calls.map(([m]) => JSON.parse(m).topic);
expect(allTopics).toContain("bridge/devices");
@@ -249,7 +250,7 @@ describe("Extension: Frontend", () => {
state: "ON",
effect: null,
power_on_behavior: null,
linkquality: null,
linkquality: 20,
update: {state: null, installed_version: -1, latest_version: -1},
}),
{retain: false, qos: 0},
@@ -268,7 +269,13 @@ describe("Extension: Frontend", () => {
expect(mockWSClient.send).toHaveBeenCalledWith(
stringify({
topic: "bulb_color",
payload: {state: "ON"},
payload: {
state: "ON",
power_on_behavior: null,
effect: null,
linkquality: 20,
update: {state: null, installed_version: -1, latest_version: -1},
},
}),
);
@@ -288,7 +295,14 @@ describe("Extension: Frontend", () => {
expect(mockWSClient.send).toHaveBeenCalledWith(
stringify({
topic: "bulb_color",
payload: {state: "ON", brightness: 90},
payload: {
state: "ON",
brightness: 90,
power_on_behavior: null,
effect: null,
linkquality: 20,
update: {state: null, installed_version: -1, latest_version: -1},
},
}),
);