This commit is contained in:
J. Nick Koston 2023-06-09 18:04:32 -05:00
parent 1bf07caf3a
commit 378cf48a35
No known key found for this signature in database
3 changed files with 4 additions and 5 deletions

View File

@ -23,7 +23,7 @@ namespace ratgdo {
} else if (this->binary_sensor_type_ == SensorType::RATGDO_SENSOR_MOTOR) { } else if (this->binary_sensor_type_ == SensorType::RATGDO_SENSOR_MOTOR) {
ESP_LOGCONFIG(TAG, " Type: Motor"); ESP_LOGCONFIG(TAG, " Type: Motor");
} else if (this->binary_sensor_type_ == SensorType::RATGDO_SENSOR_BUTTON) { } else if (this->binary_sensor_type_ == SensorType::RATGDO_SENSOR_BUTTON) {
ESP_LOGCONFIG(TAG, " Type: Button"); ESP_LOGCONFIG(TAG, " Type: Button");
} }
} }
void RATGDOBinarySensor::on_motion_state(MotionState state) void RATGDOBinarySensor::on_motion_state(MotionState state)
@ -53,7 +53,7 @@ namespace ratgdo {
return; return;
ESP_LOGD(TAG, "name: %s this->type_:%d on_button_state: %d", this->get_name(), this->binary_sensor_type_, state); ESP_LOGD(TAG, "name: %s this->type_:%d on_button_state: %d", this->get_name(), this->binary_sensor_type_, state);
this->publish_state(state == ButtonState::BUTTON_STATE_PRESSED); this->publish_state(state == ButtonState::BUTTON_STATE_PRESSED);
} }
} // namespace ratgdo } // namespace ratgdo
} // namespace esphome } // namespace esphome

View File

@ -112,8 +112,7 @@ namespace ratgdo {
} else if (cmd == 0x284) { } else if (cmd == 0x284) {
motor = 1; motor = 1;
} else if (cmd == 0x280) { } else if (cmd == 0x280) {
button = bytes1 == 1 button = bytes1 == 1 ESP_LOGD(TAG, "Pressed: %s", byte1 == 1 ? "pressed" : "released");
ESP_LOGD(TAG, "Pressed: %s", byte1 == 1 ? "pressed" : "released");
} else if (cmd == 0x48c) { } else if (cmd == 0x48c) {
openings = (byte1 << 8) | byte2; openings = (byte1 << 8) | byte2;
ESP_LOGD(TAG, "Openings: %d", (byte1 << 8) | byte2); ESP_LOGD(TAG, "Openings: %d", (byte1 << 8) | byte2);

View File

@ -98,7 +98,7 @@ namespace ratgdo {
default: default:
return "UNKNOWN"; return "UNKNOWN";
} }
} }
} // namespace ratgdo } // namespace ratgdo
} // namespace esphome } // namespace esphome