brutella / hc

hc is a lightweight framework to develop HomeKit accessories in Go.
Apache License 2.0
1.74k stars 189 forks source link

Quotation mark in accessory name prevents it from being added #192

Open joeshaw opened 3 years ago

joeshaw commented 3 years ago

Create an accessory with its accessory.Info Name field containing a quotation mark. (For me, it was 32" Roku TV.) Attempting to add the device times out. I expect this is due to an escaping problem of some sort with DNS-SD.

Currently hc converts spaces to underscores. If I add a similar replacement that strips the quotation mark, things work fine. But I'm not sure if this is the right fix.

With this replacement in place, when I add the accessory and I'm asked to name it, it doesn't have the quotation mark. I tried to add it back in and Home.app said that names cannot contain special characters.

Possibly related to #141.