- 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