Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Support] TypeError #89

Closed
shungo27 opened this issue Feb 15, 2021 · 7 comments
Closed

[Support] TypeError #89

shungo27 opened this issue Feb 15, 2021 · 7 comments
Assignees

Comments

@shungo27
Copy link

I get an error every time I restart homebridge.

TypeError: Cannot read property 'reduce' of null

Paste of Logs:

[2/15/2021, 9:58:27 AM] TypeError: Cannot read property 'reduce' of null
    at /Users/xxxxx/.nodebrew/node/v14.15.5/lib/node_modules/homebridge-cmd4/Cmd4Accessory.js:677:49
    at ChildProcess.exithandler (child_process.js:299:7)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1048:16)
    at Socket.<anonymous> (internal/child_process.js:439:11)
    at Socket.emit (events.js:315:20)
    at Pipe.<anonymous> (net.js:673:12)
[2/15/2021, 9:58:27 AM] TypeError: Cannot read property 'reduce' of null
    at /Users/xxxxx/.nodebrew/node/v14.15.5/lib/node_modules/homebridge-cmd4/Cmd4Accessory.js:677:49
    at ChildProcess.exithandler (child_process.js:299:7)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1048:16)
    at Socket.<anonymous> (internal/child_process.js:439:11)
    at Socket.emit (events.js:315:20)
    at Pipe.<anonymous> (net.js:673:12)

Cmd4 Config:

        {
            "platform": "Cmd4",
            "name": "Cmd4",
            "allowTLV8": false,
            "outputConstants": false,
            "restartRecover": false,
            "fetch": "Polled",
            "accessories": [
                {
                    "type": "Switch",
                    "name": "エアコン",
                    "on": "0",
                    "state_cmd": "/Applications/homebridge/thermostat/shellscript.sh",
                    "stateChangeResponseTime": 3,
                    "Polling": [
                        {
                            "characteristic": "On",
                            "interval": 5,
                            "timeout": 5000
                        }
                    ]
                },
                {
                    "type": "Switch",
                    "name": "サーキュレーター",
                    "on": "0",
                    "state_cmd": "/Applications/homebridge/circulator/shellscript.sh",
                    "stateChangeResponseTime": 3,
                    "Polling": [
                        {
                            "characteristic": "On",
                            "interval": 5,
                            "timeout": 5000
                        }
                    ]
                }
            ]
        }

Environment:

  • Node.js Version: 14.15.5
  • NPM Version: 6.14.11
  • Homebridge Version: 1.2.5
  • homebridge-cmd4 Version: 3.1.0
  • Operating System: macOS
  • Process Supervisor: hb-service
@ztalbot2000
Copy link
Owner

Hi,

Sorry, I did not see this come in. I only saw it by accident. I'll get back to you shortly. What an odd message.

@ztalbot2000
Copy link
Owner

Interesting indeed. For whatever reason your shell script is returning nothing. In 3.0 I had added parsing of quotes around the incoming data. The data was supposed to have been checked before hand. I guess with all the testing around the quotes, I actually did not notice that the test of no data was moved after the reduce. Ooops. I will fix this ASAP.

@ztalbot2000
Copy link
Owner

Actually, I think it would have failed before as well. instead of reduce, it would have been for match. No matter. A fix is underway.

@ztalbot2000
Copy link
Owner

v3.1.1 submitted to GitHub. Package testing underway before release to NPM.

@ztalbot2000
Copy link
Owner

Package testing complete. Fix is in v3.1.1, however your script I believe is still returning nothing to Cmd4.

@shungo27
Copy link
Author

thx! the problem is solved!

@ztalbot2000
Copy link
Owner

ztalbot2000 commented Feb 15, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants