Common macros and definitions used across the HAMQTT library.
bool(* HAMQTT_Binary_Sensor_Get_State_Func)(void *args)
Function pointer type for retrieving the state of a binary sensor.
Definition hamqtt_binary_sensor.h:76
Configuration parameters for a HAMQTT binary sensor.
Definition hamqtt_binary_sensor.h:36
bool enabled_by_default
Set to false if the sensor should not be enabled when the sensor is first added.
Definition hamqtt_binary_sensor.h:38
char * name
The name of the sensor shown in Home Assistant.
Definition hamqtt_binary_sensor.h:43
char * entity_picture
URL to a picture for the sensor.
Definition hamqtt_binary_sensor.h:39
int off_delay
Number of seconds after the sensor turns on that Home Assistant turns it back off....
Definition hamqtt_binary_sensor.h:44
char * icon
Icon for the sensor.
Definition hamqtt_binary_sensor.h:42
int expire_after
Number of seconds a sensor's state expires, if it's not updated. Set to -1 to disable expiration.
Definition hamqtt_binary_sensor.h:40
bool force_update
Set to true if Home Assistant should always send update events, even when the sensor's state doesn't ...
Definition hamqtt_binary_sensor.h:41
HAMQTT_Binary_Sensor_Config hamqtt_binary_sensor_config_default(void)
Returns a default-initialized binary sensor configuration.
char * device_class
The class of the sensor, which alters how its state and icon is rendered.
Definition hamqtt_binary_sensor.h:37
char * unique_id
Unique identifier used for discovery in Home Assistant.
Definition hamqtt_binary_sensor.h:45
Internal representation of a Home Assistant MQTT binary sensor.
void hamqtt_binary_sensor_destroy(HAMQTT_Binary_Sensor *sensor)
Destroy a HAMQTT binary sensor and free all resources.
const HAMQTT_Binary_Sensor_Config * hamqtt_binary_sensor_get_config(const HAMQTT_Binary_Sensor *sensor)
Get the configuration used to initialize the binary sensor.
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.