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 Franck Nijhof
parent e1b4edec50
commit 3bb6373df5
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
5 changed files with 7 additions and 7 deletions

View File

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

View File

@ -6,5 +6,5 @@
"dependencies": ["recorder"], "dependencies": ["recorder"],
"documentation": "https://www.home-assistant.io/integrations/duke_energy", "documentation": "https://www.home-assistant.io/integrations/duke_energy",
"iot_class": "cloud_polling", "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 aiodns==3.2.0
# homeassistant.components.duke_energy # homeassistant.components.duke_energy
aiodukeenergy==0.2.2 aiodukeenergy==0.3.0
# homeassistant.components.eafm # homeassistant.components.eafm
aioeafm==0.1.2 aioeafm==0.1.2

View File

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

View File

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