@hakit/core
Version:
A collection of React hooks and helpers for Home Assistant to easily communicate with the Home Assistant WebSocket API.
3 lines (2 loc) • 1.01 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../types/autogenerated-types-by-domain.js"),e=[t.LIGHT_COLOR_MODES.HS,t.LIGHT_COLOR_MODES.XY,t.LIGHT_COLOR_MODES.RGB,t.LIGHT_COLOR_MODES.RGBW,t.LIGHT_COLOR_MODES.RGBWW],s=[...e,t.LIGHT_COLOR_MODES.COLOR_TEMP,t.LIGHT_COLOR_MODES.BRIGHTNESS,t.LIGHT_COLOR_MODES.WHITE],l=(o,r)=>o.attributes.supported_color_modes?.includes(r)||!1,_=o=>o.attributes.color_mode&&e.includes(o.attributes.color_mode)||!1,O=o=>o.attributes.supported_color_modes?.some(r=>e.includes(r))||!1,u=o=>o.attributes.supported_color_modes?.some(r=>s.includes(r))||!1,i=o=>o.attributes.color_mode===t.LIGHT_COLOR_MODES.RGBWW?o.attributes.rgbww_color:o.attributes.color_mode===t.LIGHT_COLOR_MODES.RGBW?o.attributes.rgbw_color:o.attributes.rgb_color;exports.getLightCurrentModeRgbColor=i;exports.lightIsInColorMode=_;exports.lightSupportsBrightness=u;exports.lightSupportsColor=O;exports.lightSupportsColorMode=l;
//# sourceMappingURL=index.js.map