Skip to content

Instantly share code, notes, and snippets.

@danthelion
Created June 19, 2022 10:31
Show Gist options
  • Save danthelion/ba23358d4fc20692bcddf80bbb8ec59f to your computer and use it in GitHub Desktop.
Save danthelion/ba23358d4fc20692bcddf80bbb8ec59f to your computer and use it in GitHub Desktop.
SingerIO stream for the Find My Item Cache
class ItemStream(FindMyStream):
name = "Item"
primary_keys = ["name", "timestamp"]
schema = th.PropertiesList(
th.Property("name", th.StringType),
th.Property("location", th.ObjectType(
th.Property("longitude", th.NumberType()),
th.Property("latitude", th.NumberType()),
th.Property("altitude", th.NumberType()),
th.Property("timeStamp", th.NumberType()),
)),
th.Property("role", th.ObjectType(
th.Property("name", th.StringType()),
th.Property("emoji", th.StringType()),
th.Property("identifier", th.NumberType()),
)),
th.Property("timestamp", th.DateTimeType),
).to_dict()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment