ESPHome
2026.11.0b6
Loading...
Searching...
No Matches
esphome
components
xiaomi_hhccpot002
xiaomi_hhccpot002.cpp
Go to the documentation of this file.
1
#include "
xiaomi_hhccpot002.h
"
2
#include "
esphome/core/log.h
"
3
4
namespace
esphome::xiaomi_hhccpot002
{
5
6
ESPHOME_LOG_TAG
(TAG,
"xiaomi_hhccpot002"
);
7
8
void
XiaomiHHCCPOT002::dump_config
() {
9
ESP_LOGCONFIG(TAG,
"Xiaomi HHCCPOT002"
);
10
LOG_SENSOR(
" "
,
"Moisture"
, this->moisture_sensor_);
11
LOG_SENSOR(
" "
,
"Conductivity"
, this->conductivity_sensor_);
12
}
13
14
void
XiaomiHHCCPOT002::publish_result
(
const
xiaomi_ble::XiaomiParseResult
&res) {
15
publish_optional
(this->moisture_sensor_, res.
moisture
);
16
publish_optional
(this->conductivity_sensor_, res.
conductivity
);
17
}
18
19
}
// namespace esphome::xiaomi_hhccpot002
esphome::Component::dump_config
virtual void dump_config()
Definition
component.cpp:359
esphome::xiaomi_hhccpot002::XiaomiHHCCPOT002::publish_result
void publish_result(const xiaomi_ble::XiaomiParseResult &res) override
Definition
xiaomi_hhccpot002.cpp:14
log.h
esphome::xiaomi_hhccpot002
Definition
xiaomi_hhccpot002.cpp:4
esphome::xiaomi_hhccpot002::ESPHOME_LOG_TAG
ESPHOME_LOG_TAG(TAG, "xiaomi_hhccpot002")
esphome::publish_optional
void publish_optional(E *entity, const optional< V > &value)
Publish value to entity when the entity is configured and the value is set.
Definition
entity_base.h:309
esphome::xiaomi_ble::XiaomiParseResult
Definition
xiaomi_ble.h:10
esphome::xiaomi_ble::XiaomiParseResult::conductivity
optional< float > conductivity
Definition
xiaomi_ble.h:36
esphome::xiaomi_ble::XiaomiParseResult::moisture
optional< float > moisture
Definition
xiaomi_ble.h:35
xiaomi_hhccpot002.h
Generated by
1.12.0