4 files
This commit is contained in:
1 parent
8b759845d6
commit
55dd6a3754
4 files changed
+181
-17
No files matched your search
@@ -4298,3 +4298,4 @@
|
|||||||
{"timestamp": "2026-10-10T06:33:29.754496+00:00", "tool_name": "ha_search", "parameters": {"query": "Reload Printer data", "domain_filter": null, "area_filter": null, "search_types": null, "limit": 15, "offset": 0, "exact_match": true, "include_hidden": true, "include_config": false, "group_by_domain": false, "per_domain_limit": null, "state_filter": null, "result_fields": null, "fields": null, "config_time_budget": null, "ctx": {"_STATE_TTL_SECONDS": 86400}}, "execution_time_ms": 448.3673572540283, "success": true, "error_message": null, "response_size_bytes": 507, "user_context": null}
|
{"timestamp": "2026-10-10T06:33:29.754496+00:00", "tool_name": "ha_search", "parameters": {"query": "Reload Printer data", "domain_filter": null, "area_filter": null, "search_types": null, "limit": 15, "offset": 0, "exact_match": true, "include_hidden": true, "include_config": false, "group_by_domain": false, "per_domain_limit": null, "state_filter": null, "result_fields": null, "fields": null, "config_time_budget": null, "ctx": {"_STATE_TTL_SECONDS": 86400}}, "execution_time_ms": 448.3673572540283, "success": true, "error_message": null, "response_size_bytes": 507, "user_context": null}
|
||||||
{"timestamp": "2026-10-10T06:33:29.756280+00:00", "tool_name": "ha_search", "parameters": {"query": "Printer finished", "domain_filter": null, "area_filter": null, "search_types": null, "limit": 15, "offset": 0, "exact_match": true, "include_hidden": true, "include_config": false, "group_by_domain": false, "per_domain_limit": null, "state_filter": null, "result_fields": null, "fields": null, "config_time_budget": null, "ctx": {"_STATE_TTL_SECONDS": 86400}}, "execution_time_ms": 449.75900650024414, "success": true, "error_message": null, "response_size_bytes": 504, "user_context": null}
|
{"timestamp": "2026-10-10T06:33:29.756280+00:00", "tool_name": "ha_search", "parameters": {"query": "Printer finished", "domain_filter": null, "area_filter": null, "search_types": null, "limit": 15, "offset": 0, "exact_match": true, "include_hidden": true, "include_config": false, "group_by_domain": false, "per_domain_limit": null, "state_filter": null, "result_fields": null, "fields": null, "config_time_budget": null, "ctx": {"_STATE_TTL_SECONDS": 86400}}, "execution_time_ms": 449.75900650024414, "success": true, "error_message": null, "response_size_bytes": 504, "user_context": null}
|
||||||
{"timestamp": "2026-10-10T06:34:47.401520+00:00", "tool_name": "ha_config_get_dashboard", "parameters": {"url_path": "printer-stats", "list_only": false, "force_reload": false, "entity_id": null, "card_type": null, "heading": null, "include_config": false, "include_screenshot": false, "view_path": null, "mode": null, "query": null}, "execution_time_ms": 45.732975006103516, "success": true, "error_message": null, "response_size_bytes": 23642, "user_context": null}
|
{"timestamp": "2026-10-10T06:34:47.401520+00:00", "tool_name": "ha_config_get_dashboard", "parameters": {"url_path": "printer-stats", "list_only": false, "force_reload": false, "entity_id": null, "card_type": null, "heading": null, "include_config": false, "include_screenshot": false, "view_path": null, "mode": null, "query": null}, "execution_time_ms": 45.732975006103516, "success": true, "error_message": null, "response_size_bytes": 23642, "user_context": null}
|
||||||
|
{"timestamp": "2026-10-10T06:37:56.509432+00:00", "tool_name": "ha_manage_hacs", "parameters": {"action": "download", "repository_id": "thomasloven/lovelace-state-switch", "version": null, "repository": null, "category": null}, "execution_time_ms": 2922.42693901062, "success": true, "error_message": null, "response_size_bytes": 635, "user_context": null}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import nodeResolve from "@rollup/plugin-node-resolve";
|
||||||
|
import json from "@rollup/plugin-json";
|
||||||
|
import typescript from "rollup-plugin-typescript2";
|
||||||
|
import { terser } from "rollup-plugin-terser";
|
||||||
|
import babel from "@rollup/plugin-babel";
|
||||||
|
|
||||||
|
const dev = process.env.ROLLUP_WATCH;
|
||||||
|
|
||||||
|
export default {
|
||||||
|
input: "src/main.ts",
|
||||||
|
output: {
|
||||||
|
file: "state-switch.js",
|
||||||
|
format: "es",
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
nodeResolve(),
|
||||||
|
json(),
|
||||||
|
typescript(),
|
||||||
|
babel({
|
||||||
|
exclude: "node_modules/**",
|
||||||
|
}),
|
||||||
|
!dev && terser({ format: { comments: false } }),
|
||||||
|
],
|
||||||
|
};
|
||||||
@@ -0,0 +1,139 @@
|
|||||||
|
function t(t,e,i,s){var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r}const e=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),s=new Map;class o{constructor(t,e){if(this._$cssResult$=!0,e!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=s.get(this.cssText);return e&&void 0===t&&(s.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const n=(t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new o(s,i)},r=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new o("string"==typeof t?t:t+"",i))(e)})(t):t;var a;const l=window.trustedTypes,h=l?l.emptyScript:"",d=window.reactiveElementPolyfillSupport,c={toAttribute(t,e){switch(e){case Boolean:t=t?h:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},u=(t,e)=>e!==t&&(e==e||t==t),p={attribute:!0,type:String,converter:c,reflect:!1,hasChanged:u};class v extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;null!==(e=this.l)&&void 0!==e||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const s=this._$Eh(i,e);void 0!==s&&(this._$Eu.set(s,i),t.push(s))})),t}static createProperty(t,e=p){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const o=this[t];this[e]=s,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||p}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Eh(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$Eg)&&void 0!==e?e:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$Eg)||void 0===e||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const i=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,i)=>{e?t.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):i.forEach((e=>{const i=document.createElement("style"),s=window.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=e.cssText,t.appendChild(i)}))})(i,this.constructor.elementStyles),i}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ES(t,e,i=p){var s,o;const n=this.constructor._$Eh(t,i);if(void 0!==n&&!0===i.rLine truncated
|
||||||
|
<div
|
||||||
|
id="root"
|
||||||
|
class="${this._config.transition}"
|
||||||
|
style="
|
||||||
|
transition-duration: ${this._config.transition_time||500}ms;
|
||||||
|
transition-delay: ${this._config.transition_time||500}ms;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
${Object.keys(this.cards).map((t=>M` <div>${this.cards[t]}</div> `))}
|
||||||
|
</div>
|
||||||
|
`}async getCardSize(){var t;let e=1;for(const i in this.cards)(null===(t=this.cards[i])||void 0===t?void 0:t.getCardSize)&&(e=Math.max(e,await this.cards[i].getCardSize()));return e}static get styles(){return n`
|
||||||
|
:host {
|
||||||
|
perspective: 1000px;
|
||||||
|
}
|
||||||
|
:host(.no-match) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#root {
|
||||||
|
margin: -4px;
|
||||||
|
padding: 4px;
|
||||||
|
display: grid;
|
||||||
|
grid-template-rows: auto 0px;
|
||||||
|
overflow: clip visible;
|
||||||
|
}
|
||||||
|
#root.transition {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
#root * {
|
||||||
|
grid-column: 1;
|
||||||
|
grid-row: 2;
|
||||||
|
overflow: hidden;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
#root *.visible,
|
||||||
|
#root *.out {
|
||||||
|
grid-row: 1;
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
#root.slide-down *,
|
||||||
|
#root.slide-up *,
|
||||||
|
#root.slide-left *,
|
||||||
|
#root.slide-right * {
|
||||||
|
transition-property: transform;
|
||||||
|
transition-timing-function: linear;
|
||||||
|
transition-duration: inherit;
|
||||||
|
transform: translate(0, -110%);
|
||||||
|
}
|
||||||
|
#root.slide-up * {
|
||||||
|
transform: translate(0, 110%);
|
||||||
|
}
|
||||||
|
#root.slide-left * {
|
||||||
|
transform: translate(110%, 0);
|
||||||
|
}
|
||||||
|
#root.slide-right * {
|
||||||
|
transform: translate(-110%, 0);
|
||||||
|
}
|
||||||
|
#root.slide-down .visible,
|
||||||
|
#root.slide-up .visible,
|
||||||
|
#root.slide-left .visible,
|
||||||
|
#root.slide-right .visible {
|
||||||
|
transform: translate(0%);
|
||||||
|
}
|
||||||
|
#root.slide-down .out {
|
||||||
|
transform: translate(0, 110%);
|
||||||
|
}
|
||||||
|
#root.slide-up .out {
|
||||||
|
transform: translate(0, -110%);
|
||||||
|
}
|
||||||
|
#root.slide-left .out {
|
||||||
|
transform: translate(-110%);
|
||||||
|
}
|
||||||
|
#root.slide-right .out {
|
||||||
|
transform: translate(110%);
|
||||||
|
}
|
||||||
|
|
||||||
|
#root.swap-down *,
|
||||||
|
#root.swap-up *,
|
||||||
|
#root.swap-left *,
|
||||||
|
#root.swap-right * {
|
||||||
|
transition-property: transform;
|
||||||
|
transition-timing-function: linear;
|
||||||
|
transition-duration: inherit;
|
||||||
|
transform: translate(0, 110%);
|
||||||
|
}
|
||||||
|
#root.swap-up * {
|
||||||
|
transform: translate(0, -110%);
|
||||||
|
}
|
||||||
|
#root.swap-left * {
|
||||||
|
transform: translate(-110%, 0);
|
||||||
|
}
|
||||||
|
#root.swap-right * {
|
||||||
|
transform: translate(110%, 0);
|
||||||
|
}
|
||||||
|
#root.swap-down .visible,
|
||||||
|
#root.swap-up .visible,
|
||||||
|
#root.swap-left .visible,
|
||||||
|
#root.swap-right .visible {
|
||||||
|
transition-delay: inherit;
|
||||||
|
transform: translate(0%);
|
||||||
|
}
|
||||||
|
|
||||||
|
#root.flip,
|
||||||
|
#root.flip-x,
|
||||||
|
#root.flip-y {
|
||||||
|
position: relative;
|
||||||
|
perspective: 1000px;
|
||||||
|
}
|
||||||
|
#root.flip *,
|
||||||
|
#root.flip-x *,
|
||||||
|
#root.flip-y * {
|
||||||
|
transform: rotate3d(0, 1, 0, -180deg);
|
||||||
|
transition-property: transform;
|
||||||
|
transition-timing-function: linear;
|
||||||
|
transition-duration: inherit;
|
||||||
|
transform-style: preserve-3d;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
#root.flip-y * {
|
||||||
|
transform: rotate3d(1, 0, 0, -180deg);
|
||||||
|
}
|
||||||
|
#root.flip .visible,
|
||||||
|
#root.flip-x .visible,
|
||||||
|
#root.flip-y .visible {
|
||||||
|
backface-visibility: hidden;
|
||||||
|
transform: rotate3d(0, 0, 0, 0deg);
|
||||||
|
}
|
||||||
|
#root.flip .out,
|
||||||
|
#root.flip-x .out,
|
||||||
|
#root.flip-y .out {
|
||||||
|
pointer-events: none;
|
||||||
|
transform: rotate3d(0, 1, 0, 180deg);
|
||||||
|
}
|
||||||
|
#root.flip-y .out {
|
||||||
|
transform: rotate3d(1, 0, 0, 180deg);
|
||||||
|
}
|
||||||
|
`}}t([tt()],ht.prototype,"_config",void 0),t([tt()],ht.prototype,"_hass",void 0),t([tt()],ht.prototype,"state",void 0),t([tt()],ht.prototype,"_tmpl",void 0),customElements.get("state-switch")||(customElements.define("state-switch",ht),console.info(`%cSTATE-SWITCH ${lt} IS INSTALLED`,"color: green; font-weight: bold",""));
|
||||||
+17
-17
@@ -7,7 +7,7 @@
|
|||||||
"voltage": 121.7,
|
"voltage": 121.7,
|
||||||
"countdown_to_turn_on": 0,
|
"countdown_to_turn_on": 0,
|
||||||
"ac_frequency": 60,
|
"ac_frequency": 60,
|
||||||
"power_factor": 0.14,
|
"power_factor": 0.13,
|
||||||
"update": {
|
"update": {
|
||||||
"state": "idle",
|
"state": "idle",
|
||||||
"installed_version": 268513381,
|
"installed_version": 268513381,
|
||||||
@@ -27,8 +27,8 @@
|
|||||||
"led_brightness": 100,
|
"led_brightness": 100,
|
||||||
"countdown_to_turn_off": 0,
|
"countdown_to_turn_off": 0,
|
||||||
"countdown_to_turn_on": 0,
|
"countdown_to_turn_on": 0,
|
||||||
"power": 1.9,
|
"power": 2.5,
|
||||||
"current": 0.09,
|
"current": 0.1,
|
||||||
"energy": 54.37,
|
"energy": 54.37,
|
||||||
"power_factor": 0.18,
|
"power_factor": 0.18,
|
||||||
"update": {
|
"update": {
|
||||||
@@ -45,10 +45,10 @@
|
|||||||
"state": "ON",
|
"state": "ON",
|
||||||
"led_brightness": 100,
|
"led_brightness": 100,
|
||||||
"countdown_to_turn_off": 0,
|
"countdown_to_turn_off": 0,
|
||||||
"voltage": 120.8,
|
"voltage": 119.2,
|
||||||
"countdown_to_turn_on": 0,
|
"countdown_to_turn_on": 0,
|
||||||
"energy": 105.03,
|
"energy": 105.04,
|
||||||
"power_factor": 0.2,
|
"power_factor": 0.89,
|
||||||
"ac_frequency": 60,
|
"ac_frequency": 60,
|
||||||
"update": {
|
"update": {
|
||||||
"state": "idle",
|
"state": "idle",
|
||||||
@@ -58,8 +58,8 @@
|
|||||||
"latest_release_notes": null
|
"latest_release_notes": null
|
||||||
},
|
},
|
||||||
"linkquality": 145,
|
"linkquality": 145,
|
||||||
"power": 0.2,
|
"power": 88.4,
|
||||||
"current": 0.01,
|
"current": 0.85,
|
||||||
"power_on_behavior": "on"
|
"power_on_behavior": "on"
|
||||||
},
|
},
|
||||||
"0xb40e060fffe031e3": {
|
"0xb40e060fffe031e3": {
|
||||||
@@ -74,12 +74,12 @@
|
|||||||
"led_brightness": 100,
|
"led_brightness": 100,
|
||||||
"countdown_to_turn_off": 0,
|
"countdown_to_turn_off": 0,
|
||||||
"countdown_to_turn_on": 0,
|
"countdown_to_turn_on": 0,
|
||||||
"voltage": 119.6,
|
"voltage": 119.7,
|
||||||
"state": "ON",
|
"state": "ON",
|
||||||
"ac_frequency": 60,
|
"ac_frequency": 60,
|
||||||
"energy": 213.19,
|
"energy": 213.2,
|
||||||
"power": 101.4,
|
"power": 99,
|
||||||
"current": 0.9,
|
"current": 0.87,
|
||||||
"power_factor": 0.95,
|
"power_factor": 0.95,
|
||||||
"update": {
|
"update": {
|
||||||
"state": "idle",
|
"state": "idle",
|
||||||
@@ -95,11 +95,11 @@
|
|||||||
"led_brightness": 100,
|
"led_brightness": 100,
|
||||||
"countdown_to_turn_off": 0,
|
"countdown_to_turn_off": 0,
|
||||||
"countdown_to_turn_on": 0,
|
"countdown_to_turn_on": 0,
|
||||||
"voltage": 121.7,
|
"voltage": 121.2,
|
||||||
"energy": 101.22,
|
"energy": 101.22,
|
||||||
"state": "ON",
|
"state": "ON",
|
||||||
"power": 11.1,
|
"power": 11.9,
|
||||||
"current": 0.18,
|
"current": 0.41,
|
||||||
"ac_frequency": 60,
|
"ac_frequency": 60,
|
||||||
"power_factor": 0.54,
|
"power_factor": 0.54,
|
||||||
"update": {
|
"update": {
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
"0xffffb40e0608864e": {
|
"0xffffb40e0608864e": {
|
||||||
"led_brightness": 100,
|
"led_brightness": 100,
|
||||||
"countdown_to_turn_off": 0,
|
"countdown_to_turn_off": 0,
|
||||||
"voltage": 121.2,
|
"voltage": 121.6,
|
||||||
"energy": 35.63,
|
"energy": 35.63,
|
||||||
"countdown_to_turn_on": 0,
|
"countdown_to_turn_on": 0,
|
||||||
"state": "ON",
|
"state": "ON",
|
||||||
@@ -171,7 +171,7 @@
|
|||||||
},
|
},
|
||||||
"0xa4c1380d0679ffff": {
|
"0xa4c1380d0679ffff": {
|
||||||
"battery": 100,
|
"battery": 100,
|
||||||
"temperature": 21.3,
|
"temperature": 21.2,
|
||||||
"temperature_units": "celsius",
|
"temperature_units": "celsius",
|
||||||
"temperature_calibration": 0,
|
"temperature_calibration": 0,
|
||||||
"update": {
|
"update": {
|
||||||
|
|||||||
Reference in new issue
Block a user