@hakit/core
Version:
A collection of React hooks and helpers for Home Assistant to easily communicate with the Home Assistant WebSocket API.
22 lines (21 loc) • 879 B
JavaScript
import { LIGHT_COLOR_MODES as t } from "../../types/autogenerated-types-by-domain.js";
const s = [
t.HS,
t.XY,
t.RGB,
t.RGBW,
t.RGBWW
], e = [
...s,
t.COLOR_TEMP,
t.BRIGHTNESS,
t.WHITE
], u = (o, r) => o.attributes.supported_color_modes?.includes(r) || !1, c = (o) => o.attributes.color_mode && s.includes(o.attributes.color_mode) || !1, d = (o) => o.attributes.supported_color_modes?.some((r) => s.includes(r)) || !1, i = (o) => o.attributes.supported_color_modes?.some((r) => e.includes(r)) || !1, p = (o) => o.attributes.color_mode === t.RGBWW ? o.attributes.rgbww_color : o.attributes.color_mode === t.RGBW ? o.attributes.rgbw_color : o.attributes.rgb_color;
export {
p as getLightCurrentModeRgbColor,
c as lightIsInColorMode,
i as lightSupportsBrightness,
d as lightSupportsColor,
u as lightSupportsColorMode
};
//# sourceMappingURL=index.js.map