-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,10 +108,13 @@ class HomeAssistant extends Extension { | |
discoveryEntry.discovery_payload.supported_color_modes = colorModes; | ||
} | ||
|
||
if (entityType === 'device' && hasColorTemp) { | ||
const colorTemp = firstExpose.features.find((e) => e.name === 'color_temp'); | ||
discoveryEntry.discovery_payload.max_mireds = colorTemp.value_max; | ||
discoveryEntry.discovery_payload.min_mireds = colorTemp.value_min; | ||
if (hasColorTemp) { | ||
const colorTemps = exposes.map((expose) => expose.features.find((e) => e.name === 'color_temp')) | ||
.filter((e) => e); | ||
const max = Math.max(...colorTemps.map((e) => e.value_max)); | ||
const min = Math.min(...colorTemps.map((e) => e.value_min)); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Koenkk
Author
Owner
|
||
discoveryEntry.discovery_payload.max_mireds = max; | ||
discoveryEntry.discovery_payload.min_mireds = min; | ||
} | ||
|
||
const effect = definition && definition.exposes.find((e) => e.type === 'enum' && e.name === 'effect'); | ||
|
@Koenkk should this not be the max for min and the min for max? ?
If you have a group with 3 bulbs ranging
153-500
250-450
153-370
The only range supported by all of them would be: 250-370, unless I understand this code the range would be 153-500 which has values out of range for 2 of the 3 bulbs