Bump pyTibber to 0.30.4 (#129844)
This commit is contained in:
parent
4dbf3359c1
commit
370d7d6bdf
5 changed files with 29 additions and 85 deletions
|
@ -8,5 +8,5 @@
|
|||
"iot_class": "cloud_polling",
|
||||
"loggers": ["tibber"],
|
||||
"quality_scale": "silver",
|
||||
"requirements": ["pyTibber==0.30.3"]
|
||||
"requirements": ["pyTibber==0.30.4"]
|
||||
}
|
||||
|
|
|
@ -47,17 +47,13 @@ async def __get_prices(call: ServiceCall, *, hass: HomeAssistant) -> ServiceResp
|
|||
for tibber_home in tibber_connection.get_homes(only_active=True):
|
||||
home_nickname = tibber_home.name
|
||||
|
||||
price_info = tibber_home.info["viewer"]["home"]["currentSubscription"][
|
||||
"priceInfo"
|
||||
]
|
||||
price_data = [
|
||||
{
|
||||
"start_time": price["startsAt"],
|
||||
"price": price["total"],
|
||||
"level": price["level"],
|
||||
"start_time": starts_at,
|
||||
"price": price,
|
||||
"level": tibber_home.price_level.get(starts_at),
|
||||
}
|
||||
for key in ("today", "tomorrow")
|
||||
for price in price_info[key]
|
||||
for starts_at, price in tibber_home.price_total.items()
|
||||
]
|
||||
|
||||
selected_data = [
|
||||
|
|
|
@ -1738,7 +1738,7 @@ pyRFXtrx==0.31.1
|
|||
pySDCP==1
|
||||
|
||||
# homeassistant.components.tibber
|
||||
pyTibber==0.30.3
|
||||
pyTibber==0.30.4
|
||||
|
||||
# homeassistant.components.dlink
|
||||
pyW215==0.7.0
|
||||
|
|
|
@ -1415,7 +1415,7 @@ pyElectra==1.2.4
|
|||
pyRFXtrx==0.31.1
|
||||
|
||||
# homeassistant.components.tibber
|
||||
pyTibber==0.30.3
|
||||
pyTibber==0.30.4
|
||||
|
||||
# homeassistant.components.dlink
|
||||
pyW215==0.7.0
|
||||
|
|
|
@ -20,84 +20,32 @@ def generate_mock_home_data():
|
|||
mock_homes = [
|
||||
MagicMock(
|
||||
name="first_home",
|
||||
info={
|
||||
"viewer": {
|
||||
"home": {
|
||||
"currentSubscription": {
|
||||
"priceInfo": {
|
||||
"today": [
|
||||
{
|
||||
"startsAt": START_TIME.isoformat(),
|
||||
"total": 0.36914,
|
||||
"level": "VERY_EXPENSIVE",
|
||||
},
|
||||
{
|
||||
"startsAt": (
|
||||
START_TIME + dt.timedelta(hours=1)
|
||||
).isoformat(),
|
||||
"total": 0.36914,
|
||||
"level": "VERY_EXPENSIVE",
|
||||
},
|
||||
],
|
||||
"tomorrow": [
|
||||
{
|
||||
"startsAt": tomorrow.isoformat(),
|
||||
"total": 0.46914,
|
||||
"level": "VERY_EXPENSIVE",
|
||||
},
|
||||
{
|
||||
"startsAt": (
|
||||
tomorrow + dt.timedelta(hours=1)
|
||||
).isoformat(),
|
||||
"total": 0.46914,
|
||||
"level": "VERY_EXPENSIVE",
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
price_total={
|
||||
START_TIME.isoformat(): 0.36914,
|
||||
(START_TIME + dt.timedelta(hours=1)).isoformat(): 0.36914,
|
||||
tomorrow.isoformat(): 0.46914,
|
||||
(tomorrow + dt.timedelta(hours=1)).isoformat(): 0.46914,
|
||||
},
|
||||
price_level={
|
||||
START_TIME.isoformat(): "VERY_EXPENSIVE",
|
||||
(START_TIME + dt.timedelta(hours=1)).isoformat(): "VERY_EXPENSIVE",
|
||||
tomorrow.isoformat(): "VERY_EXPENSIVE",
|
||||
(tomorrow + dt.timedelta(hours=1)).isoformat(): "VERY_EXPENSIVE",
|
||||
},
|
||||
),
|
||||
MagicMock(
|
||||
name="second_home",
|
||||
info={
|
||||
"viewer": {
|
||||
"home": {
|
||||
"currentSubscription": {
|
||||
"priceInfo": {
|
||||
"today": [
|
||||
{
|
||||
"startsAt": START_TIME.isoformat(),
|
||||
"total": 0.36914,
|
||||
"level": "VERY_EXPENSIVE",
|
||||
},
|
||||
{
|
||||
"startsAt": (
|
||||
START_TIME + dt.timedelta(hours=1)
|
||||
).isoformat(),
|
||||
"total": 0.36914,
|
||||
"level": "VERY_EXPENSIVE",
|
||||
},
|
||||
],
|
||||
"tomorrow": [
|
||||
{
|
||||
"startsAt": tomorrow.isoformat(),
|
||||
"total": 0.46914,
|
||||
"level": "VERY_EXPENSIVE",
|
||||
},
|
||||
{
|
||||
"startsAt": (
|
||||
tomorrow + dt.timedelta(hours=1)
|
||||
).isoformat(),
|
||||
"total": 0.46914,
|
||||
"level": "VERY_EXPENSIVE",
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
price_total={
|
||||
START_TIME.isoformat(): 0.36914,
|
||||
(START_TIME + dt.timedelta(hours=1)).isoformat(): 0.36914,
|
||||
tomorrow.isoformat(): 0.46914,
|
||||
(tomorrow + dt.timedelta(hours=1)).isoformat(): 0.46914,
|
||||
},
|
||||
price_level={
|
||||
START_TIME.isoformat(): "VERY_EXPENSIVE",
|
||||
(START_TIME + dt.timedelta(hours=1)).isoformat(): "VERY_EXPENSIVE",
|
||||
tomorrow.isoformat(): "VERY_EXPENSIVE",
|
||||
(tomorrow + dt.timedelta(hours=1)).isoformat(): "VERY_EXPENSIVE",
|
||||
},
|
||||
),
|
||||
]
|
||||
|
|
Loading…
Add table
Reference in a new issue