mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-11-23 00:58:14 +00:00
Compare commits
6 Commits
3a7676f4bf
...
f64bed5058
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f64bed5058 | ||
|
|
619671de5d | ||
|
|
6d18406880 | ||
|
|
81fa876449 | ||
|
|
b563ab7923 | ||
|
|
2ebf36a445 |
@@ -108,3 +108,64 @@ If you would like to temporarily disable an item in your menu, e.g. for seasonal
|
|||||||
"enabled": false
|
"enabled": false
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Selects
|
||||||
|
|
||||||
|
Here is an example of how to make a light effect selector:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "group",
|
||||||
|
"name": "Example",
|
||||||
|
"title": "Light Effect",
|
||||||
|
"content": "{{ state_attr('light.moon', 'effect') }}",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"type": "tap",
|
||||||
|
"name": "None",
|
||||||
|
"entity": "light.example",
|
||||||
|
"tap_action": {
|
||||||
|
"service": "light.turn_on",
|
||||||
|
"data": {
|
||||||
|
"effect": "None"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "tap",
|
||||||
|
"name": "Rainbow",
|
||||||
|
"entity": "light.example",
|
||||||
|
"tap_action": {
|
||||||
|
"service": "light.turn_on",
|
||||||
|
"data": {
|
||||||
|
"effect": "Rainbow"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "tap",
|
||||||
|
"name": "Glimmer",
|
||||||
|
"entity": "light.example",
|
||||||
|
"tap_action": {
|
||||||
|
"service": "light.turn_on",
|
||||||
|
"data": {
|
||||||
|
"effect": "Glimmer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "tap",
|
||||||
|
"name": "Twinkle",
|
||||||
|
"entity": "light.example",
|
||||||
|
"tap_action": {
|
||||||
|
"service": "light.turn_on",
|
||||||
|
"data": {
|
||||||
|
"effect": "Twinkle"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The same pattern works for any selector (`input_select.*`, `select.*`, `climate.*` mode).
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
data-name="vs/editor/editor.main"
|
data-name="vs/editor/editor.main"
|
||||||
href="https://www.unpkg.com/monaco-editor@0.45.0/min/vs/editor/editor.main.css" />
|
href="https://www.unpkg.com/monaco-editor@0.52.2/min/vs/editor/editor.main.css" />
|
||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
type="text/css"
|
type="text/css"
|
||||||
|
|||||||
30
web/main.js
30
web/main.js
@@ -141,10 +141,32 @@ async function get_services() {
|
|||||||
* @returns {Promise<{}>}
|
* @returns {Promise<{}>}
|
||||||
*/
|
*/
|
||||||
async function get_schema() {
|
async function get_schema() {
|
||||||
const res = await fetch(
|
const searchParams = new URL(window.location).searchParams;
|
||||||
'https://raw.githubusercontent.com/house-of-abbey/GarminHomeAssistant/main/config.schema.json'
|
|
||||||
);
|
const url = searchParams.get('schema');
|
||||||
return res.json();
|
if (url) return (await fetch(url)).json();
|
||||||
|
|
||||||
|
const branch = searchParams.get('branch');
|
||||||
|
if (branch)
|
||||||
|
return (
|
||||||
|
await fetch(
|
||||||
|
`https://raw.githubusercontent.com/house-of-abbey/GarminHomeAssistant/refs/heads/${branch}/config.schema.json`
|
||||||
|
)
|
||||||
|
).json();
|
||||||
|
|
||||||
|
const version = searchParams.get('version');
|
||||||
|
if (version)
|
||||||
|
return (
|
||||||
|
await fetch(
|
||||||
|
`https://raw.githubusercontent.com/house-of-abbey/GarminHomeAssistant/refs/tags/${version}/config.schema.json`
|
||||||
|
)
|
||||||
|
).json();
|
||||||
|
|
||||||
|
return (
|
||||||
|
await fetch(
|
||||||
|
`https://raw.githubusercontent.com/house-of-abbey/GarminHomeAssistant/main/config.schema.json`
|
||||||
|
)
|
||||||
|
).json();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/toastify-js": "^1.12.4",
|
"@types/toastify-js": "1.12.0",
|
||||||
"@vscode/webview-ui-toolkit": "1.4.0",
|
"@vscode/webview-ui-toolkit": "1.4.0",
|
||||||
"json-ast-comments": "1.1.1",
|
"json-ast-comments": "1.1.1",
|
||||||
"monaco-editor": "0.52.2",
|
"monaco-editor": "0.52.2",
|
||||||
|
|||||||
8
web/pnpm-lock.yaml
generated
8
web/pnpm-lock.yaml
generated
@@ -6,8 +6,8 @@ settings:
|
|||||||
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@types/toastify-js':
|
'@types/toastify-js':
|
||||||
specifier: ^1.12.4
|
specifier: 1.12.0
|
||||||
version: 1.12.4
|
version: 1.12.0
|
||||||
'@vscode/webview-ui-toolkit':
|
'@vscode/webview-ui-toolkit':
|
||||||
specifier: 1.4.0
|
specifier: 1.4.0
|
||||||
version: 1.4.0(react@18.2.0)
|
version: 1.4.0(react@18.2.0)
|
||||||
@@ -55,8 +55,8 @@ packages:
|
|||||||
exenv-es6: 1.1.1
|
exenv-es6: 1.1.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/toastify-js@1.12.4:
|
/@types/toastify-js@1.12.0:
|
||||||
resolution: {integrity: sha512-zfZHU4tKffPCnZRe7pjv/eFKzTVHozKewFCKaCjZ4gFinKgJRz/t0bkZiMCXJxPhv/ZoeDGNOeRD09R0kQZ/nw==}
|
resolution: {integrity: sha512-fqpDHaKhFukN9KRm24bbH0wozvHmSwjvkaLjBUrWcSfSS4zysIwTYqNLG3XbSNhRlsTNRNLGS23tp/VhPwsfHQ==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@vscode/webview-ui-toolkit@1.4.0(react@18.2.0):
|
/@vscode/webview-ui-toolkit@1.4.0(react@18.2.0):
|
||||||
|
|||||||
Reference in New Issue
Block a user