mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +00:00
Shorten Entity Name in Aussie Broadband (#74946)
This commit is contained in:
parent
6fd47d035e
commit
01ca7f657c
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
import re
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
@ -152,7 +153,7 @@ class AussieBroadandSensorEntity(CoordinatorEntity, SensorEntity):
|
|||||||
identifiers={(DOMAIN, service[SERVICE_ID])},
|
identifiers={(DOMAIN, service[SERVICE_ID])},
|
||||||
manufacturer="Aussie Broadband",
|
manufacturer="Aussie Broadband",
|
||||||
configuration_url=f"https://my.aussiebroadband.com.au/#/{service['name'].lower()}/{service[SERVICE_ID]}/",
|
configuration_url=f"https://my.aussiebroadband.com.au/#/{service['name'].lower()}/{service[SERVICE_ID]}/",
|
||||||
name=service["description"],
|
name=re.sub(r" - AVC\d+$", "", service["description"]),
|
||||||
model=service["name"],
|
model=service["name"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ from tests.common import MockConfigEntry
|
|||||||
FAKE_SERVICES = [
|
FAKE_SERVICES = [
|
||||||
{
|
{
|
||||||
"service_id": "12345678",
|
"service_id": "12345678",
|
||||||
"description": "Fake ABB NBN Service",
|
"description": "Fake ABB NBN Service - AVC123456789",
|
||||||
"type": "NBN",
|
"type": "NBN",
|
||||||
"name": "NBN",
|
"name": "NBN",
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user