diff --git a/public/config/default-display-config.yml b/public/config/default-display-config.yml index 54d7c82..15338d7 100644 --- a/public/config/default-display-config.yml +++ b/public/config/default-display-config.yml @@ -50,17 +50,20 @@ _states: # ========================================================= switch: + labelTemplates: icon: mdi:toggle-switch-off states: on: icon: mdi:toggle-switch light: + labelTemplates: icon: mdi:lightbulb color: "#888888" feedbackLayout: "$B1" feedback: | - {% set brightness = attributes.brightness | default(255, true) %} + {% set defaultBrightness = (255 if state === 'on' else 0) %} + {% set brightness = attributes.brightness | default(defaultBrightness, true) %} { "indicator": {{ brightness / 255 * 100 }}, "value": "{{ (brightness / 255 * 100) | int }}%" @@ -72,6 +75,7 @@ light: color: "#ffd484" input_boolean: + labelTemplates: icon: mdi:toggle-switch-off states: on: @@ -91,6 +95,7 @@ person: icon: mdi:account-arrow-right binary_sensor: + labelTemplates: icon: mdi:radiobox-blank states: on: diff --git a/src/components/PiComponent.vue b/src/components/PiComponent.vue index 8fd776f..306d2be 100644 --- a/src/components/PiComponent.vue +++ b/src/components/PiComponent.vue @@ -233,6 +233,10 @@ import EntitySelection from '@/components/EntitySelection.vue' import axios from 'axios' import yaml from 'js-yaml' +axios.defaults.headers = { + 'Cache-Control': 'public, max-age=86400' +} + let manifest = ref(defaultManifest) let $HA = null diff --git a/src/components/PluginComponent.vue b/src/components/PluginComponent.vue index df63053..5a0b607 100644 --- a/src/components/PluginComponent.vue +++ b/src/components/PluginComponent.vue @@ -14,6 +14,10 @@ import defaultActiveStates from '../../public/config/active-states.yml' import axios from 'axios' import yaml from 'js-yaml' +axios.defaults.headers = { + 'Cache-Control': 'public, max-age=86400' +} + let entityConfigFactory const svgUtils = new SvgUtils() diff --git a/src/modules/plugin/entityConfigFactoryNg.js b/src/modules/plugin/entityConfigFactoryNg.js index caf5b10..0c6dcdd 100644 --- a/src/modules/plugin/entityConfigFactoryNg.js +++ b/src/modules/plugin/entityConfigFactoryNg.js @@ -23,6 +23,10 @@ export class EntityConfigFactory { * @param displayConfigurationURL : String */ constructor(displayConfigurationURL) { + axios.defaults.headers = { + 'Cache-Control': 'public, max-age=86400' + } + if (displayConfigurationURL) { console.log(`Loading display configuration from ${displayConfigurationURL}`) axios.get(displayConfigurationURL)