mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Add diagnostics to Launch Library (#64871)
This commit is contained in:
parent
2caad1a474
commit
70b24b7843
@ -584,6 +584,7 @@ omit =
|
||||
homeassistant/components/lastfm/sensor.py
|
||||
homeassistant/components/launch_library/__init__.py
|
||||
homeassistant/components/launch_library/const.py
|
||||
homeassistant/components/launch_library/diagnostics.py
|
||||
homeassistant/components/launch_library/sensor.py
|
||||
homeassistant/components/lcn/binary_sensor.py
|
||||
homeassistant/components/lcn/climate.py
|
||||
|
24
homeassistant/components/launch_library/diagnostics.py
Normal file
24
homeassistant/components/launch_library/diagnostics.py
Normal file
@ -0,0 +1,24 @@
|
||||
"""Diagnostics support for Launch Library."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from pylaunches.objects.launch import Launch
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||
|
||||
from .const import DOMAIN
|
||||
|
||||
|
||||
async def async_get_config_entry_diagnostics(
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
) -> dict[str, Any]:
|
||||
"""Return diagnostics for a config entry."""
|
||||
coordinator: DataUpdateCoordinator[list[Launch]] = hass.data[DOMAIN]
|
||||
next_launch = coordinator.data[0] if coordinator.data else None
|
||||
return {
|
||||
"next_launch": next_launch.raw_data_contents if next_launch else None,
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
"name": "Launch Library",
|
||||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/launch_library",
|
||||
"requirements": ["pylaunches==1.2.1"],
|
||||
"requirements": ["pylaunches==1.2.2"],
|
||||
"codeowners": ["@ludeeus", "@DurgNomis-drol"],
|
||||
"iot_class": "cloud_polling"
|
||||
}
|
||||
|
@ -1633,7 +1633,7 @@ pylacrosse==0.4
|
||||
pylast==4.2.1
|
||||
|
||||
# homeassistant.components.launch_library
|
||||
pylaunches==1.2.1
|
||||
pylaunches==1.2.2
|
||||
|
||||
# homeassistant.components.lg_netcast
|
||||
pylgnetcast==0.3.7
|
||||
|
@ -1020,7 +1020,7 @@ pykulersky==0.5.2
|
||||
pylast==4.2.1
|
||||
|
||||
# homeassistant.components.launch_library
|
||||
pylaunches==1.2.1
|
||||
pylaunches==1.2.2
|
||||
|
||||
# homeassistant.components.forked_daapd
|
||||
pylibrespot-java==0.1.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user