Skip to content

Commit 432ccce

Browse files
committed
Adds automations examples.
1 parent ea43c5d commit 432ccce

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

automations/configuration.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
shell_command:
3+
# Download the barcode to product_id mapping file from GitHub (required for automation to update data)
4+
download_barcode_mapping: >
5+
curl -s -o /config/barcode_to_product_id.json
6+
"https://raw.githubusercontent.com/dvejsada/HA-RohlikCZ/refs/heads/master/barcode_to_product_id.json"
7+
8+
# Lookup product id by barcode (required for automation to add to cart)
9+
lookup_product_id: >
10+
jq -r --arg barcode "{{ barcode }}"
11+
'first(.[] | select(.barcode == $barcode) | .product_id) // "unknown"'
12+
/config/barcode_to_product_id.json
13+
14+
# Lookup product name by barcode (required for automation to add to cart)
15+
lookup_product_name: >
16+
jq -r --arg barcode "{{ barcode }}"
17+
'first(.[] | select(.barcode == $barcode) | .name) // "unknown"'
18+
/config/barcode_to_product_id.json

0 commit comments

Comments
 (0)