mirror of
https://github.com/esphome/esphome.git
synced 2024-11-06 09:25:37 +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
4622ef770d
commit
2fa7f8c511
@ -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 New Issue
Block a user