Tag 2.0 🎉
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
## This browser
|
||||
|
||||
A basic concept for Browser Mod is the _Browser_. A _Browser_ is identified by a unique `BrowserID` stored in the browsers [LocalStorage](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API).
|
||||
The most important concept for Browser Mod is the _Browser_. A _Browser_ is identified by a unique `BrowserID` stored in the browsers [LocalStorage](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API).
|
||||
|
||||
Browser Mod will initially assigning a random `BrowserID` to each _Browser_ that connects, but you can change this if you want.
|
||||
|
||||
|
||||
@@ -67,6 +67,36 @@ script:
|
||||
|
||||
Will print `"Button was clicked in 79be65e8-f06c78f" to the Home Assistant log.
|
||||
|
||||
# Calling services
|
||||
|
||||
Services can be called from the backend using the normal service call procedures. Registered Browsers can be selected as targets through their device:
|
||||

|
||||
|
||||
In yaml, the BrowserID can be used for targeting a specific browser:
|
||||
|
||||
```yaml
|
||||
service: browser_mod.more_info
|
||||
data:
|
||||
entity: light.bed_light
|
||||
browser_id:
|
||||
- 79be65e8-f06c78f
|
||||
```
|
||||
|
||||
If no target or `browser_id` is specified, the service will target all registerd Browsers.
|
||||
|
||||
To call a service from a dashboard use the call-service [action](https://www.home-assistant.io/dashboards/actions/) or the special action `fire-dom-event`:
|
||||
|
||||
```yaml
|
||||
tap_action:
|
||||
action: fire-dom-event
|
||||
browser_mod:
|
||||
service: browser_mod.more_info
|
||||
data:
|
||||
entity: light.bed_light
|
||||
```
|
||||
|
||||
Services called via `fire-dom-event` or called as a part of a different service call will (by default) _only_ target the current Browser (even if it's not registered).
|
||||
|
||||
|
||||
|
||||
# Browser Mod Services
|
||||
|
||||
Reference in New Issue
Block a user