Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion custom_components/intellicenter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ def started(self, controller):

async def setup_platforms():
"""Set up platforms."""
hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
# dispatcher.async_dispatcher_send(hass, self.CONNECTION_SIGNAL, True)

hass.async_create_task(setup_platforms())

@callback
Expand Down
32 changes: 32 additions & 0 deletions custom_components/intellicenter/diagnostics.py
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
}
5 changes: 5 additions & 0 deletions custom_components/intellicenter/pyintellicenter/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ def attributes(self) -> list:
"""Return the list of attributes for this object."""
return list(self._properties.keys())

@property
def properties(self) -> dict:
"""Return the properties of the object."""
return self._properties

def update(self, updates):
"""Update the object from a set of key/value pairs, return the changed attributes."""

Expand Down
Loading