Conversation
vanHoesel
left a comment
There was a problem hiding this comment.
I consider to release my clone with the 'add-color' branch merged. If you can update your changes, I will merge yours into my repo. And push it out as a new 'official' release, as this one has become stale.
| this.name = json.device_name; | ||
| this.uuid = json.uuid; | ||
| if (json.uuid == "00000000-0000-0000-0000-000000000000") { | ||
| this.uuid = `00000000-0000-1000-8000-${json.mac.replaceAll(":", "")}`; |
There was a problem hiding this comment.
I would suggest to just use zeroes instead of the '1000' and the '8000' sequence in the time-stamp part, and ignore 'versions' etc.
| this.name = json.device_name; | ||
| this.uuid = json.uuid; | ||
| if (json.uuid == "00000000-0000-0000-0000-000000000000") { | ||
| this.uuid = `00000000-0000-1000-8000-${json.mac.replaceAll(":", "")}`; |
There was a problem hiding this comment.
Please add .toUpper() to prettify the output as it is in the twinkly controllers
|
I looooove your changes, this was something bothering me for a while. Excited you have fixed it already!! |
| this.name = json.device_name; | ||
| this.uuid = json.uuid; | ||
| if (json.uuid == "00000000-0000-0000-0000-000000000000") { | ||
| this.uuid = `00000000-0000-1000-8000-${json.mac.replaceAll(":", "")}`; |
There was a problem hiding this comment.
replaceAl(":" ... must be replace(/:/g ... , since we need to support node.js v14
|
I've included this pull request with some minor changes: |
I have three Twinkly lights. Two are
TW175SEUM06and one isTW175SEUP07.The two
TW175SEUM06report"uuid":"00000000-0000-0000-0000-000000000000"and hence the plugin kept sayingFound known deviceIP address changed toand alternating between the IPs of the twoTW175SEUM06s.For reference:
This PR generates a deterministic UUID version1 from the MAC address of the Twinkly if a nil UUID is detected.
My two
TW175SEUM06are now uniquely identifiable and all appears to be working: