mirror of
https://github.com/esphome/esphome.git
synced 2024-12-21 16:27:44 +01:00
aec02afcdc
* Fix clang-tidy header filter * Allow private members * Fix clang-tidy detections * Run clang-format * Fix remaining detections * Fix graph * Run clang-format
37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "esphome/core/component.h"
|
|
#include "esphome/components/sensor/sensor.h"
|
|
#include "esphome/components/esp32_ble_tracker/esp32_ble_tracker.h"
|
|
|
|
#ifdef USE_ESP32
|
|
|
|
namespace esphome {
|
|
namespace inkbird_ibsth1_mini {
|
|
|
|
class InkbirdIbstH1Mini : public Component, public esp32_ble_tracker::ESPBTDeviceListener {
|
|
public:
|
|
void set_address(uint64_t address) { address_ = address; }
|
|
|
|
bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override;
|
|
|
|
void dump_config() override;
|
|
float get_setup_priority() const override { return setup_priority::DATA; }
|
|
void set_temperature(sensor::Sensor *temperature) { temperature_ = temperature; }
|
|
void set_external_temperature(sensor::Sensor *external_temperature) { external_temperature_ = external_temperature; }
|
|
void set_humidity(sensor::Sensor *humidity) { humidity_ = humidity; }
|
|
void set_battery_level(sensor::Sensor *battery_level) { battery_level_ = battery_level; }
|
|
|
|
protected:
|
|
uint64_t address_;
|
|
sensor::Sensor *temperature_{nullptr};
|
|
sensor::Sensor *external_temperature_{nullptr};
|
|
sensor::Sensor *humidity_{nullptr};
|
|
sensor::Sensor *battery_level_{nullptr};
|
|
};
|
|
|
|
} // namespace inkbird_ibsth1_mini
|
|
} // namespace esphome
|
|
|
|
#endif
|