From 41062186bb7e801d4bd74c67818234049194824b Mon Sep 17 00:00:00 2001 From: gabrielburnworth Date: Thu, 2 May 2024 10:14:49 -0700 Subject: [PATCH] remove unreleased lua helpers --- CHANGELOG.md | 2 +- VERSION | 2 +- lib/os/lua.ex | 2 -- lib/os/lua/info.ex | 10 ---------- test/os/lua/ext/info_test.exs | 14 -------------- 5 files changed, 2 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7a97a352..b67aed27d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ * Firmware update to fix calibration deadzone settings. * Add optional arguments to `take_photo` and `take_photo_raw` lua helpers. * Add point group `planted_at`/`created_at` conditional. - * Add `utc`, `local_time`, `current_day`, and `current_year` lua helpers. + * Add `utc` and `local_time` lua helpers. * Dependency updates (includes system updates). # 15.4.6 diff --git a/VERSION b/VERSION index 493053fa1..8b2e2a73a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -15.4.7-rc7 \ No newline at end of file +15.4.7-rc8 \ No newline at end of file diff --git a/lib/os/lua.ex b/lib/os/lua.ex index 143a99b52..8ee41e9c0 100644 --- a/lib/os/lua.ex +++ b/lib/os/lua.ex @@ -116,9 +116,7 @@ defmodule FarmbotOS.Lua do cs_eval: &FarmbotOS.Celery.execute_from_lua/2, current_hour: &Info.current_hour/2, current_minute: &Info.current_minute/2, - current_day: &Info.current_day/2, current_month: &Info.current_month/2, - current_year: &Info.current_year/2, current_second: &Info.current_second/2, detect_weeds: execute_script("plant-detection"), dispense: &DataManipulation.dispense/2, diff --git a/lib/os/lua/info.ex b/lib/os/lua/info.ex index efdfec5f4..95c3b3ea0 100644 --- a/lib/os/lua/info.ex +++ b/lib/os/lua/info.ex @@ -104,21 +104,11 @@ defmodule FarmbotOS.Lua.Info do Timex.Timezone.convert(datetime, tz) end - @doc "Returns the current year" - def current_year(_args, lua) do - {[DateTime.utc_now().year], lua} - end - @doc "Returns the current month" def current_month(_args, lua) do {[DateTime.utc_now().month], lua} end - @doc "Returns the current day" - def current_day(_args, lua) do - {[DateTime.utc_now().day], lua} - end - @doc "Returns the current hour" def current_hour(_args, lua) do {[DateTime.utc_now().hour], lua} diff --git a/test/os/lua/ext/info_test.exs b/test/os/lua/ext/info_test.exs index 3bbee765e..cbf965fbc 100644 --- a/test/os/lua/ext/info_test.exs +++ b/test/os/lua/ext/info_test.exs @@ -222,13 +222,6 @@ defmodule FarmbotOS.Lua.InfoTest do assert actual == second end - test "current_year()" do - year = DateTime.utc_now().year - lua_code = "return current_year()" - {:ok, [actual]} = lua(lua_code, lua_code) - assert actual == year - end - test "current_month()" do month = DateTime.utc_now().month lua_code = "return current_month()" @@ -236,13 +229,6 @@ defmodule FarmbotOS.Lua.InfoTest do assert actual == month end - test "current_day()" do - day = DateTime.utc_now().day - lua_code = "return current_day()" - {:ok, [actual]} = lua(lua_code, lua_code) - assert actual == day - end - test "current_hour()" do hour = DateTime.utc_now().hour lua_code = "return current_hour()"