farmbot v6.0.0 Farmbot.BotState View Source
State tree of the bot.
Link to this section Summary
Functions
Forces a dispatch to all the clients
Start the Bot State Server
Subscribe to updates from the bot
Unsubscribes from the bot state tracker. returns a boolean where true means the called pid was actually subscribed and false means it was not actually subscribed
Link to this section Types
Instance of this module.
Link to this type
t()
View Source
t() :: %Farmbot.BotState{configuration: Farmbot.BotState.Configuration.t, informational_settings: Farmbot.BotState.InformationalSettings.t, jobs: %{optional(binary) => Farmbot.BotState.Job.t}, location_data: Farmbot.BotState.LocationData.t, mcu_params: Farmbot.BotState.McuParams.t, pins: %{optional(number) => Farmbot.BotState.Pin.t}, process_info: Farmbot.BotState.ProcessInfo.t, user_env: %{optional(binary) => binary}}
Bot State
Link to this section Functions
Forces a dispatch to all the clients.
Start the Bot State Server.
Link to this function
subscribe(state_tracker)
View Source
subscribe(state_server) :: :ok | {:error, :already_subscribed}
Subscribe to updates from the bot.
Updates
Updates will come in randomly in the shape of
{:bot_state, state} where state is a BotState struct.
Unsubscribes from the bot state tracker. returns a boolean where true means the called pid was actually subscribed and false means it was not actually subscribed.