forked from xiaozhi/xiaozhi-esp32
Add Backlight and PowerSaveTimer
This commit is contained in:
@@ -15,24 +15,6 @@ namespace iot {
|
||||
class BoardControl : public Thing {
|
||||
public:
|
||||
BoardControl() : Thing("BoardControl", "当前 AI 机器人管理和控制") {
|
||||
// 添加电池电量属性
|
||||
properties_.AddNumberProperty("BatteryLevel", "当前电池电量百分比", [this]() -> int {
|
||||
int level = 0;
|
||||
bool charging = false;
|
||||
Board::GetInstance().GetBatteryLevel(level, charging);
|
||||
ESP_LOGI(TAG, "当前电池电量: %d%%, 充电状态: %s", level, charging ? "充电中" : "未充电");
|
||||
return level;
|
||||
});
|
||||
|
||||
// 添加充电状态属性
|
||||
properties_.AddBooleanProperty("Charging", "是否正在充电", [this]() -> bool {
|
||||
int level = 0;
|
||||
bool charging = false;
|
||||
Board::GetInstance().GetBatteryLevel(level, charging);
|
||||
ESP_LOGI(TAG, "当前电池电量: %d%%, 充电状态: %s", level, charging ? "充电中" : "未充电");
|
||||
return charging;
|
||||
});
|
||||
|
||||
// 修改重新配网
|
||||
methods_.AddMethod("ResetWifiConfiguration", "重新配网", ParameterList(),
|
||||
[this](const ParameterList& parameters) {
|
||||
|
||||
Reference in New Issue
Block a user