button
This commit is contained in:
parent
1bf07caf3a
commit
378cf48a35
|
@ -23,7 +23,7 @@ namespace ratgdo {
|
|||
} else if (this->binary_sensor_type_ == SensorType::RATGDO_SENSOR_MOTOR) {
|
||||
ESP_LOGCONFIG(TAG, " Type: Motor");
|
||||
} 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)
|
||||
|
@ -53,7 +53,7 @@ namespace ratgdo {
|
|||
return;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ratgdo
|
||||
} // namespace esphome
|
||||
|
|
|
@ -112,8 +112,7 @@ namespace ratgdo {
|
|||
} else if (cmd == 0x284) {
|
||||
motor = 1;
|
||||
} else if (cmd == 0x280) {
|
||||
button = bytes1 == 1
|
||||
ESP_LOGD(TAG, "Pressed: %s", byte1 == 1 ? "pressed" : "released");
|
||||
button = bytes1 == 1 ESP_LOGD(TAG, "Pressed: %s", byte1 == 1 ? "pressed" : "released");
|
||||
} else if (cmd == 0x48c) {
|
||||
openings = (byte1 << 8) | byte2;
|
||||
ESP_LOGD(TAG, "Openings: %d", (byte1 << 8) | byte2);
|
||||
|
|
|
@ -98,7 +98,7 @@ namespace ratgdo {
|
|||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ratgdo
|
||||
} // namespace esphome
|
||||
|
|
Loading…
Reference in New Issue