mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-14 06:40:05 +00:00
fix: Fix crash on a null color in attribute output (#32784)
This commit is contained in:
@@ -1061,6 +1061,17 @@ describe("Controller", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("Publish entity state attribute output with a null color", async () => {
|
||||
await controller.start();
|
||||
settings.set(["advanced", "output"], "attribute_and_json");
|
||||
mockMQTTPublishAsync.mockClear();
|
||||
const device = getZ2MDevice("bulb");
|
||||
await controller.publishEntityState(device, {state: "ON", color: null});
|
||||
await flushPromises();
|
||||
expect(mockMQTTPublishAsync).toHaveBeenCalledWith("zigbee2mqtt/bulb/state", "ON", {qos: 0, retain: true});
|
||||
expect(mockMQTTPublishAsync).toHaveBeenCalledWith("zigbee2mqtt/bulb/color", "", {qos: 0, retain: true});
|
||||
});
|
||||
|
||||
it("Publish entity state attribute_json output filtered", async () => {
|
||||
await controller.start();
|
||||
settings.set(["advanced", "output"], "attribute_and_json");
|
||||
|
||||
Reference in New Issue
Block a user