mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-27 00:17:22 +02:00
Rf Bridge: add bucket sniffing and beep functionality (#1819)
Co-authored-by: Otto winter <otto@otto-winter.com> Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -201,6 +201,14 @@ void RFBridgeComponent::stop_advanced_sniffing() {
|
||||
this->flush();
|
||||
}
|
||||
|
||||
void RFBridgeComponent::start_bucket_sniffing() {
|
||||
ESP_LOGD(TAG, "Raw Bucket Sniffing on");
|
||||
this->write(RF_CODE_START);
|
||||
this->write(RF_CODE_RFIN_BUCKET);
|
||||
this->write(RF_CODE_STOP);
|
||||
this->flush();
|
||||
}
|
||||
|
||||
void RFBridgeComponent::send_raw(std::string raw_code) {
|
||||
ESP_LOGD(TAG, "Sending Raw Code: %s", raw_code.c_str());
|
||||
|
||||
@@ -208,5 +216,16 @@ void RFBridgeComponent::send_raw(std::string raw_code) {
|
||||
this->flush();
|
||||
}
|
||||
|
||||
void RFBridgeComponent::beep(uint16_t ms) {
|
||||
ESP_LOGD(TAG, "Beeping for %hu ms", ms);
|
||||
|
||||
this->write(RF_CODE_START);
|
||||
this->write(RF_CODE_BEEP);
|
||||
this->write((ms >> 8) & 0xFF);
|
||||
this->write(ms & 0xFF);
|
||||
this->write(RF_CODE_STOP);
|
||||
this->flush();
|
||||
}
|
||||
|
||||
} // namespace rf_bridge
|
||||
} // namespace esphome
|
||||
|
||||
Reference in New Issue
Block a user