Skip to content

Commit

Permalink
[v15.4.9-rc2] fix planted_at badarg bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielburnworth committed Jun 11, 2024
1 parent 8cd161a commit 88fe6df
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Add `tool.flow_rate_ml_per_s`.
* Add `get_tool` Lua helper and use it in relevant helpers.
* Fix `update_device({mounted_tool_id = 0})` functionality and validate values.
* Fix `badarg` bug for plants with `planted_at` value.

# 15.4.8

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15.4.9-rc0
15.4.9-rc2
16 changes: 12 additions & 4 deletions lib/os/sys_calls/point_lookup.ex
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,18 @@ defmodule FarmbotOS.SysCalls.PointLookup do
)
end

%{resource_type: type, resource_id: id}
|> Map.merge(s)
|> Map.take(@relevant_keys)
|> Map.put(:age, age)
p =
%{resource_type: type, resource_id: id}
|> Map.merge(s)
|> Map.take(@relevant_keys)
|> Map.put(:age, age)

if p.planted_at do
p
|> Map.put(:planted_at, DateTime.to_iso8601(s.planted_at))
else
p
end

other ->
Logger.debug("Point error: Please notify support #{inspect(other)}")
Expand Down

0 comments on commit 88fe6df

Please sign in to comment.