HAMQTT 0.1.0
ESP-IDF component for integrating devices with Home Assistant over MQTT
Loading...
Searching...
No Matches
HAMQTT_Button Struct Reference

Internal representation of a Home Assistant MQTT button. More...

#include <hamqtt_button.h>

Public Member Functions

HAMQTT_Buttonhamqtt_button_create (HAMQTT_Button_Config *config, HAMQTT_Button_On_Press_Func on_press_func, void *on_press_func_args)
 Create a new HAMQTT button.
void hamqtt_button_destroy (HAMQTT_Button *button)
 Destroy a HAMQTT button and free all resources.
const HAMQTT_Button_Confighamqtt_button_get_config (const HAMQTT_Button *button)
 Get the configuration used to initialize the button.

Detailed Description

Internal representation of a Home Assistant MQTT button.

Member Function Documentation

◆ hamqtt_button_create()

HAMQTT_Button * hamqtt_button_create ( HAMQTT_Button_Config * config,
HAMQTT_Button_On_Press_Func on_press_func,
void * on_press_func_args )

Create a new HAMQTT button.

Parameters
configPointer to a button configuration. Must remain valid for the lifetime of the button.
on_press_funcFunction pointer for handling pressing the ubtton. (See HAMQTT_Button_On_Press_Func).
on_press_func_argsA pointer to the arguments to be passed to the on_press_func.
Returns
Pointer to the created HAMQTT_Button, or NULL on failure.

◆ hamqtt_button_destroy()

void hamqtt_button_destroy ( HAMQTT_Button * button)

Destroy a HAMQTT button and free all resources.

Parameters
buttonPointer to the button to destroy. Must not be NULL.

◆ hamqtt_button_get_config()

const HAMQTT_Button_Config * hamqtt_button_get_config ( const HAMQTT_Button * button)

Get the configuration used to initialize the button.

Parameters
buttonPointer to the button.
Returns
Pointer to the original configuration struct.

The documentation for this struct was generated from the following file: