mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-13 16:13:32 +02:00
jsn_sr04t component: AJ_SR04M compatibility mode in checksum calculation (#7044)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -9,9 +9,14 @@
|
||||
namespace esphome {
|
||||
namespace jsn_sr04t {
|
||||
|
||||
enum Model {
|
||||
JSN_SR04T,
|
||||
AJ_SR04M,
|
||||
};
|
||||
|
||||
class Jsnsr04tComponent : public sensor::Sensor, public PollingComponent, public uart::UARTDevice {
|
||||
public:
|
||||
// Nothing really public.
|
||||
void set_model(Model model) { this->model_ = model; }
|
||||
|
||||
// ========== INTERNAL METHODS ==========
|
||||
void update() override;
|
||||
@@ -20,6 +25,7 @@ class Jsnsr04tComponent : public sensor::Sensor, public PollingComponent, public
|
||||
|
||||
protected:
|
||||
void check_buffer_();
|
||||
Model model_;
|
||||
|
||||
std::vector<uint8_t> buffer_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user