mirror of
https://github.com/esphome/esphome.git
synced 2025-03-14 14:48:18 +00:00
travis
This commit is contained in:
parent
cb48212def
commit
cf00126215
@ -54,14 +54,14 @@ class MPR121Channel : public binary_sensor::BinarySensor {
|
||||
void process(uint16_t data) { this->publish_state(static_cast<bool>(data & (1 << this->channel_))); }
|
||||
int get_channel() { return this->channel_; };
|
||||
void set_touch_threshold(uint8_t touch_threshold) { this->touch_threshold_ = touch_threshold; };
|
||||
void set_release_threshold(uint8_t release_threshold) { this->release_threshold = release_threshold; };
|
||||
void set_release_threshold(uint8_t release_threshold) { this->release_threshold_ = release_threshold; };
|
||||
uint8_t get_touch_threshold() { return this->touch_threshold_; };
|
||||
uint8_t get_release_threshold() { return this->release_threshold; };
|
||||
uint8_t get_release_threshold() { return this->release_threshold_; };
|
||||
|
||||
protected:
|
||||
uint8_t channel_{0};
|
||||
uint8_t touch_threshold_{DEFAULT_TOUCH_THRESHOLD};
|
||||
uint8_t release_threshold{DEFAULT_RELEASE_THRESHOLD};
|
||||
uint8_t release_threshold_{DEFAULT_RELEASE_THRESHOLD};
|
||||
};
|
||||
|
||||
class MPR121Component : public Component, public i2c::I2CDevice {
|
||||
@ -70,9 +70,9 @@ class MPR121Component : public Component, public i2c::I2CDevice {
|
||||
void set_touch_debounce(uint8_t debounce);
|
||||
void set_release_debounce(uint8_t debounce);
|
||||
void set_touch_threshold(uint8_t touch_threshold) { this->touch_threshold_ = touch_threshold; };
|
||||
void set_release_threshold(uint8_t release_threshold) { this->release_threshold = release_threshold; };
|
||||
void set_release_threshold(uint8_t release_threshold) { this->release_threshold_ = release_threshold; };
|
||||
uint8_t get_touch_threshold() { return this->touch_threshold_; };
|
||||
uint8_t get_release_threshold() { return this->release_threshold; };
|
||||
uint8_t get_release_threshold() { return this->release_threshold_; };
|
||||
void setup() override;
|
||||
void dump_config() override;
|
||||
float get_setup_priority() const override { return setup_priority::DATA; }
|
||||
@ -83,7 +83,7 @@ class MPR121Component : public Component, public i2c::I2CDevice {
|
||||
uint16_t currtouched_{0};
|
||||
uint8_t debounce_{0};
|
||||
uint8_t touch_threshold_{DEFAULT_TOUCH_THRESHOLD};
|
||||
uint8_t release_threshold{DEFAULT_RELEASE_THRESHOLD};
|
||||
uint8_t release_threshold_{DEFAULT_RELEASE_THRESHOLD};
|
||||
enum ErrorCode {
|
||||
NONE = 0,
|
||||
COMMUNICATION_FAILED,
|
||||
|
Loading…
x
Reference in New Issue
Block a user