Fix opower for AEP utilities (#106010)

This commit is contained in:
tronikos 2023-12-18 22:49:18 -08:00 committed by GitHub
parent 69fccec147
commit 09a0ace671
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,9 @@ class OpowerCoordinator(DataUpdateCoordinator[dict[str, Forecast]]):
(
self.api.utility.subdomain(),
account.meter_type.name.lower(),
account.utility_account_id,
# Some utilities like AEP have "-" in their account id.
# Replace it with "_" to avoid "Invalid statistic_id"
account.utility_account_id.replace("-", "_"),
)
)
cost_statistic_id = f"{DOMAIN}:{id_prefix}_energy_cost"