Coverage for custom_components/remote_logger/const.py: 100%
35 statements
« prev ^ index » next coverage.py v7.16.2, created at 2026-11-11 23:42 +0000
« prev ^ index » next coverage.py v7.16.2, created at 2026-11-11 23:42 +0000
1"""Constants for the remote_logger integration."""
3from homeassistant.const import Platform
4from homeassistant.generated.entity_platforms import EntityPlatforms
6DOMAIN = "remote_logger"
8PLATFORMS: list[EntityPlatforms] = [Platform.SENSOR]
10# Backend selection
11CONF_BACKEND = "backend"
12BACKEND_OTEL = "otel"
13BACKEND_SYSLOG = "syslog"
15# Common config entry data keys
16CONF_USE_TLS = "use_tls"
18# OTel-specific config keys
19CONF_RESOURCE_ATTRIBUTES = "resource_attributes"
20CONF_ENCODING = "encoding"
21CONF_BATCH_MAX_SIZE = "batch_max_size"
23# Syslog-specific config keys
24CONF_APP_NAME = "app_name"
25CONF_FACILITY = "facility"
26CONF_STRICT_MODE = "strict_mode"
27CONF_ENTERPRISE_NUMBER = "enterprise_number"
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"
38CONF_SUPPRESS_SYSTEM_LOG_EVENT_NAME = "suppress_system_log_event_name"
40# HA lifecycle event types (EVENT_HOMEASSISTANT_*)
41LIFECYCLE_EVENTS: list[str] = [
42 "homeassistant_start",
43 "homeassistant_started",
44 "homeassistant_stop",
45 "homeassistant_close",
46 "homeassistant_final_write",
47]
49# HA core change event types
50CORE_CHANGE_EVENTS: list[str] = [
51 "area_registry_updated",
52 "automation_reloaded",
53 "category_registry_updated",
54 "component_loaded",
55 "core_config_updated",
56 "data_entry_flow_progressed",
57 "device_registry_updated",
58 "entity_registry_updated",
59 "floor_registry_updated",
60 "label_registry_updated",
61 "labs_updated",
62 "logging_changed",
63 "lovelace_updated",
64 "panels_updated",
65 "repairs_issue_registry_updated",
66 "scene_reloaded",
67 "service_registered",
68 "service_removed",
69 "themes_updated",
70 "user_added",
71 "user_removed",
72 "user_updated",
73]
74CORE_STATE_EVENTS: list[str] = [
75 "state_changed",
76 "logbook_entry",
77]
79CORE_ACTIVITY_EVENTS: list[str] = [
80 "automation_triggered",
81 "persistent_notifications_updated",
82 "script_started",
83 "call_service",
84 "mobile_app_notification_action",
85]
86BATCH_FLUSH_INTERVAL_SECONDS = 120
87DEFAULT_BATCH_MAX_SIZE = 20
89DEFAULT_USE_TLS = False
91CONF_CLIENT_TIMEOUT = "client_timeout"
92DEFAULT_CLIENT_TIMEOUT = 10
94CONF_EVENT_BASED_LOGGING = "event_based_logging"
95CONF_LOG_LEVEL = "log_level"
96DEFAULT_LOG_LEVEL = "INFO"