Fix mealie sensor: brug dict-key i stedet for attribut-access
value_json.items resolver til dict-metoden .items() når Mealie API ikke er klar ved opstart. Bruger nu value_json['items'] med default.
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
method: GET
|
method: GET
|
||||||
scan_interval: 1800
|
scan_interval: 1800
|
||||||
value_template: "{{ value_json.items | length }}"
|
value_template: "{{ value_json['items'] | default([]) | length }}"
|
||||||
json_attributes_path: "$"
|
json_attributes_path: "$"
|
||||||
json_attributes:
|
json_attributes:
|
||||||
- items
|
- items
|
||||||
|
|||||||
Reference in New Issue
Block a user