Improved thread safety

This commit is contained in:
2022-08-16 20:42:35 +00:00
parent ae9ffb65c1
commit 39f727206f
11 changed files with 82 additions and 8 deletions

31
test/automations.yaml Normal file
View File

@@ -0,0 +1,31 @@
- id: "1660669793583"
alias: Toggle bed light
description: ""
trigger:
- platform: time_pattern
seconds: /3
condition: []
action:
- type: toggle
device_id: 98861bdf58b3c79183c03be06da14f27
entity_id: light.bed_light
domain: light
mode: single
- alias: Popup when kitchen light togggled
trigger:
- platform: state
entity_id: light.kitchen_lights
action:
- service: browser_mod.sequence
data:
sequence:
- service: delay
data:
time: 5000
- service: browser_mod.popup
data:
title: automation
content:
type: markdown
content: "{%raw%}{{states('light.bed_light')}}{%endraw%}"

View File

@@ -1,5 +1,7 @@
default_config:
automation: !include test/automations.yaml
demo:
http:
@@ -12,6 +14,8 @@ logger:
logs:
custom_components.browser_mod: info
# debugpy:
# browser_mod:
# devices:
# camdevice:

View File

@@ -32,6 +32,7 @@ views:
action: more-info
- !include views/popup.yaml
- !include views/frontend-backend.yaml
- title: Popup card
popup_cards:

View File

@@ -0,0 +1,30 @@
title: frontend vs backend
cards:
- type: entities
entities:
- light.bed_light
- light.kitchen_lights
- type: button
name: fire-dom-event
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
title: fire-dom-event
content:
type: markdown
content: "{{states('light.bed_light')}}"
- type: button
name: call-service
tap_action:
action: call-service
service: browser_mod.popup
data:
title: call-service
content:
type: markdown
content: "{{states('light.bed_light')}}"