@hakit/core
Version:
A collection of React hooks and helpers for Home Assistant to easily communicate with the Home Assistant WebSocket API.
174 lines (173 loc) • 7.73 kB
JavaScript
import { rgbw2rgb as o, rgbww2rgb as t, temperature2rgb as s } from "./utils/colors/convert-light-color.js";
import { hex2rgb as m, hs2rgb as p, hsv2rgb as i, lab2hex as u, lab2rgb as f, rgb2hex as x, rgb2hs as T, rgb2hsv as l, rgb2lab as g } from "./utils/colors/convert-color.js";
import { COLORS as n, getColorByIndex as A } from "./utils/colors/colors.js";
import { THEME_COLORS as b, computeCssColor as E } from "./utils/colors/compute-color.js";
import { expandHex as I, hexBlend as C } from "./utils/colors/hex.js";
import { getRGBContrastRatio as R, luminosity as D, rgbContrast as N } from "./utils/colors/rgb.js";
import { stateColorBrightness as h } from "./utils/colors/index.js";
import { labBrighten as y, labDarken as U } from "./utils/colors/lab.js";
import { getLightCurrentModeRgbColor as F, lightIsInColorMode as d, lightSupportsBrightness as H, lightSupportsColor as v, lightSupportsColorMode as P } from "./utils/light/index.js";
import { getCssColorValue as W } from "./utils/colors.js";
import { computeDomain as w } from "./utils/computeDomain.js";
import { computeDomainTitle as G } from "./utils/computeDomainTitle.js";
import { supportsFeatureFromAttributes as K } from "./utils/supports-feature.js";
import { timeAgo as j } from "./utils/time/time-ago.js";
import { stateActive as J } from "./utils/entity.js";
import { toReadableString as Z } from "./utils/string.js";
import { formatNumber as ee, getDefaultFormatOptions as re, getNumberFormatOptions as oe, isNumericFromAttributes as te, isNumericState as se, round as ae } from "./utils/number.js";
import { UNIT_TO_MILLISECOND_CONVERT as pe, checkValidDate as ie, formatDate as ue, formatDateTime as fe, formatDuration as xe, formatTime as Te, isDate as le, isTimestamp as ge, millisecondsToDuration as ce } from "./utils/date.js";
import { DOMAIN_ATTRIBUTES_FORMATERS as Ae, DOMAIN_ATTRIBUTES_UNITS as Se, TEMPERATURE_ATTRIBUTES as be, computeAttributeValueDisplay as Ee, getWeatherUnit as _e } from "./utils/computeAttributeDisplay.js";
import { computeStateDisplay as Ce, computeStateDisplayFromEntityAttributes as Oe } from "./utils/computeStateDisplay.js";
import { DEFAULT_STATES as De, DOMAINS_WITH_DYNAMIC_PICTURE as Ne, OFF as Le, OFF_STATES as he, ON as Me, UNAVAILABLE as ye, UNAVAILABLE_STATES as Ue, UNIT_C as Be, UNIT_F as Fe, UNKNOWN as de, isOffState as He, isUnavailableState as ve } from "./data/entity.js";
import { H as Ve, l as We, c as ke, u as we, a as ze, b as Ge } from "../index-BPKUNssF.js";
import { HassContext as Ke } from "./HassConnect/HassContext.js";
import { loadTokens as je, saveTokens as qe } from "./HassConnect/token-storage.js";
import { g as Qe, u as Ze, b as $e, a as er, c as rr } from "../index-CzNGKXJS.js";
import { createService as tr, useService as sr } from "./hooks/useService/index.js";
import { useLightBrightness as mr } from "./hooks/useLightBrightness/index.js";
import { useLightTemperature as ir } from "./hooks/useLightTemperature/index.js";
import { useLightColor as fr } from "./hooks/useLightColor/index.js";
import { useLowDevices as Tr } from "./hooks/useLowDevices/index.js";
import { useDevice as gr } from "./hooks/useDevice/index.js";
import { useHistory as nr } from "./hooks/useHistory/index.js";
import { coordinates as Sr } from "./hooks/useHistory/coordinates.js";
import { useSubscribeEntity as Er } from "./hooks/useSubscribeEntity/index.js";
import { useLogs as Ir } from "./hooks/useLogs/index.js";
import { useHaStatus as Or } from "./hooks/useHaStatus/index.js";
import { useConfig as Dr } from "./hooks/useConfig/index.js";
import { useWeather as Lr } from "./hooks/useWeather/index.js";
import { getSupportedForecastTypes as Mr } from "./hooks/useWeather/helpers.js";
import { CONTINUOUS_DOMAINS as Ur, createHistoricState as Br, localizeStateMessage as Fr, localizeTriggerSource as dr, subscribeLogbook as Hr } from "./hooks/useLogs/logbook.js";
import { useAreas as Pr } from "./hooks/useAreas/index.js";
import { default as Wr } from "./hooks/useLocale/locales/index.js";
import { subscribeAreaRegistry as wr } from "./hooks/useAreas/subscribe/areas.js";
import { subscribeEntityRegistry as Gr } from "./hooks/useAreas/subscribe/entities.js";
import { subscribeDeviceRegistry as Kr } from "./hooks/useAreas/subscribe/devices.js";
import { useTemplate as jr } from "./hooks/useTemplate/index.js";
import { useCamera as Jr } from "./hooks/useCamera/index.js";
import { ASPECT_RATIO_DEFAULT as Zr, CAMERA_ORIENTATIONS as $r, CAMERA_SUPPORT_ON_OFF as eo, CAMERA_SUPPORT_STREAM as ro, MAX_IMAGE_WIDTH as oo, STREAM_TYPE_HLS as to, STREAM_TYPE_WEB_RTC as so } from "./hooks/useCamera/constants.js";
import { LIGHT_COLOR_MODES as mo } from "./types/autogenerated-types-by-domain.js";
import { batteryIconByLevel as io } from "./hooks/useIcon/domains/battery.js";
export {
Zr as ASPECT_RATIO_DEFAULT,
$r as CAMERA_ORIENTATIONS,
eo as CAMERA_SUPPORT_ON_OFF,
ro as CAMERA_SUPPORT_STREAM,
n as COLORS,
Ur as CONTINUOUS_DOMAINS,
De as DEFAULT_STATES,
Ne as DOMAINS_WITH_DYNAMIC_PICTURE,
Ae as DOMAIN_ATTRIBUTES_FORMATERS,
Se as DOMAIN_ATTRIBUTES_UNITS,
Ve as HassConnect,
Ke as HassContext,
mo as LIGHT_COLOR_MODES,
oo as MAX_IMAGE_WIDTH,
Le as OFF,
he as OFF_STATES,
Me as ON,
to as STREAM_TYPE_HLS,
so as STREAM_TYPE_WEB_RTC,
be as TEMPERATURE_ATTRIBUTES,
b as THEME_COLORS,
ye as UNAVAILABLE,
Ue as UNAVAILABLE_STATES,
Be as UNIT_C,
Fe as UNIT_F,
pe as UNIT_TO_MILLISECOND_CONVERT,
de as UNKNOWN,
io as batteryIconByLevel,
ie as checkValidDate,
Ee as computeAttributeValueDisplay,
E as computeCssColor,
w as computeDomain,
G as computeDomainTitle,
Ce as computeStateDisplay,
Oe as computeStateDisplayFromEntityAttributes,
Sr as coordinates,
Br as createHistoricState,
tr as createService,
I as expandHex,
ue as formatDate,
fe as formatDateTime,
xe as formatDuration,
ee as formatNumber,
Te as formatTime,
A as getColorByIndex,
W as getCssColorValue,
re as getDefaultFormatOptions,
Qe as getIconByEntity,
F as getLightCurrentModeRgbColor,
oe as getNumberFormatOptions,
R as getRGBContrastRatio,
Mr as getSupportedForecastTypes,
_e as getWeatherUnit,
m as hex2rgb,
C as hexBlend,
p as hs2rgb,
i as hsv2rgb,
le as isDate,
te as isNumericFromAttributes,
se as isNumericState,
He as isOffState,
ge as isTimestamp,
ve as isUnavailableState,
u as lab2hex,
f as lab2rgb,
y as labBrighten,
U as labDarken,
d as lightIsInColorMode,
H as lightSupportsBrightness,
v as lightSupportsColor,
P as lightSupportsColorMode,
je as loadTokens,
Wr as locales,
We as localize,
Fr as localizeStateMessage,
dr as localizeTriggerSource,
D as luminosity,
ce as millisecondsToDuration,
x as rgb2hex,
T as rgb2hs,
l as rgb2hsv,
g as rgb2lab,
N as rgbContrast,
o as rgbw2rgb,
t as rgbww2rgb,
ae as round,
qe as saveTokens,
J as stateActive,
h as stateColorBrightness,
wr as subscribeAreaRegistry,
Kr as subscribeDeviceRegistry,
Gr as subscribeEntityRegistry,
Hr as subscribeLogbook,
K as supportsFeatureFromAttributes,
s as temperature2rgb,
j as timeAgo,
Z as toReadableString,
ke as updateLocales,
Pr as useAreas,
Jr as useCamera,
Dr as useConfig,
gr as useDevice,
Ze as useEntity,
Or as useHaStatus,
we as useHass,
nr as useHistory,
$e as useIcon,
er as useIconByDomain,
rr as useIconByEntity,
mr as useLightBrightness,
fr as useLightColor,
ir as useLightTemperature,
ze as useLocale,
Ge as useLocales,
Ir as useLogs,
Tr as useLowDevices,
sr as useService,
Er as useSubscribeEntity,
jr as useTemplate,
Lr as useWeather
};
//# sourceMappingURL=index.js.map