ebaauw / homebridge-zp

Homebridge plugin for Sonos ZonePlayer
Apache License 2.0
241 stars 20 forks source link

Change Serial Number prefix to SPKR #170

Closed jsiegenthaler closed 3 years ago

jsiegenthaler commented 3 years ago

Issue

Enhancement Following the change of accessory icon from TV to Speaker, the Serial Number should now be prefixed with SPKR instead of TV

homebridge-zp v1.2.1

jsiegenthaler commented 3 years ago

OK, I found config option tvPreFix But it doesn't work, even after a Homebridge restart

ebaauw commented 3 years ago

the Serial Number should now be prefixed with SPKR instead of TV

Why?

OK, I found config option tvPreFix

It's tvIdPrefix

But it doesn't work, even after a Homebridge restart

Of course not. You cannot change the serial number of an accessory. You'd need to remove the accessory from HomeKit, remove the accessory from the Homebridge cache (or unexpose the accessory, restart Homebridge, re-expose the accessory, restart Homebridge), and re-pair the accessory. And what for?
The only reason I introduced this setting is so I can have a production and test installation of Homebridge ZP on the same IP network, each exposing the external accessories. If multiple HAP servers expose the same accessory (as defined by the UUID derived from the serial number), Bonjour would choke.

jsiegenthaler commented 3 years ago

In the Readme: (https://github.com/ebaauw/homebridge-zp) it states:

tvPreFix | TV | Prefix for serial number of TV accessories, to enable multiple instances of Homebridge ZP on the same network. which is why I used tvPrefix. I changed to tvIdPrefix and can now change the prefix of the serial number. I guess the Readme needs updating.

And as to why do I want to do this? It's called "completeness".

ebaauw commented 3 years ago

I guess the Readme needs updating.

Indeed. Unfortunately, I need to maintain this at three places: in the code, in config.schema.json (for the Homebridge UI Settings form), and in the README. Missed the last one.

Should only have one place to maintain these, and generate the others automatically. So much to do, so little time...