Tibber, accumulated reward (#53195)
Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>pull/53225/head
parent
79a418f1bc
commit
d17776af87
|
@ -2,7 +2,7 @@
|
|||
"domain": "tibber",
|
||||
"name": "Tibber",
|
||||
"documentation": "https://www.home-assistant.io/integrations/tibber",
|
||||
"requirements": ["pyTibber==0.18.0"],
|
||||
"requirements": ["pyTibber==0.19.0"],
|
||||
"codeowners": ["@danielhiversen"],
|
||||
"quality_scale": "silver",
|
||||
"config_flow": true,
|
||||
|
|
|
@ -129,6 +129,12 @@ RT_SENSOR_MAP = {
|
|||
SIGNAL_STRENGTH_DECIBELS,
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
],
|
||||
"accumulatedReward": [
|
||||
"accumulated reward",
|
||||
DEVICE_CLASS_MONETARY,
|
||||
None,
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
],
|
||||
"accumulatedCost": [
|
||||
"accumulated cost",
|
||||
DEVICE_CLASS_MONETARY,
|
||||
|
@ -330,6 +336,7 @@ class TibberSensorRT(TibberSensor):
|
|||
"accumulated consumption",
|
||||
"accumulated production",
|
||||
"accumulated cost",
|
||||
"accumulated reward",
|
||||
]:
|
||||
self._attr_last_reset = dt_util.as_utc(
|
||||
dt_util.now().replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
|
@ -366,6 +373,7 @@ class TibberSensorRT(TibberSensor):
|
|||
"accumulated consumption",
|
||||
"accumulated production",
|
||||
"accumulated cost",
|
||||
"accumulated reward",
|
||||
]:
|
||||
self._attr_last_reset = dt_util.as_utc(
|
||||
timestamp.replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
|
@ -422,7 +430,7 @@ class TibberRtDataHandler:
|
|||
sensor_name, device_class, unit, state_class = RT_SENSOR_MAP[
|
||||
sensor_type
|
||||
]
|
||||
if sensor_type == "accumulatedCost":
|
||||
if sensor_type in ["accumulatedCost", "accumulatedReward"]:
|
||||
unit = self._tibber_home.currency
|
||||
entity = TibberSensorRT(
|
||||
self._tibber_home,
|
||||
|
|
|
@ -1271,7 +1271,7 @@ pyRFXtrx==0.27.0
|
|||
# pySwitchmate==0.4.6
|
||||
|
||||
# homeassistant.components.tibber
|
||||
pyTibber==0.18.0
|
||||
pyTibber==0.19.0
|
||||
|
||||
# homeassistant.components.dlink
|
||||
pyW215==0.7.0
|
||||
|
|
|
@ -714,7 +714,7 @@ pyMetno==0.8.3
|
|||
pyRFXtrx==0.27.0
|
||||
|
||||
# homeassistant.components.tibber
|
||||
pyTibber==0.18.0
|
||||
pyTibber==0.19.0
|
||||
|
||||
# homeassistant.components.nextbus
|
||||
py_nextbusnext==0.1.4
|
||||
|
|
Loading…
Reference in New Issue