Comment with possible alternate way to do things later on, close #31

This commit is contained in:
2022-12-29 18:18:37 -05:00
parent 40d3c6d313
commit 45060855a4

View File

@ -82,4 +82,34 @@ scrape:
select: "#root > div > div.Page-module__content___196kn.Page-module__padded___3hQ0U > div > div > div:nth-child(2) > div.grid__column___nhz7X.grid__desktop10___2T18R > div:nth-child(1) > div.grid__column___nhz7X.grid__desktop8___38Y4U > div:nth-child(3) > div > div.GasPriceCollection-module__collectionContainer___29Ngz > div:nth-child(2) > div:nth-child(1) > span"
unit_of_measurement: USD
value_template: '{{ value | replace("$", "") | float }}'
icon: mdi:gas-station
icon: mdi:gas-station
# Possible alternate way to do things, may revisit later, keeping for reference
# rest:
# - scan_interval: 3600
# resource: https://www.gasbuddy.com/graphql
# method: POST
# headers:
# Content-Type: application/json
# payload: |
# {
# "operationName": "LocationBySearchTerm",
# "variables": {
# "fuel": 1,
# "maxAge": 0,
# "search": "43512"
# },
# "query": "query LocationBySearchTerm($search: String) { locationBySearchTerm(search: $search) { trends { areaName country today todayLow } } }"
# }
# sensor:
# - unique_id: gasbuddy_lowest_gas_price
# name: Gasbuddy Lowest Gas Price
# icon: mdi:gas-station
# unit_of_measurement: USD
# value_template: "{{ value_json.data.locationBySearchTerm.trends.0.todayLow | float }}"
# - unique_id: gasbuddy_average_gas_price
# name: Gasbuddy Average Gas Price
# icon: mdi:gas-station
# unit_of_measurement: USD
# value_template: "{{ value_json.data.locationBySearchTerm.trends.0.today | float }}"