UNPKG

@hakit/core

Version:

A collection of React hooks and helpers for Home Assistant to easily communicate with the Home Assistant WebSocket API.

270 lines (269 loc) 11.9 kB
import { rgbw2rgb as r, rgbww2rgb as o, temperature2rgb as a } from "./utils/colors/convert-light-color.js"; import { hex2rgb as i, hs2rgb as m, hsv2rgb as n, lab2hex as p, lab2rgb as u, rgb2hex as f, rgb2hs as y, rgb2hsv as g, rgb2lab as c } from "./utils/colors/convert-color.js"; import { COLORS as l, getColorByIndex as T } from "./utils/colors/colors.js"; import { THEME_COLORS as x, computeCssColor as A } from "./utils/colors/compute-color.js"; import { expandHex as b, hexBlend as N } from "./utils/colors/hex.js"; import { getRGBContrastRatio as C, luminosity as h, rgbContrast as I } from "./utils/colors/rgb.js"; import { stateColorBrightness as _ } from "./utils/colors/index.js"; import { labBrighten as O, labDarken as v } from "./utils/colors/lab.js"; import { D as U, O as M, P as B, H as k, T as W, t as P, R as H, e as Y, o as V, n as w, f as z, q as G, p as Z, w as j, u as K, z as X, r as q, h as J, S as Q, U as $, j as ee, i as te, a2 as re, J as oe, K as ae, v as se, a1 as ie, F as me, y as ne, x as pe, M as ue, a9 as fe, a7 as ye, a6 as ge, a8 as ce, aa as Ee, N as le, k as Te, m as De, L as xe, B as Ae, A as Se, g as be, Q as Ne, a as Re, c as Ce, b as he, l as Ie, d as de, Y as _e, a4 as Le, E as Oe, a5 as ve, I as Fe, s as Ue, a0 as Me, G as Be, a3 as ke, C as We, $ as Pe, V as He, X as Ye, Z as Ve, _ as we, W as ze } from "../index-BDZyTvOW.js"; import { getCssColorValue as Ze } from "./utils/colors.js"; import { computeDomain as Ke } from "./utils/computeDomain.js"; import { supportsFeatureFromAttributes as qe } from "./utils/supports-feature.js"; import { timeAgo as Qe } from "./utils/time/time-ago.js"; import { caseInsensitiveStringCompare as et, stringCompare as tt, toReadableString as rt } from "./utils/string.js"; import { formatNumber as at, getDefaultFormatOptions as st, getNumberFormatOptions as it, isNumericFromAttributes as mt, isNumericState as nt, round as pt } from "./utils/number.js"; import { LOCAL_TIME_ZONE as ft, TimeFormat as yt, TimeZone as gt, UNIT_TO_MILLISECOND_CONVERT as ct, checkValidDate as Et, formatAmPmSuffix as lt, formatDate as Tt, formatDateMonth as Dt, formatDateMonthYear as xt, formatDateNumeric as At, formatDateShort as St, formatDateTime as bt, formatDateTimeNumeric as Nt, formatDateTimeWithBrowserDefaults as Rt, formatDateTimeWithSeconds as Ct, formatDateVeryShort as ht, formatDateWeekday as It, formatDateWeekdayDay as dt, formatDateWeekdayShort as _t, formatDateYear as Lt, formatDuration as Ot, formatHour as vt, formatMinute as Ft, formatSeconds as Ut, formatShortDateTime as Mt, formatShortDateTimeWithConditionalYear as Bt, formatShortDateTimeWithYear as kt, formatTime as Wt, formatTimeWithoutAmPm as Pt, isDate as Ht, isTimestamp as Yt, millisecondsToDuration as Vt, resolveTimeZone as wt, shouldUseAmPm as zt } from "./utils/date.js"; import { stripPrefixFromEntityName as Zt } from "./utils/stripPrefixFromEntityName.js"; import { DEFAULT_STATES as Kt, DOMAINS_WITH_DYNAMIC_PICTURE as Xt, OFF as qt, OFF_STATES as Jt, ON as Qt, UNAVAILABLE as $t, UNAVAILABLE_STATES as er, UNIT_C as tr, UNIT_F as rr, UNKNOWN as or, isOffState as ar, isUnavailableState as sr } from "./data/entity.js"; import { loadTokens as mr, saveTokens as nr } from "./HassConnect/token-storage.js"; import { g as ur, u as fr, b as yr, a as gr, c as cr } from "../index-CPm3GSga.js"; import { useEntities as lr } from "./hooks/useEntities/index.js"; import { createService as Dr, useService as xr } from "./hooks/useService/index.js"; import { useLightBrightness as Sr } from "./hooks/useLightBrightness/index.js"; import { useLightTemperature as Nr } from "./hooks/useLightTemperature/index.js"; import { useLightColor as Cr } from "./hooks/useLightColor/index.js"; import { useLowDevices as Ir } from "./hooks/useLowDevices/index.js"; import { useDevice as _r } from "./hooks/useDevice/index.js"; import { useHistory as Or } from "./hooks/useHistory/index.js"; import { coordinates as Fr } from "./hooks/useHistory/coordinates.js"; import { useSubscribeEntity as Mr } from "./hooks/useSubscribeEntity/index.js"; import { useLogs as kr } from "./hooks/useLogs/index.js"; import { useHaStatus as Pr } from "./hooks/useHaStatus/index.js"; import { useUser as Yr } from "./hooks/useUser/index.js"; import { useUsers as wr } from "./hooks/useUsers/index.js"; import { useWeather as Gr } from "./hooks/useWeather/index.js"; import { getSupportedForecastTypes as jr } from "./hooks/useWeather/helpers.js"; import { CONTINUOUS_DOMAINS as Xr, createHistoricState as qr, localizeStateMessage as Jr, localizeTriggerSource as Qr, subscribeLogbook as $r } from "./hooks/useLogs/logbook.js"; import { useAreas as to } from "./hooks/useAreas/index.js"; import { default as oo } from "./hooks/useLocale/locales/index.js"; import { areaCompare as so, createAreaRegistryEntry as io, deleteAreaRegistryEntry as mo, getAreaDeviceLookup as no, getAreaEntityLookup as po, subscribeAreaRegistry as uo, updateAreaRegistryEntry as fo } from "./utils/subscribe/areas.js"; import { subscribeEntityRegistry as go } from "./utils/subscribe/entities.js"; import { subscribeFloorRegistry as Eo } from "./utils/subscribe/floors.js"; import { fetchEntitySourcesWithCache as To } from "./utils/subscribe/entity_sources.js"; import { DateFormat as xo, FirstWeekday as Ao, NumberFormat as So, findAvailableLanguage as bo, getUserLocaleLanguage as No, subscribeFrontendUserData as Ro } from "./utils/subscribe/frontend_data.js"; import { subscribeUser as ho, subscribeUsers as Io, userCollection as _o } from "./utils/subscribe/user.js"; import { useTemplate as Oo } from "./hooks/useTemplate/index.js"; import { useCamera as Fo } from "./hooks/useCamera/index.js"; import { useLocaleData as Mo } from "./hooks/useLocaleData/index.js"; import { useRegistryData as ko } from "./hooks/useRegistryData/index.js"; import { useFloors as Po } from "./hooks/useFloors/index.js"; import { ASPECT_RATIO_DEFAULT as Yo, CAMERA_ORIENTATIONS as Vo, CAMERA_SUPPORT_ON_OFF as wo, CAMERA_SUPPORT_STREAM as zo, MAX_IMAGE_WIDTH as Go, STREAM_TYPE_HLS as Zo, STREAM_TYPE_WEB_RTC as jo } from "./hooks/useCamera/constants.js"; import { LIGHT_COLOR_MODES as Xo } from "./types/autogenerated-types-by-domain.js"; import { batteryIconByLevel as Jo } from "./hooks/useIcon/domains/battery.js"; export { Yo as ASPECT_RATIO_DEFAULT, Vo as CAMERA_ORIENTATIONS, wo as CAMERA_SUPPORT_ON_OFF, zo as CAMERA_SUPPORT_STREAM, l as COLORS, Xr as CONTINUOUS_DOMAINS, U as DEFAULT_ENTITY_NAME, Kt as DEFAULT_STATES, Xt as DOMAINS_WITH_DYNAMIC_PICTURE, M as DOMAIN_ATTRIBUTES_FORMATTERS, B as DOMAIN_ATTRIBUTES_UNITS, xo as DateFormat, Ao as FirstWeekday, k as HassConnect, Xo as LIGHT_COLOR_MODES, ft as LOCAL_TIME_ZONE, Go as MAX_IMAGE_WIDTH, So as NumberFormat, qt as OFF, Jt as OFF_STATES, Qt as ON, Zo as STREAM_TYPE_HLS, jo as STREAM_TYPE_WEB_RTC, W as TEMPERATURE_ATTRIBUTES, x as THEME_COLORS, yt as TimeFormat, gt as TimeZone, $t as UNAVAILABLE, er as UNAVAILABLE_STATES, tr as UNIT_C, rr as UNIT_F, ct as UNIT_TO_MILLISECOND_CONVERT, or as UNKNOWN, so as areaCompare, Jo as batteryIconByLevel, et as caseInsensitiveStringCompare, Et as checkValidDate, P as computeAreaName, H as computeAttributeValueDisplay, A as computeCssColor, Y as computeDefaultFavoriteColors, V as computeDeviceName, w as computeDeviceNameDisplay, Ke as computeDomain, z as computeDomainTitle, G as computeEntityEntryName, Z as computeEntityName, j as computeEntityNameDisplay, K as computeEntityNameList, X as computeEntityRegistryName, q as computeFloorName, J as computeObjectId, Q as computeStateDisplay, $ as computeStateDisplayFromEntityAttributes, ee as computeStateName, te as computeStateNameFromEntityAttributes, Fr as coordinates, io as createAreaRegistryEntry, qr as createHistoricState, Dr as createService, mo as deleteAreaRegistryEntry, re as devicesInArea, oe as entityRegistryByEntityId, ae as entityRegistryById, se as entityUseDeviceName, b as expandHex, ie as fallbackDeviceName, me as fetchEntityRegistryDisplay, To as fetchEntitySourcesWithCache, bo as findAvailableLanguage, ne as findBatteryChargingEntity, pe as findBatteryEntity, lt as formatAmPmSuffix, Tt as formatDate, Dt as formatDateMonth, xt as formatDateMonthYear, At as formatDateNumeric, St as formatDateShort, bt as formatDateTime, Nt as formatDateTimeNumeric, Rt as formatDateTimeWithBrowserDefaults, Ct as formatDateTimeWithSeconds, ht as formatDateVeryShort, It as formatDateWeekday, dt as formatDateWeekdayDay, _t as formatDateWeekdayShort, Lt as formatDateYear, Ot as formatDuration, vt as formatHour, Ft as formatMinute, at as formatNumber, Ut as formatSeconds, Mt as formatShortDateTime, Bt as formatShortDateTimeWithConditionalYear, kt as formatShortDateTimeWithYear, Wt as formatTime, Pt as formatTimeWithoutAmPm, no as getAreaDeviceLookup, po as getAreaEntityLookup, ue as getAutomaticEntityIds, T as getColorByIndex, Ze as getCssColorValue, st as getDefaultFormatOptions, fe as getDeviceContext, ye as getDeviceEntityDisplayLookup, ge as getDeviceEntityLookup, ce as getDeviceIntegrationLookup, Ee as getDevices, le as getEntities, Te as getEntityContext, De as getEntityEntryContext, xe as getEntityPlatformLookup, Ae as getExtendedEntityRegistryEntries, Se as getExtendedEntityRegistryEntry, ur as getIconByEntity, be as getLightCurrentModeRgbColor, it as getNumberFormatOptions, C as getRGBContrastRatio, jr as getSupportedForecastTypes, No as getUserLocaleLanguage, Ne as getWeatherUnit, i as hex2rgb, N as hexBlend, m as hs2rgb, n as hsv2rgb, Ht as isDate, mt as isNumericFromAttributes, nt as isNumericState, ar as isOffState, Yt as isTimestamp, sr as isUnavailableState, p as lab2hex, u as lab2rgb, O as labBrighten, v as labDarken, Re as lightIsInColorMode, Ce as lightSupportsBrightness, he as lightSupportsColor, Ie as lightSupportsColorMode, de as lightSupportsFavoriteColors, mr as loadTokens, oo as locales, _e as localize, Jr as localizeStateMessage, Qr as localizeTriggerSource, h as luminosity, Vt as millisecondsToDuration, Le as removeConfigEntryFromDevice, Oe as removeEntityRegistryEntry, wt as resolveTimeZone, f as rgb2hex, y as rgb2hs, g as rgb2hsv, c as rgb2lab, I as rgbContrast, r as rgbw2rgb, o as rgbww2rgb, pt as round, nr as saveTokens, zt as shouldUseAmPm, ve as sortDeviceRegistryByName, Fe as sortEntityRegistryByName, Ue as stateActive, _ as stateColorBrightness, tt as stringCompare, Zt as stripPrefixFromEntityName, uo as subscribeAreaRegistry, Me as subscribeDeviceRegistry, go as subscribeEntityRegistry, Be as subscribeEntityRegistryDisplay, Eo as subscribeFloorRegistry, Ro as subscribeFrontendUserData, $r as subscribeLogbook, ho as subscribeUser, Io as subscribeUsers, qe as supportsFeatureFromAttributes, a as temperature2rgb, Qe as timeAgo, rt as toReadableString, fo as updateAreaRegistryEntry, ke as updateDeviceRegistryEntry, We as updateEntityRegistryEntry, Pe as updateLocales, to as useAreas, Fo as useCamera, He as useConfig, _r as useDevice, lr as useEntities, fr as useEntity, Po as useFloors, Pr as useHaStatus, Ye as useHass, Or as useHistory, yr as useIcon, gr as useIconByDomain, cr as useIconByEntity, Sr as useLightBrightness, Cr as useLightColor, Nr as useLightTemperature, Ve as useLocale, Mo as useLocaleData, we as useLocales, kr as useLogs, Ir as useLowDevices, ko as useRegistryData, xr as useService, ze as useStore, Mr as useSubscribeEntity, Oo as useTemplate, Yr as useUser, wr as useUsers, Gr as useWeather, _o as userCollection }; //# sourceMappingURL=index.js.map