Skip to content

Commit e267900

Browse files
authored
Add bluetooth connection availability to diagnostics for lamarzocco (#144012)
* Add bluetooth connection availability to diagnostics for lamarzocco * make even more detailed
1 parent 06bb692 commit e267900

File tree

2 files changed

+529
-512
lines changed

2 files changed

+529
-512
lines changed

homeassistant/components/lamarzocco/diagnostics.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
from typing import Any
66

77
from homeassistant.components.diagnostics import async_redact_data
8+
from homeassistant.const import CONF_MAC, CONF_TOKEN
89
from homeassistant.core import HomeAssistant
910

11+
from .const import CONF_USE_BLUETOOTH
1012
from .coordinator import LaMarzoccoConfigEntry
1113

1214
TO_REDACT = {
@@ -21,4 +23,12 @@ async def async_get_config_entry_diagnostics(
2123
"""Return diagnostics for a config entry."""
2224
coordinator = entry.runtime_data.config_coordinator
2325
device = coordinator.device
24-
return async_redact_data(device.to_dict(), TO_REDACT)
26+
data = {
27+
"device": device.to_dict(),
28+
"bluetooth_available": {
29+
"options_enabled": entry.options.get(CONF_USE_BLUETOOTH, True),
30+
CONF_MAC: CONF_MAC in entry.data,
31+
CONF_TOKEN: CONF_TOKEN in entry.data,
32+
},
33+
}
34+
return async_redact_data(data, TO_REDACT)

0 commit comments

Comments
 (0)