mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Improve IssueRegistryItemSnapshot (#127949)
This commit is contained in:
parent
6f45e376da
commit
c22bbc5b91
@ -5,21 +5,55 @@
|
||||
'workday',
|
||||
'bad_date_holiday-1-2024_08_15',
|
||||
): IssueRegistryItemSnapshot({
|
||||
'active': True,
|
||||
'breaks_in_ha_version': None,
|
||||
'created': <ANY>,
|
||||
'data': dict({
|
||||
'country': 'DE',
|
||||
'entry_id': '1',
|
||||
'named_holiday': '2024-08-15',
|
||||
}),
|
||||
'dismissed_version': None,
|
||||
'domain': 'workday',
|
||||
'is_fixable': True,
|
||||
'is_persistent': False,
|
||||
'issue_domain': None,
|
||||
'issue_id': 'bad_date_holiday-1-2024_08_15',
|
||||
'learn_more_url': None,
|
||||
'severity': <IssueSeverity.WARNING: 'warning'>,
|
||||
'translation_key': 'bad_date_holiday',
|
||||
'translation_placeholders': dict({
|
||||
'country': 'DE',
|
||||
'remove_holidays': '2024-08-15',
|
||||
'title': 'Mock Title',
|
||||
}),
|
||||
}),
|
||||
tuple(
|
||||
'workday',
|
||||
'bad_date_holiday-1-2025_08_15',
|
||||
): IssueRegistryItemSnapshot({
|
||||
'active': True,
|
||||
'breaks_in_ha_version': None,
|
||||
'created': <ANY>,
|
||||
'data': dict({
|
||||
'country': 'DE',
|
||||
'entry_id': '1',
|
||||
'named_holiday': '2025-08-15',
|
||||
}),
|
||||
'dismissed_version': None,
|
||||
'domain': 'workday',
|
||||
'is_fixable': True,
|
||||
'is_persistent': False,
|
||||
'issue_domain': None,
|
||||
'issue_id': 'bad_date_holiday-1-2025_08_15',
|
||||
'learn_more_url': None,
|
||||
'severity': <IssueSeverity.WARNING: 'warning'>,
|
||||
'translation_key': 'bad_date_holiday',
|
||||
'translation_placeholders': dict({
|
||||
'country': 'DE',
|
||||
'remove_holidays': '2025-08-15',
|
||||
'title': 'Mock Title',
|
||||
}),
|
||||
}),
|
||||
})
|
||||
# ---
|
||||
|
@ -197,7 +197,7 @@ class HomeAssistantSnapshotSerializer(AmberDataSerializer):
|
||||
cls, data: ir.IssueEntry
|
||||
) -> SerializableData:
|
||||
"""Prepare a Home Assistant issue registry entry for serialization."""
|
||||
return IssueRegistryItemSnapshot(data.to_json() | {"created": ANY})
|
||||
return IssueRegistryItemSnapshot(dataclasses.asdict(data) | {"created": ANY})
|
||||
|
||||
@classmethod
|
||||
def _serializable_state(cls, data: State) -> SerializableData:
|
||||
|
Loading…
x
Reference in New Issue
Block a user