Add basic rfxtrx diagnostics (#67671)
* Add basic rfxtrx diagnostics * Skip diagnostics for coverage
This commit is contained in:
parent
03ec77fb62
commit
09a85d2a5d
4 changed files with 23 additions and 2 deletions
|
@ -960,6 +960,7 @@ omit =
|
||||||
homeassistant/components/remote_rpi_gpio/*
|
homeassistant/components/remote_rpi_gpio/*
|
||||||
homeassistant/components/rest/notify.py
|
homeassistant/components/rest/notify.py
|
||||||
homeassistant/components/rest/switch.py
|
homeassistant/components/rest/switch.py
|
||||||
|
homeassistant/components/rfxtrx/diagnostics.py
|
||||||
homeassistant/components/ridwell/__init__.py
|
homeassistant/components/ridwell/__init__.py
|
||||||
homeassistant/components/ridwell/sensor.py
|
homeassistant/components/ridwell/sensor.py
|
||||||
homeassistant/components/ridwell/switch.py
|
homeassistant/components/ridwell/switch.py
|
||||||
|
|
|
@ -42,12 +42,11 @@ from .const import (
|
||||||
CONF_PROTOCOLS,
|
CONF_PROTOCOLS,
|
||||||
DATA_RFXOBJECT,
|
DATA_RFXOBJECT,
|
||||||
DEVICE_PACKET_TYPE_LIGHTING4,
|
DEVICE_PACKET_TYPE_LIGHTING4,
|
||||||
|
DOMAIN,
|
||||||
EVENT_RFXTRX_EVENT,
|
EVENT_RFXTRX_EVENT,
|
||||||
SERVICE_SEND,
|
SERVICE_SEND,
|
||||||
)
|
)
|
||||||
|
|
||||||
DOMAIN = "rfxtrx"
|
|
||||||
|
|
||||||
DEFAULT_OFF_DELAY = 2.0
|
DEFAULT_OFF_DELAY = 2.0
|
||||||
|
|
||||||
SIGNAL_EVENT = f"{DOMAIN}_event"
|
SIGNAL_EVENT = f"{DOMAIN}_event"
|
||||||
|
|
|
@ -44,3 +44,5 @@ DEVICE_PACKET_TYPE_LIGHTING4 = 0x13
|
||||||
EVENT_RFXTRX_EVENT = "rfxtrx_event"
|
EVENT_RFXTRX_EVENT = "rfxtrx_event"
|
||||||
|
|
||||||
DATA_RFXOBJECT = "rfxobject"
|
DATA_RFXOBJECT = "rfxobject"
|
||||||
|
|
||||||
|
DOMAIN = "rfxtrx"
|
||||||
|
|
19
homeassistant/components/rfxtrx/diagnostics.py
Normal file
19
homeassistant/components/rfxtrx/diagnostics.py
Normal 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),
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue