Add more domains to sensor group, strip device name from disabled entities (#10490)

This commit is contained in:
Bram Kragten 2021-11-01 15:55:55 +01:00 committed by GitHub
parent 5851fe26ff
commit 3cf9b745b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -152,7 +152,14 @@ export class HaDeviceEntitiesCard extends LitElement {
.path=${domainIcon(computeDomain(entry.entity_id))}
></ha-svg-icon>
<paper-item-body>
<div class="name">${entry.stateName || entry.entity_id}</div>
<div class="name">
${entry.stateName
? stripPrefixFromEntityName(
entry.stateName,
`${this.deviceName} `.toLowerCase()
)
: entry.entity_id}
</div>
</paper-item-body>
</paper-icon-item>
`;

View File

@ -121,7 +121,13 @@ export class HaConfigDevicePage extends LitElement {
const result = groupBy(entities, (entry) =>
entry.entity_category
? entry.entity_category
: ["sensor", "binary_sensor"].includes(computeDomain(entry.entity_id))
: [
"sensor",
"binary_sensor",
"camera",
"device_tracker",
"weather",
].includes(computeDomain(entry.entity_id))
? "sensor"
: "control"
) as Record<