mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 23:18:10 +01:00
commit
31ad75d01b
4 changed files with 11 additions and 7 deletions
|
@ -51,7 +51,7 @@ void FingerprintGrowComponent::update() {
|
||||||
void FingerprintGrowComponent::setup() {
|
void FingerprintGrowComponent::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up Grow Fingerprint Reader...");
|
ESP_LOGCONFIG(TAG, "Setting up Grow Fingerprint Reader...");
|
||||||
if (this->check_password_()) {
|
if (this->check_password_()) {
|
||||||
if (this->new_password_ != nullptr) {
|
if (this->new_password_ != -1) {
|
||||||
if (this->set_password_())
|
if (this->set_password_())
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@ -202,9 +202,9 @@ bool FingerprintGrowComponent::check_password_() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FingerprintGrowComponent::set_password_() {
|
bool FingerprintGrowComponent::set_password_() {
|
||||||
ESP_LOGI(TAG, "Setting new password: %d", *this->new_password_);
|
ESP_LOGI(TAG, "Setting new password: %d", this->new_password_);
|
||||||
this->data_ = {SET_PASSWORD, (uint8_t)(*this->new_password_ >> 24), (uint8_t)(*this->new_password_ >> 16),
|
this->data_ = {SET_PASSWORD, (uint8_t)(this->new_password_ >> 24), (uint8_t)(this->new_password_ >> 16),
|
||||||
(uint8_t)(*this->new_password_ >> 8), (uint8_t)(*this->new_password_ & 0xFF)};
|
(uint8_t)(this->new_password_ >> 8), (uint8_t)(this->new_password_ & 0xFF)};
|
||||||
if (this->send_command_() == OK) {
|
if (this->send_command_() == OK) {
|
||||||
ESP_LOGI(TAG, "New password successfully set");
|
ESP_LOGI(TAG, "New password successfully set");
|
||||||
ESP_LOGI(TAG, "Define the new password in your configuration and reflash now");
|
ESP_LOGI(TAG, "Define the new password in your configuration and reflash now");
|
||||||
|
|
|
@ -96,7 +96,7 @@ class FingerprintGrowComponent : public PollingComponent, public uart::UARTDevic
|
||||||
}
|
}
|
||||||
void set_sensing_pin(GPIOPin *sensing_pin) { this->sensing_pin_ = sensing_pin; }
|
void set_sensing_pin(GPIOPin *sensing_pin) { this->sensing_pin_ = sensing_pin; }
|
||||||
void set_password(uint32_t password) { this->password_ = password; }
|
void set_password(uint32_t password) { this->password_ = password; }
|
||||||
void set_new_password(uint32_t new_password) { this->new_password_ = &new_password; }
|
void set_new_password(uint32_t new_password) { this->new_password_ = new_password; }
|
||||||
void set_fingerprint_count_sensor(sensor::Sensor *fingerprint_count_sensor) {
|
void set_fingerprint_count_sensor(sensor::Sensor *fingerprint_count_sensor) {
|
||||||
this->fingerprint_count_sensor_ = fingerprint_count_sensor;
|
this->fingerprint_count_sensor_ = fingerprint_count_sensor;
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ class FingerprintGrowComponent : public PollingComponent, public uart::UARTDevic
|
||||||
uint8_t address_[4] = {0xFF, 0xFF, 0xFF, 0xFF};
|
uint8_t address_[4] = {0xFF, 0xFF, 0xFF, 0xFF};
|
||||||
uint16_t capacity_ = 64;
|
uint16_t capacity_ = 64;
|
||||||
uint32_t password_ = 0x0;
|
uint32_t password_ = 0x0;
|
||||||
uint32_t *new_password_{nullptr};
|
uint32_t new_password_ = -1;
|
||||||
GPIOPin *sensing_pin_{nullptr};
|
GPIOPin *sensing_pin_{nullptr};
|
||||||
uint8_t enrollment_image_ = 0;
|
uint8_t enrollment_image_ = 0;
|
||||||
uint16_t enrollment_slot_ = 0;
|
uint16_t enrollment_slot_ = 0;
|
||||||
|
|
|
@ -76,7 +76,11 @@ void SPIComponent::setup() {
|
||||||
if (spi_bus_num == 0) {
|
if (spi_bus_num == 0) {
|
||||||
this->hw_spi_ = &SPI;
|
this->hw_spi_ = &SPI;
|
||||||
} else {
|
} else {
|
||||||
|
#if defined(USE_ESP32_VARIANT_ESP32C3) || defined(USE_ESP32_VARIANT_ESP32S2) || defined(USE_ESP32_VARIANT_ESP32S3)
|
||||||
|
this->hw_spi_ = new SPIClass(FSPI); // NOLINT(cppcoreguidelines-owning-memory)
|
||||||
|
#else
|
||||||
this->hw_spi_ = new SPIClass(VSPI); // NOLINT(cppcoreguidelines-owning-memory)
|
this->hw_spi_ = new SPIClass(VSPI); // NOLINT(cppcoreguidelines-owning-memory)
|
||||||
|
#endif // USE_ESP32_VARIANT
|
||||||
}
|
}
|
||||||
spi_bus_num++;
|
spi_bus_num++;
|
||||||
this->hw_spi_->begin(clk_pin, miso_pin, mosi_pin);
|
this->hw_spi_->begin(clk_pin, miso_pin, mosi_pin);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""Constants used by esphome."""
|
"""Constants used by esphome."""
|
||||||
|
|
||||||
__version__ = "2022.8.0"
|
__version__ = "2022.8.1"
|
||||||
|
|
||||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue