|
@@ -74,6 +74,7 @@ class FoodCookingApp : BaseApp() {
|
|
|
private lateinit var pm: PowerManager
|
|
|
var minute = 0
|
|
|
private var heartBeatInterval :Interval?=null
|
|
|
+ var ledLock = false
|
|
|
override fun onCreate() {
|
|
|
|
|
|
hookWebView()
|
|
@@ -252,6 +253,64 @@ class FoodCookingApp : BaseApp() {
|
|
|
sendBroadcast(intent)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (!ledLock) {
|
|
|
+ ledLock = true;
|
|
|
+ if (!pm.isScreenOn) {
|
|
|
+
|
|
|
+ //合盖
|
|
|
+ if (devInfo.potCloverStatus.toInt() == 0) {
|
|
|
+ CofarSDK.flashWhiteRedLed()
|
|
|
+ } else {
|
|
|
+ CofarSDK.switchWhiteLed('0');
|
|
|
+ CofarSDK.flashRedLed()
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ if (devInfo.status == DevStatus.STOP.toInt()) {
|
|
|
+
|
|
|
+ if (devInfo.potStatus.toInt() == 0) {
|
|
|
+ if (devInfo.potCloverStatus.toInt() == 0) {
|
|
|
+ CofarSDK.flashWhiteRedLed()
|
|
|
+ } else {
|
|
|
+ CofarSDK.switchWhiteLed('0');
|
|
|
+ CofarSDK.flashRedLed()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ CofarSDK.switchWhiteLed('0');
|
|
|
+ CofarSDK.flashRedLed();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (devInfo.status == DevStatus.RUNNING.toInt()) {
|
|
|
+
|
|
|
+ if (devInfo.temp < 60) {
|
|
|
+ CofarSDK.switchRedLed('0');
|
|
|
+ CofarSDK.switchWhiteLed('1');
|
|
|
+ } else {
|
|
|
+ CofarSDK.switchRedLed('1');
|
|
|
+ CofarSDK.switchWhiteLed('0');
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (devInfo.status == DevStatus.PAUSE.toInt()) {
|
|
|
+
|
|
|
+ //判断盖子是否打开
|
|
|
+ //合盖
|
|
|
+ if (devInfo.potCloverStatus.toInt() == 1) {
|
|
|
+ CofarSDK.switchWhiteLed('0');
|
|
|
+ CofarSDK.flashRedLed()
|
|
|
+ } else {
|
|
|
+ CofarSDK.flashWhiteRedLed()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ledLock = false;
|
|
|
+ }
|
|
|
GlobalDevEvent.globalCoverEvent(event, pm)
|
|
|
}
|
|
|
}
|