Git Product home page Git Product logo

Comments (7)

nichwang88 avatar nichwang88 commented on July 28, 2024 1

快速开关,homebridge异常退出的问题我没有遇到,楼主可以尝试将homebridge加入自启动项目,异常退出也会自动重启进程的方式临时解决。
场景执行奔溃的问题,我倒是确实碰到了,我测试只有在灯泡全开的情况下才能执行晚安关灯操作,一旦有某几盏灯本来就是关闭状态的就会执行失败,然后重新加载homebridge。

from homebridge-aqara.

zhang8083 avatar zhang8083 commented on July 28, 2024

@nichwang88 谢谢您的回复,所以现在的主要的问题就是,开关在某种状态下,如果你再让他进入同一个状态,就会导致homebridge崩溃的。我自己也写了一个脚本,定时监测homebridge进程,如果发现进程不在了,就重启homebridge。可以临时解决,homebridge崩溃的问题。 平时开关过程中只要不按太快出现同状态切换的情况,可以避免软件崩溃,但是场景就没办法控制了,比如离家模式,我要让所有的灯或者开关关闭,但是之前开关本来就是关闭状态,这种情况只能把设备都开启,然后再激活离家模式,才可能避免程序不崩溃了 :(

from homebridge-aqara.

Sagwed avatar Sagwed commented on July 28, 2024

难道你们没发现AqaraPlatform.js 399 行代码报错吗?

  // Dont' send duplicate command out.
  if (this.lastValue == on) {
    platform.log.debug("Value not changed, do nothing");
    return;
  }

这里的 platform.log.debug 这一行应该注释掉,或者将下面 var platform = this.platform; 提前

from homebridge-aqara.

zhang8083 avatar zhang8083 commented on July 28, 2024

@Sagwed 谢谢兄弟,移到前面去可以了:)

from homebridge-aqara.

nichwang88 avatar nichwang88 commented on July 28, 2024

@zhang8083 @Sagwed 楼上两位兄弟,我对编程不怎么了解,"var platform = this.platform"提前到哪里,能说仔细点吗?谢谢!

from homebridge-aqara.

Sagwed avatar Sagwed commented on July 28, 2024

@nichwang88 直接注释掉399行 platform.log.debug("Value not changed, do nothing"); 好了
反正调试信息也没用。如果要保留这行的话

LightSwitchCommander.prototype.send = function(on) {
  // Dont' send duplicate command out.
  if (this.lastValue == on) {
    platform.log.debug("Value not changed, do nothing");
    return;
  }

  var platform = this.platform;
  var password = platform.passwords[this.deviceSid];

var platform = this.platform; 提到 if 前面改成

LightSwitchCommander.prototype.send = function(on) {
  var platform = this.platform;
  // Dont' send duplicate command out.
  if (this.lastValue == on) {
    platform.log.debug("Value not changed, do nothing");
    return;
  }

  var password = platform.passwords[this.deviceSid];

from homebridge-aqara.

nichwang88 avatar nichwang88 commented on July 28, 2024

@Sagwed 多谢,搞定了,果然是高手。

from homebridge-aqara.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.