Reading through the Apple HAP documentation, it's pretty clear that "if a device can dynamically generate pin codes, it should."
To that end, I started playing around with stuff, and a dynamically generated pin code has no drawbacks (other than having to see what value was generated this time around).
I believe the same is true of setup id (which is used for the URL generation in #31 and #30). To that end, I believe that these values should not be stored in the pickle.
The other thing I discovered while developing accessories is that pickle is not a great way of storing stuff, especially during development. It means that if you change a class, or an import, then things can stop working, and you'd need to delete the pickle file and then re-add the accessory. There are also possible security implications of pickling data, but I'm less concerned about that because we aren't unpickling user supplied data.
Reading through the Apple HAP documentation, it's pretty clear that "if a device can dynamically generate pin codes, it should."
To that end, I started playing around with stuff, and a dynamically generated pin code has no drawbacks (other than having to see what value was generated this time around).
I believe the same is true of setup id (which is used for the URL generation in #31 and #30). To that end, I believe that these values should not be stored in the pickle.
The other thing I discovered while developing accessories is that pickle is not a great way of storing stuff, especially during development. It means that if you change a class, or an import, then things can stop working, and you'd need to delete the pickle file and then re-add the accessory. There are also possible security implications of pickling data, but I'm less concerned about that because we aren't unpickling user supplied data.