Skip to content

v15.4.8

Compare
Choose a tag to compare
@farmbot-ci farmbot-ci released this 28 May 20:06
16e3811
  • Add support for using remote plant objects in the water Lua helper.
  • Add to_unix Lua helper.
  • Add planted_at to local plant objects.

-- works in v15.4.7:
plant = variable("Plant")
water(plant)
-- `plant` is fetched locally and includes `age`:
print(inspect(plant))

-- does not work in v15.4.7, now works in v15.4.8:
plant_id = 12345
plant = api({method = "get", url = "/api/points/" .. plant_id})
water(plant)
-- `plant` is feteched from the Web App API and includes `planted_at`:
print(inspect(plant))

-- new `to_unix` helper:
plant_id = 12345
plant = api({method = "get", url = "/api/points/" .. plant_id})
print(to_unix(plant.planted_at))
print(to_unix(utc())
print(to_unix(utc()) - to_unix(local_time())) -- 0