OpenWonderLabs / homebridge-switchbot

The Homebridge SwitchBot plugin allows you to access your SwitchBot Device(s) from HomeKit. Homebridge.
https://www.switch-bot.com/
ISC License
229 stars 47 forks source link

Bug: Homebridge shuts down. If there is a ceiling light. #982

Closed sinsin-san closed 5 days ago

sinsin-san commented 3 weeks ago

Describe the Bug

If there is a ceiling light, the home bridge shuts down.

To Reproduce

Expected Behavior

The home bridge must be able to be used without shutting down and with ceiling lights.

Relevant Log Output

[06/06/2024, 06:07:56] TypeError: Cannot read properties of undefined (reading 'bName')
    at new CeilingLight (file:///var/lib/homebridge/node_modules/@switchbot/homebridge-switchbot/src/device/ceilinglight.ts:55:40)
    at SwitchBotPlatform.createCeilingLight (file:///var/lib/homebridge/node_modules/@switchbot/homebridge-switchbot/src/platform.ts:1744:7)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[06/06/2024, 06:07:56] TypeError: Cannot read properties of undefined (reading 'bName')
    at new CeilingLight (file:///var/lib/homebridge/node_modules/@switchbot/homebridge-switchbot/src/device/ceilinglight.ts:55:40)
    at SwitchBotPlatform.createCeilingLight (file:///var/lib/homebridge/node_modules/@switchbot/homebridge-switchbot/src/platform.ts:1744:7)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[06/06/2024, 06:07:56] TypeError: Cannot read properties of undefined (reading 'bName')
    at new CeilingLight (file:///var/lib/homebridge/node_modules/@switchbot/homebridge-switchbot/src/device/ceilinglight.ts:55:40)
    at SwitchBotPlatform.createCeilingLight (file:///var/lib/homebridge/node_modules/@switchbot/homebridge-switchbot/src/platform.ts:1744:7)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[06/06/2024, 06:07:56] TypeError: Cannot read properties of undefined (reading 'bName')
    at new CeilingLight (file:///var/lib/homebridge/node_modules/@switchbot/homebridge-switchbot/src/device/ceilinglight.ts:55:40)
    at SwitchBotPlatform.createCeilingLight (file:///var/lib/homebridge/node_modules/@switchbot/homebridge-switchbot/src/platform.ts:1744:7)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[06/06/2024, 06:07:56] Got SIGTERM, shutting down Homebridge...

Config for homebridge-switchbot

{
    "name": "SwitchBot",
    "credentials": {
        "token": "******",
        "secret": "******",
        "notice": "Keep your Token & Secret a secret!"
    },
    "options": {
        "logging": "debug"
    },
    "platform": "SwitchBot"
}

Screenshots

No response

Device and Model

Raspberry Pi 3b+

Node.js Version

v18.16.0

NPM Version

no

Homebridge Version

v1.8.2

Homebridge Switchbot Plugin Version

v3.5.0

Homebridge Config UI X Plugin Version

No response

Operating System

Raspbian

donavanbecker commented 3 weeks ago

I will get this resolved in the next release. Can you try a previous release?

sinsin-san commented 3 weeks ago

Thank you for your reply and suggestions. The issue did not occur with v3.4.0, so I will use it until it is resolved.

github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

donavanbecker commented 1 week ago

v3.5.1 has been released, please install and let me know if this has been resolved.

sinsin-san commented 5 days ago

I tried it with v3.5.1 and was able to confirm that it works as expected. Thank you for fixing it.