Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add prices to long-term statistics #133

Merged
merged 3 commits into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion custom_components/gasbuddy/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from typing import Final

from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass

from .entity import GasBuddySensorEntityDescription

Expand Down Expand Up @@ -51,25 +51,33 @@
name="Regular Gas",
icon="mdi:gas-station",
suggested_display_precision=2,
device_class=SensorDeviceClass.MONETARY,
state_class=SensorStateClass.MEASUREMENT,
),
"midgrade_gas": GasBuddySensorEntityDescription(
key="midgrade_gas",
name="MidGrade Gas",
icon="mdi:gas-station",
suggested_display_precision=2,
device_class=SensorDeviceClass.MONETARY,
state_class=SensorStateClass.MEASUREMENT,
),
"premium_gas": GasBuddySensorEntityDescription(
key="premium_gas",
name="Premium Gas",
icon="mdi:gas-station",
suggested_display_precision=2,
device_class=SensorDeviceClass.MONETARY,
state_class=SensorStateClass.MEASUREMENT,
),
"diesel": GasBuddySensorEntityDescription(
key="diesel",
name="Diesel",
icon="mdi:gas-station",
suggested_display_precision=2,
entity_registry_enabled_default=False,
device_class=SensorDeviceClass.MONETARY,
state_class=SensorStateClass.MEASUREMENT,
),
"regular_gas_cash": GasBuddySensorEntityDescription(
key="regular_gas",
Expand All @@ -78,6 +86,8 @@
icon="mdi:gas-station",
suggested_display_precision=2,
entity_registry_enabled_default=False,
device_class=SensorDeviceClass.MONETARY,
state_class=SensorStateClass.MEASUREMENT,
),
"midgrade_gas_cash": GasBuddySensorEntityDescription(
key="midgrade_gas",
Expand All @@ -86,6 +96,8 @@
icon="mdi:gas-station",
suggested_display_precision=2,
entity_registry_enabled_default=False,
device_class=SensorDeviceClass.MONETARY,
state_class=SensorStateClass.MEASUREMENT,
),
"premium_gas_cash": GasBuddySensorEntityDescription(
key="premium_gas",
Expand All @@ -94,6 +106,8 @@
icon="mdi:gas-station",
suggested_display_precision=2,
entity_registry_enabled_default=False,
device_class=SensorDeviceClass.MONETARY,
state_class=SensorStateClass.MEASUREMENT,
),
"diesel_cash": GasBuddySensorEntityDescription(
key="diesel",
Expand All @@ -102,6 +116,8 @@
icon="mdi:gas-station",
suggested_display_precision=2,
entity_registry_enabled_default=False,
device_class=SensorDeviceClass.MONETARY,
state_class=SensorStateClass.MEASUREMENT,
),
# special fuels
"e85": GasBuddySensorEntityDescription(
Expand All @@ -110,6 +126,8 @@
icon="mdi:gas-station",
suggested_display_precision=2,
entity_registry_enabled_default=False,
device_class=SensorDeviceClass.MONETARY,
state_class=SensorStateClass.MEASUREMENT,
),
"e85_cash": GasBuddySensorEntityDescription(
key="e85",
Expand All @@ -118,13 +136,17 @@
icon="mdi:gas-station",
suggested_display_precision=2,
entity_registry_enabled_default=False,
device_class=SensorDeviceClass.MONETARY,
state_class=SensorStateClass.MEASUREMENT,
),
"e15": GasBuddySensorEntityDescription(
key="e15",
name="UNL88",
icon="mdi:gas-station",
suggested_display_precision=2,
entity_registry_enabled_default=False,
device_class=SensorDeviceClass.MONETARY,
state_class=SensorStateClass.MEASUREMENT,
),
"e15_cash": GasBuddySensorEntityDescription(
key="e15",
Expand All @@ -133,5 +155,7 @@
icon="mdi:gas-station",
suggested_display_precision=2,
entity_registry_enabled_default=False,
device_class=SensorDeviceClass.MONETARY,
state_class=SensorStateClass.MEASUREMENT,
),
}
Loading