forked from DigiLive/mushroom-strategy
1 line
54 KiB
JavaScript
1 line
54 KiB
JavaScript
(()=>{var e,t,i={744:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?n((i=e,Array.isArray(i)?[]:{}),e,t):e;var i}function a(e,t,i){return e.concat(t).map((function(e){return r(e,i)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function n(e,i,c){(c=c||{}).arrayMerge=c.arrayMerge||a,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=r;var l=Array.isArray(i);return l===Array.isArray(e)?l?c.arrayMerge(e,i,c):function(e,t,i){var a={};return i.isMergeableObject(e)&&o(e).forEach((function(t){a[t]=r(e[t],i)})),o(t).forEach((function(o){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(s(e,o)&&i.isMergeableObject(t[o])?a[o]=function(e,t){if(!t.customMerge)return n;var i=t.customMerge(e);return"function"==typeof i?i:n}(o,i)(e[o],t[o],i):a[o]=r(t[o],i))})),a}(e,i,c):r(i,c)}n.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,i){return n(e,i,t)}),{})};var c=n;e.exports=c},245:(e,t,i)=>{"use strict";i.d(t,{H:()=>T});var r=i(744),a=i.n(r);const o=JSON.parse('{"camera":{"all_cameras":"All Cameras","cameras":"Cameras"},"climate":{"all_climates":"All Climates","climates":"Climates"},"cover":{"all_covers":"All Covers","covers":"Covers"},"fan":{"all_fans":"All Fans","fans":"Fans"},"generic":{"all":"All","areas":"Areas","busy":"Busy","good_afternoon":"Good afternoon","good_evening":"Good evening","good_morning":"Good morning","hello":"Hello","home":"Home","miscellaneous":"Miscellaneous","numbers":"Numbers","off":"Off","on":"On","open":"Open","unclosed":"Unclosed"},"input_select":{"input_selects":"Input Selects"},"light":{"all_lights":"All Lights","lights":"Lights"},"lock":{"locks":"Locks"},"media_player":{"media_players":"Mediaplayers"},"scene":{"scenes":"Scenes"},"select":{"selects":"Selects"},"sensor":{"binary":"Binary","sensors":"Sensors"},"switch":{"all_switches":"All Switches","switches":"Switches"},"vacuum":{"all_vacuums":"All Vacuums","vacuums":"Vacuums"}}');var s=i.t(o,2);const n=JSON.parse('{"camera":{"all_cameras":"Todas las Cámaras","cameras":"Cámaras"},"climate":{"all_climates":"Todos los Termostatos","climates":"Termostatos"},"cover":{"all_covers":"Todas las Cubiertas","covers":"Cubiertas"},"fan":{"all_fans":"Todos los Ventiladores","fans":"Ventiladores"},"generic":{"all":"Todo","areas":"Áreas","busy":"Ocupado","good_afternoon":"Buenas tardes","good_evening":"Buenas noches","good_morning":"Buenos días","hello":"Hola","home":"Inicio","miscellaneous":"Varios","numbers":"Números","off":"Apagado","on":"Encendido","open":"Abierto","unclosed":"Sin Cerrar"},"input_select":{"input_selects":"Selecciones de Entrada"},"light":{"all_lights":"Todas las Luces","lights":"Luces"},"lock":{"locks":"Candados"},"media_player":{"media_players":"Reproductores Multimedia"},"select":{"selects":"Seleccionar"},"sensor":{"binary":"Binario","sensors":"Sensores"},"switch":{"all_switches":"Todos los Apagadores","switches":"Apagadores"},"vacuum":{"all_vacuums":"Todas las Aspiradoras","vacuums":"Aspiradoras"}}');var c=i.t(n,2);const l=JSON.parse('{"camera":{"all_cameras":"Alle Cameras","cameras":"Cameras"},"climate":{"all_climates":"Alle Klimaatregelingen","climates":"Klimaatregelingen"},"cover":{"all_covers":"Alle Bedekkingen","covers":"Bedekkingen"},"fan":{"all_fans":"Alle Ventilatoren","fans":"Ventilatoren"},"generic":{"all":"Alle","areas":"Ruimtes","busy":"Bezig","good_afternoon":"Goede middag","good_evening":"Goede avond","good_morning":"Goede morgen","hello":"Hallo","home":"Start","miscellaneous":"Overige","numbers":"Nummers","off":"Uit","on":"Aan","open":"Open","unclosed":"Ongesloten"},"input_select":{"input_selects":"Lijsten"},"light":{"all_lights":"Alle Lampen","lights":"Lampen"},"lock":{"locks":"Sloten"},"media_player":{"media_players":"Mediaspelers"},"scene":{"scenes":"Scenes"},"select":{"selects":"Statuslijsten"},"sensor":{"binary":"Binaire","sensors":"Sensoren"},"switch":{"all_switches":"Alle Schakelaars","switches":"Schakelaars"},"vacuum":{"all_vacuums":"Alle Afzuiging","vacuums":"Afzuiging"}}');var d=i.t(l,2);const h=JSON.parse('{"camera":{"all_cameras":"Alle Kameras","cameras":"Kameras"},"climate":{"all_climates":"Alle Klimaanlagen","climates":"Klimaanlagen"},"cover":{"all_covers":"Alle Abdeckungen","covers":"Abdeckungen"},"fan":{"all_fans":"Alle Ventilatoren","fans":"Ventilatoren"},"generic":{"all":"Alle","areas":"Bereiche","busy":"Beschäftigt","good_afternoon":"Guten Nachmittag","good_evening":"Guten Abend","good_morning":"Guten Morgen","hello":"Hallo","home":"Start","miscellaneous":"Sonstiges","numbers":"Zahlen","off":"Aus","on":"Ein","open":"Offen","unclosed":"Nicht Geschlossen"},"input_select":{"input_selects":"Auswahl-Eingaben"},"light":{"all_lights":"Alle Leuchten","lights":"Leuchten"},"lock":{"locks":"Schlösser"},"media_player":{"media_players":"Wiedergabegeräte"},"scene":{"scenes":"Szenen"},"select":{"selects":"Auswahlen"},"sensor":{"binary":"Binäre","sensors":"Sensoren"},"switch":{"all_switches":"Alle Schalter","switches":"Schalter"},"vacuum":{"all_vacuums":"Alle Staubsauger","vacuums":"Staubsauger"}}'),u={en:s,es:c,nl:d,de:i.t(h,2)};function f(e,t){try{return e.split(".").reduce(((e,t)=>e[t]),u[t])}catch(e){return}}var p,m,w,g,v,y,_,C,b,O,H=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},E=function(e,t,i,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(e,i):a?a.value=i:t.set(e,i),i};class T{constructor(){throw new Error("This class should be invoked with method initialize() instead of using the keyword new!")}static get strategyOptions(){return H(this,p,"f",_)}static get areas(){return H(this,p,"f",g)}static get devices(){return H(this,p,"f",w)}static get entities(){return H(this,p,"f",m)}static get debug(){return H(this,p,"f",C)}static async initialize(e){var t;this.customLocalize=(t=e.hass,function(e){let i=f(e,t?.locale.language??"en");return i||(i=f(e,"en")),i??e});const i={areas:{undisclosed:{area_id:"undisclosed",floor_id:null,name:"Undisclosed",picture:null,icon:"mdi:floor-plan",labels:[],aliases:[],hidden:!1}},debug:!1,domains:{_:{hide_config_entities:!0,hide_diagnostic_entities:!0},default:{title:(r=this.customLocalize)("generic.miscellaneous"),showControls:!1,hidden:!1},light:{title:r("light.lights"),showControls:!0,iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off",hidden:!1},scene:{title:r("scene.scenes"),showControls:!1,onService:"scene.turn_on",hidden:!1},fan:{title:r("fan.fans"),showControls:!0,iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off",hidden:!1},cover:{title:r("cover.covers"),showControls:!0,iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover",hidden:!1},switch:{title:r("switch.switches"),showControls:!0,iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off",hidden:!1},camera:{title:r("camera.cameras"),showControls:!1,hidden:!1},lock:{title:r("lock.locks"),showControls:!1,hidden:!1},climate:{title:r("climate.climates"),showControls:!1,hidden:!1},media_player:{title:r("media_player.media_players"),showControls:!1,hidden:!1},sensor:{title:r("sensor.sensors"),showControls:!1,hidden:!1},binary_sensor:{title:`${r("sensor.binary")} `+r("sensor.sensors"),showControls:!1,hidden:!1},number:{title:r("generic.numbers"),showControls:!1,hidden:!1},vacuum:{title:r("vacuum.vacuums"),showControls:!0,hidden:!1},select:{title:r("select.selects"),showControls:!1,hidden:!1},input_select:{title:r("input_select.input_selects"),showControls:!1,hidden:!1}},home_view:{hidden:[]},views:{home:{order:1,hidden:!1},light:{order:2,hidden:!1},fan:{order:3,hidden:!1},cover:{order:4,hidden:!1},switch:{order:5,hidden:!1},climate:{order:6,hidden:!1},camera:{order:7,hidden:!1},vacuum:{order:8,hidden:!1},scene:{order:9,hidden:!1}}};var r;E(this,p,a()(i,e.config?.strategy?.options??{}),"f",_),E(this,p,e.hass.states,"f",v),E(this,p,H(this,p,"f",_).debug,"f",C);try{[{set value(e){E(p,p,e,"f",m)}}.value,{set value(e){E(p,p,e,"f",w)}}.value,{set value(e){E(p,p,e,"f",g)}}.value]=await Promise.all([e.hass.callWS({type:"config/entity_registry/list"}),e.hass.callWS({type:"config/device_registry/list"}),e.hass.callWS({type:"config/area_registry/list"})])}catch(e){throw p.logError("An error occurred while querying Home assistant's registries!",e),"Check the console for details"}H(this,p,"f",_).areas.undisclosed?.hidden||(H(this,p,"f",_).areas.undisclosed={...i.areas.undisclosed,...H(this,p,"f",_).areas.undisclosed},H(this,p,"f",_).areas.undisclosed.area_id="undisclosed",H(this,p,"f",g).push(H(this,p,"f",_).areas.undisclosed)),E(this,p,p.areas.map((e=>({...e,...H(this,p,"f",_).areas?.[e.area_id]}))),"f",g),H(this,p,"f",g).sort(((e,t)=>(e.order??1/0)-(t.order??1/0)||e.name.localeCompare(t.name))),H(this,p,"f",_).views=Object.fromEntries(Object.entries(H(this,p,"f",_).views).sort((([,e],[,t])=>(e.order??1/0)-(t.order??1/0)||(e.title??"undefined").localeCompare(t.title??"undefined")))),H(this,p,"f",_).domains=Object.fromEntries(Object.entries(H(this,p,"f",_).domains).sort((([,e],[,t])=>(e.order??1/0)-(t.order??1/0)||(e.title??"undefined").localeCompare(t.title??"undefined")))),E(this,p,!0,"f",y)}static isInitialized(){return H(this,p,"f",y)}static getCountTemplate(e,t,i){const r=[];this.isInitialized()||console.warn("Helper class should be initialized before calling this method!");for(const t of H(this,p,"f",g)){const i=H(this,p,"f",w).filter((e=>e.area_id===t.area_id)).map((e=>e.id)),a=H(this,p,"f",m).filter(H(this,p,"m",b),{area:t,domain:e,areaDeviceIds:i}).map((e=>`states['${e.entity_id}']`));r.push(...a)}return`{% set entities = [${r}] %}\n {{ entities\n | selectattr('state','${t}','${i}')\n | selectattr('state','ne','unavailable')\n | selectattr('state','ne','unknown')\n | list\n | count\n }}`}static getDeviceEntities(e,t){this.isInitialized()||console.warn("Helper class should be initialized before calling this method!");const i=H(this,p,"f",w).filter((t=>(t.area_id??"undisclosed")===e.area_id)).map((e=>e.id));return H(this,p,"f",m).filter(H(this,p,"m",b),{area:e,domain:t,areaDeviceIds:i}).sort(((e,t)=>(e.original_name??"undefined").localeCompare(t.original_name??"undefined")))}static getStateEntities(e,t){this.isInitialized()||console.warn("Helper class should be initialized before calling this method!");const i=[],r=Object.fromEntries(H(this,p,"f",m).map((e=>[e.entity_id,e]))),a=Object.fromEntries(H(this,p,"f",w).map((e=>[e.id,e]))),o=Object.values(H(this,p,"f",v)).filter((e=>e.entity_id.startsWith(`${t}.`)));for(const t of o){const o=r[t.entity_id],s=a[o?.device_id??""];(o?.area_id===e.area_id||s&&s.area_id===e.area_id)&&i.push(t)}return i}static getEntityState(e){return H(this,p,"f",v)[e.entity_id]}static sanitizeClassName(e){return(e=e.charAt(0).toUpperCase()+e.slice(1)).replace(/([-_][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_","")))}static getExposedViewIds(){return this.isInitialized()||console.warn("Helper class should be initialized before calling this method!"),H(this,p,"m",O).call(this,H(this,p,"f",_).views,"hidden",!1)}static getExposedDomainIds(){return this.isInitialized()||console.warn("Helper class should be initialized before calling this method!"),H(this,p,"m",O).call(this,H(this,p,"f",_).domains,"hidden",!1)}static logError(e,t){p.debug?console.error(e,t):console.error(e)}}p=T,b=function(e){const t=p.strategyOptions.card_options?.[e.entity_id],i=p.strategyOptions.card_options?.[e.device_id??"null"],r=!t?.hidden&&!i?.hidden&&null===e.hidden_by&&null===e.disabled_by,a=void 0===this.domain||e.entity_id.startsWith(`${this.domain}.`),o="undisclosed"===this.area.area_id?!e.area_id&&(this.areaDeviceIds.includes(e.device_id??"")||!e.device_id):e.area_id===this.area.area_id||!e.area_id&&this.areaDeviceIds.includes(e.device_id??"");return r&&a&&o},O=function(e,t,i){const r=[];for(const a of Object.keys(e))e[a][t]===i&&r.push(a);return r},m={value:void 0},w={value:void 0},g={value:[]},v={value:void 0},y={value:!1},_={value:void 0},C={value:void 0}},818:(e,t,i)=>{"use strict";i.r(t),i.d(t,{AbstractCard:()=>a});var r=i(245);class a{constructor(e){if(this.config={type:"custom:mushroom-entity-card",icon:"mdi:help-circle"},!r.H.isInitialized())throw new Error("The Helper module must be initialized before using this one.");this.entity=e}getCard(){return{...this.config,entity:"entity_id"in this.entity?this.entity.entity_id:void 0}}}},301:(e,t,i)=>{"use strict";i.r(t),i.d(t,{AreaCard:()=>s});var r,a=i(818),o=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};class s extends a.AbstractCard{constructor(e,t={}){super(e),r.set(this,{type:"custom:mushroom-template-card",primary:void 0,icon:"mdi:floor-plan",icon_color:"blue",tap_action:{action:"navigate",navigation_path:""},hold_action:{action:"none"}}),"default"===t.type&&delete t.type,o(this,r,"f").primary=e.name,o(this,r,"f").tap_action&&"navigation_path"in o(this,r,"f").tap_action&&(o(this,r,"f").tap_action.navigation_path=e.area_id),e.icon&&(o(this,r,"f").icon=e.icon),this.config=Object.assign(this.config,o(this,r,"f"),t)}}r=new WeakMap},151:(e,t,i)=>{"use strict";i.r(t),i.d(t,{BinarySensorCard:()=>o});var r,a=i(982);class o extends a.SensorCard{constructor(e,t={}){super(e),r.set(this,{type:"custom:mushroom-entity-card",icon:"mdi:power-cycle",icon_color:"green"}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),t)}}r=new WeakMap},723:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CameraCard:()=>o});var r,a=i(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),r.set(this,{entity:"",type:"picture-entity",show_name:!1,show_state:!1,camera_view:"live"}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),t)}}r=new WeakMap},721:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ClimateCard:()=>o});var r,a=i(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),r.set(this,{type:"custom:mushroom-climate-card",icon:void 0,hvac_modes:["off","cool","heat","fan_only"],show_temperature_control:!0}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),t)}}r=new WeakMap},896:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ControllerCard:()=>n});var r,a,o=function(e,t,i,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(e,i):a?a.value=i:t.set(e,i),i},s=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};class n{constructor(e,t={}){r.set(this,void 0),a.set(this,{type:"mushroom-title-card",showControls:!0,iconOn:"mdi:power-on",iconOff:"mdi:power-off",onService:"none",offService:"none"}),o(this,r,e,"f"),o(this,a,{...s(this,a,"f"),...t},"f")}createCard(){const e=[{type:"custom:mushroom-title-card",title:s(this,a,"f").title,subtitle:s(this,a,"f").subtitle}];return s(this,a,"f").showControls&&e.push({type:"horizontal-stack",cards:[{type:"custom:mushroom-template-card",icon:s(this,a,"f").iconOff,layout:"vertical",icon_color:"red",tap_action:{action:"call-service",service:s(this,a,"f").offService,target:s(this,r,"f"),data:{}}},{type:"custom:mushroom-template-card",icon:s(this,a,"f").iconOn,layout:"vertical",icon_color:"amber",tap_action:{action:"call-service",service:s(this,a,"f").onService,target:s(this,r,"f"),data:{}}}]}),{type:"horizontal-stack",cards:e}}}r=new WeakMap,a=new WeakMap},33:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CoverCard:()=>o});var r,a=i(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),r.set(this,{type:"custom:mushroom-cover-card",icon:void 0,show_buttons_control:!0,show_position_control:!0,show_tilt_position_control:!0}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),t)}}r=new WeakMap},667:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FanCard:()=>o});var r,a=i(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),r.set(this,{type:"custom:mushroom-fan-card",icon:void 0,show_percentage_control:!0,show_oscillate_control:!0,icon_animation:!0}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),t)}}r=new WeakMap},42:(e,t,i)=>{"use strict";i.r(t),i.d(t,{AreaCard:()=>s});var r,a=i(818),o=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};class s extends a.AbstractCard{constructor(e,t={}){super(e),r.set(this,{type:"area",area:""}),o(this,r,"f").area=e.area_id,o(this,r,"f").navigation_path=o(this,r,"f").area,delete t.type,this.config=Object.assign(this.config,o(this,r,"f"),t)}}r=new WeakMap},810:(e,t,i)=>{"use strict";i.r(t),i.d(t,{InputSelectCard:()=>o});var r,a=i(212);class o extends a.SelectCard{constructor(e,t={}){super(e),r.set(this,{type:"custom:mushroom-select-card",icon:void 0}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),t)}}r=new WeakMap},254:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LightCard:()=>l});var r,a=i(818),o=i(843),s=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},n=o.M.isCallServiceActionConfig,c=o.M.isCallServiceActionTarget;class l extends a.AbstractCard{constructor(e,t={}){super(e),r.set(this,{type:"custom:mushroom-light-card",icon:void 0,show_brightness_control:!0,show_color_control:!0,show_color_temp_control:!0,use_light_color:!0,double_tap_action:{action:"call-service",service:"light.turn_on",target:{entity_id:void 0},data:{rgb_color:[255,255,255]}}}),n(s(this,r,"f").double_tap_action)&&c(s(this,r,"f").double_tap_action.target)&&(s(this,r,"f").double_tap_action.target.entity_id=e.entity_id),this.config=Object.assign(this.config,s(this,r,"f"),t)}}r=new WeakMap},936:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LockCard:()=>o});var r,a=i(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),r.set(this,{type:"custom:mushroom-lock-card",icon:void 0}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),t)}}r=new WeakMap},879:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MediaPlayerCard:()=>o});var r,a=i(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),r.set(this,{type:"custom:mushroom-media-player-card",use_media_info:!0,media_controls:["on_off","play_pause_stop"],show_volume_level:!0,volume_controls:["volume_mute","volume_set","volume_buttons"]}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),t)}}r=new WeakMap},486:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MiscellaneousCard:()=>o});var r,a=i(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),r.set(this,{type:"custom:mushroom-entity-card",icon_color:"blue-grey"}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),t)}}r=new WeakMap},137:(e,t,i)=>{"use strict";i.r(t),i.d(t,{NumberCard:()=>o});var r,a=i(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),r.set(this,{type:"custom:mushroom-number-card",icon:void 0}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),t)}}r=new WeakMap},845:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PersonCard:()=>o});var r,a=i(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),r.set(this,{type:"custom:mushroom-person-card",layout:"vertical",primary_info:"none",secondary_info:"none",icon_type:"entity-picture"}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),t)}}r=new WeakMap},858:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SceneCard:()=>d});var r,a=i(818),o=i(843),s=i(245),n=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)},c=o.M.isCallServiceActionConfig,l=o.M.isCallServiceActionTarget;class d extends a.AbstractCard{constructor(e,t={}){super(e),r.set(this,{type:"custom:mushroom-entity-card",icon:"mdi:palette",icon_color:"blue",tap_action:{action:"call-service",service:"scene.turn_on",target:{entity_id:void 0}}}),c(n(this,r,"f").tap_action)&&l(n(this,r,"f").tap_action.target)&&(n(this,r,"f").tap_action.target.entity_id=e.entity_id),n(this,r,"f").icon=s.H.getEntityState(e)?.attributes.icon??n(this,r,"f").icon,this.config=Object.assign(this.config,n(this,r,"f"),t)}}r=new WeakMap},212:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SelectCard:()=>o});var r,a=i(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),r.set(this,{type:"custom:mushroom-select-card",icon:void 0}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),t)}}r=new WeakMap},982:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SensorCard:()=>o});var r,a=i(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),r.set(this,{type:"custom:mushroom-entity-card",icon:"mdi:information",animate:!0,line_color:"green"}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),t)}}r=new WeakMap},708:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SwitchCard:()=>o});var r,a=i(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),r.set(this,{type:"custom:mushroom-entity-card",icon:void 0,tap_action:{action:"toggle"}}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),t)}}r=new WeakMap},430:(e,t,i)=>{"use strict";i.r(t),i.d(t,{VacuumCard:()=>s});var r=i(818);const a=["on_off","start_pause","stop","locate","clean_spot","return_home"];var o;class s extends r.AbstractCard{constructor(e,t={}){super(e),o.set(this,{type:"custom:mushroom-vacuum-card",icon:void 0,icon_animation:!0,commands:[...a],tap_action:{action:"more-info"}}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,o,"f"),t)}}o=new WeakMap},222:(e,t,i)=>{"use strict";i.r(t),i.d(t,{AbstractChip:()=>o});var r=i(245),a=i(843).M.isCallServiceActionConfig;class o{constructor(){if(this.config={type:"template"},!r.H.isInitialized())throw new Error("The Helper module must be initialized before using this one.")}getChip(){return this.config}setTapActionTarget(e){"tap_action"in this.config&&a(this.config.tap_action)?this.config.tap_action.target=e:r.H.debug&&console.warn(this.constructor.name+" - Target not set: Invalid target or tap action.")}}},757:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ClimateChip:()=>s});var r,a=i(245),o=i(222);class s extends o.AbstractChip{constructor(e={}){super(),r.set(this,{type:"template",icon:"mdi:thermostat",icon_color:"orange",content:a.H.getCountTemplate("climate","ne","off"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"climates"}}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),e)}}r=new WeakMap},589:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CoverChip:()=>s});var r,a=i(245),o=i(222);class s extends o.AbstractChip{constructor(e={}){super(),r.set(this,{type:"template",icon:"mdi:window-open",icon_color:"cyan",content:a.H.getCountTemplate("cover","search","(open|opening|closing)"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"covers"}}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),e)}}r=new WeakMap},867:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FanChip:()=>s});var r,a=i(245),o=i(222);class s extends o.AbstractChip{constructor(e={}){super(),r.set(this,{type:"template",icon:"mdi:fan",icon_color:"green",content:a.H.getCountTemplate("fan","eq","on"),tap_action:{action:"call-service",service:"fan.turn_off"},hold_action:{action:"navigate",navigation_path:"fans"}}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),e)}}r=new WeakMap},741:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LightChip:()=>s});var r,a=i(245),o=i(222);class s extends o.AbstractChip{constructor(e={}){super(),r.set(this,{type:"template",icon:"mdi:lightbulb-group",icon_color:"amber",content:a.H.getCountTemplate("light","eq","on"),tap_action:{action:"call-service",service:"light.turn_off"},hold_action:{action:"navigate",navigation_path:"lights"}}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),e)}}r=new WeakMap},908:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SwitchChip:()=>s});var r,a=i(245),o=i(222);class s extends o.AbstractChip{constructor(e={}){super(),r.set(this,{type:"template",icon:"mdi:dip-switch",icon_color:"blue",content:a.H.getCountTemplate("switch","eq","on"),tap_action:{action:"call-service",service:"switch.turn_off"},hold_action:{action:"navigate",navigation_path:"switches"}}),this.config=Object.assign(this.config,function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)}(this,r,"f"),e)}}r=new WeakMap},778:(e,t,i)=>{"use strict";i.r(t),i.d(t,{WeatherChip:()=>s});var r,a=i(222),o=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};class s extends a.AbstractChip{constructor(e,t={}){super(),r.set(this,{type:"weather",show_temperature:!0,show_conditions:!0}),function(e,t,i,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?a.call(e,i):a?a.value=i:t.set(e,i)}(this,r,{...o(this,r,"f"),entity:e,...t},"f"),this.config=Object.assign(this.config,o(this,r,"f"),t)}}r=new WeakMap},843:(e,t,i)=>{"use strict";var r;i.d(t,{M:()=>r}),function(e){e.isCallServiceActionConfig=function(e){return e&&"call-service"===e.action&&["action","service"].every((t=>t in e))},e.isCallServiceActionTarget=function(e){return e&&["entity_id","device_id","area_id"].some((t=>t in e))}}(r||(r={}))},122:(e,t,i)=>{"use strict";i.r(t),i.d(t,{AbstractView:()=>n});var r,a=i(245),o=i(896),s=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};class n{constructor(e=""){if(this.config={icon:"mdi:view-dashboard",subview:!1},this.viewControllerCard={cards:[],type:""},r.set(this,void 0),!a.H.isInitialized())throw new Error("The Helper module must be initialized before using this one.");e&&function(e,t,i,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?a.call(e,i):a?a.value=i:t.set(e,i)}(this,r,e,"f")}async createViewCards(){const e=[],t=a.H.strategyOptions.domains[s(this,r,"f")??"_"].hide_config_entities||a.H.strategyOptions.domains._.hide_config_entities,n=a.H.strategyOptions.domains[s(this,r,"f")??"_"].hide_diagnostic_entities||a.H.strategyOptions.domains._.hide_diagnostic_entities;for(const c of a.H.areas){const l=[],d=a.H.getDeviceEntities(c,s(this,r,"f")??""),h=a.H.sanitizeClassName(s(this,r,"f")+"Card"),u=await i(560)(`./${h}`);let f={area_id:[c.area_id]};"undisclosed"===c.area_id&&(f={entity_id:d.map((e=>e.entity_id))});for(const e of d){let i=a.H.strategyOptions.card_options?.[e.entity_id],r=a.H.strategyOptions.card_options?.[e.device_id??"null"];i?.hidden||r?.hidden||"config"===e.entity_category&&t||"diagnostic"===e.entity_category&&n||l.push(new u[h](e,i).getCard())}if(l.length){const t="controllerCardOptions"in this.config?this.config.controllerCardOptions:{};l.unshift(new o.ControllerCard(f,Object.assign({title:c.name},t)).createCard()),e.push({type:"vertical-stack",cards:l})}}return this.viewControllerCard.cards.length&&e.length&&e.unshift(this.viewControllerCard),e}async getView(){return{...this.config,cards:await this.createViewCards()}}targetDomain(e){return{entity_id:a.H.entities.filter((t=>t.entity_id.startsWith(e+".")&&!t.hidden_by&&!a.H.strategyOptions.card_options?.[t.entity_id]?.hidden)).map((e=>e.entity_id))}}}r=new WeakMap},255:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CameraView:()=>h});var r,a,o,s,n=i(896),c=i(122),l=i(245),d=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};class h extends c.AbstractView{constructor(e={}){super(d(r,r,"f",a)),o.set(this,{title:l.H.customLocalize("camera.cameras"),path:"cameras",icon:"mdi:cctv",subview:!1,controllerCardOptions:{showControls:!1}}),s.set(this,{title:l.H.customLocalize("camera.all_cameras"),subtitle:`${l.H.getCountTemplate(d(r,r,"f",a),"ne","off")} ${l.H.customLocalize("camera.cameras")} `+l.H.customLocalize("generic.busy")}),this.config=Object.assign(this.config,d(this,o,"f"),e),this.viewControllerCard=new n.ControllerCard({},{...d(this,s,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}r=h,o=new WeakMap,s=new WeakMap,a={value:"camera"}},559:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ClimateView:()=>h});var r,a,o,s,n=i(245),c=i(896),l=i(122),d=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};class h extends l.AbstractView{constructor(e={}){super(d(r,r,"f",a)),o.set(this,{title:n.H.customLocalize("climate.climates"),path:"climates",icon:"mdi:thermostat",subview:!1,controllerCardOptions:{showControls:!1}}),s.set(this,{title:n.H.customLocalize("climate.all_climates"),subtitle:`${n.H.getCountTemplate(d(r,r,"f",a),"ne","off")} ${n.H.customLocalize("climate.climates")} `+n.H.customLocalize("generic.busy")}),this.config=Object.assign(this.config,d(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(d(r,r,"f",a)),{...d(this,s,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}r=h,o=new WeakMap,s=new WeakMap,a={value:"climate"}},547:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CoverView:()=>h});var r,a,o,s,n=i(245),c=i(896),l=i(122),d=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};class h extends l.AbstractView{constructor(e={}){super(d(r,r,"f",a)),o.set(this,{title:n.H.customLocalize("cover.covers"),path:"covers",icon:"mdi:window-open",subview:!1,controllerCardOptions:{iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover"}}),s.set(this,{title:n.H.customLocalize("cover.all_covers"),subtitle:`${n.H.getCountTemplate(d(r,r,"f",a),"search","(open|opening|closing)")} ${n.H.customLocalize("cover.covers")} `+n.H.customLocalize("generic.unclosed")}),this.config=Object.assign(this.config,d(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(d(r,r,"f",a)),{...d(this,s,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}r=h,o=new WeakMap,s=new WeakMap,a={value:"cover"}},626:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FanView:()=>h});var r,a,o,s,n=i(245),c=i(896),l=i(122),d=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};class h extends l.AbstractView{constructor(e={}){super(d(r,r,"f",a)),o.set(this,{title:n.H.customLocalize("fan.fans"),path:"fans",icon:"mdi:fan",subview:!1,controllerCardOptions:{iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off"}}),s.set(this,{title:n.H.customLocalize("fan.all_fans"),subtitle:`${n.H.getCountTemplate(d(r,r,"f",a),"eq","on")} ${n.H.customLocalize("fan.fans")} `+n.H.customLocalize("generic.on")}),this.config=Object.assign(this.config,d(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(d(r,r,"f",a)),{...d(this,s,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}r=h,o=new WeakMap,s=new WeakMap,a={value:"fan"}},31:(e,t,i)=>{"use strict";i.r(t),i.d(t,{HomeView:()=>h});var r,a,o,s,n,c=i(245),l=i(122),d=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};class h extends l.AbstractView{constructor(e={}){super(),r.add(this),a.set(this,{title:c.H.customLocalize("generic.home"),icon:"mdi:home-assistant",path:"home",subview:!1}),this.config=Object.assign(this.config,d(this,a,"f"),e)}async createViewCards(){return await Promise.all([d(this,r,"m",o).call(this),d(this,r,"m",s).call(this),d(this,r,"m",n).call(this)]).then((([e,t,i])=>{const r=c.H.strategyOptions,a=[];return e.length&&a.push({type:"custom:mushroom-chips-card",alignment:"center",chips:e}),t.length&&a.push({type:"horizontal-stack",cards:t}),c.H.strategyOptions.home_view.hidden.includes("greeting")||a.push({type:"custom:mushroom-template-card",primary:`{% set time = now().hour %} {% if (time >= 18) %} ${c.H.customLocalize("generic.good_evening")},{{user}}!\n {% elif (time >= 12) %} ${c.H.customLocalize("generic.good_afternoon")}, {{user}}!\n {% elif (time >= 5) %} ${c.H.customLocalize("generic.good_morning")}, {{user}}!\n {% else %} ${c.H.customLocalize("generic.hello")}, {{user}}! {% endif %}`,icon:"mdi:hand-wave",icon_color:"orange",tap_action:{action:"none"},double_tap_action:{action:"none"},hold_action:{action:"none"}}),r.quick_access_cards&&a.push(...r.quick_access_cards),a.push({type:"vertical-stack",cards:i}),r.extra_cards&&a.push(...r.extra_cards),a}))}}a=new WeakMap,r=new WeakSet,o=async function(){if(c.H.strategyOptions.home_view.hidden.includes("chips"))return[];const e=[],t=c.H.strategyOptions.chips,r=["light","fan","cover","switch","climate"],a=c.H.areas.map((e=>e.area_id??""));let o;const s=t?.weather_entity??c.H.entities.find((e=>e.entity_id.startsWith("weather.")&&null===e.disabled_by&&null===e.hidden_by))?.entity_id;if(s)try{o=await Promise.resolve().then(i.bind(i,778));const t=new o.WeatherChip(s);e.push(t.getChip())}catch(e){c.H.logError("An error occurred while creating the weather chip!",e)}for(let s of r)if(t?.[`${s}_count`]??1){const t=c.H.sanitizeClassName(s+"Chip");try{o=await i(216)(`./${t}`);const r=new o[t];r.setTapActionTarget({area_id:a}),e.push(r.getChip())}catch(e){c.H.logError(`An error occurred while creating the ${s} chip!`,e)}}return t?.extra_chips&&e.push(...t.extra_chips),e},s=function(){if(c.H.strategyOptions.home_view.hidden.includes("persons"))return[];const e=[];return Promise.resolve().then(i.bind(i,845)).then((t=>{for(const i of c.H.entities.filter((e=>e.entity_id.startsWith("person.")&&null==e.hidden_by&&null==e.disabled_by)))e.push(new t.PersonCard(i).getCard())})),e},n=async function(){if(c.H.strategyOptions.home_view.hidden.includes("areas"))return[];const e=[];let t=[];c.H.strategyOptions.home_view.hidden.includes("areasTitle")||e.push({type:"custom:mushroom-title-card",title:c.H.customLocalize("generic.areas")});for(const[r,a]of c.H.areas.entries()){let o,s=c.H.strategyOptions.areas[a.area_id]?.type??c.H.strategyOptions.areas._?.type??"default";try{o=await i(560)(`./${s}`)}catch(e){o=await Promise.resolve().then(i.bind(i,301)),c.H.strategyOptions.debug&&"default"!==s&&console.error(e)}if(!c.H.strategyOptions.areas[a.area_id]?.hidden){let e={...c.H.strategyOptions.areas._,...c.H.strategyOptions.areas[a.area_id]};t.push(new o.AreaCard(a,e).getCard())}if(r===c.H.areas.length-1)for(let i=0;i<t.length;i+=2)e.push({type:"horizontal-stack",cards:t.slice(i,i+2)})}return e}},304:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LightView:()=>h});var r,a,o,s,n=i(245),c=i(896),l=i(122),d=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};class h extends l.AbstractView{constructor(e={}){super(d(r,r,"f",a)),o.set(this,{title:n.H.customLocalize("light.lights"),path:"lights",icon:"mdi:lightbulb-group",subview:!1,controllerCardOptions:{iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off"}}),s.set(this,{title:n.H.customLocalize("light.all_lights"),subtitle:`${n.H.getCountTemplate(d(r,r,"f",a),"eq","on")} ${n.H.customLocalize("light.lights")} `+n.H.customLocalize("generic.on")}),this.config=Object.assign(this.config,d(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(d(r,r,"f",a)),{...d(this,s,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}r=h,o=new WeakMap,s=new WeakMap,a={value:"light"}},204:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SceneView:()=>l});var r,a,o,s=i(245),n=i(122),c=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};class l extends n.AbstractView{constructor(e={}){super(c(r,r,"f",a)),o.set(this,{title:s.H.customLocalize("scene.scenes"),path:"scenes",icon:"mdi:palette",subview:!1,controllerCardOptions:{showControls:!1}}),this.config=Object.assign(this.config,c(this,o,"f"),e)}}r=l,o=new WeakMap,a={value:"scene"}},464:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SwitchView:()=>h});var r,a,o,s,n=i(245),c=i(896),l=i(122),d=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};class h extends l.AbstractView{constructor(e={}){super(d(r,r,"f",a)),o.set(this,{title:n.H.customLocalize("switch.switches"),path:"switches",icon:"mdi:dip-switch",subview:!1,controllerCardOptions:{iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off"}}),s.set(this,{title:n.H.customLocalize("switch.all_switches"),subtitle:`${n.H.getCountTemplate(d(r,r,"f",a),"eq","on")} ${n.H.customLocalize("switch.switches")} `+n.H.customLocalize("generic.on")}),this.config=Object.assign(this.config,d(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(d(r,r,"f",a)),{...d(this,s,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}r=h,o=new WeakMap,s=new WeakMap,a={value:"switch"}},499:(e,t,i)=>{"use strict";i.r(t),i.d(t,{VacuumView:()=>h});var r,a,o,s,n=i(245),c=i(896),l=i(122),d=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};class h extends l.AbstractView{constructor(e={}){super(d(r,r,"f",a)),o.set(this,{title:n.H.customLocalize("vacuum.vacuums"),path:"vacuums",icon:"mdi:robot-vacuum",subview:!1,controllerCardOptions:{iconOn:"mdi:robot-vacuum",iconOff:"mdi:robot-vacuum-off",onService:"vacuum.start",offService:"vacuum.stop"}}),s.set(this,{title:n.H.customLocalize("vacuum.all_vacuums"),subtitle:`${n.H.getCountTemplate(d(r,r,"f",a),"ne","off")} ${n.H.customLocalize("vacuum.vacuums")} `+n.H.customLocalize("generic.busy")}),this.config=Object.assign(this.config,d(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(d(r,r,"f",a)),{...d(this,s,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}r=h,o=new WeakMap,s=new WeakMap,a={value:"vacuum"}},560:(e,t,i)=>{var r={"./AbstractCard":[818],"./AbstractCard.ts":[818],"./AreaCard":[301,792],"./AreaCard.ts":[301,792],"./BinarySensorCard":[151,792],"./BinarySensorCard.ts":[151,792],"./CameraCard":[723,792],"./CameraCard.ts":[723,792],"./ClimateCard":[721,792],"./ClimateCard.ts":[721,792],"./ControllerCard":[896],"./ControllerCard.ts":[896],"./CoverCard":[33,792],"./CoverCard.ts":[33,792],"./FanCard":[667,792],"./FanCard.ts":[667,792],"./HaAreaCard":[42,792],"./HaAreaCard.ts":[42,792],"./InputSelectCard":[810,792],"./InputSelectCard.ts":[810,792],"./LightCard":[254,792],"./LightCard.ts":[254,792],"./LockCard":[936,792],"./LockCard.ts":[936,792],"./MediaPlayerCard":[879,792],"./MediaPlayerCard.ts":[879,792],"./MiscellaneousCard":[486,792],"./MiscellaneousCard.ts":[486,792],"./NumberCard":[137,792],"./NumberCard.ts":[137,792],"./PersonCard":[845,792],"./PersonCard.ts":[845,792],"./SceneCard":[858,792],"./SceneCard.ts":[858,792],"./SelectCard":[212,792],"./SelectCard.ts":[212,792],"./SensorCard":[982],"./SensorCard.ts":[982],"./SwitchCard":[708,792],"./SwitchCard.ts":[708,792],"./VacuumCard":[430,792],"./VacuumCard.ts":[430,792]};function a(e){if(!i.o(r,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],a=t[0];return Promise.all(t.slice(1).map(i.e)).then((()=>i(a)))}a.keys=()=>Object.keys(r),a.id=560,e.exports=a},216:(e,t,i)=>{var r={"./AbstractChip":[222,792],"./AbstractChip.ts":[222,792],"./ClimateChip":[757,792],"./ClimateChip.ts":[757,792],"./CoverChip":[589,792],"./CoverChip.ts":[589,792],"./FanChip":[867,792],"./FanChip.ts":[867,792],"./LightChip":[741,792],"./LightChip.ts":[741,792],"./SwitchChip":[908,792],"./SwitchChip.ts":[908,792],"./WeatherChip":[778,792],"./WeatherChip.ts":[778,792]};function a(e){if(!i.o(r,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],a=t[0];return i.e(t[1]).then((()=>i(a)))}a.keys=()=>Object.keys(r),a.id=216,e.exports=a},555:(e,t,i)=>{var r={"./AbstractView":[122,792],"./AbstractView.ts":[122,792],"./CameraView":[255,792],"./CameraView.ts":[255,792],"./ClimateView":[559,792],"./ClimateView.ts":[559,792],"./CoverView":[547,792],"./CoverView.ts":[547,792],"./FanView":[626,792],"./FanView.ts":[626,792],"./HomeView":[31,792],"./HomeView.ts":[31,792],"./LightView":[304,792],"./LightView.ts":[304,792],"./SceneView":[204,792],"./SceneView.ts":[204,792],"./SwitchView":[464,792],"./SwitchView.ts":[464,792],"./VacuumView":[499,792],"./VacuumView.ts":[499,792]};function a(e){if(!i.o(r,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],a=t[0];return i.e(t[1]).then((()=>i(a)))}a.keys=()=>Object.keys(r),a.id=555,e.exports=a}},r={};function a(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return i[e](o,o.exports,a),o.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(i,r){if(1&r&&(i=this(i)),8&r)return i;if("object"==typeof i&&i){if(4&r&&i.__esModule)return i;if(16&r&&"function"==typeof i.then)return i}var o=Object.create(null);a.r(o);var s={};e=e||[null,t({}),t([]),t(t)];for(var n=2&r&&i;"object"==typeof n&&!~e.indexOf(n);n=t(n))Object.getOwnPropertyNames(n).forEach((e=>s[e]=()=>i[e]));return s.default=()=>i,a.d(o,s),o},a.d=(e,t)=>{for(var i in t)a.o(t,i)&&!a.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},a.e=()=>Promise.resolve(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e=a(245),t=a(982),i=a(896);class r extends HTMLTemplateElement{static async generateDashboard(t){await e.H.initialize(t);const i=t.config?.views??[];let r;for(let t of e.H.getExposedViewIds())try{const o=e.H.sanitizeClassName(t+"View");r=await a(555)(`./${o}`);const s=await new r[o](e.H.strategyOptions.views[t]).getView();s.cards?.length&&i.push(s)}catch(i){e.H.logError(`View '${t}' couldn't be loaded!`,i)}for(let t of e.H.areas)t.hidden||i.push({title:t.name,path:t.area_id??t.name,subview:!0,strategy:{type:"custom:mushroom-strategy",options:{area:t}}});return e.H.strategyOptions.extra_views&&i.push(...e.H.strategyOptions.extra_views),{views:i}}static async generateView(r){const o=e.H.getExposedDomainIds(),s=r.view.strategy?.options?.area??{},n=[...s.extra_cards??[]];let c={area_id:[s.area_id]};for(const r of o){if("default"===r)continue;const o=e.H.sanitizeClassName(r+"Card");let l=[];try{l=await a(560)(`./${o}`).then((a=>{let n=[];const l=e.H.getDeviceEntities(s,r);let d=e.H.strategyOptions.domains[r??"_"].hide_config_entities||e.H.strategyOptions.domains._.hide_config_entities,h=e.H.strategyOptions.domains[r??"_"].hide_diagnostic_entities||e.H.strategyOptions.domains._.hide_diagnostic_entities;if("undisclosed"===s.area_id&&(c={entity_id:l.map((e=>e.entity_id))}),l.length){const u=new i.ControllerCard(c,e.H.strategyOptions.domains[r]).createCard();if("sensor"===r){const i=e.H.getStateEntities(s,"sensor"),r=[];for(const a of l){if("diagnostic"===a.entity_category&&h)continue;const o=i.find((e=>e.entity_id===a.entity_id));let s=e.H.strategyOptions.card_options?.[a.entity_id];o?.attributes.unit_of_measurement&&(s={type:"custom:mini-graph-card",entities:[a.entity_id],...s},r.push(new t.SensorCard(a,s).getCard()))}return r.length&&(n.push({type:"vertical-stack",cards:r}),n.unshift(u)),n}for(const t of l){let i,r=e.H.strategyOptions.card_options?.[t.entity_id];t.device_id&&(i=e.H.strategyOptions.card_options?.[t.device_id]),"config"===t.entity_category&&d||"diagnostic"===t.entity_category&&h||n.push(new a[o](t,r).getCard())}if("binary_sensor"===r){const e=[];for(let t=0;t<n.length;t+=2)e.push({type:"horizontal-stack",cards:n.slice(t,t+2)});n=e}n.length&&n.unshift(u)}return n}))}catch(t){e.H.logError("An error occurred while creating the domain cards!",t)}l.length&&n.push({type:"vertical-stack",cards:l})}if(!e.H.strategyOptions.domains.default.hidden){const t=e.H.getDeviceEntities(s).filter((e=>!o.includes(e.entity_id.split(".",1)[0])));if(t.length){let r=[];try{r=await Promise.resolve().then(a.bind(a,486)).then((r=>{const a=[new i.ControllerCard(c,e.H.strategyOptions.domains.default).createCard()];for(const i of t){let t=e.H.strategyOptions.card_options?.[i.entity_id];e.H.strategyOptions.card_options?.[i.device_id??"null"],"config"===i.entity_category&&e.H.strategyOptions.domains._.hide_config_entities||"diagnostic"===i.entity_category&&e.H.strategyOptions.domains._.hide_diagnostic_entities||a.push(new r.MiscellaneousCard(i,t).getCard())}return a}))}catch(t){e.H.logError("An error occurred while creating the domain cards!",t)}n.push({type:"vertical-stack",cards:r})}}return{cards:n}}}customElements.define("ll-strategy-mushroom-strategy",r),console.info("%c Mushroom Strategy %c ".concat("v2.2.0"," "),"color: white; background: coral; font-weight: 700;","color: coral; background: white; font-weight: 700;")})()})(); |