Migrate WLED to new entity naming style (#74860)

This commit is contained in:
Franck Nijhof 2022-07-10 23:56:48 +02:00 committed by GitHub
parent 176e2754ec
commit f15d3fc5db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 28 additions and 33 deletions

View file

@ -71,11 +71,8 @@ class WLEDNumber(WLEDEntity, NumberEntity):
# Segment 0 uses a simpler name, which is more natural for when using
# a single segment / using WLED with one big LED strip.
self._attr_name = (
f"{coordinator.data.info.name} Segment {segment} {description.name}"
)
if segment == 0:
self._attr_name = f"{coordinator.data.info.name} {description.name}"
if segment != 0:
self._attr_name = f"Segment {segment} {description.name}"
self._attr_unique_id = (
f"{coordinator.data.info.mac_address}_{description.key}_{segment}"