|
@@ -122,12 +122,19 @@ class BtCmd {
|
|
|
}
|
|
|
|
|
|
static setSleepAfterPlayPause(time) {
|
|
|
- const hours = Math.floor(time / (1000 * 60 * 60));
|
|
|
- const minutes = Math.floor((time % (1000 * 60 * 60)) / (1000 * 60));
|
|
|
- const seconds = Math.floor((time % (1000 * 60)) / 1000);
|
|
|
- console.log(`${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`);
|
|
|
+ if (time > 0) {
|
|
|
+ let day = (60 * 60 * 24)
|
|
|
+ let hour = 60 * 60
|
|
|
+ const hours = Math.floor(time / day);
|
|
|
+ const minutes = Math.floor((time % day) / hour);
|
|
|
+ const seconds = Math.floor((time % day % hour / 60));
|
|
|
+ console.log(`${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`);
|
|
|
+
|
|
|
+ return this._build(CmdRtc.setSleepAfterPlayPause, [hours, minutes, seconds]);
|
|
|
+ } else {
|
|
|
+ return this._build(CmdRtc.setSleepAfterPlayPause, [-1]);
|
|
|
+ }
|
|
|
|
|
|
- return this._build(CmdRtc.setSleepAfterPlayPause, [hours, minutes, seconds]);
|
|
|
}
|
|
|
|
|
|
// 设置休眠
|