mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 15:08:10 +01:00
RG15 data is float/double, not int (#3512)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
parent
d63e14a4b6
commit
a3d73d1e23
1 changed files with 1 additions and 1 deletions
|
@ -195,7 +195,7 @@ void HydreonRGxxComponent::process_line_() {
|
||||||
if (n == std::string::npos) {
|
if (n == std::string::npos) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int data = strtol(this->buffer_.substr(n + strlen(PROTOCOL_NAMES[i])).c_str(), nullptr, 10);
|
float data = strtof(this->buffer_.substr(n + strlen(PROTOCOL_NAMES[i])).c_str(), nullptr);
|
||||||
this->sensors_[i]->publish_state(data);
|
this->sensors_[i]->publish_state(data);
|
||||||
ESP_LOGD(TAG, "Received %s: %f", PROTOCOL_NAMES[i], this->sensors_[i]->get_raw_state());
|
ESP_LOGD(TAG, "Received %s: %f", PROTOCOL_NAMES[i], this->sensors_[i]->get_raw_state());
|
||||||
this->sensors_received_ |= (1 << i);
|
this->sensors_received_ |= (1 << i);
|
||||||
|
|
Loading…
Reference in a new issue