Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Lindvig authored Jan 4, 2023
1 parent 66fd790 commit 6018094
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion custom_components/fuelprices_dk/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
CONF_PLATFORM = "sensor"
CREDITS = [
{"Created by": "J-Lindvig (https://github.com/J-Lindvig)"},
{"Contributor": "Johan Leth (https://github.com/JVLeth)"},
{"Techinal support": "Peer Jensen (www.fuelfinder.dk)"},
]
DOMAIN = "fuelprices_dk"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/fuelprices_dk/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"codeowners": ["@J-Lindvig"],
"requirements": ["beautifulsoup4", "html.parser"],
"iot_class": "cloud_polling",
"version": "1.5"
"version": "1.6"
}
11 changes: 7 additions & 4 deletions custom_components/fuelprices_dk/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import asyncio
import logging

from homeassistant.const import DEVICE_CLASS_MONETARY, ATTR_ATTRIBUTION
from homeassistant.const import ATTR_ATTRIBUTION
from .const import (
CONF_CLIENT,
CONF_UPDATE_INTERVAL,
Expand All @@ -14,7 +14,11 @@

from datetime import timedelta

from homeassistant.components.sensor import SensorEntity, SensorStateClass
from homeassistant.components.sensor import (
SensorEntity,
SensorStateClass,
SensorDeviceClass,
)
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator

_LOGGER: logging.Logger = logging.getLogger(__package__)
Expand Down Expand Up @@ -94,7 +98,6 @@ def extra_state_attributes(self):
attr["product_name"] = self._productName
attr["product_type"] = self._productKey
attr["price_type"] = self._fuelCompany.getPriceType()
# attr["last_update"] = self._fuelCompany.getLastUpdate()
attr["last_update"] = self._fuelCompany.getProductLastUpdate(self._productKey)
attr[ATTR_ATTRIBUTION] = CREDITS
return attr
Expand All @@ -105,7 +108,7 @@ def unique_id(self):

@property
def device_class(self):
return DEVICE_CLASS_MONETARY
return SensorDeviceClass.MONETARY

@property
def state_class(self) -> str:
Expand Down

0 comments on commit 6018094

Please sign in to comment.