mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Add bluetooth connection availability to diagnostics for lamarzocco (#144012)
* Add bluetooth connection availability to diagnostics for lamarzocco * make even more detailed
This commit is contained in:
parent
06bb692522
commit
e2679004a1
@ -5,8 +5,10 @@ from __future__ import annotations
|
||||
from typing import Any
|
||||
|
||||
from homeassistant.components.diagnostics import async_redact_data
|
||||
from homeassistant.const import CONF_MAC, CONF_TOKEN
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from .const import CONF_USE_BLUETOOTH
|
||||
from .coordinator import LaMarzoccoConfigEntry
|
||||
|
||||
TO_REDACT = {
|
||||
@ -21,4 +23,12 @@ async def async_get_config_entry_diagnostics(
|
||||
"""Return diagnostics for a config entry."""
|
||||
coordinator = entry.runtime_data.config_coordinator
|
||||
device = coordinator.device
|
||||
return async_redact_data(device.to_dict(), TO_REDACT)
|
||||
data = {
|
||||
"device": device.to_dict(),
|
||||
"bluetooth_available": {
|
||||
"options_enabled": entry.options.get(CONF_USE_BLUETOOTH, True),
|
||||
CONF_MAC: CONF_MAC in entry.data,
|
||||
CONF_TOKEN: CONF_TOKEN in entry.data,
|
||||
},
|
||||
}
|
||||
return async_redact_data(data, TO_REDACT)
|
||||
|
@ -1,6 +1,12 @@
|
||||
# serializer version: 1
|
||||
# name: test_diagnostics
|
||||
dict({
|
||||
'bluetooth_available': dict({
|
||||
'mac': False,
|
||||
'options_enabled': True,
|
||||
'token': True,
|
||||
}),
|
||||
'device': dict({
|
||||
'dashboard': dict({
|
||||
'available_firmware_update': False,
|
||||
'ble_auth_token': None,
|
||||
@ -762,5 +768,6 @@
|
||||
'wifi_rssi': -51,
|
||||
'wifi_ssid': 'MyWifi',
|
||||
}),
|
||||
}),
|
||||
})
|
||||
# ---
|
||||
|
Loading…
x
Reference in New Issue
Block a user