Skip to content

Commit

Permalink
Move system log to the first place in the diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Apr 18, 2024
1 parent 514af68 commit c8a9ad3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/hass_diagnostics/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ async def async_get_config_entry_diagnostics(
):
info = {}

# global system_log
if system_log := hass.data[SYSTEM_LOG]:
info[SYSTEM_LOG] = [i.to_dict() for i in system_log.records.values()]

component: EntityComponent = hass.data["entity_components"]["sensor"]
for entity in component.entities:
if isinstance(entity, SmartLog):
Expand All @@ -20,8 +24,4 @@ async def async_get_config_entry_diagnostics(
if entity.extra_state_attributes:
info[SETUP_TIME] = entity.extra_state_attributes[SETUP_TIME]

# global system_log
if system_log := hass.data[SYSTEM_LOG]:
info[SYSTEM_LOG] = [i.to_dict() for i in system_log.records.values()]

return info

0 comments on commit c8a9ad3

Please sign in to comment.