Skip to content

Commit

Permalink
Merge pull request #314 from cgiesche/streamdeck-homeassistant-297
Browse files Browse the repository at this point in the history
streamdeck-homeassistant-297 [Task] Disable caching on axios requests.
  • Loading branch information
cgiesche authored Nov 12, 2024
2 parents 39a3b58 + 9eed71c commit ec0fe46
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion public/config/default-display-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}%"
Expand All @@ -72,6 +75,7 @@ light:
color: "#ffd484"

input_boolean:
labelTemplates:
icon: mdi:toggle-switch-off
states:
on:
Expand All @@ -91,6 +95,7 @@ person:
icon: mdi:account-arrow-right

binary_sensor:
labelTemplates:
icon: mdi:radiobox-blank
states:
on:
Expand Down
4 changes: 4 additions & 0 deletions src/components/PiComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/components/PluginComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions src/modules/plugin/entityConfigFactoryNg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ec0fe46

Please sign in to comment.