kovalev-sergey / homebridge-sony-audio

HomeKit integration for Sony Audio products
Apache License 2.0
14 stars 0 forks source link

"Adding new accessory" whenever Homebridge starts #33

Open jonzhan opened 1 year ago

jonzhan commented 1 year ago

Describe The Bug: As far as I can tell, control of the soundbar (a HT-Z9F) still works fine, but I was wondering if it is unexpected behaviour to see a "adding new accessory" whenever Homebridge restarts.

To Reproduce: Install plugin, set up soundbar in homekit, restart homebridge

Expected behavior: An accessory which is already set up in Homekit should not be repeatedly added. I think it should also be added to cached accessories but it does not appear there.

Logs:

This happened once, then stopped happening afterward.

[3/30/2023, 8:33:00 PM] Error: This callback function has already been called by someone else; it can only be called one time.
    at /homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:12:13
    at /homebridge/node_modules/homebridge-sony-audio/src/sonyAudioAccessory.ts:442:21
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[3/30/2023, 8:33:00 PM] Error: This callback function has already been called by someone else; it can only be called one time.
    at /homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:12:13
    at /homebridge/node_modules/homebridge-sony-audio/src/sonyAudioAccessory.ts:450:21
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[3/30/2023, 8:33:00 PM] Error: This callback function has already been called by someone else; it can only be called one time.
    at /homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:12:13
    at /homebridge/node_modules/homebridge-sony-audio/src/sonyAudioAccessory.ts:442:21
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[3/30/2023, 8:33:00 PM] Error: This callback function has already been called by someone else; it can only be called one time.
    at /homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:12:13
    at /homebridge/node_modules/homebridge-sony-audio/src/sonyAudioAccessory.ts:450:21
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[3/30/2023, 8:33:00 PM] Error: This callback function has already been called by someone else; it can only be called one time.
    at /homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:12:13
    at /homebridge/node_modules/homebridge-sony-audio/src/sonyAudioAccessory.ts:442:21
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[3/30/2023, 8:33:00 PM] Error: This callback function has already been called by someone else; it can only be called one time.
    at /homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:12:13
    at /homebridge/node_modules/homebridge-sony-audio/src/sonyAudioAccessory.ts:450:21
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[3/30/2023, 8:33:00 PM] Error: This callback function has already been called by someone else; it can only be called one time.
    at /homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:12:13
    at /homebridge/node_modules/homebridge-sony-audio/src/sonyAudioAccessory.ts:442:21
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[3/30/2023, 8:33:00 PM] Error: This callback function has already been called by someone else; it can only be called one time.
    at /homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:12:13
    at /homebridge/node_modules/homebridge-sony-audio/src/sonyAudioAccessory.ts:450:21
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[3/30/2023, 8:33:00 PM] Error: This callback function has already been called by someone else; it can only be called one time.
    at /homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:12:13
    at /homebridge/node_modules/homebridge-sony-audio/src/sonyAudioAccessory.ts:442:21
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[3/30/2023, 8:33:00 PM] Error: This callback function has already been called by someone else; it can only be called one time.
    at /homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:12:13
    at /homebridge/node_modules/homebridge-sony-audio/src/sonyAudioAccessory.ts:450:21
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[3/30/2023, 8:33:00 PM] Error: This callback function has already been called by someone else; it can only be called one time.
    at /homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:12:13
    at /homebridge/node_modules/homebridge-sony-audio/src/sonyAudioAccessory.ts:442:21
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[3/30/2023, 8:33:00 PM] Error: This callback function has already been called by someone else; it can only be called one time.
    at /homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:12:13
    at /homebridge/node_modules/homebridge-sony-audio/src/sonyAudioAccessory.ts:450:21
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

This happens on every Homebridge start and it doesn't look like it should?

[3/30/2023, 8:33:32 PM] [Sony Audio Platform] Adding new accessory: My Soundbar
[3/30/2023, 8:33:32 PM] [Sony Audio Platform] Compatible device found, added: My Soundbar
[3/30/2023, 8:33:32 PM] My Soundbar XXXX is running on port XXXX.
[3/30/2023, 8:33:32 PM] Please add [My Soundbar XXXX] manually in Home app. Setup Code: XXXX

Plugin Config:

        {
            "name": "Sony Audio Platform",
            "platform": "SonyAudio"
        }

Screenshots: None

Environment:

twentyNoise commented 1 year ago

I'm seeing the same issue and on some devices the Sony Audio Device (my receiver) disappears from the Home App and on others it just shows as "No Response" and I then restart the Sony Audio Device child bridge and it works again.