diff --git a/app/models/fbos_config.rb b/app/models/fbos_config.rb index 1b868a3f76..22181a3130 100644 --- a/app/models/fbos_config.rb +++ b/app/models/fbos_config.rb @@ -12,6 +12,7 @@ class MissingSerial < StandardError; end FARMDUINO_K14 = "farmduino_k14", FARMDUINO_K15 = "farmduino_k15", FARMDUINO_K16 = "farmduino_k16", + FARMDUINO_K17 = "farmduino_k17", EXPRESS_K10 = "express_k10", EXPRESS_K11 = "express_k11", ] diff --git a/app/mutations/devices/create_seed_data.rb b/app/mutations/devices/create_seed_data.rb index fde0f20387..5027606e7b 100644 --- a/app/mutations/devices/create_seed_data.rb +++ b/app/mutations/devices/create_seed_data.rb @@ -11,9 +11,11 @@ class CreateSeedData < Mutations::Command "genesis_1.4" => Devices::Seeders::GenesisOneFour, "genesis_1.5" => Devices::Seeders::GenesisOneFive, "genesis_1.6" => Devices::Seeders::GenesisOneSix, + "genesis_1.7" => Devices::Seeders::GenesisOneSeven, "genesis_xl_1.4" => Devices::Seeders::GenesisXlOneFour, "genesis_xl_1.5" => Devices::Seeders::GenesisXlOneFive, "genesis_xl_1.6" => Devices::Seeders::GenesisXlOneSix, + "genesis_xl_1.7" => Devices::Seeders::GenesisXlOneSeven, "demo_account" => Devices::Seeders::DemoAccountSeeder, "none" => Devices::Seeders::None, diff --git a/app/mutations/devices/seeders/genesis_one_seven.rb b/app/mutations/devices/seeders/genesis_one_seven.rb new file mode 100644 index 0000000000..fd79e4aa3e --- /dev/null +++ b/app/mutations/devices/seeders/genesis_one_seven.rb @@ -0,0 +1,73 @@ +module Devices + module Seeders + class GenesisOneSeven < AbstractGenesis + def settings_firmware + device + .fbos_config + .update!(firmware_hardware: FbosConfig::FARMDUINO_K17) + end + + def settings_change_firmware_config_defaults + end + + def peripherals_rotary_tool + add_peripheral(2, ToolNames::ROTARY_TOOL) + end + + def peripherals_rotary_tool_reverse + add_peripheral(3, ToolNames::ROTARY_TOOL_REVERSE) + end + + def tool_slots_slot_7 + add_tool_slot(name: ToolNames::ROTARY_TOOL, + x: 50, + y: 800, + z: -200, + tool: tools_rotary) + end + + def tool_slots_slot_8 + add_tool_slot(name: ToolNames::SEED_TROUGH_1, + x: 0, + y: 25, + z: -100, + tool: tools_seed_trough_1, + pullout_direction: ToolSlot::NONE, + gantry_mounted: true) + end + + def tool_slots_slot_9 + add_tool_slot(name: ToolNames::SEED_TROUGH_2, + x: 0, + y: 50, + z: -100, + tool: tools_seed_trough_2, + pullout_direction: ToolSlot::NONE, + gantry_mounted: true) + end + + def tools_rotary + @tools_rotary ||= + add_tool(ToolNames::ROTARY_TOOL) + end + + def tools_seed_trough_1 + @tools_seed_trough_1 ||= + add_tool(ToolNames::SEED_TROUGH_1) + end + + def tools_seed_trough_2 + @tools_seed_trough_2 ||= + add_tool(ToolNames::SEED_TROUGH_2) + end + + def sequences_mow_all_weeds + success = install_sequence_version_by_name(PublicSequenceNames::MOW_ALL_WEEDS) + if !success + s = SequenceSeeds::MOW_ALL_WEEDS.deep_dup + Sequences::Create.run!(s, device: device) + end + end + end + end +end diff --git a/app/mutations/devices/seeders/genesis_xl_one_seven.rb b/app/mutations/devices/seeders/genesis_xl_one_seven.rb new file mode 100644 index 0000000000..aca317b37b --- /dev/null +++ b/app/mutations/devices/seeders/genesis_xl_one_seven.rb @@ -0,0 +1,85 @@ +module Devices + module Seeders + class GenesisXlOneSeven < AbstractGenesis + def settings_firmware + device + .fbos_config + .update!(firmware_hardware: FbosConfig::FARMDUINO_K17) + end + + def settings_change_firmware_config_defaults + end + + def settings_device_name + device.update!(name: Names::GENESIS_XL) + end + + def settings_default_map_size_x + device.web_app_config.update!(map_size_x: 5_900) + end + + def settings_default_map_size_y + device.web_app_config.update!(map_size_y: 2_900) + end + + def peripherals_rotary_tool + add_peripheral(2, ToolNames::ROTARY_TOOL) + end + + def peripherals_rotary_tool_reverse + add_peripheral(3, ToolNames::ROTARY_TOOL_REVERSE) + end + + def tool_slots_slot_7 + add_tool_slot(name: ToolNames::ROTARY_TOOL, + x: 50, + y: 800, + z: -200, + tool: tools_rotary) + end + + def tool_slots_slot_8 + add_tool_slot(name: ToolNames::SEED_TROUGH_1, + x: 0, + y: 25, + z: -100, + tool: tools_seed_trough_1, + pullout_direction: ToolSlot::NONE, + gantry_mounted: true) + end + + def tool_slots_slot_9 + add_tool_slot(name: ToolNames::SEED_TROUGH_2, + x: 0, + y: 50, + z: -100, + tool: tools_seed_trough_2, + pullout_direction: ToolSlot::NONE, + gantry_mounted: true) + end + + def tools_rotary + @tools_rotary ||= + add_tool(ToolNames::ROTARY_TOOL) + end + + def tools_seed_trough_1 + @tools_seed_trough_1 ||= + add_tool(ToolNames::SEED_TROUGH_1) + end + + def tools_seed_trough_2 + @tools_seed_trough_2 ||= + add_tool(ToolNames::SEED_TROUGH_2) + end + + def sequences_mow_all_weeds + success = install_sequence_version_by_name(PublicSequenceNames::MOW_ALL_WEEDS) + if !success + s = SequenceSeeds::MOW_ALL_WEEDS.deep_dup + Sequences::Create.run!(s, device: device) + end + end + end + end +end diff --git a/frontend/controls/peripherals/__tests__/index_test.tsx b/frontend/controls/peripherals/__tests__/index_test.tsx index f5cbae53c1..17b076f776 100644 --- a/frontend/controls/peripherals/__tests__/index_test.tsx +++ b/frontend/controls/peripherals/__tests__/index_test.tsx @@ -82,6 +82,7 @@ describe("", () => { ["farmduino_k14", 5], ["farmduino_k15", 5], ["farmduino_k16", 7], + ["farmduino_k17", 7], ["express_k10", 3], ["express_k11", 3], ])("adds peripherals: %s", (firmware, expectedAdds) => { diff --git a/frontend/controls/peripherals/index.tsx b/frontend/controls/peripherals/index.tsx index 803ac71939..f6c23a780b 100644 --- a/frontend/controls/peripherals/index.tsx +++ b/frontend/controls/peripherals/index.tsx @@ -93,6 +93,7 @@ export class Peripherals ...EXTRA_PERIPHERALS, ]; case "farmduino_k16": + case "farmduino_k17": return [ ...BASE_PERIPHERALS, ...ROTARY_TOOL, diff --git a/frontend/devices/connectivity/fbos_metric_demo_data.ts b/frontend/devices/connectivity/fbos_metric_demo_data.ts index 1c139b5dd8..c65a90bd95 100644 --- a/frontend/devices/connectivity/fbos_metric_demo_data.ts +++ b/frontend/devices/connectivity/fbos_metric_demo_data.ts @@ -21,7 +21,7 @@ export const generateDemoTelemetry = (): TaggedTelemetry[] => { cpu_usage: 5 + random(-4, 4), target: "demo", fbos_version: "100.0.0", - firmware_hardware: "farmduino_k16", + firmware_hardware: "farmduino_k17", created_at: at, updated_at: (new Date(at)).toISOString(), } diff --git a/frontend/devices/interfaces.ts b/frontend/devices/interfaces.ts index e4e4693e4a..18665dde22 100644 --- a/frontend/devices/interfaces.ts +++ b/frontend/devices/interfaces.ts @@ -39,6 +39,7 @@ export enum Feature { farmduino_k14 = "farmduino_k14", farmduino_k15 = "farmduino_k15", farmduino_k16 = "farmduino_k16", + farmduino_k17 = "farmduino_k17", firmware_restart = "firmware_restart", flash_firmware = "flash_firmware", groups = "groups", diff --git a/frontend/messages/__tests__/cards_test.tsx b/frontend/messages/__tests__/cards_test.tsx index 2e9cab3ff1..b50dc5bf74 100644 --- a/frontend/messages/__tests__/cards_test.tsx +++ b/frontend/messages/__tests__/cards_test.tsx @@ -2,6 +2,11 @@ jest.mock("../../devices/actions", () => ({ updateConfig: jest.fn() })); jest.mock("../../api/crud", () => ({ destroy: jest.fn() })); +let mockFeatureBoolean = false; +jest.mock("../../devices/should_display", () => ({ + shouldDisplayFeature: () => mockFeatureBoolean, +})); + const fakeBulletin: Bulletin = { content: "Alert content.", href: "https://farm.bot", @@ -28,7 +33,9 @@ jest.mock("../../redux/store", () => ({ import React from "react"; import { mount, shallow } from "enzyme"; -import { AlertCard, changeFirmwareHardware, ReSeedAccount } from "../cards"; +import { + AlertCard, changeFirmwareHardware, ReSeedAccount, SEED_DATA_OPTIONS, +} from "../cards"; import { AlertCardProps, Bulletin } from "../interfaces"; import { fakeTimeSettings } from "../../__test_support__/fake_time_settings"; import { FBSelect } from "../../ui"; @@ -249,6 +256,18 @@ describe("changeFirmwareHardware()", () => { }); }); +describe("SEED_DATA_OPTIONS()", () => { + it("returns options", () => { + mockFeatureBoolean = false; + expect(SEED_DATA_OPTIONS().length).toEqual(13); + }); + + it("returns more options", () => { + mockFeatureBoolean = true; + expect(SEED_DATA_OPTIONS().length).toEqual(15); + }); +}); + describe("", () => { it("changes selection", () => { window.confirm = () => true; diff --git a/frontend/messages/cards.tsx b/frontend/messages/cards.tsx index 7105efd116..e183954ca8 100644 --- a/frontend/messages/cards.tsx +++ b/frontend/messages/cards.tsx @@ -32,6 +32,8 @@ import { push } from "../history"; import moment from "moment"; import { Path } from "../internal_urls"; import { logout } from "../logout"; +import { shouldDisplayFeature } from "../devices/should_display"; +import { Feature } from "../devices/interfaces"; export const AlertCard = (props: AlertCardProps) => { const { alert, timeSettings, findApiAlertById, dispatch } = props; @@ -187,6 +189,11 @@ const FirmwareChoiceTable = () => {"Farmduino"} {FIRMWARE_CHOICES_DDI["farmduino_k16"].label} + + {"Genesis v1.7"} + {"Farmduino"} + {FIRMWARE_CHOICES_DDI["farmduino_k17"].label} + {"Express v1.0"} {"Farmduino"} @@ -245,9 +252,15 @@ export const SEED_DATA_OPTIONS = (): DropDownItem[] => [ { label: "Genesis v1.4", value: "genesis_1.4" }, { label: "Genesis v1.5", value: "genesis_1.5" }, { label: "Genesis v1.6", value: "genesis_1.6" }, + ...(shouldDisplayFeature(Feature.farmduino_k17) + ? [{ label: "Genesis v1.7", value: "genesis_1.7" }] + : []), { label: "Genesis v1.4 XL", value: "genesis_xl_1.4" }, { label: "Genesis v1.5 XL", value: "genesis_xl_1.5" }, { label: "Genesis v1.6 XL", value: "genesis_xl_1.6" }, + ...(shouldDisplayFeature(Feature.farmduino_k17) + ? [{ label: "Genesis v1.7 XL", value: "genesis_xl_1.7" }] + : []), { label: "Express v1.0", value: "express_1.0" }, { label: "Express v1.1", value: "express_1.1" }, { label: "Express v1.0 XL", value: "express_xl_1.0" }, diff --git a/frontend/os_download/content.tsx b/frontend/os_download/content.tsx index 8545f6813d..03de316d5d 100644 --- a/frontend/os_download/content.tsx +++ b/frontend/os_download/content.tsx @@ -67,6 +67,8 @@ const PLATFORM_DATA = (): PlatformContent[] => [ "Genesis XL v1.6.1 (white cable)", "Genesis v1.6.2 (white cable or 2 HDMI ports)", "Genesis XL v1.6.2 (white cable or 2 HDMI ports)", + "Genesis v1.7", + "Genesis XL v1.7", ], }, { @@ -135,6 +137,7 @@ enum Version { "v1.4" = "v1.4", "v1.5" = "v1.5", "v1.6" = "v1.6", + "v1.7" = "v1.7", } const VERSIONS = () => ({ @@ -143,6 +146,7 @@ const VERSIONS = () => ({ Version["v1.1"], ], [Model.Genesis]: [ + // Version["v1.7"], Version["v1.6"], Version["v1.5"], Version["v1.4"], @@ -223,6 +227,9 @@ const DOWNLOADS = (): Downloads => ({ [Run.second]: RPI4(), [Run.third]: RPI4(), }, + [Version["v1.7"]]: { + [Run.first]: RPI4(), + }, } }); diff --git a/frontend/settings/fbos_settings/__tests__/rpi_model_test.tsx b/frontend/settings/fbos_settings/__tests__/rpi_model_test.tsx index 52a53c8f4e..7fd2fcad61 100644 --- a/frontend/settings/fbos_settings/__tests__/rpi_model_test.tsx +++ b/frontend/settings/fbos_settings/__tests__/rpi_model_test.tsx @@ -19,6 +19,7 @@ type TestCase = [string, string, FirmwareHardware, string]; const TEST_CASES: TestCase[] = [ ["3", "rpi3", "arduino", "pi 3"], ["4", "rpi4", "farmduino_k16", "pi 4"], + ["4", "rpi4", "farmduino_k17", "pi 4"], ["01", "rpi", "express_k10", "zero w"], ["02", "rpi3", "express_k11", "zero 2 w"], ]; diff --git a/frontend/settings/firmware/__tests__/board_type_test.tsx b/frontend/settings/firmware/__tests__/board_type_test.tsx index c06d40b380..275a399821 100644 --- a/frontend/settings/firmware/__tests__/board_type_test.tsx +++ b/frontend/settings/firmware/__tests__/board_type_test.tsx @@ -3,6 +3,11 @@ jest.mock("../../../api/crud", () => ({ save: jest.fn(), })); +let mockFeatureBoolean = false; +jest.mock("../../../devices/should_display", () => ({ + shouldDisplayFeature: () => mockFeatureBoolean, +})); + import React from "react"; import { mount, shallow } from "enzyme"; import { BoardType } from "../board_type"; @@ -78,6 +83,7 @@ describe("", () => { }); it("displays boards", () => { + mockFeatureBoolean = false; const wrapper = mount(); const { list } = wrapper.find("FBSelect").props(); expect(list).toEqual([ @@ -90,5 +96,13 @@ describe("", () => { { label: "Farmduino (Express v1.1)", value: "express_k11" }, { label: "None", value: "none" }, ]); + expect(list?.length).toEqual(8); + }); + + it("displays more boards", () => { + mockFeatureBoolean = true; + const wrapper = mount(); + const { list } = wrapper.find("FBSelect").props(); + expect(list?.length).toEqual(9); }); }); diff --git a/frontend/settings/firmware/__tests__/firmware_hardware_support_test.ts b/frontend/settings/firmware/__tests__/firmware_hardware_support_test.ts index 638237dae3..e87d34b16f 100644 --- a/frontend/settings/firmware/__tests__/firmware_hardware_support_test.ts +++ b/frontend/settings/firmware/__tests__/firmware_hardware_support_test.ts @@ -20,6 +20,10 @@ describe("boardType()", () => { expect(boardType("5.0.3.I")).toEqual("farmduino_k16"); }); + it("returns Farmduino k1.7", () => { + expect(boardType("5.0.3.J")).toEqual("farmduino_k17"); + }); + it("returns Farmduino Express k1.0", () => { expect(boardType("5.0.3.E")).toEqual("express_k10"); }); diff --git a/frontend/settings/firmware/firmware_hardware_support.ts b/frontend/settings/firmware/firmware_hardware_support.ts index 16cc73fe69..0bc52c7a41 100644 --- a/frontend/settings/firmware/firmware_hardware_support.ts +++ b/frontend/settings/firmware/firmware_hardware_support.ts @@ -1,9 +1,11 @@ import { FirmwareHardware, TaggedFbosConfig } from "farmbot"; +import { shouldDisplayFeature } from "../../devices/should_display"; +import { Feature } from "../../devices/interfaces"; export const isFwHardwareValue = (x?: unknown): x is FirmwareHardware => { const values: FirmwareHardware[] = [ "arduino", - "farmduino", "farmduino_k14", "farmduino_k15", "farmduino_k16", + "farmduino", "farmduino_k14", "farmduino_k15", "farmduino_k16", "farmduino_k17", "express_k10", "express_k11", "none", ]; @@ -18,6 +20,7 @@ const ordered: FirmwareHardware[] = [ "farmduino_k14", "farmduino_k15", "farmduino_k16", + "farmduino_k17", "none", ]; @@ -112,6 +115,7 @@ const FIRMWARE_LOOKUP: { [id: string]: FirmwareHardware } = { G: "farmduino_k14", H: "farmduino_k15", I: "farmduino_k16", + J: "farmduino_k17", E: "express_k10", D: "express_k11", }; @@ -122,6 +126,7 @@ enum BoardLabels { farmduino_k14 = "Farmduino (Genesis v1.4)", farmduino_k15 = "Farmduino (Genesis v1.5)", farmduino_k16 = "Farmduino (Genesis v1.6)", + farmduino_k17 = "Farmduino (Genesis v1.7)", express_k10 = "Farmduino (Express v1.0)", express_k11 = "Farmduino (Express v1.1)", none = "None", @@ -133,6 +138,7 @@ enum KitLabels { farmduino_k14 = "Genesis v1.4", farmduino_k15 = "Genesis v1.5", farmduino_k16 = "Genesis v1.6", + farmduino_k17 = "Genesis v1.7", express_k10 = "Express v1.0", express_k11 = "Express v1.1", none = "None", @@ -145,6 +151,7 @@ const KIT_LOOKUP = { farmduino_k14: KitLabels.farmduino_k14, farmduino_k15: KitLabels.farmduino_k15, farmduino_k16: KitLabels.farmduino_k16, + farmduino_k17: KitLabels.farmduino_k17, express_k10: KitLabels.express_k10, express_k11: KitLabels.express_k11, none: KitLabels.none, @@ -156,6 +163,7 @@ const FARMDUINO = { label: BoardLabels.farmduino, value: "farmduino" }; const FARMDUINO_K14 = { label: BoardLabels.farmduino_k14, value: "farmduino_k14" }; const FARMDUINO_K15 = { label: BoardLabels.farmduino_k15, value: "farmduino_k15" }; const FARMDUINO_K16 = { label: BoardLabels.farmduino_k16, value: "farmduino_k16" }; +const FARMDUINO_K17 = { label: BoardLabels.farmduino_k17, value: "farmduino_k17" }; const EXPRESS_K10 = { label: BoardLabels.express_k10, value: "express_k10" }; const EXPRESS_K11 = { label: BoardLabels.express_k11, value: "express_k11" }; const NONE = { label: BoardLabels.none, value: "none" }; @@ -166,6 +174,7 @@ export const FIRMWARE_CHOICES_DDI = { [FARMDUINO_K14.value]: FARMDUINO_K14, [FARMDUINO_K15.value]: FARMDUINO_K15, [FARMDUINO_K16.value]: FARMDUINO_K16, + [FARMDUINO_K17.value]: FARMDUINO_K17, [EXPRESS_K10.value]: EXPRESS_K10, [EXPRESS_K11.value]: EXPRESS_K11, [NONE.value]: NONE, @@ -177,6 +186,7 @@ export const getFirmwareChoices = () => ([ FARMDUINO_K14, FARMDUINO_K15, FARMDUINO_K16, + ...(shouldDisplayFeature(Feature.farmduino_k17) ? [FARMDUINO_K17] : []), EXPRESS_K10, EXPRESS_K11, NONE, diff --git a/frontend/settings/hardware_settings/default_values.ts b/frontend/settings/hardware_settings/default_values.ts index 1cb7a42ea5..19748804a3 100644 --- a/frontend/settings/hardware_settings/default_values.ts +++ b/frontend/settings/hardware_settings/default_values.ts @@ -155,6 +155,7 @@ export const getDefaultFwConfigValue = case "farmduino_k14": case "farmduino_k15": case "farmduino_k16": + case "farmduino_k17": return DEFAULT_GENESIS_FIRMWARE_CONFIG_VALUES[key]; case "express_k10": case "express_k11": diff --git a/frontend/tools/__tests__/add_tool_test.tsx b/frontend/tools/__tests__/add_tool_test.tsx index 8cc32dd9d3..62c7ebc417 100644 --- a/frontend/tools/__tests__/add_tool_test.tsx +++ b/frontend/tools/__tests__/add_tool_test.tsx @@ -107,6 +107,7 @@ describe("", () => { ["farmduino_k14", 6], ["farmduino_k15", 8], ["farmduino_k16", 9], + ["farmduino_k17", 9], ["express_k10", 3], ["express_k11", 3], ])("adds peripherals: %s", (firmware, expectedAdds) => { diff --git a/frontend/tools/add_tool.tsx b/frontend/tools/add_tool.tsx index 88fdd1a62c..a5ffc6763d 100644 --- a/frontend/tools/add_tool.tsx +++ b/frontend/tools/add_tool.tsx @@ -103,6 +103,7 @@ export class RawAddTool extends React.Component { ...TROUGHS, ]; case "farmduino_k16": + case "farmduino_k17": return [ ...BASE_TOOLS, t("Rotary Tool"), diff --git a/frontend/util/version.ts b/frontend/util/version.ts index a6095fc264..63e4c4e081 100644 --- a/frontend/util/version.ts +++ b/frontend/util/version.ts @@ -84,6 +84,7 @@ export enum FbosVersionFallback { } const fallbackData: MinOsFeatureLookup = { + [Feature.farmduino_k17]: MinVersionOverride.NEVER, [Feature.planted_at_now]: MinVersionOverride.NEVER, }; diff --git a/frontend/wizard/checks.tsx b/frontend/wizard/checks.tsx index 8a10e5aa8b..f9492876ea 100644 --- a/frontend/wizard/checks.tsx +++ b/frontend/wizard/checks.tsx @@ -333,9 +333,11 @@ const SEED_DATA_OPTION_TO_FW_HARDWARE: Record = { "genesis_1.4": "farmduino_k14", "genesis_1.5": "farmduino_k15", "genesis_1.6": "farmduino_k16", + "genesis_1.7": "farmduino_k17", "genesis_xl_1.4": "farmduino_k14", "genesis_xl_1.5": "farmduino_k15", "genesis_xl_1.6": "farmduino_k16", + "genesis_xl_1.7": "farmduino_k17", "express_1.0": "express_k10", "express_1.1": "express_k11", "express_xl_1.0": "express_k10", @@ -349,6 +351,7 @@ const FW_HARDWARE_TO_RPI: Record = { "farmduino_k14": "3", "farmduino_k15": "3", "farmduino_k16": undefined, + "farmduino_k17": "4", "express_k10": "01", "express_k11": "02", "none": "3", diff --git a/package.json b/package.json index 4a0de367dd..c5c2f94bb5 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "bowser": "2.11.0", "browser-speech": "1.1.1", "events": "3.3.0", - "farmbot": "15.8.1", + "farmbot": "15.8.3", "i18next": "23.6.0", "lodash": "4.17.21", "markdown-it": "13.0.2", diff --git a/spec/controllers/api/devices/devices_controller_seed_spec.rb b/spec/controllers/api/devices/devices_controller_seed_spec.rb index 8a9c027815..751b900b1c 100644 --- a/spec/controllers/api/devices/devices_controller_seed_spec.rb +++ b/spec/controllers/api/devices/devices_controller_seed_spec.rb @@ -680,6 +680,82 @@ def check_slot_pairing(slot, expected_name) expect(settings_default_map_size_y?(device)).to eq(1400) end + it "seeds accounts with Genesis 1.7 data" do + start_tests "genesis_1.7" + + expect(peripherals_lighting?(device).pin).to eq(7) + expect(peripherals_peripheral_4?(device).pin).to eq(10) + expect(peripherals_peripheral_5?(device).pin).to eq(12) + expect(peripherals_vacuum?(device).pin).to be(9) + expect(peripherals_water?(device).pin).to be(8) + expect(peripherals_rotary_tool?(device).pin).to eq(2) + expect(peripherals_rotary_tool_reverse?(device).pin).to eq(3) + expect(pin_bindings_button_1?(device).special_action).to eq("emergency_lock") + expect(pin_bindings_button_2?(device).special_action).to eq("emergency_unlock") + expect(plants?(device)).to be false + expect(sensors_soil_sensor?(device).pin).to eq(59) + expect(sensors_tool_verification?(device).pin).to eq(63) + expect(settings_device_name?(device)).to eq(Names::GENESIS) + expect(settings_change_firmware_config_defaults?(device)).to be(true) + expect(settings_soil_height?(device)).to eq(-200) + expect(settings_gantry_height?(device)).to eq(120) + expect(settings_firmware?(device)).to eq("farmduino_k17") + expect(settings_hide_sensors?(device)).to be(false) + expect(tool_slots_slot_1?(device).name).to eq("Slot") + expect(tool_slots_slot_2?(device).name).to eq("Slot") + expect(tool_slots_slot_3?(device).name).to eq("Slot") + expect(tool_slots_slot_4?(device).name).to eq("Slot") + expect(tool_slots_slot_5?(device).name).to eq("Slot") + expect(tool_slots_slot_6?(device).name).to eq("Slot") + expect(tool_slots_slot_7?(device).name).to eq("Slot") + expect(tool_slots_slot_8?(device).name).to eq("Slot") + expect(tool_slots_slot_9?(device).name).to eq("Slot") + + check_slot_pairing(tool_slots_slot_1?(device), "Seeder") + check_slot_pairing(tool_slots_slot_2?(device), "Seed Bin") + check_slot_pairing(tool_slots_slot_3?(device), "Seed Tray") + check_slot_pairing(tool_slots_slot_4?(device), "Watering Nozzle") + check_slot_pairing(tool_slots_slot_5?(device), "Soil Sensor") + check_slot_pairing(tool_slots_slot_6?(device), "Weeder") + check_slot_pairing(tool_slots_slot_7?(device), "Rotary Tool") + check_slot_pairing(tool_slots_slot_8?(device), "Seed Trough 1") + check_slot_pairing(tool_slots_slot_9?(device), "Seed Trough 2") + + expect(tools_seed_bin?(device)).to be + expect(tools_seed_tray?(device)).to be + expect(tools_seed_trough_1?(device)).to be + expect(tools_seed_trough_2?(device)).to be + expect(tools_seeder?(device)).to be_kind_of(Tool) + expect(tools_soil_sensor?(device)).to be_kind_of(Tool) + expect(tools_watering_nozzle?(device)).to be_kind_of(Tool) + expect(tools_weeder?(device)).to be_kind_of(Tool) + expect(tools_rotary?(device)).to be_kind_of(Tool) + expect(sequences_pickup_seed?(device)).to be + expect(sequences_plant_seed?(device)).to be_kind_of(Sequence) + expect(sequences_take_photo_of_plant?(device)).to be_kind_of(Sequence) + expect(sequences_water_plant?(device)).to be_kind_of(Sequence) + expect(point_groups_spinach?(device)).to_not be + expect(point_groups_broccoli?(device)).to_not be + expect(point_groups_beet?(device)).to_not be + expect(point_groups_all_plants?(device)).to be_kind_of(PointGroup) + expect(point_groups_all_points?(device)).to be_kind_of(PointGroup) + expect(point_groups_all_weeds?(device)).to be_kind_of(PointGroup) + expect(sequences_find_home?(device)).to be_kind_of(Sequence) + expect(sequences_water_all_plants?(device)).to be_kind_of(Sequence) + expect(sequences_water_all?(device)).to be_kind_of(Sequence) + expect(sequences_photo_grid?(device)).to be_kind_of(Sequence) + expect(sequences_weed_detection_grid?(device)).to be_kind_of(Sequence) + expect(sequences_soil_height_grid?(device)).to be_kind_of(Sequence) + expect(sequences_grid?(device)).to be_kind_of(Sequence) + expect(sequences_dispense_water?(device)).to be_kind_of(Sequence) + expect(sequences_mount_tool?(device)).to be_kind_of(Sequence) + expect(sequences_dismount_tool?(device)).to be_kind_of(Sequence) + expect(sequences_mow_all_weeds?(device)).to be_kind_of(Sequence) + expect(sequences_pick_from_seed_tray?(device)).to be_kind_of(Sequence) + expect(settings_default_map_size_x?(device)).to eq(2900) + expect(settings_default_map_size_y?(device)).to eq(1400) + end + it "seeds accounts with Genesis XL 1.4 data" do start_tests "genesis_xl_1.4" @@ -828,6 +904,82 @@ def check_slot_pairing(slot, expected_name) expect(settings_default_map_size_y?(device)).to eq(2900) end + it "seeds accounts with Genesis XL 1.7 data" do + start_tests "genesis_xl_1.7" + + expect(peripherals_lighting?(device).pin).to eq(7) + expect(peripherals_peripheral_4?(device).pin).to eq(10) + expect(peripherals_peripheral_5?(device).pin).to eq(12) + expect(peripherals_vacuum?(device).pin).to be(9) + expect(peripherals_water?(device).pin).to be(8) + expect(peripherals_rotary_tool?(device).pin).to eq(2) + expect(peripherals_rotary_tool_reverse?(device).pin).to eq(3) + expect(pin_bindings_button_1?(device).special_action).to eq("emergency_lock") + expect(pin_bindings_button_2?(device).special_action).to eq("emergency_unlock") + expect(plants?(device)).to be false + expect(sensors_soil_sensor?(device).pin).to eq(59) + expect(sensors_tool_verification?(device).pin).to eq(63) + expect(settings_device_name?(device)).to eq(Names::GENESIS_XL) + expect(settings_change_firmware_config_defaults?(device)).to be(true) + expect(settings_soil_height?(device)).to eq(-200) + expect(settings_gantry_height?(device)).to eq(120) + expect(settings_firmware?(device)).to eq("farmduino_k17") + expect(settings_hide_sensors?(device)).to be(false) + expect(tool_slots_slot_1?(device).name).to eq("Slot") + expect(tool_slots_slot_2?(device).name).to eq("Slot") + expect(tool_slots_slot_3?(device).name).to eq("Slot") + expect(tool_slots_slot_4?(device).name).to eq("Slot") + expect(tool_slots_slot_5?(device).name).to eq("Slot") + expect(tool_slots_slot_6?(device).name).to eq("Slot") + expect(tool_slots_slot_7?(device).name).to eq("Slot") + expect(tool_slots_slot_8?(device).name).to eq("Slot") + expect(tool_slots_slot_9?(device).name).to eq("Slot") + + check_slot_pairing(tool_slots_slot_1?(device), "Seeder") + check_slot_pairing(tool_slots_slot_2?(device), "Seed Bin") + check_slot_pairing(tool_slots_slot_3?(device), "Seed Tray") + check_slot_pairing(tool_slots_slot_4?(device), "Watering Nozzle") + check_slot_pairing(tool_slots_slot_5?(device), "Soil Sensor") + check_slot_pairing(tool_slots_slot_6?(device), "Weeder") + check_slot_pairing(tool_slots_slot_7?(device), "Rotary Tool") + check_slot_pairing(tool_slots_slot_8?(device), "Seed Trough 1") + check_slot_pairing(tool_slots_slot_9?(device), "Seed Trough 2") + + expect(tools_seed_bin?(device)).to be + expect(tools_seed_tray?(device)).to be + expect(tools_seed_trough_1?(device)).to be + expect(tools_seed_trough_2?(device)).to be + expect(tools_seeder?(device)).to be_kind_of(Tool) + expect(tools_soil_sensor?(device)).to be_kind_of(Tool) + expect(tools_watering_nozzle?(device)).to be_kind_of(Tool) + expect(tools_weeder?(device)).to be_kind_of(Tool) + expect(tools_rotary?(device)).to be_kind_of(Tool) + expect(sequences_pickup_seed?(device)).to be + expect(sequences_plant_seed?(device)).to be_kind_of(Sequence) + expect(sequences_take_photo_of_plant?(device)).to be_kind_of(Sequence) + expect(sequences_water_plant?(device)).to be_kind_of(Sequence) + expect(point_groups_spinach?(device)).to_not be + expect(point_groups_broccoli?(device)).to_not be + expect(point_groups_beet?(device)).to_not be + expect(point_groups_all_plants?(device)).to be_kind_of(PointGroup) + expect(point_groups_all_points?(device)).to be_kind_of(PointGroup) + expect(point_groups_all_weeds?(device)).to be_kind_of(PointGroup) + expect(sequences_find_home?(device)).to be_kind_of(Sequence) + expect(sequences_water_all_plants?(device)).to be_kind_of(Sequence) + expect(sequences_water_all?(device)).to be_kind_of(Sequence) + expect(sequences_photo_grid?(device)).to be_kind_of(Sequence) + expect(sequences_weed_detection_grid?(device)).to be_kind_of(Sequence) + expect(sequences_soil_height_grid?(device)).to be_kind_of(Sequence) + expect(sequences_grid?(device)).to be_kind_of(Sequence) + expect(sequences_dispense_water?(device)).to be_kind_of(Sequence) + expect(sequences_mount_tool?(device)).to be_kind_of(Sequence) + expect(sequences_dismount_tool?(device)).to be_kind_of(Sequence) + expect(sequences_mow_all_weeds?(device)).to be_kind_of(Sequence) + expect(sequences_pick_from_seed_tray?(device)).to be_kind_of(Sequence) + expect(settings_default_map_size_x?(device)).to eq(5900) + expect(settings_default_map_size_y?(device)).to eq(2900) + end + it "seeds accounts with Genesis XL 1.6 data" do start_tests "genesis_xl_1.6"