forked from jlvaillant/intellicenter
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0a4b55
commit d0a9d0c
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""Diagnostics support for Intellicenter.""" | ||
|
||
from __future__ import annotations | ||
|
||
from typing import Any | ||
|
||
from homeassistant.config_entries import ConfigEntry | ||
from homeassistant.core import HomeAssistant | ||
|
||
from .const import DOMAIN | ||
from .pyintellicenter import ModelController | ||
|
||
|
||
async def async_get_config_entry_diagnostics( | ||
hass: HomeAssistant, entry: ConfigEntry | ||
) -> dict[str, Any]: | ||
"""Return diagnostics for a config entry.""" | ||
controller: ModelController = hass.data[DOMAIN][entry.entry_id].controller | ||
|
||
objects = [ | ||
{ | ||
"objnam": obj.objnam, | ||
"objtype": obj.objtype, | ||
"subtype": obj.subtype, | ||
"properties": obj.properties, | ||
} | ||
for obj in controller.model.objectList | ||
] | ||
|
||
return { | ||
"objects": objects | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters