working 2.0 clone

This commit is contained in:
root
2024-10-01 14:06:39 +00:00
commit 873064d680
704 changed files with 46961 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import homeassistant
from homeassistant.components.http import HomeAssistantView
from homeassistant.helpers.system_info import async_get_system_info
ATTR_INSTALLATION_TYPE = "installation_type"
class DiscoveryInfoView(HomeAssistantView):
"""Get all logged errors and warnings."""
url = "/api/remote_homeassistant/discovery"
name = "api:remote_homeassistant:discovery"
async def get(self, request):
"""Get discovery information."""
hass = request.app["hass"]
system_info = await async_get_system_info(hass)
return self.json(
{
"uuid": await hass.helpers.instance_id.async_get(),
"location_name": hass.config.location_name,
"ha_version": homeassistant.const.__version__,
"installation_type": system_info[ATTR_INSTALLATION_TYPE],
}
)