Coverage for custom_components / remote_logger / const.py: 100%
32 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-05-22 21:55 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-05-22 21:55 +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# Optional HA event subscriptions config keys
28CONF_LOG_HA_LIFECYCLE = "log_ha_lifecycle"
29CONF_LOG_HA_CORE_CHANGES = "log_ha_core_changes"
30CONF_CUSTOM_EVENTS = "custom_events"
31CONF_LOG_HA_CORE_ACTIVITY = "log_ha_core_activity"
32CONF_LOG_HA_STATE_CHANGES = "log_ha_state_changes"
33CONF_LOG_HA_FULL_STATE_CHANGES = "log_ha_full_state_changes"
34CONF_LOG_HA_EVENT_BODY = "log_ha_event_body"
35CONF_SUPPRESS_SYSTEM_LOG_EVENT_NAME = "suppress_system_log_event_name"
37# HA lifecycle event types (EVENT_HOMEASSISTANT_*)
38LIFECYCLE_EVENTS: list[str] = [
39 "homeassistant_start",
40 "homeassistant_started",
41 "homeassistant_stop",
42 "homeassistant_close",
43 "homeassistant_final_write",
44]
46# HA core change event types
47CORE_CHANGE_EVENTS: list[str] = [
48 "area_registry_updated",
49 "automation_reloaded",
50 "category_registry_updated",
51 "component_loaded",
52 "core_config_updated",
53 "data_entry_flow_progressed",
54 "device_registry_updated",
55 "entity_registry_updated",
56 "floor_registry_updated",
57 "label_registry_updated",
58 "labs_updated",
59 "logging_changed",
60 "lovelace_updated",
61 "panels_updated",
62 "repairs_issue_registry_updated",
63 "scene_reloaded",
64 "service_registered",
65 "service_removed",
66 "themes_updated",
67 "user_added",
68 "user_removed",
69 "user_updated",
70]
71CORE_STATE_EVENTS: list[str] = [
72 "state_changed",
73 "logbook_entry",
74]
76CORE_ACTIVITY_EVENTS: list[str] = [
77 "automation_triggered",
78 "persistent_notifications_updated",
79 "script_started",
80 "call_service",
81 "mobile_app_notification_action",
82]
83BATCH_FLUSH_INTERVAL_SECONDS = 120
84DEFAULT_BATCH_MAX_SIZE = 20
86DEFAULT_USE_TLS = False
88CONF_CLIENT_TIMEOUT = "client_timeout"
89DEFAULT_CLIENT_TIMEOUT = 10
91CONF_EVENT_BASED_LOGGING = "event_based_logging"
92CONF_LOG_LEVEL = "log_level"
93DEFAULT_LOG_LEVEL = "INFO"