chrivers / bifrost

Hue Bridge Emulator
GNU General Public License v3.0
117 stars 5 forks source link

Implement proper support for `id_v1` and v1 api #23

Closed chrivers closed 1 month ago

chrivers commented 1 month ago

So far, bifrost only supported barely enough of the v1 api to find a bridge, which is needed by the hue app.

Other apps, like Hue Essentials, still depend heavily on the v1 api, and did not work with bifrost.

One issue is that bifrost tried to use UUIDs for id_v1, which is (maybe?) valid according to the spec, but many clients expect a decimal number (in string form).

So we build an internal id_v1 index tracker, to generate these ids as needed, and implement the necessary endpoints to interact with lights, rooms and scenes.

This brings Hue Essentials mostly up to par with the Hue App.

chrivers commented 1 month ago

Fixed the last issue I had with this branch: State file upgrading.

The state file (state.yaml, unless specified otherwise in the config) has had two unnamed fields in previous versions of bifrost.

Now, it gains a version field, and it is automatically upgraded when a newer bifrost release runs. A backup of the old state file is saved, in case the user wants to go back to the previous bifrost.