petro-kushchak / homebridge-homepod-radio

MIT License
39 stars 2 forks source link

Edit: R̶a̶d̶i̶o̶s̶/r̶a̶d̶i̶o̶ s̶p̶e̶a̶k̶e̶r̶s̶ a̶r̶e̶ n̶o̶t̶ r̶e̶m̶o̶v̶e̶d̶ p̶r̶o̶p̶e̶r̶l̶y̶ Creating non-functional Smart Speaker accessory #54

Open justjam2013 opened 1 month ago

justjam2013 commented 1 month ago

Installed version of homebridge-homepod-radio: v3.0.0 - latest

I created a radio speaker in Homebridge UI, just to test the functionality, then decided that it wasn't functionality that I needed, so I removed it. However the accessory is still present in the Homebridge UI:

Screenshot 2024-09-30 at 2 39 22 AM

When Homebridge boots, the following is output to the logs :

[9/29/2024, 11:51:31 PM] [HomepodRadioPlatform] Loaded 1 radios: HomePod Radio ... [9/29/2024, 11:51:32 PM] HomePod Radio ADD6 is running on port 39975. [9/29/2024, 11:51:32 PM] Please add [HomePod Radio ADD6] manually in Home app. Setup Code: 128-93-119

This is the homebridge-homepod-radio portion of the Homebridge config JSON, that shows only the file streaming and platform configuration with no radio speaker configured (the UI configuration also shows no radio speakers):

    {
        "homepodId": "A2:F4:D3:57:78:CF",
        "serialNumber": "MiniPod B",
        "mediaPath": "/media",
        "httpPort": 7654,
        "enableVolumeControl": true,
        "verboseMode": false,
        "audioFiles": [
            {
                "name": "Announcement",
                "fileName": "announcement.wav",
                "volume": 65
            }
        ],
        "platform": "HomepodRadioPlatform"
    }
justjam2013 commented 1 month ago

Update: upon inspection of the code, HomepodRadioPlatformConfig.loadRadios() creates a dummy radio with comment backward compatibility - single accessory model.

Is there a better way to handle this, instead of creating a dummy Smart Speaker accessory? This effectively creates a non-functional Smart Speaker for each HomePod configured in the plugin.

petro-kushchak commented 1 month ago

yeah, this "backward compatibility" now can be removed, also it definitely should not create any radio unless specified in the config... Will fix this soon