mirror of
https://github.com/esphome/esphome.git
synced 2024-12-25 15:04:54 +01:00
formatting
This commit is contained in:
parent
74ca4e04bb
commit
f448db79d5
3 changed files with 62 additions and 65 deletions
|
@ -148,28 +148,23 @@ void KT0803Component::update() {
|
||||||
this->publish_pw_ok();
|
this->publish_pw_ok();
|
||||||
this->publish_slncid();
|
this->publish_slncid();
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
for (size_t addr = 0; addr < 0x2F; addr++) {
|
for (size_t addr = 0; addr < 0x2F; addr++) {
|
||||||
uint8_t c;
|
uint8_t c;
|
||||||
if (i2c::ERROR_OK == this->read_register(addr, &c, 1, false)) {
|
if (i2c::ERROR_OK == this->read_register(addr, &c, 1, false)) {
|
||||||
ESP_LOGV(TAG, "update register[%02X]: %02X", addr, c);
|
ESP_LOGV(TAG, "update register[%02X]: %02X", addr, c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void KT0803Component::loop() {
|
void KT0803Component::loop() {}
|
||||||
}
|
|
||||||
|
|
||||||
// config
|
// config
|
||||||
|
|
||||||
void KT0803Component::set_chip_id(ChipId value) {
|
void KT0803Component::set_chip_id(ChipId value) { this->chip_id_ = value; }
|
||||||
this->chip_id_ = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
ChipId KT0803Component::get_chip_id() {
|
ChipId KT0803Component::get_chip_id() { return this->chip_id_; }
|
||||||
return this->chip_id_;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string KT0803Component::get_chip_string() const {
|
std::string KT0803Component::get_chip_string() const {
|
||||||
switch (this->chip_id_) {
|
switch (this->chip_id_) {
|
||||||
|
@ -198,7 +193,9 @@ void KT0803Component::set_frequency(float value) {
|
||||||
this->state_.CHSEL0 = (uint8_t) ((ch >> 0) & 0x01);
|
this->state_.CHSEL0 = (uint8_t) ((ch >> 0) & 0x01);
|
||||||
this->write_reg_(0x00);
|
this->write_reg_(0x00);
|
||||||
this->write_reg_(0x01);
|
this->write_reg_(0x01);
|
||||||
|
if (this->chip_id_ != ChipId::KT0803) {
|
||||||
this->write_reg_(0x02);
|
this->write_reg_(0x02);
|
||||||
|
}
|
||||||
|
|
||||||
this->publish_frequency();
|
this->publish_frequency();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue