UNPKG

iobroker.nspanel-lovelace-ui

Version:

NsPanel Lovelace UI is a Firmware for the nextion screen inside of NSPanel in the Design of Lovelace UI Design.

1,538 lines (1,469 loc) 231 kB
export { }; async function configuration (): Promise<void> { /************************************************************************************** ** ** ** https://github.com/ticaki/ioBroker.nspanel-lovelace-ui/wiki/Adapter-Installation ** ** ** *************************************************************************************/ /*********************************************************************** ** ** ** Page Configuration ** ** ** ***********************************************************************/ const Hauptseite: ScriptConfig.PageType = { type: 'cardGrid', uniqueName: 'global_main', heading: 'Die Leere', items: [] }; const globalPagesConfig: ScriptConfig.globalPagesConfig = { type: 'globalConfig', //mandatory // global pages subPages: [ Hauptseite ], }; /** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** * END STOP END STOP END - No more configuration - END STOP END STOP END * ******************************************************************************** * For a update copy and paste the code below from orginal file. * * ****************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** */ try { log(await sendToAsync('nspanel-lovelace-ui.0', 'ScriptConfigGlobal', {...globalPagesConfig, version}, {timeout: 30_000})); } catch (e) { log(`Error in sendTo ScriptConfig: ${e}! This usually means that the adapter is not working!`, 'error'); } stopScript(scriptName, undefined) } const version = '0.13.0'; const HMIOff = {red: 68, green: 115, blue: 158}; // Blue-Off - Original Entity Off const HMIOn = {red: 3, green: 169, blue: 244}; // Blue-On const HMIDark = {red: 29, green: 29, blue: 29}; // Original Background Color const Off = {red: 253, green: 128, blue: 0}; // Orange-Off - nicer color transitions const On = {red: 253, green: 216, blue: 53}; const MSRed = {red: 251, green: 105, blue: 98}; const MSYellow = {red: 255, green: 235, blue: 156}; const MSGreen = {red: 121, green: 222, blue: 121}; const Red = {red: 255, green: 0, blue: 0}; const White = {red: 255, green: 255, blue: 255}; const Yellow = {red: 255, green: 255, blue: 0}; const Green = {red: 0, green: 255, blue: 0}; const Blue = {red: 0, green: 0, blue: 255}; const DarkBlue = {red: 0, green: 0, blue: 136}; const Gray = {red: 136, green: 136, blue: 136}; const Black = {red: 0, green: 0, blue: 0}; const Cyan = {red: 0, green: 255, blue: 255}; const Magenta = {red: 255, green: 0, blue: 255}; const colorSpotify = {red: 30, green: 215, blue: 96}; const colorAlexa = {red: 49, green: 196, blue: 243}; const colorSonos = {red: 216, green: 161, blue: 88}; const colorRadio = {red: 255, green: 127, blue: 0}; const BatteryFull = {red: 96, green: 176, blue: 62}; const BatteryEmpty = {red: 179, green: 45, blue: 25}; //Menu Icon Colors const Menu = {red: 150, green: 150, blue: 100}; const MenuLowInd = {red: 255, green: 235, blue: 156}; const MenuHighInd = {red: 251, green: 105, blue: 98}; //Dynamische Indikatoren (Abstufung grün nach gelb nach rot) const colorScale0 = {red: 99, green: 190, blue: 123}; const colorScale1 = {red: 129, green: 199, blue: 126}; const colorScale2 = {red: 161, green: 208, blue: 127}; const colorScale3 = {red: 129, green: 217, blue: 126}; const colorScale4 = {red: 222, green: 226, blue: 131}; const colorScale5 = {red: 254, green: 235, blue: 132}; const colorScale6 = {red: 255, green: 210, blue: 129}; const colorScale7 = {red: 251, green: 185, blue: 124}; const colorScale8 = {red: 251, green: 158, blue: 117}; const colorScale9 = {red: 248, green: 131, blue: 111}; const colorScale10 = {red: 248, green: 105, blue: 107}; //Screensaver Default Theme Colors const scbackground = {red: 0, green: 0, blue: 0}; const scbackgroundInd1 = {red: 255, green: 0, blue: 0}; const scbackgroundInd2 = {red: 121, green: 222, blue: 121}; const scbackgroundInd3 = {red: 255, green: 255, blue: 0}; const sctime = {red: 255, green: 255, blue: 255}; const sctimeAMPM = {red: 255, green: 255, blue: 255}; const scdate = {red: 255, green: 255, blue: 255}; const sctMainIcon = {red: 255, green: 255, blue: 255}; const sctMainText = {red: 255, green: 255, blue: 255}; const sctForecast1 = {red: 255, green: 255, blue: 255}; const sctForecast2 = {red: 255, green: 255, blue: 255}; const sctForecast3 = {red: 255, green: 255, blue: 255}; const sctForecast4 = {red: 255, green: 255, blue: 255}; const sctF1Icon = {red: 255, green: 235, blue: 156}; const sctF2Icon = {red: 255, green: 235, blue: 156}; const sctF3Icon = {red: 255, green: 235, blue: 156}; const sctF4Icon = {red: 255, green: 235, blue: 156}; const sctForecast1Val = {red: 255, green: 255, blue: 255}; const sctForecast2Val = {red: 255, green: 255, blue: 255}; const sctForecast3Val = {red: 255, green: 255, blue: 255}; const sctForecast4Val = {red: 255, green: 255, blue: 255}; const scbar = {red: 255, green: 255, blue: 255}; const sctMainIconAlt = {red: 255, green: 255, blue: 255}; const sctMainTextAlt = {red: 255, green: 255, blue: 255}; const sctTimeAdd = {red: 255, green: 255, blue: 255}; //Auto-Weather-Colors const swClearNight = {red: 150, green: 150, blue: 100}; const swCloudy = {red: 75, green: 75, blue: 75}; const swExceptional = {red: 255, green: 50, blue: 50}; const swFog = {red: 150, green: 150, blue: 150}; const swHail = {red: 200, green: 200, blue: 200}; const swLightning = {red: 200, green: 200, blue: 0}; const swLightningRainy = {red: 200, green: 200, blue: 150}; const swPartlycloudy = {red: 150, green: 150, blue: 150}; const swPouring = {red: 50, green: 50, blue: 255}; const swRainy = {red: 100, green: 100, blue: 255}; const swSnowy = {red: 150, green: 150, blue: 150}; const swSnowyRainy = {red: 150, green: 150, blue: 255}; const swSunny = {red: 255, green: 255, blue: 0}; const swWindy = {red: 150, green: 150, blue: 150}; type PageType = ScriptConfig.PageType; type PageBaseType = ScriptConfig.PageBaseType; type PageItem = ScriptConfig.PageItem; type PageBaseItem = ScriptConfig.PageBaseItem; type PageMediaItem = ScriptConfig.PageMediaItem; type PageThermoItem = ScriptConfig.PageThermoItem; type PageThermo2Item = ScriptConfig.PageThermo2Item; type PageEntities = ScriptConfig.PageEntities; type PageGrid = ScriptConfig.PageGrid; type PageGrid2 = ScriptConfig.PageGrid2; type PageGrid3 = ScriptConfig.PageGrid3; type PageThermo = ScriptConfig.PageThermo; type PageThermo2 = ScriptConfig.PageThermo2; type PageMedia = ScriptConfig.PageMedia; type PageAlarm = ScriptConfig.PageAlarm; type PageUnlock = ScriptConfig.PageUnlock; type PageQR = ScriptConfig.PageQR; type PagePower = ScriptConfig.PagePower; type PageChart = ScriptConfig.PageChart; type PagetypeType = ScriptConfig.PagetypeType; type NavigationItemConfig = ScriptConfig.NavigationItemConfig; declare namespace ScriptConfig { export type PopupType = | 'popupFan' | 'popupInSel' | 'popupLight' | 'popupLightNew' | 'popupNotify' | 'popupShutter' | 'popupThermo' | 'popupTimer'; export type EventMethod = | 'startup' | 'sleepReached' | 'pageOpenDetail' | 'buttonPress2' | 'buttonPress3' | 'renderCurrentPage' | 'button1' | 'button2'; export type panelRecvType = { event: 'event'; method: EventMethod; }; export type NavigationItemConfig = { name: string; left?: { single?: string; double?: string; }; right?: { single?: string; double?: string; }; page: string; optional?: never; } | null; export type SerialType = 'button' | 'light' | 'shutter' | 'text' | 'input_sel' | 'timer' | 'number' | 'fan'; /** * Defines the possible roles for entities in the NSPanel. * * This type represents the various roles that entities can have within the NSPanel system. * */ export type roles = | 'light' | 'socket' | 'dimmer' | 'hue' | 'rgb' | 'rgbSingle' | 'ct' | 'blind' | 'door' | 'window' | 'volumeGroup' | 'volume' | 'info' | 'humidity' | 'temperature' | 'value.temperature' | 'value.humidity' | 'thermostat' | 'warning' | 'cie' | 'gate' | 'motion' | 'buttonSensor' | 'button' | 'value.time' | 'level.timer' | 'value.alarmtime' | 'level.mode.fan' | 'lock' | 'slider' | 'switch.mode.wlan' | 'media' | 'timeTable' | 'airCondition'; export type ButtonActionType = | 'bExit' | 'bUp' | 'bNext' | 'bSubNext' | 'bPrev' | 'bSubPrev' | 'bHome' | 'notifyAction' | 'OnOff' | 'button' | 'up' | 'stop' | 'down' | 'positionSlider' | 'tiltOpen' | 'tiltStop' | 'tiltSlider' | 'tiltClose' | 'brightnessSlider' | 'colorTempSlider' | 'colorWheel' | 'tempUpd' | 'tempUpdHighLow' | 'media-back' | 'media-pause' | 'media-next' | 'media-shuffle' | 'volumeSlider' | 'mode-speakerlist' | 'mode-playlist' | 'mode-tracklist' | 'mode-repeat' | 'mode-equalizer' | 'mode-seek' | 'mode-crossfade' | 'mode-favorites' | 'mode-insel' | 'media-OnOff' | 'timer-start' | 'timer-pause' | 'timer-cancle' | 'timer-finish' | 'hvac_action' | 'mode-modus1' | 'mode-modus2' | 'mode-modus3' | 'number-set' | 'mode-preset_modes' | 'A1' | 'A2' | 'A3' | 'A4' | 'D1' | 'U1' | 'f1Icon' | 'f2Icon' | 'f3Icon' | 'f4Icon' | 'f5Icon'; export type RGB = { red: number; green: number; blue: number; }; export type Payload = { payload: string; }; export type PageBaseType = { type: PagetypeType; uniqueName: string; heading: string; items: PageItem[]; useColor?: boolean; subPage?: boolean; parent?: string; parentIcon?: string; parentIconColor?: RGB; prev?: string; prevIcon?: string; prevIconColor?: RGB; next?: string; nextIcon?: string; nextIconColor?: RGB; home?: string; homeIcon?: string; homeIconColor?: RGB; hiddenByTrigger?: boolean; alwaysOnDisplay?: boolean | 'action' | null; }; export type PagetypeType = | 'cardChart' | 'cardLChart' | 'cardEntities' | 'cardSchedule' | 'cardGrid' | 'cardGrid2' | 'cardGrid3' | 'cardThermo' | 'cardThermo2' | 'cardMedia' | 'cardUnlock' | 'cardQR' | 'cardAlarm' | 'cardPower'; //| 'cardBurnRec' export type PageTypeGlobal = | PageChart | PageEntities | PageSchedule | PageGrid | PageGrid2 | PageGrid3 | PageThermo | PageThermo2 | PageMedia | PageUnlock | PageQR | PageAlarm | PagePower | PageNative; export type PageType = | PageTypeGlobal | PageLink; export type PageLink = { heading?: string; globalLink: string; } & Pick<PageBaseType, 'prev' | 'next' | 'home' | 'parent'>; export type PageNative = { type: undefined; heading?: string; native: any; } & Pick<PageBaseType, 'uniqueName' | 'prev' | 'next' | 'home' | 'parent'>; export type PageEntities = { type: 'cardEntities'; items: PageItem[]; //4 } & PageBaseType & PageMenuBaseConfig; export type PageSchedule = { type: 'cardSchedule'; items: PageItem[]; //5 } & PageBaseType & PageMenuBaseConfig; export type PageGrid = { type: 'cardGrid'; items: PageItem[]; // 6 } & PageBaseType & PageMenuBaseConfig; export type PageGrid2 = { type: 'cardGrid2'; items: PageItem[]; // 8 } & PageBaseType & PageMenuBaseConfig; export type PageGrid3 = { type: 'cardGrid3'; items: PageItem[]; //4 } & PageBaseType & PageMenuBaseConfig; export type PageThermo = { type: 'cardThermo'; items: [PageThermoItem]; } & Omit<PageBaseType, 'useColor'>; export type PageThermo2 = { type: 'cardThermo2'; thermoItems: PageThermo2Item[]; items: PageThermo2PageItems[]; sortOrder?: 'H' | 'V' | 'HM' | 'VM' | 'HB' | 'VB'; } & Omit<PageBaseType, 'useColor'> & PageMenuBaseConfig; export type PageMedia = { type: 'cardMedia'; media: PageMediaItem; items: PageItem[]; } & Omit<PageBaseType, 'useColor' | 'autoCreateAlias'> & PageMenuBaseConfig; export type PageAlarm = { type: 'cardAlarm'; items: [PageItem]; } & PageBaseType; export type PageUnlock = { type: 'cardUnlock'; items: [PageItem]; } & PageBaseType; export type PageQR = { type: 'cardQR'; } & Omit<PageBaseType, 'useColor' | 'heading' | 'items'>; export type PagePower = { type: 'cardPower'; } & Omit<PageBaseType, 'useColor' | 'heading' | 'items'>; export type PageChart = { type: 'cardChart' | 'cardLChart'; } & Omit<PageBaseType, 'useColor' | 'heading' | 'items'>; export type PageItem = PageBaseItem | PageThermoItem; /** * Base configuration for page menus. * Controls scroll behavior, filtering and presentation mode. */ type PageMenuBaseConfig = { /** * Defines how many items are scrolled at once. * - `"page"`: Scroll by a full page (all visible items). * - `"half"`: Scroll by half a page (only supported by certain card types). */ scrollType?: 'page' | 'half'; /** * Filters which items are shown. * - `"true"`: Show only items whose primary entity resolves to `true`. * - `"false"`: Show only items whose primary entity resolves to `false`. * - `number`: Show only items matching the given numeric filter value. */ filterType?: 'true' | 'false' | number; } & ( /** * Standard scroll presentations. * - `"classic"`: Windowed paging with optional `"half"`/`"page"` stride. * - `"arrow"`: Fixed number of slots, last slot can show a paging arrow. * Defaults to `"classic"`. */ {scrollPresentation?: 'classic' | 'arrow'} | { /** * Special mode that behaves like `"classic"`, * including `"half"`/`"page"` support. * Pages automatically advance after a fixed interval. */ scrollPresentation: 'auto'; /** * Interval (in seconds) to automatically advance to the next page. * Always required in `"auto"` mode. * Defaults to `15` seconds if not specified. */ scrollAutoTiming: number; } ); export type PageMediaItem = { /** * The media dp to use, most a folder, device or channel. Not a state. */ id: string; name?: string; mediaDevice?: string; //??? colorMediaIcon?: RGB; colorMediaArtist?: RGB; colorMediaTitle?: RGB; speakerList?: string[]; /** * Optional list of predefined volume presets. * Each entry must be a string formatted as "name?value", * e.g. ["quiet?5", "loud?95"]. * * - `name`: Label shown in the UI. * - `value`: Volume level (as stringified number). * * Notes: * - The effective volume will be clamped to `minValue` and `maxValue`. * For example, with minValue = 40 and maxValue = 60, * "loud?100" will result in volume = 60. */ volumePresets?: string[]; /** * List of favorite playlists (whitelist). * - If present and non-empty, only the playlists in this list are shown. * - If empty or undefined, all available playlists are shown. */ favoriteList?: string[]; /** * List of available playlists. * - Alexa & Spotify: contains the playlists provided by the adapter. * - Sonos: contains user-defined playlists, since Sonos playlists cannot be read by the adapter. */ playList?: string[]; equalizerList?: string[]; repeatList?: string[]; globalTracklist?: string[]; /* Volume */ minValue?: number; /* Volume */ maxValue?: number; /** detailed configuration */ itemsColorOn?: { trackList?: RGB; speakerList?: RGB; repeat?: RGB; equalizer?: RGB; playList?: RGB; online?: RGB; reminder?: RGB; crossfade?: RGB; favoriteList?: RGB; volumePresets?: RGB; }; itemsColorOff?: { trackList?: RGB; speakerList?: RGB; repeat?: RGB; equalizer?: RGB; playList?: RGB; online?: RGB; reminder?: RGB; crossfade?: RGB; favoriteList?: RGB; volumePresets?: RGB; }; deactivateDefaultItems?: { trackList?: boolean; speakerList?: boolean; repeat?: boolean; equalizer?: boolean; playList?: boolean; online?: boolean; reminder?: boolean; clock?: boolean; favoriteList?: boolean; crossfade?: boolean; }; }; export type PageThermoItem = { popupThermoMode1?: string[]; popupThermoMode2?: string[]; popupThermoMode3?: string[]; popUpThermoName?: string[]; setThermoAlias?: string[]; setThermoDestTemp2?: string; } & PageBaseItem; export type PageThermo2PageItems = { heatCycleIndex?: number; } & PageBaseItem; export type PageThermo2Item = ( | { // temperature data point thermoId1: string; // humidity data point thermoId2?: string; // mode data point (common.states) modeId?: string; // set data point (writeable) set: string; } | { //channel with all data id: string; // for cooling part of a airCondition name2?: string; iconHeatCycle2?: AllIcons | ''; iconHeatCycleOnColor2?: RGB; iconHeatCycleOffColor2?: RGB; } ) & { // icon id icon?: AllIcons | ''; // icon for id2 icon2?: AllIcons | ''; // icon for the pageitem iconHeatCycle?: AllIcons | ''; iconHeatCycleOnColor?: RGB; iconHeatCycleOffColor?: RGB; // headline name?: string; // 100 === 10.0 minValue?: number; maxValue?: number; stepValue?: number; /** * The unit of the 2. line. can string, icon or state */ power?: string; unit2?: string; onColor2?: RGB; unit?: string; onColor?: RGB; // array of stings for mode modeList?: string[]; } // mean string start with getState(' and end with ').val type getStateID = string; export type PageBaseItem = | ({ /** * Native configuration no validation */ native: any; } & ({navigate: boolean; targetPage: string} | {navigate?: undefined; targetPage?: undefined})) | (( | { navigate: true; targetPage: string; /** * The data point with the data to be used. */ id?: string | null; } | { /** * The data point with the data to be used. */ id: string; navigate?: false | null | undefined; } ) & { uniqueName?: string; role?: string; /** * The icon that is used in the standard case or if ID is true */ icon?: AllIcons; /** * The icon that is used when id is false */ icon2?: AllIcons; /** * Used with blinds for partially open. */ icon3?: AllIcons; /** * The color that is used in the standard case or if ID is true */ onColor?: RGB; /** * The color that is used when id is false */ offColor?: RGB; useColor?: boolean; /** * Interpolate the icon colour by ID */ interpolateColor?: boolean; minValueBrightness?: number; maxValueBrightness?: number; minValueColorTemp?: number; maxValueColorTemp?: number; minValueLevel?: number; maxValueLevel?: number; minValueTilt?: number; maxValueTilt?: number; minValue?: number; maxValue?: number; stepValue?: number; prefixName?: string; suffixName?: string; prefixValue?: string; suffixValue?: string; name?: string; secondRow?: string; buttonText?: string; unit?: string; colormode?: string; colorScale?: IconScaleElement; modeList?: string[]; hidePassword?: boolean; autoCreateALias?: boolean; yAxis?: string; yAxisTicks?: number[] | string; xAxisDecorationId?: string; useValue?: boolean; monobutton?: boolean; inSel_ChoiceState?: boolean; inSel_Alias?: string; iconArray?: string[]; customIcons?: any[]; shutterIcons?: [shutterIcons?, shutterIcons?, shutterIcons?] | null; fontSize?: 0 | 1 | 2 | 3 | 4 | 5; actionStringArray?: string[]; alwaysOnDisplay?: boolean; /** * Wird vom Skript verwendet um zu entscheiden welches Popup verwendet wird. * Adapter verwendet immer die neuen Popups außer wenn beim popupShutter tilt vorhanden ist * dann wird das alte verwendet! * * @deprecated unused in adapter */ popupVersion?: number; shutterType?: string; sliderItems?: [sliderItems?, sliderItems?, sliderItems?] | null; filter?: number; enabled?: boolean | string; // erstmal für media mit id keine erstellung einer mediaCard - nur schalten asControl?: boolean; }); type sliderItems = { heading: string; icon1?: string; icon2?: string; minValue?: number; maxValue?: number; stepValue?: number; zeroValue?: boolean; id?: string; // writeable overwrite actual and set }; type shutterIcons = { id: string; icon: string; icon2?: string; iconOnColor?: RGB; iconOffColor?: RGB; buttonType: string; }; export type DimMode = { dimmodeOn: boolean | undefined; brightnessDay: number | undefined; brightnessNight: number | undefined; timeDay: string | undefined; timeNight: string | undefined; }; /** * Represents the configuration for a button function. * This type can be one of the following modes: * - 'page': Navigates to a specified page. * - 'switch': Toggles the state of a datapoint. * - 'button': Triggers a button datapoint with a true value. * - null: Represents no configuration. */ export type ConfigButtonFunction = | { /** * Mode for navigating to a page. * */ mode: 'page'; /** * The page to navigate to. * * @optional */ page?: string; } | { /** * Mode for toggling a datapoint. * */ mode: 'switch'; /** * The state of the datapoint to toggle. * */ state: string; } | { /** * Mode for triggering a button datapoint. * */ mode: 'button'; /** * The state of the button datapoint to trigger. * */ state: string; } | null; export type globalPagesConfig = { version?: string; type: 'globalConfig'; subPages: PageTypeGlobal[]; nativePageItems?: any[]; navigation?: NavigationItemConfig[]; }; export type leftScreensaverEntityType = | [ScreenSaverElementWithUndefined?, ScreenSaverElementWithUndefined?, ScreenSaverElementWithUndefined?] | []; export type indicatorScreensaverEntityType = | [ ScreenSaverElementWithUndefined?, ScreenSaverElementWithUndefined?, ScreenSaverElementWithUndefined?, ScreenSaverElementWithUndefined?, ScreenSaverElementWithUndefined?, ] | []; export type ScreenSaverElementWithUndefined = null | undefined | ScreenSaverElement; export type ScreenSaverElement = {type: ScreenSaverType} & ( | { type: 'script'; ScreensaverEntity: string; ScreensaverEntityText: string; /** * Value wird mit diesem Factor multipliziert. */ ScreensaverEntityFactor?: number; ScreensaverEntityDecimalPlaces?: number; ScreensaverEntityDateFormat?: Intl.DateTimeFormatOptions; ScreensaverEntityIconOn?: string | null; ScreensaverEntityIconOff?: string | null; ScreensaverEntityUnitText?: string; ScreensaverEntityIconColor?: RGB | IconScaleElement | string; ScreensaverEntityOnColor?: RGB; ScreensaverEntityOffColor?: RGB; ScreensaverEntityOnText?: string | null; ScreensaverEntityOffText?: string | null; ScreensaverEntityNaviToPage?: string | null; ScreensaverEntityButton?: string | null; ScreensaverEntitySwitch?: string | null; /** * To show different icons for different values in the screensaver * * Value is the threshold for the icon. Lower values are first. * Example: * [ {icon: 'sun-thermometer', value:40}, {icon: 'sun-thermometer-outline', value: 35}, {icon: 'thermometer-high', value: 30}, {icon: 'thermometer', value: 25}, {icon: 'thermometer-low', value: 15}, {icon: 'snowflake-alert', value: 2}, {icon: 'snowflake-thermometer', value: -2}, {icon: 'snowflake', value: -10}, ] */ ScreensaverEntityIconSelect?: {icon: string; value: number}[] | null; } & { /** * Optional condition that determines whether a ScreensaverEntity should be visible. * * - If `undefined`, the entity is always shown (`true`). * - If provided, the adapter prepends `return` to the string and evaluates it. * The result must be a boolean: * - `true` → the entity is shown. * - `false` → the entity is hidden. * * Example: * ```ts * ScreensaverEntityVisibleCondition: "val.length > 0 && val !== 'OFF'" * ``` */ ScreensaverEntityEnabled?: string; ScreensaverEntityVisibleCondition?: string; } | {type: 'native'; native: any} | ({ type: 'template'; template: string; dpInit: string; readOptions?: Record<string, any>; modeScr: 'left' | 'bottom' | 'indicator' | 'favorit' | 'alternate'; } & ({enabled: string; visibleCondition?: string} | {enabled?: string})) ); export type ScreenSaverNotifyElement = {type: ScreenSaverType} & ( | ({ type: 'script'; /** * Lower number = higher priority */ Priority: number; Headline: string; HeadlinePrefix?: string; HeadlineUnit?: string; Text: string; TextSuffix?: string; TextPrefix?: string; HeadlineIcon?: string | null; } & ( | { Enabled?: string | null | string[]; } | { /** * Condition that determines whether a Notify should be visible. * * - If `undefined`, the entity is always shown (`true`). * - If provided, the adapter prepends `return` to the string and evaluates it. * The result must be a boolean: * - `true` → the entity is shown. * - `false` → the entity is hidden. * * Example: * ```ts * VisibleCondition: "val.length > 0 && val !== 'OFF'" * ``` */ Enabled: string | string[]; VisibleCondition?: string; } )) | {type: 'native'; native: any} | { type: 'template'; template: string; dpInit: string; enabled?: string; visibleCondition?: string; modeScr: 'left' | 'bottom' | 'indicator' | 'favorit' | 'alternate'; } ); export type WeatherAddDefaultItemsJson = { sunriseSet?: boolean; // Sunrise/Sunset forecastDay1?: boolean; // Forecast Day 1 forecastDay2?: boolean; // Forecast Day 2 forecastDay3?: boolean; // Forecast Day 3 forecastDay4?: boolean; // Forecast Day 4 forecastDay5?: boolean; // Forecast Day 5 forecastDay6?: boolean; // Forecast Day 6 (falls vom Adapter unterstützt) windSpeed?: boolean; // Windgeschwindigkeit windGust?: boolean; // Böen windDirection?: boolean; // Windrichtung uvIndex?: boolean; // UV-Index (falls vom Adapter unterstützt) solar?: boolean; // Solarstrahlung (falls vom Adapter unterstützt) }; export type ScreenSaverMRElement = {type: ScreenSaverType} & ( | { type: 'script'; ScreensaverEntity: string | null; ScreensaverEntityIconOn: string | null; ScreensaverEntityIconSelect?: {[key: string]: string} | null | undefined; ScreensaverEntityIconOff: string | null; ScreensaverEntityValue: string | null; ScreensaverEntityValueDecimalPlace: number | null; ScreensaverEntityValueUnit: string | null; ScreensaverEntityOnColor: RGB; ScreensaverEntityOffColor: RGB; } ); type ScreenSaverType = 'template' | 'script' | 'native'; export type IconScaleElement = { val_min: number; val_max: number; val_best?: number; /** * The 3. color for color best. Only with val_best. */ color_best?: RGB;/** /** * The color mix mode. Default is 'mixed'. * ‘mixed’: the target colour is achieved by scaling between the two RGB colours. 2 colours are required. * 'cie': the target colour is achieved by mixing according to the CIE colour table. 2 colours are required. * 'hue': the target colour is calculated by scaling via colour, saturation and brightness. 2 colours are required. * 'triGrad': the target colour is interpolated in a three-color gradient from red to green. Colours are ignored * 'triGradAnchor': the target colour is interpolated in a three-color gradient from red to green, Yellow is anchored to val_best. Colours are ignored * 'quadriGrad': the target colour is interpolated in a four-color gradient from red to yellow, green and blue. Colours are ignored. * 'quadriGradAnchor': the target colour is interpolated in a four-color gradient from red to yellow, green and blue. green is anchored to val_best. Colours are ignored. */ mode?: 'mixed' | 'hue' | 'cie' | 'triGrad' | 'triGradAnchor' | 'quadriGrad' | 'quadriGradAnchor'; /** * The logarithm scaling to max, min or leave undefined for linear scaling. */ log10?: 'max' | 'min'; valIcon_min?: number; valIcon_max?: number }; /** we need this to have a nice order when using switch() */ export type adapterPlayerInstanceType = | 'alexa2.0.' | 'alexa2.1.' | 'alexa2.2.' | 'alexa2.3.' | 'alexa2.4.' | 'alexa2.5.' | 'alexa2.6.' | 'alexa2.7.' | 'alexa2.8.' | 'alexa2.9.' | 'sonos.0.' | 'sonos.1.' | 'sonos.2.' | 'sonos.3.' | 'sonos.4.' | 'sonos.5.' | 'sonos.6.' | 'sonos.7.' | 'sonos.8.' | 'sonos.9.' | 'spotify-premium.0.' | 'spotify-premium.1.' | 'spotify-premium.2.' | 'spotify-premium.3.' | 'spotify-premium.4.' | 'spotify-premium.5.' | 'spotify-premium.6.' | 'spotify-premium.7.' | 'spotify-premium.8.' | 'spotify-premium.9.' | 'volumio.0.' | 'volumio.1.' | 'volumio.2.' | 'volumio.3.' | 'volumio.4.' | 'volumio.5.' | 'volumio.6.' | 'volumio.7.' | 'volumio.8.' | 'volumio.9.' | 'squeezeboxrpc.0.' | 'squeezeboxrpc.1.' | 'squeezeboxrpc.2.' | 'squeezeboxrpc.3.' | 'squeezeboxrpc.4.' | 'squeezeboxrpc.5.' | 'squeezeboxrpc.6.' | 'squeezeboxrpc.7.' | 'squeezeboxrpc.8.' | 'squeezeboxrpc.9.' | 'bosesoundtouch.0.' | 'bosesoundtouch.1.' | 'bosesoundtouch.2.' | 'bosesoundtouch.3.' | 'bosesoundtouch.4.' | 'bosesoundtouch.5.' | 'bosesoundtouch.6.' | 'bosesoundtouch.7.' | 'bosesoundtouch.8.' | 'bosesoundtouch.9.'; export type PlayerType = _PlayerTypeWithMediaDevice | _PlayerTypeWithOutMediaDevice; export type _PlayerTypeWithOutMediaDevice = 'spotify-premium' | 'volumio' | 'bosesoundtouch'; export type _PlayerTypeWithMediaDevice = 'alexa2' | 'sonos' | 'squeezeboxrpc'; export type notSortedPlayerType = | `${PlayerType}.0.` | `${PlayerType}.1.` | `${PlayerType}.2.` | `${PlayerType}.3.` | `${PlayerType}.4.` | `${PlayerType}.5.` | `${PlayerType}.6.` | `${PlayerType}.7.` | `${PlayerType}.8.` | `${PlayerType}.9.`; export type mediaOptional = | 'seek' | 'crossfade' | 'speakerlist' | 'playlist' | 'tracklist' | 'equalizer' | 'repeat' | 'favorites'; export type AllIcons = | 'ab-testing' | 'abacus' | 'abjad-arabic' | 'abjad-hebrew' | 'abugida-devanagari' | 'abugida-thai' | 'access-point' | 'access-point-check' | 'access-point-minus' | 'access-point-network' | 'access-point-network-off' | 'access-point-off' | 'access-point-plus' | 'access-point-remove' | 'account' | 'account-alert' | 'account-alert-outline' | 'account-arrow-down' | 'account-arrow-down-outline' | 'account-arrow-left' | 'account-arrow-left-outline' | 'account-arrow-right' | 'account-arrow-right-outline' | 'account-arrow-up' | 'account-arrow-up-outline' | 'account-box' | 'account-box-multiple' | 'account-box-multiple-outline' | 'account-box-outline' | 'account-cancel' | 'account-cancel-outline' | 'account-cash' | 'account-cash-outline' | 'account-check' | 'account-check-outline' | 'account-child' | 'account-child-circle' | 'account-child-outline' | 'account-circle' | 'account-circle-outline' | 'account-clock' | 'account-clock-outline' | 'account-cog' | 'account-cog-outline' | 'account-convert' | 'account-convert-outline' | 'account-cowboy-hat' | 'account-cowboy-hat-outline' | 'account-details' | 'account-details-outline' | 'account-edit' | 'account-edit-outline' | 'account-eye' | 'account-eye-outline' | 'account-filter' | 'account-filter-outline' | 'account-group' | 'account-group-outline' | 'account-hard-hat' | 'account-hard-hat-outline' | 'account-heart' | 'account-heart-outline' | 'account-injury' | 'account-injury-outline' | 'account-key' | 'account-key-outline' | 'account-lock' | 'account-lock-open' | 'account-lock-open-outline' | 'account-lock-outline' | 'account-minus' | 'account-minus-outline' | 'account-multiple' | 'account-multiple-check' | 'account-multiple-check-outline' | 'account-multiple-minus' | 'account-multiple-minus-outline' | 'account-multiple-outline' | 'account-multiple-plus' | 'account-multiple-plus-outline' | 'account-multiple-remove' | 'account-multiple-remove-outline' | 'account-music' | 'account-music-outline' | 'account-network' | 'account-network-outline' | 'account-off' | 'account-off-outline' | 'account-outline' | 'account-plus' | 'account-plus-outline' | 'account-question' | 'account-question-outline' | 'account-reactivate' | 'account-reactivate-outline' | 'account-remove' | 'account-remove-outline' | 'account-school' | 'account-school-outline' | 'account-search' | 'account-search-outline' | 'account-settings' | 'account-settings-outline' | 'account-star' | 'account-star-outline' | 'account-supervisor' | 'account-supervisor-circle' | 'account-supervisor-circle-outline' | 'account-supervisor-outline' | 'account-switch' | 'account-switch-outline' | 'account-sync' | 'account-sync-outline' | 'account-tie' | 'account-tie-hat' | 'account-tie-hat-outline' | 'account-tie-outline' | 'account-tie-voice' | 'account-tie-voice-off' | 'account-tie-voice-off-outline' | 'account-tie-voice-outline' | 'account-tie-woman' | 'account-voice' | 'account-voice-off' | 'account-wrench' | 'account-wrench-outline' | 'adjust' | 'advertisements' | 'advertisements-off' | 'air-conditioner' | 'air-filter' | 'air-horn' | 'air-humidifier' | 'air-humidifier-off' | 'air-purifier' | 'airbag' | 'airballoon' | 'airballoon-outline' | 'airplane' | 'airplane-alert' | 'airplane-check' | 'airplane-clock' | 'airplane-cog' | 'airplane-edit' | 'airplane-landing' | 'airplane-marker' | 'airplane-minus' | 'airplane-off' | 'airplane-plus' | 'airplane-remove' | 'airplane-search' | 'airplane-settings' | 'airplane-takeoff' | 'airport' | 'alarm' | 'alarm-bell' | 'alarm-check' | 'alarm-light' | 'alarm-light-off' | 'alarm-light-off-outline' | 'alarm-light-outline' | 'alarm-multiple' | 'alarm-note' | 'alarm-note-off' | 'alarm-off' | 'alarm-panel' | 'alarm-panel-outline' | 'alarm-plus' | 'alarm-snooze' | 'album' | 'alert' | 'alert-box' | 'alert-box-outline' | 'alert-circle' | 'alert-circle-check' | 'alert-circle-check-outline' | 'alert-circle-outline' | 'alert-decagram' | 'alert-decagram-outline' | 'alert-minus' | 'alert-minus-outline' | 'alert-octagon' | 'alert-octagon-outline' | 'alert-octagram' | 'alert-octagram-outline' | 'alert-outline' | 'alert-plus' | 'alert-plus-outline' | 'alert-remove' | 'alert-remove-outline' | 'alert-rhombus' | 'alert-rhombus-outline' | 'alien' | 'alien-outline' | 'align-horizontal-center' | 'align-horizontal-distribute' | 'align-horizontal-left' | 'align-horizontal-right' | 'align-vertical-bottom' | 'align-vertical-center' | 'align-vertical-distribute' | 'align-vertical-top' | 'all-inclusive' | 'all-inclusive-box' | 'all-inclusive-box-outline' | 'allergy' | 'alpha' | 'alpha-a' | 'alpha-a-box' | 'alpha-a-box-outline' | 'alpha-a-circle' | 'alpha-a-circle-outline' | 'alpha-b' | 'alpha-b-box' | 'alpha-b-box-outline' | 'alpha-b-circle' | 'alpha-b-circle-outline' | 'alpha-c' | 'alpha-c-box' | 'alpha-c-box-outline' | 'alpha-c-circle' | 'alpha-c-circle-outline' | 'alpha-d' | 'alpha-d-box' | 'alpha-d-box-outline' | 'alpha-d-circle' | 'alpha-d-circle-outline' | 'alpha-e' | 'alpha-e-box' | 'alpha-e-box-outline' | 'alpha-e-circle' | 'alpha-e-circle-outline' | 'alpha-f' | 'alpha-f-box' | 'alpha-f-box-outline' | 'alpha-f-circle' | 'alpha-f-circle-outline' | 'alpha-g' | 'alpha-g-box' | 'alpha-g-box-outline' | 'alpha-g-circle' | 'alpha-g-circle-outline' | 'alpha-h' | 'alpha-h-box' | 'alpha-h-box-outline' | 'alpha-h-circle' | 'alpha-h-circle-outline' | 'alpha-i' | 'alpha-i-box' | 'alpha-i-box-outline' | 'alpha-i-circle' | 'alpha-i-circle-outline' | 'alpha-j' | 'alpha-j-box' | 'alpha-j-box-outline' | 'alpha-j-circle' | 'alpha-j-circle-outline' | 'alpha-k' | 'alpha-k-box' | 'alpha-k-box-outline' | 'alpha-k-circle' | 'alpha-k-circle-outline' | 'alpha-l' | 'alpha-l-box' | 'alpha-l-box-outline' | 'alpha-l-circle' | 'alpha-l-circle-outline' | 'alpha-m' | 'alpha-m-box' | 'alpha-m-box-outline' | 'alpha-m-circle' | 'alpha-m-circle-outline' | 'alpha-n' | 'alpha-n-box' | 'alpha-n-box-outline' | 'alpha-n-circle' | 'alpha-n-circle-outline' | 'alpha-o' | 'alpha-o-box' | 'alpha-o-box-outline' | 'alpha-o-circle' | 'alpha-o-circle-outline' | 'alpha-p' | 'alpha-p-box' | 'alpha-p-box-outline' | 'alpha-p-circle' | 'alpha-p-circle-outline' | 'alpha-q' | 'alpha-q-box' | 'alpha-q-box-outline' | 'alpha-q-circle' | 'alpha-q-circle-outline' | 'alpha-r' | 'alpha-r-box' | 'alpha-r-box-outline' | 'alpha-r-circle' | 'alpha-r-circle-outline' | 'alpha-s' | 'alpha-s-box' | 'alpha-s-box-outline' | 'alpha-s-circle' | 'alpha-s-circle-outline' | 'alpha-t' | 'alpha-t-box' | 'alpha-t-box-outline' | 'alpha-t-circle' | 'alpha-t-circle-outline' | 'alpha-u' | 'alpha-u-box' | 'alpha-u-box-outline' | 'alpha-u-circle' | 'alpha-u-circle-outline' | 'alpha-v' | 'alpha-v-box' | 'alpha-v-box-outline' | 'alpha-v-circle' | 'alpha-v-circle-outline' | 'alpha-w' | 'alpha-w-box' | 'alpha-w-box-outline' | 'alpha-w-circle' | 'alpha-w-circle-outline' | 'alpha-x' | 'alpha-x-box' | 'alpha-x-box-outline' | 'alpha-x-circle' | 'alpha-x-circle-outline' | 'alpha-y' | 'alpha-y-box' | 'alpha-y-box-outline' | 'alpha-y-circle' | 'alpha-y-circle-outline' | 'alpha-z' | 'alpha-z-box' | 'alpha-z-box-outline' | 'alpha-z-circle' | 'alpha-z-circle-outline' | 'alphabet-aurebesh' | 'alphabet-cyrillic' | 'alphabet-greek' | 'alphabet-latin' | 'alphabet-piqad' | 'alphabet-tengwar' | 'alphabetical' | 'alphabetical-off' | 'alphabetical-variant' | 'alphabetical-variant-off' | 'altimeter' | 'ambulance' | 'ammunition' | 'ampersand' | 'amplifier' | 'amplifier-off' | 'anchor' | 'android' | 'android-messages' | 'android-studio' | 'angle-acute' | 'angle-obtuse' | 'angle-right' | 'angular' | 'angularjs' | 'animation' | 'animation-outline' | 'animation-play' | 'animation-play-outline' | 'ansible' | 'antenna' | 'anvil' | 'apache-kafka' | 'api' | 'api-off' | 'apple' | 'apple-finder' | 'apple-icloud' | 'apple-ios' | 'apple-keyboard-caps' | 'apple-keyboard-command' | 'apple-keyboard-control' | 'apple-keyboard-option' | 'apple-keyboard-shift' | 'apple-safari' | 'application' | 'application-array' | 'application-array-outline' | 'application-braces' | 'application-braces-outline' | 'application-brackets' | 'application-brackets-outline' | 'application-cog' | 'application-cog-outline' | 'application-edit' | 'application-edit-outline' | 'application-export' | 'application-import' | 'application-outline' | 'application-parentheses' | 'application-parentheses-outline' | 'application-settings' | 'application-settings-outline' | 'application-variable' | 'application-variable-outline' | 'approximately-equal' | 'approximately-equal-box' | 'apps' | 'apps-box' | 'arch' | 'archive' | 'archive-alert' | 'archive-alert-outline' | 'archive-arrow-down' | 'archive-arrow-down-outline' | 'archive-arrow-up' | 'archive-a