Skip to content

Commit

Permalink
add support for Burbank Water and Power (#110)
Browse files Browse the repository at this point in the history
* add support for Burbank Water and Power

* Updated with pre-commit

* response is always an empty body, handle exceptions properly

* Rename bwp.py to burbankwaterandpower.py and remove commented code
  • Loading branch information
brentos authored Feb 13, 2025
1 parent 431b412 commit 81cfc79
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Supported utilities (in alphabetical order):
- Public Service Company of Oklahoma (PSO)
- Southwestern Electric Power Company (SWEPCO)
- Arizona Public Service (APS)
- Burbank Water and Power (BWP)
- City of Austin Utilities
- Consolidated Edison (ConEd)
- Orange & Rockland Utilities (ORU)
Expand Down
46 changes: 46 additions & 0 deletions src/opower/utilities/burbankwaterandpower.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"""Burbank Water and Power (BWP)."""

from typing import Optional

import aiohttp

from ..const import USER_AGENT
from .base import UtilityBase


class BurbankWaterAndPower(UtilityBase):
"""Burbank Water and Power (BWP)."""

@staticmethod
def name() -> str:
"""Distinct recognizable name of the utility."""
return "Burbank Water and Power (BWP)"

@staticmethod
def subdomain() -> str:
"""Return the opower.com subdomain for this utility."""
return "bwp"

@staticmethod
def timezone() -> str:
"""Return the timezone."""
return "America/Los_Angeles"

@staticmethod
async def async_login(
session: aiohttp.ClientSession,
username: str,
password: str,
optional_mfa_secret: Optional[str],
) -> None:
"""Login to the utility website."""
async with session.post(
"https://bwp.opower.com/ei/edge/apis/user-account-control-v1/cws/v1/bwp/account/signin",
json={
"username": username,
"password": password,
},
headers={"User-Agent": USER_AGENT},
raise_for_status=False,
) as _:
pass

0 comments on commit 81cfc79

Please sign in to comment.