Skip to content

SetSwitchStateAction ​

Inherits: EventAction < Resource

Action to set a switch or light to a specific state (ON/OFF/BROKEN)

Properties ​

intinteractable_unique_id0
SwitchInteraction.SwitchStateswitch_stateSwitchInteraction.SwitchState.OFF

Variables ​

InteractableObjecttarget_switchnull

Methods ​

Stringget_function_description()
InteractableObjectfind_target_switch()
Dictionarysave()
voidload_data( data: Dictionary )

Property descriptions ​

int interactable_unique_id = 0 ​

ID of the switch/light to control

SwitchInteraction.SwitchState switch_state = SwitchInteraction.SwitchState.OFF ​

State to set the switch to

Variable descriptions ​

InteractableObject target_switch = null ​

Reference to the target switch

Method descriptions ​

String get_function_description() ​

Return a description of this action with parameter placeholders

InteractableObject find_target_switch() ​

Find the target switch by ID

Dictionary save() ​

Save action state to a dictionary

void load_data( data: Dictionary ) ​

Load action state from a dictionary