Sfoglia il codice sorgente

filter "home-assistant-entity-registry": also shorten samsung tv uuids

The same UPnP device UUID that is already shortened in the config entries and the device registry is used as the entity unique id.

The matter rule is merged into the same loop without changing its behavior.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fabian Peter Hammerle 1 mese fa
parent
commit
b90c362319
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      gitconfig

+ 1 - 1
gitconfig

@@ -68,7 +68,7 @@
 	smudge = cat
 
 [filter "home-assistant-entity-registry"]
-	clean = "jq '((.data.entities[]?, .data.deleted_entities[]?) | select(.platform == \"matter\" and .unique_id != null) | .unique_id) |= sub(\"^(?<p>[[:xdigit:]]{6})[[:xdigit:]]{10}(?=-[[:xdigit:]]{16}-)\"; \"\\(.p)…\")' | eval \"$(git config --get filter.truncate-mac-address-to-24-bits.clean)\""
+	clean = "jq '((.data.entities[]?, .data.deleted_entities[]?) | select(.unique_id != null)) |= if .platform == \"matter\" then .unique_id |= sub(\"^(?<p>[[:xdigit:]]{6})[[:xdigit:]]{10}(?=-[[:xdigit:]]{16}-)\"; \"\\(.p)…\") elif .platform == \"samsungtv\" then .unique_id |= sub(\"^(?<p>[[:xdigit:]]{2})[[:xdigit:]]{6}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}$\"; \"\\(.p)…\") else . end' | eval \"$(git config --get filter.truncate-mac-address-to-24-bits.clean)\""
 	smudge = cat
 	required = true