mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 10:47:10 +00:00
Fix logbook state query with postgresql (#73924)
This commit is contained in:
parent
3058a432a5
commit
28dd92d928
@ -377,9 +377,9 @@ def _rows_match(row: Row | EventAsRow, other_row: Row | EventAsRow) -> bool:
|
|||||||
"""Check of rows match by using the same method as Events __hash__."""
|
"""Check of rows match by using the same method as Events __hash__."""
|
||||||
if (
|
if (
|
||||||
row is other_row
|
row is other_row
|
||||||
or (state_id := row.state_id) is not None
|
or (state_id := row.state_id)
|
||||||
and state_id == other_row.state_id
|
and state_id == other_row.state_id
|
||||||
or (event_id := row.event_id) is not None
|
or (event_id := row.event_id)
|
||||||
and event_id == other_row.event_id
|
and event_id == other_row.event_id
|
||||||
):
|
):
|
||||||
return True
|
return True
|
||||||
|
@ -87,7 +87,7 @@ EVENT_COLUMNS_FOR_STATE_SELECT = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
EMPTY_STATE_COLUMNS = (
|
EMPTY_STATE_COLUMNS = (
|
||||||
literal(value=None, type_=sqlalchemy.String).label("state_id"),
|
literal(value=0, type_=sqlalchemy.Integer).label("state_id"),
|
||||||
literal(value=None, type_=sqlalchemy.String).label("state"),
|
literal(value=None, type_=sqlalchemy.String).label("state"),
|
||||||
literal(value=None, type_=sqlalchemy.String).label("entity_id"),
|
literal(value=None, type_=sqlalchemy.String).label("entity_id"),
|
||||||
literal(value=None, type_=sqlalchemy.String).label("icon"),
|
literal(value=None, type_=sqlalchemy.String).label("icon"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user