jhansche / pybirdbuddy

25 stars 2 forks source link

Add FeedItemCollectedPostcard #20

Closed jhansche closed 1 year ago

jhansche commented 1 year ago

A new feed item type was introduced, and since we didn't know about the schema, the feed() response was extremely sparse for those items - basically included only the cursor and type. We then try to sort by createdAt in order to select the newest edge in the feed, but because we weren't selecting the createdAt field in the GraphQL query, the field is None, which cannot be converted to a datetime and cannot take part in max(key=lambda).

This change adds the new feed item type and related fields, and also attempts to fix the missing createdAt issue, so that new feed item types will not break the coordinator like this in the future.

This resolves https://github.com/jhansche/ha-birdbuddy/issues/73