lwitzani / homebridgeStatusWidget

MIT License
371 stars 143 forks source link

multiple instances cross notifi about update #36

Closed simon-bd closed 2 years ago

simon-bd commented 3 years ago

I have 2 homebridge instances running, one where I'm currently waiting to update node.js because I wanted to display the error I'm getting, when one of the scriptable discover a new version of node.js the notification comes about an available update, one the next with the updated node.js refreshes it sees it as if the first instance was updated :)

lwitzani commented 3 years ago

Hi, yes i have the same setup and know this problem with the current code. Currently you would need to have the script two times in scriptable and change line 109 which is

const NOTIFICATION_JSON_FILE_NAME = 'notificationState.json';

to a unique value in each script (setup each widget with one of the scripts)

A solution to this would be to put that variable in the configuration, but i didnt do it yet since it will make the old configurations invalid and people will loose their config if they update the code (unless i also write code that migrates old config versions). I know i should fix it ;) but the workaround is easy

simon-bd commented 3 years ago

Worked like a charm!