File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments