ESP32 Hall Sensor

See Application::make_esp32_hall_sensor().

API Reference

class ESP32HallSensor : public sensor::PollingSensorComponent

Public Functions

ESP32HallSensor(const std::string &name, uint32_t update_interval = 15000)
void update()
std::string unit_of_measurement()

Override this to set the Home Assistant unit of measurement for this sensor.

Return “” to disable this feature.

Return
The icon of this sensor, for example “°C”.

std::string icon()

Override this to set the Home Assistant icon for this sensor.

Return “” to disable this feature.

Return
The icon of this sensor, for example “mdi:battery”.

int8_t accuracy_decimals()

Return the accuracy in decimals for this sensor.

std::string unique_id()

A unique ID for this sensor, empty for no unique id.

See unique ID requirements: https://developers.home-assistant.io/docs/en/entity_registry_index.html#unique-id-requirements

Return
The unique id as a string.