Convert dataclass to dict in pyLoad diagnostics (#120552)

This commit is contained in:
Mr. Bubbles 2024-06-26 13:36:01 +02:00 committed by GitHub
parent a36c40a434
commit 13a9efb6a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View File

@ -2,6 +2,7 @@
from __future__ import annotations
from dataclasses import asdict
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
@ -22,5 +23,5 @@ async def async_get_config_entry_diagnostics(
return {
"config_entry_data": async_redact_data(dict(config_entry.data), TO_REDACT),
"pyload_data": pyload_data,
"pyload_data": asdict(pyload_data),
}

View File

@ -10,8 +10,15 @@
'verify_ssl': False,
}),
'pyload_data': dict({
'__type': "<class 'homeassistant.components.pyload.coordinator.pyLoadData'>",
'repr': 'pyLoadData(pause=False, active=1, queue=6, total=37, speed=5405963.0, download=True, reconnect=False, captcha=False, free_space=99999999999)',
'active': 1,
'captcha': False,
'download': True,
'free_space': 99999999999,
'pause': False,
'queue': 6,
'reconnect': False,
'speed': 5405963.0,
'total': 37,
}),
})
# ---