Iot: Use English description

This commit is contained in:
Terrence
2025-05-19 10:06:05 +08:00
parent 425f46df4b
commit c3e488e744
4 changed files with 18 additions and 18 deletions

View File

@@ -15,16 +15,16 @@ private:
bool discharging_ = false;
public:
Battery() : Thing("Battery", "电池管理") {
Battery() : Thing("Battery", "The battery of the device") {
// 定义设备的属性
properties_.AddNumberProperty("level", "当前电量百分比", [this]() -> int {
properties_.AddNumberProperty("level", "Current battery level", [this]() -> int {
auto& board = Board::GetInstance();
if (board.GetBatteryLevel(level_, charging_, discharging_)) {
return level_;
}
return 0;
});
properties_.AddBooleanProperty("charging", "是否充电中", [this]() -> int {
properties_.AddBooleanProperty("charging", "Whether the battery is charging", [this]() -> int {
return charging_;
});
}