Skip to content

Don't override parsed values with other values#21

Merged
angelnu merged 3 commits into
angelnu:mainfrom
alistair23:alistair/dict-fixup
Oct 26, 2025
Merged

Don't override parsed values with other values#21
angelnu merged 3 commits into
angelnu:mainfrom
alistair23:alistair/dict-fixup

Conversation

@alistair23
Copy link
Copy Markdown
Contributor

If processing multiple packets only the last packet gets kept. This ensures that we process all of the packets.

According to PEP0584 the newset value should be used if the value is set multiple times.

@alistair23 alistair23 force-pushed the alistair/dict-fixup branch 2 times, most recently from 2fd83d8 to c5b3cda Compare October 26, 2025 11:53
If ttn_parse() returns an empty results let's skip it, otherwise we can
end up overwritting data with an empty packet if multiple packets have
been sent.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
@alistair23 alistair23 force-pushed the alistair/dict-fixup branch 2 times, most recently from 5b27924 to b38fadb Compare October 26, 2025 12:05
OR together all of the results of ttn_parse() so that we don't miss any
data.

According to PEP0584 (https://peps.python.org/pep-0584/#specification)
the newset value should be used if the value is set multiple times.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
Signed-off-by: Alistair Francis <alistair@alistair23.me>
@alistair23
Copy link
Copy Markdown
Contributor Author

This hopefully fixes my missing messages issue.

As an extra bonus it means that some of the recent values are added after a reboot, so not every single entity is "Unavailable" after a reboot.

@angelnu angelnu merged commit 476866a into angelnu:main Oct 26, 2025
4 checks passed
@alistair23 alistair23 deleted the alistair/dict-fixup branch October 26, 2025 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants