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

Internal representation of a Home Assistant MQTT binary sensor. More...

#include <hamqtt_binary_sensor.h>

Public Member Functions

HAMQTT_Binary_Sensorhamqtt_binary_sensor_create (HAMQTT_Binary_Sensor_Config *config, HAMQTT_Binary_Sensor_Get_State_Func get_state_func, void *get_state_func_args)
 Create a new HAMQTT binary sensor.
void hamqtt_binary_sensor_destroy (HAMQTT_Binary_Sensor *sensor)
 Destroy a HAMQTT binary sensor and free all resources.
const HAMQTT_Binary_Sensor_Confighamqtt_binary_sensor_get_config (const HAMQTT_Binary_Sensor *sensor)
 Get the configuration used to initialize the binary sensor.

Detailed Description

Internal representation of a Home Assistant MQTT binary sensor.

Member Function Documentation

◆ hamqtt_binary_sensor_create()

HAMQTT_Binary_Sensor * hamqtt_binary_sensor_create ( HAMQTT_Binary_Sensor_Config * config,
HAMQTT_Binary_Sensor_Get_State_Func get_state_func,
void * get_state_func_args )

Create a new HAMQTT binary sensor.

Parameters
configPointer to a binary sensor configuration. Must remain valid for the lifetime of the binary sensor.
get_state_funcFunction pointer for retrieving the state of a binary sensor. (See HAMQTT_Binary_Sensor_Get_State_Func).
get_state_func_argsA pointer to the arguments to be passed to the get_state_func.
Returns
Pointer to the created HAMQTT_Binary_Sensor, or NULL on failure.

◆ hamqtt_binary_sensor_destroy()

void hamqtt_binary_sensor_destroy ( HAMQTT_Binary_Sensor * sensor)

Destroy a HAMQTT binary sensor and free all resources.

Parameters
sensorPointer to the binary sensor to destroy. Must not be NULL.

◆ hamqtt_binary_sensor_get_config()

const HAMQTT_Binary_Sensor_Config * hamqtt_binary_sensor_get_config ( const HAMQTT_Binary_Sensor * sensor)

Get the configuration used to initialize the binary sensor.

Parameters
sensorPointer to the binary sensor.
Returns
Pointer to the original configuration struct.

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