Skip to content

Commit

Permalink
Merge pull request #24 from crlogic/main
Browse files Browse the repository at this point in the history
support latest esphome
  • Loading branch information
hjmcnew authored Apr 26, 2023
2 parents aaa86fc + 27af860 commit 47708b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Binary file added docs/V1.3:HS2xx3A Datasheet CH.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions leapmmw_sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
void publishTarget(std::string idx, float dist, float snr) {
auto get_sensors = App.get_sensors();
for(int i = 0; i < get_sensors.size(); i++) {
auto name = get_sensors[i]->get_name();
std::string name = get_sensors[i]->get_name();
auto target = "target_" + to_string(idx);
if(name.size() > 10 && name.substr(0, 8) == target) {
if(name.substr(9, 3) == "dis") {
Expand All @@ -31,7 +31,7 @@ class leapmmw : public Component, public UARTDevice {
void publishNumber (std::string sensor, float resp) {
auto get_numbers = App.get_numbers();
for(int i = 0; i < get_numbers.size(); i++) {
auto name = get_numbers[i]->get_name();
std::string name = get_numbers[i]->get_name();
// if(name.size() > 6 && name == sensor) {
std::size_t found = name.find(sensor);
if(name.size() > 6 && found!=std::string::npos) {
Expand All @@ -43,7 +43,7 @@ class leapmmw : public Component, public UARTDevice {
void publishSwitch(std::string sensor, int state) {
auto sens = App.get_switches();
for(int i = 0; i < sens.size(); i++) {
auto name = sens[i]->get_name();
std::string name = sens[i]->get_name();
// if(name.size() > 2 && name == sensor) {
std::size_t found = name.find(sensor);
if(name.size() > 2 && found!=std::string::npos) {
Expand Down

0 comments on commit 47708b6

Please sign in to comment.