mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Limit iqs indicator to colors only (#23026)
This commit is contained in:
parent
988fa3e4e4
commit
8c7fcc725c
@ -38,7 +38,14 @@ export interface IntegrationManifest {
|
||||
homekit?: { models: string[] };
|
||||
integration_type?: IntegrationType;
|
||||
loggers?: string[];
|
||||
quality_scale?: "bronze" | "gold" | "internal" | "platinum" | "silver";
|
||||
quality_scale?:
|
||||
| "bronze"
|
||||
| "gold"
|
||||
| "internal"
|
||||
| "platinum"
|
||||
| "silver"
|
||||
| "custom"
|
||||
| "no_score";
|
||||
iot_class:
|
||||
| "assumed_state"
|
||||
| "cloud_polling"
|
||||
|
@ -108,6 +108,9 @@ import { fileDownload } from "../../../util/file_download";
|
||||
import type { DataEntryFlowProgressExtended } from "./ha-config-integrations";
|
||||
import { showAddIntegrationDialog } from "./show-add-integration-dialog";
|
||||
|
||||
type MedalColor = "gold" | "silver" | "bronze" | "platinum";
|
||||
const MEDAL_COLORS = ["bronze", "silver", "gold", "platinum"];
|
||||
|
||||
export const renderConfigEntryError = (
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry
|
||||
@ -341,7 +344,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
|
||||
? html`<div class="version">${this._manifest.version}</div>`
|
||||
: nothing}
|
||||
${this._manifest?.quality_scale &&
|
||||
this._manifest?.quality_scale !== "internal"
|
||||
MEDAL_COLORS.includes(this._manifest.quality_scale)
|
||||
? html`
|
||||
<div class="quality-scale integration-info">
|
||||
<ha-svg-icon
|
||||
@ -352,7 +355,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
|
||||
></ha-svg-icon>
|
||||
<span>
|
||||
${this.hass.localize(
|
||||
`ui.panel.config.integrations.config_entry.${this._manifest.quality_scale}_quality`,
|
||||
`ui.panel.config.integrations.config_entry.${this._manifest.quality_scale as MedalColor}_quality`,
|
||||
{
|
||||
quality_scale: html`
|
||||
<a
|
||||
|
Loading…
x
Reference in New Issue
Block a user