UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

10 lines 16.8 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[16508],{32656:function(e,t,a){a.a(e,async function(e,t){try{a(74423),a(62953);var i=a(40445),s=a(5124),o=a(67576),l=a(63672),n=a(1087),r=a(57237),d=a(26300),h=(a(3449),a(606)),u=a(91485),p=e([d,h,u]);[d,h,u]=p.then?(await p)():p;let c,b,m,v,g,y,$,f,M,w,C,x=e=>e;const _="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z";class L extends s.WF{reportValidity(){const e=this._inputs;return!e||[...e].every(e=>e.reportValidity())}render(){return(0,s.qy)(c||(c=x` ${0} <div class="time-input-wrap-wrap"> <div class="time-input-wrap"> ${0} <ha-input id="hour" type="number" inputmode="numeric" .value="${0}" .label="${0}" .placeholder="${0}" name="hours" @change="${0}" @focusin="${0}" without-spin-buttons .required="${0}" .autoValidate="${0}" maxlength="2" max="${0}" min="0" .disabled="${0}"> </ha-input> <div class="time-separator">:</div> <ha-input id="min" type="number" inputmode="numeric" .value="${0}" .label="${0}" .placeholder="${0}" @change="${0}" @focusin="${0}" name="minutes" without-spin-buttons .required="${0}" .autoValidate="${0}" maxlength="2" max="59" min="0" .disabled="${0}"> </ha-input> ${0} ${0} ${0} ${0} ${0} </div> </div> ${0} `),this.label?(0,s.qy)(b||(b=x`<label>${0}${0}</label>`),this.label,this.required?" *":""):s.s6,this.enableDay?(0,s.qy)(m||(m=x` <ha-input id="day" type="number" inputmode="numeric" .value="${0}" .label="${0}" .placeholder="${0}" name="days" @change="${0}" @focusin="${0}" without-spin-buttons .required="${0}" .autoValidate="${0}" min="0" .disabled="${0}"> </ha-input> <div class="time-separator">:</div> `),this.days.toFixed(),this.placeholderLabels?"":this.dayLabel,this.placeholderLabels?this.dayLabel:"",this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled):s.s6,this.hours.toFixed(),this.placeholderLabels?"":this.hourLabel,this.placeholderLabels?this.hourLabel:"",this._valueChanged,this._onFocus,this.required,this.autoValidate,(0,l.J)(this._hourMax),this.disabled,this._formatValue(this.minutes),this.placeholderLabels?"":this.minLabel,this.placeholderLabels?this.minLabel:"",this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled,this.enableSecond?(0,s.qy)(v||(v=x`<div class="time-separator">:</div>`)):s.s6,this.enableSecond?(0,s.qy)(g||(g=x`<ha-input id="sec" type="number" inputmode="decimal" step="any" .value="${0}" .label="${0}" .placeholder="${0}" @change="${0}" @focusin="${0}" name="seconds" without-spin-buttons .required="${0}" .autoValidate="${0}" max="59" min="0" .disabled="${0}"> </ha-input> ${0}`),this._formatValue(this.seconds),this.placeholderLabels?"":this.secLabel,this.placeholderLabels?this.secLabel:"",this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled,this.enableMillisecond?(0,s.qy)(y||(y=x`<div class="time-separator">:</div>`)):s.s6):s.s6,this.enableMillisecond?(0,s.qy)($||($=x`<ha-input id="millisec" type="number" .value="${0}" .label="${0}" .placeholder="${0}" @change="${0}" @focusin="${0}" name="milliseconds" without-spin-buttons .required="${0}" .autoValidate="${0}" maxlength="3" max="999" min="0" .disabled="${0}"> </ha-input>`),this._formatValue(this.milliseconds,3),this.placeholderLabels?"":this.millisecLabel,this.placeholderLabels?this.millisecLabel:"",this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled):s.s6,24===this.format?s.s6:(0,s.qy)(f||(f=x`<ha-select .required="${0}" .value="${0}" .disabled="${0}" .name="${0}" @selected="${0}" @wa-after-hide="${0}" @wa-hide="${0}" .options="${0}"> </ha-select>`),this.required,this.amPm,this.disabled,"amPm",this._valueChanged,r.d,r.d,["AM","PM"]),!this.clearable||this.required||this.disabled?s.s6:(0,s.qy)(M||(M=x`<ha-icon-button label="clear" @click="${0}" .path="${0}"></ha-icon-button>`),this._clearValue,_),this.helper?(0,s.qy)(w||(w=x`<ha-input-helper-text .disabled="${0}">${0}</ha-input-helper-text>`),this.disabled,this.helper):s.s6)}_clearValue(){(0,n.r)(this,"value-changed")}_valueChanged(e){const t=e.currentTarget;this[t.name||""]="amPm"===t.name?e.detail.value:Number(t.value);const a={hours:this.hours,minutes:this.minutes,seconds:this.seconds,milliseconds:this.milliseconds};this.enableDay&&(a.days=this.days),12===this.format&&(a.amPm=this.amPm),(0,n.r)(this,"value-changed",{value:a})}_onFocus(e){e.currentTarget.select()}_formatValue(e,t=2){const a=e.toString();return a.includes(".")?a:a.padStart(t,"0")}get _hourMax(){if(!this.noHoursLimit)return 12===this.format?12:23}constructor(...e){super(...e),this.autoValidate=!1,this.required=!1,this.format=12,this.disabled=!1,this.days=0,this.hours=0,this.minutes=0,this.seconds=0,this.milliseconds=0,this.dayLabel="",this.hourLabel="",this.minLabel="",this.secLabel="",this.millisecLabel="",this.enableSecond=!1,this.enableMillisecond=!1,this.enableDay=!1,this.noHoursLimit=!1,this.amPm="AM",this.placeholderLabels=!1}}L.shadowRootOptions=Object.assign(Object.assign({},s.WF.shadowRootOptions),{},{delegatesFocus:!0}),L.styles=(0,s.AH)(C||(C=x`:host([clearable]){position:relative}.time-input-wrap-wrap{display:flex}.time-input-wrap{display:flex;flex:var(--time-input-flex,unset);border-radius:var(--mdc-shape-small,var(--ha-border-radius-sm)) var(--mdc-shape-small,var(--ha-border-radius-sm)) var(--ha-border-radius-square) var(--ha-border-radius-square);overflow:hidden;position:relative;direction:ltr;padding-right:3px}ha-input{height:56px;padding:0;width:60px;flex-grow:1}ha-input:first-child{--text-field-border-top-left-radius:var(--mdc-shape-medium)}ha-input:last-child{--text-field-border-top-right-radius:var(--mdc-shape-medium)}ha-input::part(wa-base){padding:var(--ha-space-1)}ha-input:first-child::part(wa-base){padding-inline-start:var(--ha-space-4)}ha-input:last-child::part(wa-base){padding-inline-end:var(--ha-space-4)}ha-input::part(wa-hint){height:0}ha-input::part(wa-input){text-align:center}.time-separator,ha-icon-button{background-color:var(--ha-color-form-background);color:var(--ha-color-text-secondary);border-bottom:1px solid var(--ha-color-border-neutral-loud);box-sizing:border-box;height:56px;margin-inline-start:calc(var(--ha-space-1) * -1)}.time-separator{width:12px;margin-inline-end:calc(var(--ha-space-1) * -1);display:flex;align-items:center;justify-content:center}:host([clearable]) .mdc-select__anchor{padding-inline-end:var(--select-selected-text-padding-end,12px)}ha-icon-button{position:relative;--ha-icon-button-size:36px;border-start-end-radius:var(--ha-border-radius-sm);--mdc-icon-size:20px;direction:var(--direction);display:flex;align-items:center}ha-select{margin-inline:calc(var(--ha-space-1) * -1)}label{-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);-webkit-font-smoothing:var(--ha-font-smoothing);font-family:var( --mdc-typography-body2-font-family, var(--mdc-typography-font-family, var(--ha-font-family-body)) );font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));line-height:var( --mdc-typography-body2-line-height, var(--ha-line-height-condensed) );font-weight:var(--mdc-typography-body2-font-weight,var(--ha-font-weight-normal));letter-spacing:var( --mdc-typography-body2-letter-spacing, .0178571429em );text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:var(--mdc-typography-body2-text-transform,inherit);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));padding-left:4px;padding-inline-start:4px;padding-inline-end:initial}ha-input-helper-text{padding-top:8px;line-height:var(--ha-line-height-condensed)}`)),(0,i.Cg)([(0,o.MZ)()],L.prototype,"label",void 0),(0,i.Cg)([(0,o.MZ)()],L.prototype,"helper",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"auto-validate",type:Boolean})],L.prototype,"autoValidate",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],L.prototype,"required",void 0),(0,i.Cg)([(0,o.MZ)({type:Number})],L.prototype,"format",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],L.prototype,"disabled",void 0),(0,i.Cg)([(0,o.MZ)({type:Number})],L.prototype,"days",void 0),(0,i.Cg)([(0,o.MZ)({type:Number})],L.prototype,"hours",void 0),(0,i.Cg)([(0,o.MZ)({type:Number})],L.prototype,"minutes",void 0),(0,i.Cg)([(0,o.MZ)({type:Number})],L.prototype,"seconds",void 0),(0,i.Cg)([(0,o.MZ)({type:Number})],L.prototype,"milliseconds",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"day-label"})],L.prototype,"dayLabel",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"hour-label"})],L.prototype,"hourLabel",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"min-label"})],L.prototype,"minLabel",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"sec-label"})],L.prototype,"secLabel",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"ms-label"})],L.prototype,"millisecLabel",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"enable-second",type:Boolean})],L.prototype,"enableSecond",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"enable-millisecond",type:Boolean})],L.prototype,"enableMillisecond",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"enable-day",type:Boolean})],L.prototype,"enableDay",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"no-hours-limit",type:Boolean})],L.prototype,"noHoursLimit",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],L.prototype,"amPm",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],L.prototype,"clearable",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"placeholder-labels",type:Boolean})],L.prototype,"placeholderLabels",void 0),(0,i.Cg)([(0,o.YG)("ha-input")],L.prototype,"_inputs",void 0),L=(0,i.Cg)([(0,o.EM)("ha-base-time-input")],L),t()}catch(c){t(c)}})},89865:function(e,t,a){a.a(e,async function(e,t){try{a(18111),a(61701),a(62953);var i=a(40445),s=(a(22395),a(5124)),o=a(67576),l=a(1087),n=a(18350),r=(a(67094),e([n]));n=(r.then?(await r)():r)[0];let d,h,u,p,c=e=>e;class b extends s.WF{render(){return(0,s.qy)(d||(d=c` <wa-button-group childSelector="ha-button"> ${0} </wa-button-group> `),this.buttons.map(e=>(0,s.qy)(h||(h=c`<ha-button iconTag="ha-svg-icon" class="icon" .variant="${0}" .size="${0}" .value="${0}" @click="${0}" .title="${0}" .appearance="${0}"> ${0} </ha-button>`),this.active===e.value&&this.activeVariant?this.activeVariant:this.variant,this.size,e.value,this._handleClick,e.label,this.active===e.value?"accent":"filled",e.iconPath?(0,s.qy)(u||(u=c`<ha-svg-icon aria-label="${0}" .path="${0}"></ha-svg-icon>`),e.label,e.iconPath):e.label)))}_handleClick(e){this.active=e.currentTarget.value,(0,l.r)(this,"value-changed",{value:this.active})}constructor(...e){super(...e),this.size="medium",this.nowrap=!1,this.fullWidth=!1,this.variant="brand"}}b.styles=(0,s.AH)(p||(p=c`:host{--mdc-icon-size:var(--button-toggle-icon-size, 20px)}:host([no-wrap]) wa-button-group::part(base){flex-wrap:nowrap}wa-button-group{padding:var(--ha-button-toggle-group-padding)}:host([full-width]) wa-button-group,:host([full-width]) wa-button-group::part(base){width:100%}:host([full-width]) ha-button{flex:1}`)),(0,i.Cg)([(0,o.MZ)({attribute:!1})],b.prototype,"buttons",void 0),(0,i.Cg)([(0,o.MZ)()],b.prototype,"active",void 0),(0,i.Cg)([(0,o.MZ)({reflect:!0})],b.prototype,"size",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0,attribute:"no-wrap"})],b.prototype,"nowrap",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0,attribute:"full-width"})],b.prototype,"fullWidth",void 0),(0,i.Cg)([(0,o.MZ)()],b.prototype,"variant",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"active-variant"})],b.prototype,"activeVariant",void 0),b=(0,i.Cg)([(0,o.EM)("ha-button-toggle-group")],b),t()}catch(d){t(d)}})},39927:function(e,t,a){a.a(e,async function(e,t){try{a(62953);var i=a(40445),s=a(5124),o=a(67576),l=a(1087),n=a(32656),r=a(89865),d=e([n,r]);[n,r]=d.then?(await d)():d;let h,u,p,c=e=>e;const b="M20 14H4V10H20",m="M20 14H14V20H10V14H4V10H10V4H14V10H20V14Z",v=["milliseconds","seconds","minutes","hours","days"];class g extends s.WF{reportValidity(){var e,t;return null===(e=null===(t=this._input)||void 0===t?void 0:t.reportValidity())||void 0===e||e}render(){return(0,s.qy)(h||(h=c` <div class="row"> ${0} <ha-base-time-input .label="${0}" .helper="${0}" .required="${0}" .clearable="${0}" .autoValidate="${0}" .disabled="${0}" errorMessage="Required" .enableSecond="${0}" .enableMillisecond="${0}" .enableDay="${0}" format="24" .days="${0}" .hours="${0}" .minutes="${0}" .seconds="${0}" .milliseconds="${0}" @value-changed="${0}" no-hours-limit day-label="dd" hour-label="hh" min-label="mm" sec-label="ss" ms-label="ms"></ha-base-time-input> </div> `),this.allowNegative?(0,s.qy)(u||(u=c` <ha-button-toggle-group size="small" .buttons="${0}" .active="${0}" @value-changed="${0}"></ha-button-toggle-group> `),[{label:"+",iconPath:m,value:"+"},{label:"-",iconPath:b,value:"-"}],this._negative?"-":"+",this._negativeChanged):s.s6,this.label,this.helper,this.required,!this.required&&void 0!==this.data,this.required,this.disabled,this.enableSecond,this.enableMillisecond,this.enableDay,this._days,this._hours,this._minutes,this._seconds,this._milliseconds,this._durationChanged)}get _negative(){var e,t,a,i,s;return this._toggleNegative||(null!==(e=this.data)&&void 0!==e&&e.days?this.data.days<0:null!==(t=this.data)&&void 0!==t&&t.hours?this.data.hours<0:null!==(a=this.data)&&void 0!==a&&a.minutes?this.data.minutes<0:null!==(i=this.data)&&void 0!==i&&i.seconds?this.data.seconds<0:!(null===(s=this.data)||void 0===s||!s.milliseconds)&&this.data.milliseconds<0)}get _days(){var e;return null!==(e=this.data)&&void 0!==e&&e.days?this.allowNegative?Math.abs(Number(this.data.days)):Number(this.data.days):this.required||this.data?0:NaN}get _hours(){var e;return null!==(e=this.data)&&void 0!==e&&e.hours?this.allowNegative?Math.abs(Number(this.data.hours)):Number(this.data.hours):this.required||this.data?0:NaN}get _minutes(){var e;return null!==(e=this.data)&&void 0!==e&&e.minutes?this.allowNegative?Math.abs(Number(this.data.minutes)):Number(this.data.minutes):this.required||this.data?0:NaN}get _seconds(){var e;return null!==(e=this.data)&&void 0!==e&&e.seconds?this.allowNegative?Math.abs(Number(this.data.seconds)):Number(this.data.seconds):this.required||this.data?0:NaN}get _milliseconds(){var e;return null!==(e=this.data)&&void 0!==e&&e.milliseconds?this.allowNegative?Math.abs(Number(this.data.milliseconds)):Number(this.data.milliseconds):this.required||this.data?0:NaN}_durationChanged(e){e.stopPropagation();const t=e.detail.value?Object.assign({},e.detail.value):void 0;if(t){if(t.hours||(t.hours=0),t.minutes||(t.minutes=0),"days"in t&&(t.days||(t.days=0)),"seconds"in t&&(t.seconds||(t.seconds=0)),"milliseconds"in t&&(t.milliseconds||(t.milliseconds=0)),this.allowNegative&&v.forEach(e=>{t[e]&&(t[e]=Math.abs(t[e]))}),this.enableMillisecond||t.milliseconds?t.milliseconds>999&&(t.seconds+=Math.floor(t.milliseconds/1e3),t.milliseconds%=1e3):delete t.milliseconds,this.enableSecond||t.seconds){if(this.enableSecond&&t.seconds>59){var a;t.minutes=(null!==(a=t.minutes)&&void 0!==a?a:0)+Math.floor(t.seconds/60),t.seconds%=60}}else delete t.seconds;var i;if(t.minutes>59&&(t.hours+=Math.floor(t.minutes/60),t.minutes%=60),this.enableDay&&t.hours>24)t.days=(null!==(i=t.days)&&void 0!==i?i:0)+Math.floor(t.hours/24),t.hours%=24;this._negative&&v.forEach(e=>{t[e]&&(t[e]=-Math.abs(t[e]))})}(0,l.r)(this,"value-changed",{value:t})}_negativeChanged(e){var t;e.stopPropagation();const a="-"===((null===(t=e.detail)||void 0===t?void 0:t.value)||e.target.value);this._toggleNegative=a;const i=this.data;i&&(v.forEach(e=>{i[e]&&(i[e]=a?-Math.abs(i[e]):Math.abs(i[e]))}),(0,l.r)(this,"value-changed",{value:i}))}constructor(...e){super(...e),this.required=!1,this.enableMillisecond=!1,this.enableDay=!1,this.allowNegative=!1,this.enableSecond=!0,this.disabled=!1,this._toggleNegative=!1}}g.shadowRootOptions=Object.assign(Object.assign({},s.WF.shadowRootOptions),{},{delegatesFocus:!0}),g.styles=(0,s.AH)(p||(p=c`.row{display:flex;align-items:center}ha-button-toggle-group{margin:var(--ha-space-2)}`)),(0,i.Cg)([(0,o.MZ)({attribute:!1})],g.prototype,"data",void 0),(0,i.Cg)([(0,o.MZ)()],g.prototype,"label",void 0),(0,i.Cg)([(0,o.MZ)()],g.prototype,"helper",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],g.prototype,"required",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"enable-millisecond",type:Boolean})],g.prototype,"enableMillisecond",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"enable-day",type:Boolean})],g.prototype,"enableDay",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"allow-negative",type:Boolean})],g.prototype,"allowNegative",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"enable-second",type:Boolean})],g.prototype,"enableSecond",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],g.prototype,"disabled",void 0),(0,i.Cg)([(0,o.P)("ha-base-time-input",!0)],g.prototype,"_input",void 0),g=(0,i.Cg)([(0,o.EM)("ha-duration-input")],g),t()}catch(h){t(h)}})}}]);