-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Doc enhancement] Powerfull ideas using eval() #123
Comments
Some template you could provide in the wallpanel documentation: wallpanel.yaml inside /packages/ rest_command:
wallpanel_speak:
url: !secret wallpanel_apipath
method: POST
headers:
accept: 'application/json, text/html'
payload: "{'speak': '{{ message }}'}"
content_type: 'application/json; charset=utf-8'
wallpanel_play_alarm:
url: !secret wallpanel_apipath
method: POST
headers:
accept: 'application/json, text/html'
payload: '{"audio": "http://homeassistant.fritz.box:8123/local/images443/polizei.mp3"}'
content_type: 'application/json; charset=utf-8'
wallpanel_play_doorbell:
url: !secret wallpanel_apipath
method: POST
headers:
accept: 'application/json, text/html'
payload: '{"audio": "http://homeassistant.fritz.box:8123/local/images443/doorbell.mp3"}'
content_type: 'application/json; charset=utf-8'
wallpanel_play_nothing:
url: !secret wallpanel_apipath
method: POST
headers:
accept: 'application/json, text/html'
payload: '{"audio": ""}'
content_type: 'application/json; charset=utf-8'
wallpanel_wakeup:
url: !secret wallpanel_apipath
method: POST
headers:
accept: 'application/json, text/html'
payload: '{"wake": true, "wakeTime": 60}'
content_type: 'application/json; charset=utf-8'
wallpanel_settings:
url: !secret wallpanel_apipath
method: POST
headers:
accept: 'application/json, text/html'
payload: '{"settings": true}'
content_type: 'application/json; charset=utf-8'
wallpanel_door:
url: !secret wallpanel_apipath
method: POST
headers:
accept: 'application/json, text/html'
payload: '{"url": "http://homeassistant.fritz.box:8123/my-wallpanel/door"}'
content_type: 'application/json; charset=utf-8' |
If anyone stumbles on this post, here is how I managed to achieve navigating between HA dashboards without reloading the whole page (I'm using MQTT, this should also apply to HTTP API):
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem description: sending an
url
takes much time to reload the page, a simple javascript event, would be very fast in navigating on the dashboard.Use cases: For example I have one tab on my WallPanel showing the cameras, as soon someone rings my doorbell, or as soon as movement is detected by my camera, I want to trigger a wakeup event on the WallPanel as well as navigate to the Camera sub-page.
I tried to do this using something like:
As you run the webView.evaluateJavascript() method this is definitely a very powerful solution.
wallpanel-android/WallPanelApp/src/main/java/xyz/wallpanel/app/ui/activities/BrowserActivityNative.kt
Line 213 in 4c276ba
Anotter use case I had in mind, was when someone rings my doorbell I don't only want to play the doorbell alarm on the WallPanel speaker but also flash a red screen on the screen in case my WallPanel is muted (baby sleeping). Here I wanted to create a red box element and make it visible for a view seconds everything using simple pure javascript, but triggering it using eval().
@TheTimeWalker could you please provide more examples in the documentation as well as fix the timeout bug #50 related to the eval() command which currently blocks this poweruser enhancement.
Originally posted by @JavanXD in #26 (comment)
The text was updated successfully, but these errors were encountered: