Skip to content

Commit

Permalink
fix: extend should pass options.supportsHueSaturation to meta.support…
Browse files Browse the repository at this point in the history
…sHueSaturation
  • Loading branch information
sjorge committed May 29, 2023
1 parent 52c14f9 commit bb2e37a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,15 @@ const extend = {
const toZigbee = [tz.light_onoff_brightness, tz.light_color, tz.ignore_transition, tz.ignore_rate, tz.light_brightness_move,
tz.light_brightness_step, tz.level_config, tz.light_hue_saturation_move, ...options.toZigbee,
tz.light_hue_saturation_step, tz.light_color_options, tz.light_color_mode, ...(!options.disableEffect ? [tz.effect] : [])];
const meta = {supportsHueAndSaturation: options.supportsHueAndSaturation};

if (!options.disablePowerOnBehavior) {
exposes.push(e.power_on_behavior(['off', 'on', 'toggle', 'previous']));
fromZigbee.push(fz.power_on_behavior);
toZigbee.push(tz.power_on_behavior);
}

const result = {exposes, fromZigbee, toZigbee};
const result = {exposes, fromZigbee, toZigbee, meta};
if (!options.noConfigure) {
result.configure = async (device, coordinatorEndpoint, logger) => {
await light.configure(device, coordinatorEndpoint, logger, false);
Expand All @@ -120,6 +121,7 @@ const extend = {
tz.light_colortemp_move, tz.light_brightness_step, tz.light_colortemp_step, tz.light_hue_saturation_move,
tz.light_hue_saturation_step, tz.light_colortemp_startup, tz.level_config, tz.light_color_options,
tz.light_color_mode, ...(!options.disableEffect ? [tz.effect] : []), ...options.toZigbee];
const meta = {supportsHueAndSaturation: options.supportsHueAndSaturation};

if (options.disableColorTempStartup) {
exposes[0].removeFeature('color_temp_startup');
Expand All @@ -132,7 +134,7 @@ const extend = {
toZigbee.push(tz.power_on_behavior);
}

const result = {exposes, fromZigbee, toZigbee};
const result = {exposes, fromZigbee, toZigbee, meta};
if (!options.noConfigure) {
result.configure = async (device, coordinatorEndpoint, logger) => {
await light.configure(device, coordinatorEndpoint, logger, true);
Expand Down

0 comments on commit bb2e37a

Please sign in to comment.