feat: add support for exporting log status, timestamp to farmOS
This commit is contained in:
parent
61402c183e
commit
a5550091d3
2 changed files with 12 additions and 0 deletions
|
|
@ -458,6 +458,8 @@ class ToFarmOSLog(ToFarmOS):
|
|||
supported_fields = [
|
||||
"uuid",
|
||||
"name",
|
||||
"timestamp",
|
||||
"status",
|
||||
"notes",
|
||||
]
|
||||
|
||||
|
|
@ -513,6 +515,8 @@ class ToFarmOSLog(ToFarmOS):
|
|||
return {
|
||||
"uuid": UUID(log["id"]),
|
||||
"name": log["attributes"]["name"],
|
||||
"timestamp": self.normalize_datetime(log["attributes"]["timestamp"]),
|
||||
"status": log["attributes"]["status"],
|
||||
"notes": notes,
|
||||
}
|
||||
|
||||
|
|
@ -521,6 +525,10 @@ class ToFarmOSLog(ToFarmOS):
|
|||
attrs = {}
|
||||
if "name" in self.fields:
|
||||
attrs["name"] = source_data["name"]
|
||||
if "timestamp" in self.fields:
|
||||
attrs["timestamp"] = self.format_datetime(source_data["timestamp"])
|
||||
if "status" in self.fields:
|
||||
attrs["status"] = source_data["status"]
|
||||
if "notes" in self.fields:
|
||||
attrs["notes"] = {"value": source_data["notes"]}
|
||||
|
||||
|
|
|
|||
|
|
@ -360,6 +360,8 @@ class FromWuttaFarmLog(FromWuttaFarm):
|
|||
supported_fields = [
|
||||
"uuid",
|
||||
"name",
|
||||
"timestamp",
|
||||
"status",
|
||||
"notes",
|
||||
]
|
||||
|
||||
|
|
@ -367,6 +369,8 @@ class FromWuttaFarmLog(FromWuttaFarm):
|
|||
return {
|
||||
"uuid": log.farmos_uuid or self.app.make_true_uuid(),
|
||||
"name": log.message,
|
||||
"timestamp": log.timestamp,
|
||||
"status": log.status,
|
||||
"notes": log.notes,
|
||||
"_src_object": log,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue