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

Add prices service calls for easyEnergy #105175

Merged
merged 12 commits into from
Dec 18, 2023
Prev Previous commit
Next Next commit
Fix pylint error by removing the else
  • Loading branch information
klaasnicolaas committed Dec 13, 2023
commit 5e01eb967f88d866e698e054841a8340f4091fac
17 changes: 8 additions & 9 deletions homeassistant/components/easyenergy/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,15 @@ async def __get_prices(
vat=vat,
)
return {"prices": data.timestamp_prices}
else:
data = await coordinator.easyenergy.energy_prices(
start_date=start,
end_date=end,
vat=vat,
)
data = await coordinator.easyenergy.energy_prices(
start_date=start,
end_date=end,
vat=vat,
)

if price_type == PriceType.ENERGY_USAGE:
return {"prices": data.timestamp_usage_prices}
return {"prices": data.timestamp_return_prices}
if price_type == PriceType.ENERGY_USAGE:
return {"prices": data.timestamp_usage_prices}
return {"prices": data.timestamp_return_prices}


async def async_setup_services(
Expand Down