1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-06 21:32:21 +01:00

Combine code of xiaomi_miscale and xiaomi_miscale2 (#2266)

* Combine xiaomi_miscale and xiaomi_miscale2

* check if message contains impedance

* auto detect scale version

* remove xiaomi_miscale2

* fix lint errors

* Apply suggestions from code review

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>

* Apply suggestions from code review on old code

* Fix clang-tidy warnings

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
This commit is contained in:
Robert Resch
2021-09-22 12:12:55 +02:00
committed by GitHub
parent ed593544d8
commit f1364d4af4
8 changed files with 98 additions and 225 deletions

View File

@@ -380,8 +380,8 @@ bool ESPBTUUID::operator==(const ESPBTUUID &uuid) const {
}
return false;
}
esp_bt_uuid_t ESPBTUUID::get_uuid() { return this->uuid_; }
std::string ESPBTUUID::to_string() {
esp_bt_uuid_t ESPBTUUID::get_uuid() const { return this->uuid_; }
std::string ESPBTUUID::to_string() const {
char sbuf[64];
switch (this->uuid_.len) {
case ESP_UUID_LEN_16:

View File

@@ -34,9 +34,9 @@ class ESPBTUUID {
bool operator==(const ESPBTUUID &uuid) const;
bool operator!=(const ESPBTUUID &uuid) const { return !(*this == uuid); }
esp_bt_uuid_t get_uuid();
esp_bt_uuid_t get_uuid() const;
std::string to_string();
std::string to_string() const;
protected:
esp_bt_uuid_t uuid_;