mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-27 21:20:03 +00:00
This commit is contained in:
@@ -127,7 +127,11 @@ export default class HomeAssistant extends Extension {
|
||||
const hasBrightness = exposes.find((expose) => expose.features.find((e) => e.name === 'brightness'));
|
||||
const hasColorTemp = exposes.find((expose) => expose.features.find((e) => e.name === 'color_temp'));
|
||||
const state = firstExpose.features.find((f) => f.name === 'state');
|
||||
const preferHS = !!exposes.find((expose) => expose.preferredColorMode === 'hs');
|
||||
// Prefer HS over XY when at least one of the lights in the group prefers HS over XY.
|
||||
// A light prefers HS over XY when HS is earlier in the feature array than HS.
|
||||
const preferHS = exposes.map((e) => [e.features.findIndex((ee) => ee.name === 'color_xy'),
|
||||
e.features.findIndex((ee) => ee.name === 'color_hs')])
|
||||
.filter((d) => d[0] !== -1 && d[1] !== -1 && d[1] < d[0]).length !== 0;
|
||||
|
||||
const discoveryEntry: DiscoveryEntry = {
|
||||
type: 'light',
|
||||
|
||||
Vendored
+1
-1
@@ -101,7 +101,7 @@ declare global {
|
||||
interface DefinitionExpose {
|
||||
type: string, name?: string, features?: DefinitionExposeFeature[],
|
||||
endpoint?: string, values?: string[], value_off?: string, value_on?: string,
|
||||
access: number, property: string, unit?: string, preferredColorMode?: 'xy' | 'hs',
|
||||
access: number, property: string, unit?: string,
|
||||
value_min?: number, value_max?: number}
|
||||
|
||||
interface Definition {
|
||||
|
||||
Reference in New Issue
Block a user