Add basic rfxtrx diagnostics (#67671)

* Add basic rfxtrx diagnostics

* Skip diagnostics for coverage
This commit is contained in:
Joakim Plate 2022-03-12 05:27:08 +01:00 committed by GitHub
parent 03ec77fb62
commit 09a85d2a5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 2 deletions

View file

@ -960,6 +960,7 @@ omit =
homeassistant/components/remote_rpi_gpio/*
homeassistant/components/rest/notify.py
homeassistant/components/rest/switch.py
homeassistant/components/rfxtrx/diagnostics.py
homeassistant/components/ridwell/__init__.py
homeassistant/components/ridwell/sensor.py
homeassistant/components/ridwell/switch.py

View file

@ -42,12 +42,11 @@ from .const import (
CONF_PROTOCOLS,
DATA_RFXOBJECT,
DEVICE_PACKET_TYPE_LIGHTING4,
DOMAIN,
EVENT_RFXTRX_EVENT,
SERVICE_SEND,
)
DOMAIN = "rfxtrx"
DEFAULT_OFF_DELAY = 2.0
SIGNAL_EVENT = f"{DOMAIN}_event"

View file

@ -44,3 +44,5 @@ DEVICE_PACKET_TYPE_LIGHTING4 = 0x13
EVENT_RFXTRX_EVENT = "rfxtrx_event"
DATA_RFXOBJECT = "rfxobject"
DOMAIN = "rfxtrx"

View file

@ -0,0 +1,19 @@
"""Diagnostics support for RFXCOM RFXtrx."""
from __future__ import annotations
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
TO_REDACT = {"host"}
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, entry: ConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
return {
"entry": async_redact_data(entry.as_dict(), TO_REDACT),
}