mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 15:08:10 +01:00
Add E-Trailer Gaslevel support to Mopeka Std Check (#5397)
* Add E-Trailer Gaslevel support to Mopeka Std Check Signed-off-by: Philipp Helo Rehs <Philipp.Rehs@hhu.de> * fix format --------- Signed-off-by: Philipp Helo Rehs <Philipp.Rehs@hhu.de> Co-authored-by: Philipp Helo Rehs <Philipp.Rehs@hhu.de>
This commit is contained in:
parent
164631fcec
commit
11f6e555f9
2 changed files with 3 additions and 1 deletions
|
@ -71,7 +71,8 @@ bool MopekaStdCheck::parse_device(const esp32_ble_tracker::ESPBTDevice &device)
|
|||
const auto *mopeka_data = (const mopeka_std_package *) manu_data.data.data();
|
||||
|
||||
const u_int8_t hardware_id = mopeka_data->data_1 & 0xCF;
|
||||
if (static_cast<SensorType>(hardware_id) != STANDARD && static_cast<SensorType>(hardware_id) != XL) {
|
||||
if (static_cast<SensorType>(hardware_id) != STANDARD && static_cast<SensorType>(hardware_id) != XL &&
|
||||
static_cast<SensorType>(hardware_id) != ETRAILER) {
|
||||
ESP_LOGE(TAG, "[%s] Unsupported Sensor Type (0x%X)", device.address_str().c_str(), hardware_id);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace mopeka_std_check {
|
|||
enum SensorType {
|
||||
STANDARD = 0x02,
|
||||
XL = 0x03,
|
||||
ETRAILER = 0x46,
|
||||
};
|
||||
|
||||
// 4 values in one struct so it aligns to 8 byte. One `mopeka_std_values` is 40 bit long.
|
||||
|
|
Loading…
Reference in a new issue