Update Duke Energy package to fix integration (#141669)

* Update Duke Energy package to fix integration

* fix tests
This commit is contained in:
Jason Hunter 2025-03-28 14:33:59 -04:00 committed by GitHub
parent ea4ad681e4
commit 7ae397a211
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 7 additions and 7 deletions

View File

@ -50,10 +50,10 @@ class DukeEnergyConfigFlow(ConfigFlow, domain=DOMAIN):
_LOGGER.exception("Unexpected exception")
errors["base"] = "unknown"
else:
username = auth["cdp_internal_user_id"].lower()
username = auth["internalUserID"].lower()
await self.async_set_unique_id(username)
self._abort_if_unique_id_configured()
email = auth["email"].lower()
email = auth["loginEmailAddress"].lower()
data = {
CONF_EMAIL: email,
CONF_USERNAME: username,

View File

@ -6,5 +6,5 @@
"dependencies": ["recorder"],
"documentation": "https://www.home-assistant.io/integrations/duke_energy",
"iot_class": "cloud_polling",
"requirements": ["aiodukeenergy==0.2.2"]
"requirements": ["aiodukeenergy==0.3.0"]
}

2
requirements_all.txt generated
View File

@ -225,7 +225,7 @@ aiodiscover==2.6.1
aiodns==3.2.0
# homeassistant.components.duke_energy
aiodukeenergy==0.2.2
aiodukeenergy==0.3.0
# homeassistant.components.eafm
aioeafm==0.1.2

View File

@ -213,7 +213,7 @@ aiodiscover==2.6.1
aiodns==3.2.0
# homeassistant.components.duke_energy
aiodukeenergy==0.2.2
aiodukeenergy==0.3.0
# homeassistant.components.eafm
aioeafm==0.1.2

View File

@ -61,8 +61,8 @@ def mock_api() -> Generator[AsyncMock]:
):
api = mock_api.return_value
api.authenticate.return_value = {
"email": "TEST@EXAMPLE.COM",
"cdp_internal_user_id": "test-username",
"loginEmailAddress": "TEST@EXAMPLE.COM",
"internalUserID": "test-username",
}
api.get_meters.return_value = {}
yield api