Skip to content

Developers

Shawn Bruce edited this page Apr 21, 2021 · 5 revisions

Helpers

  • get_psu_state()
    Returns: bool

  • turn_psu_on()
    Returns: None

  • turn_psu_off()
    Returns: None

  • register_plugin(implementation)
    Parameters:
    implementation - The instance of the calling class object.
    Returns: None
    Notes: See Developers -> Sub Plugin

Events

PLUGIN_PSUCONTROL_PSU_STATE_CHANGED

Payload:

  • isPSUOn (bool)

Sub Plugin

Sub plugins can be created to provide additional switching and/or sensing methods in PSU Control. A sub plugin is just another OctoPrint plugin that has registered with PSU Control. A drop in single file example can be found here.

While not explicitly required I would recommend that sub-plugins be PSUControl specific and have their plugin id prefixed with psucontrol_ and the display name prefixed with PSU Control - . Doing so simplifies the user experience as well as debugging.

Methods

  • turn_psu_on()
    Returns: None
    Notes: Turn the power supply on.

  • turn_psu_off()
    Returns: None
    Notes: Turn the power supply off.

  • get_psu_state()
    Returns: bool
    Notes: Report the current power supply state.

Registering with PSU Control

Sub plugins should register using the register_plugins helper during on_startup.

Clone this wiki locally