mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-30 15:48:33 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba337bd329 | ||
|
|
7e7057eccd | ||
|
|
cbcd32064c |
@@ -1,3 +1,3 @@
|
||||
{
|
||||
".": "2.1.2"
|
||||
".": "2.1.3"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## [2.1.3](https://github.com/Koenkk/zigbee2mqtt/compare/2.1.2...2.1.3) (2025-03-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Home Assistant: fix brightness only lights ([#26560](https://github.com/Koenkk/zigbee2mqtt/issues/26560)) ([7e7057e](https://github.com/Koenkk/zigbee2mqtt/commit/7e7057eccd1fe638dd73b4a4f303c6612b73c89d))
|
||||
|
||||
## [2.1.2](https://github.com/Koenkk/zigbee2mqtt/compare/2.1.1...2.1.2) (2025-03-01)
|
||||
|
||||
|
||||
|
||||
@@ -536,13 +536,23 @@ export default class HomeAssistant extends Extension {
|
||||
},
|
||||
};
|
||||
|
||||
discoveryEntry.discovery_payload.supported_color_modes = [
|
||||
'brightness',
|
||||
const colorModes = [
|
||||
hasColorXY && !preferHS ? 'xy' : null,
|
||||
(!hasColorXY || preferHS) && hasColorHS ? 'hs' : null,
|
||||
hasColorTemp ? 'color_temp' : null,
|
||||
].filter((c) => c);
|
||||
|
||||
if (colorModes.length) {
|
||||
discoveryEntry.discovery_payload.supported_color_modes = colorModes;
|
||||
} else {
|
||||
/**
|
||||
* All bulbs support brightness, note that `brightness` cannot be combined
|
||||
* with other color modes.
|
||||
* https://github.com/Koenkk/zigbee2mqtt/issues/26520#issuecomment-2692432058
|
||||
*/
|
||||
discoveryEntry.discovery_payload.supported_color_modes = ['brightness'];
|
||||
}
|
||||
|
||||
if (hasColorTemp) {
|
||||
const colorTemps = (exposes as zhc.Light[])
|
||||
.map((expose) => expose.features.find((e) => e.name === 'color_temp'))
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "zigbee2mqtt",
|
||||
"version": "2.1.2",
|
||||
"version": "2.1.3",
|
||||
"description": "Zigbee to MQTT bridge using Zigbee-herdsman",
|
||||
"main": "index.js",
|
||||
"packageManager": "pnpm@10.4.1",
|
||||
|
||||
@@ -141,7 +141,7 @@ describe('Extension: HomeAssistant', () => {
|
||||
name: null,
|
||||
schema: 'json',
|
||||
state_topic: 'zigbee2mqtt/ha_discovery_group',
|
||||
supported_color_modes: ['brightness', 'xy', 'color_temp'],
|
||||
supported_color_modes: ['xy', 'color_temp'],
|
||||
effect: true,
|
||||
effect_list: [
|
||||
'blink',
|
||||
@@ -165,6 +165,33 @@ describe('Extension: HomeAssistant', () => {
|
||||
qos: 1,
|
||||
});
|
||||
|
||||
payload = {
|
||||
availability: [{topic: 'zigbee2mqtt/bridge/state', value_template: '{{ value_json.state }}'}],
|
||||
brightness: true,
|
||||
brightness_scale: 254,
|
||||
command_topic: 'zigbee2mqtt/bulb_enddevice/set',
|
||||
device: {
|
||||
identifiers: ['zigbee2mqtt_0x0017880104e45553'],
|
||||
manufacturer: 'Sengled',
|
||||
model: 'Element classic (A19)',
|
||||
model_id: 'E11-G13',
|
||||
name: 'bulb_enddevice',
|
||||
via_device: 'zigbee2mqtt_bridge_0x00124b00120144ae',
|
||||
},
|
||||
name: null,
|
||||
object_id: 'bulb_enddevice',
|
||||
origin: origin,
|
||||
schema: 'json',
|
||||
state_topic: 'zigbee2mqtt/bulb_enddevice',
|
||||
supported_color_modes: ['brightness'],
|
||||
unique_id: '0x0017880104e45553_light_zigbee2mqtt',
|
||||
};
|
||||
|
||||
expect(mockMQTTPublishAsync).toHaveBeenCalledWith('homeassistant/light/0x0017880104e45553/light/config', stringify(payload), {
|
||||
retain: true,
|
||||
qos: 1,
|
||||
});
|
||||
|
||||
payload = {
|
||||
availability: [{topic: 'zigbee2mqtt/bridge/state', value_template: '{{ value_json.state }}'}],
|
||||
command_topic: 'zigbee2mqtt/ha_discovery_group/set',
|
||||
@@ -381,7 +408,7 @@ describe('Extension: HomeAssistant', () => {
|
||||
availability: [{topic: 'zigbee2mqtt/bridge/state', value_template: '{{ value_json.state }}'}],
|
||||
brightness: true,
|
||||
brightness_scale: 254,
|
||||
supported_color_modes: ['brightness', 'color_temp'],
|
||||
supported_color_modes: ['color_temp'],
|
||||
min_mireds: 250,
|
||||
max_mireds: 454,
|
||||
command_topic: 'zigbee2mqtt/bulb/set',
|
||||
@@ -1633,7 +1660,7 @@ describe('Extension: HomeAssistant', () => {
|
||||
name: null,
|
||||
schema: 'json',
|
||||
state_topic: 'zigbee2mqtt/ha_discovery_group_new',
|
||||
supported_color_modes: ['brightness', 'xy', 'color_temp'],
|
||||
supported_color_modes: ['xy', 'color_temp'],
|
||||
effect: true,
|
||||
effect_list: [
|
||||
'blink',
|
||||
@@ -2101,7 +2128,7 @@ describe('Extension: HomeAssistant', () => {
|
||||
name: null,
|
||||
schema: 'json',
|
||||
state_topic: 'zigbee2mqtt/ha_discovery_group',
|
||||
supported_color_modes: ['brightness', 'xy', 'color_temp'],
|
||||
supported_color_modes: ['xy', 'color_temp'],
|
||||
effect: true,
|
||||
effect_list: [
|
||||
'blink',
|
||||
@@ -2145,7 +2172,7 @@ describe('Extension: HomeAssistant', () => {
|
||||
name: null,
|
||||
schema: 'json',
|
||||
state_topic: 'zigbee2mqtt/ha_discovery_group',
|
||||
supported_color_modes: ['brightness', 'xy', 'color_temp'],
|
||||
supported_color_modes: ['xy', 'color_temp'],
|
||||
effect: true,
|
||||
effect_list: [
|
||||
'blink',
|
||||
@@ -2200,7 +2227,7 @@ describe('Extension: HomeAssistant', () => {
|
||||
name: null,
|
||||
schema: 'json',
|
||||
state_topic: 'zigbee2mqtt/bulb',
|
||||
supported_color_modes: ['brightness', 'color_temp'],
|
||||
supported_color_modes: ['color_temp'],
|
||||
object_id: 'bulb',
|
||||
unique_id: '0x000b57fffec6a5b2_light_zigbee2mqtt',
|
||||
origin: origin,
|
||||
|
||||
Reference in New Issue
Block a user