8000 Add roomba diagnostic for last command · home-assistant/core@28d6203 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 28d6203

Browse files
committed
Add roomba diagnostic for last command
1 parent cfaf18f commit 28d6203

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""Diagnostics support for Roomba."""
2+
3+
from __future__ import annotations
4+
5+
from typing import Any
6+
7+
from homeassistant.config_entries import ConfigEntry
8+
from homeassistant.core import HomeAssistant
9+
10+
from . import roomba_reported_state
11+
from .const import DOMAIN
12+
from .models import RoombaData
13+
14+
15+
async def async_get_config_entry_diagnostics(
16+
hass: HomeAssistant, config_entry: ConfigEntry
17+
) -> dict[str, Any]:
18+
"""Return diagnostics for a config entry."""
19+
domain_data: RoombaData = hass.data[DOMAIN][config_entry.entry_id]
20+
return {
21+
"lastCommand": roomba_reported_state(domain_data.roomba).get("lastCommand", {}),
22+
}

0 commit comments

Comments
 (0)
0