Coverage for custom_components/remote_logger/const.py: 100%
29 statements
« prev ^ index » next coverage.py v7.10.6, created at 2026-04-07 04:46 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2026-04-07 04:46 +0000
1"""Constants for the remote_logger integration."""
3from homeassistant.const import EntityPlatforms, Platform
5DOMAIN = "remote_logger"
7PLATFORMS: list[EntityPlatforms] = [Platform.SENSOR]
9# Backend selection
10CONF_BACKEND = "backend"
11BACKEND_OTEL = "otel"
12BACKEND_SYSLOG = "syslog"
14# Common config entry data keys
15CONF_USE_TLS = "use_tls"
17# OTel-specific config keys
18CONF_RESOURCE_ATTRIBUTES = "resource_attributes"
19CONF_ENCODING = "encoding"
20CONF_BATCH_MAX_SIZE = "batch_max_size"
22# Syslog-specific config keys
23CONF_APP_NAME = "app_name"
24CONF_FACILITY = "facility"
27# HA event type
28EVENT_SYSTEM_LOG = "system_log_event"
30# Optional HA event subscriptions config keys
31CONF_LOG_HA_LIFECYCLE = "log_ha_lifecycle"
32CONF_LOG_HA_CORE_CHANGES = "log_ha_core_changes"
33CONF_CUSTOM_EVENTS = "custom_events"
34CONF_LOG_HA_CORE_ACTIVITY = "log_ha_core_activity"
35CONF_LOG_HA_STATE_CHANGES = "log_ha_state_changes"
36CONF_LOG_HA_FULL_STATE_CHANGES = "log_ha_full_state_changes"
37CONF_LOG_HA_EVENT_BODY = "log_ha_event_body"
39# HA lifecycle event types (EVENT_HOMEASSISTANT_*)
40LIFECYCLE_EVENTS: list[str] = [
41 "homeassistant_start",
42 "homeassistant_started",
43 "homeassistant_stop",
44 "homeassistant_close",
45 "homeassistant_final_write",
46]
48# HA core change event types
49CORE_CHANGE_EVENTS: list[str] = [
50 "component_loaded",
51 "core_config_updated",
52 "service_registered",
53 "service_removed",
54 "automation_reloaded",
55 "lovelace_updated",
56 "data_entry_flow_progressed",
57 "panels_updated",
58 "themes_updated",
59 "scene_reloaded",
60 "labs_updated",
61 "user_added",
62 "user_updated",
63 "user_removed",
64 "device_registry_updated",
65 "entity_registry_updated",
66 "area_registry_updated",
67 "floor_registry_updated",
68 "label_registry_updated",
69 "category_registry_updated",
70 "logging_changed",
71 "labs_updated",
72 "panels_updated",
73 "repairs_issues_registry_updated",
74]
75CORE_STATE_EVENTS: list[str] = [
76 "state_changed",
77 "logbook_entry",
78]
80CORE_ACTIVITY_EVENTS: list[str] = ["automation_triggered", "script_started", "call_service", "mobile_app_notification_action"]
81BATCH_FLUSH_INTERVAL_SECONDS = 120
82DEFAULT_BATCH_MAX_SIZE = 20
84DEFAULT_USE_TLS = False
86CONF_CLIENT_TIMEOUT = "client_timeout"
87DEFAULT_CLIENT_TIMEOUT = 10