Skip to content

Commit b1aa79c

Browse files
Merge pull request #245 from vincentwolsink/fix_diagnostics
Fix diagnostics
2 parents 728b7c6 + ddbd8bb commit b1aa79c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

custom_components/aguaiot/diagnostics.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
88
from homeassistant.core import HomeAssistant
99

10-
from .const import DOMAIN
1110

1211
TO_REDACT = {
1312
CONF_PASSWORD,
@@ -16,10 +15,11 @@
1615

1716

1817
async def async_get_config_entry_diagnostics(
19-
hass: HomeAssistant, entry: ConfigEntry
18+
hass: HomeAssistant, config_entry: ConfigEntry
2019
) -> dict[str, Any]:
2120
"""Return diagnostics for a config entry."""
22-
agua = hass.data[DOMAIN][entry.entry_id]["agua"]
21+
coordinator = config_entry.runtime_data
22+
agua = coordinator.agua
2323

2424
devices = {}
2525
for device in agua.devices:
@@ -28,6 +28,6 @@ async def async_get_config_entry_diagnostics(
2828
devices[device.name][reg] = device.get_register(reg)
2929

3030
return {
31-
"entry": async_redact_data(entry.as_dict(), TO_REDACT),
31+
"entry": async_redact_data(config_entry.as_dict(), TO_REDACT),
3232
"devices": devices,
3333
}

0 commit comments

Comments
 (0)