Compare commits

...

10 Commits

Author SHA1 Message Date
Ludeeus a6f8f0495c Do not show skip if entity support auto update 2022-03-31 16:12:48 +00:00
Bram Kragten ba8b20d877 Fix url config when not logged in to cloud (#12176) 2022-03-31 10:59:44 -05:00
Bram Kragten 8de542388f Show hidden entities on device page (#12177) 2022-03-31 10:59:20 -05:00
Raman Gupta e6c580aadc Add zwave-js node alerts to device configuration page (#12173)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2022-03-31 09:06:47 -05:00
Joakim Sørensen 11696c566a Add support for my backup links (#12172) 2022-03-31 09:05:39 -05:00
Joakim Sørensen edc15940a2 Add icon to add-on picker (#12174) 2022-03-31 15:16:19 +02:00
Joakim Sørensen bf35ee549d Only use the state to mark updates as pending (#12171) 2022-03-31 15:15:21 +02:00
Philip Allgaier 4c3baa678c Bump caniuse-lite (#12168) 2022-03-30 17:12:22 -05:00
Philip Allgaier 0bb2767696 Add missing labels to media player volume buttons (#12170) 2022-03-30 17:11:50 -05:00
Philip Allgaier 80a4852325 Add missing label for new statistics "adjust sum" button (#12169) 2022-03-30 17:11:23 -05:00
14 changed files with 93 additions and 35 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ export const mockHassioSupervisor = (hass: MockHomeAssistant) => {
version_latest: "3.6.2",
update_available: false,
repository: "a0d7b954",
icon: true,
icon: false,
logo: true,
},
{
Binary file not shown.
+7
View File
@@ -6,6 +6,7 @@ import {
UPDATE_SUPPORT_PROGRESS,
UPDATE_SUPPORT_INSTALL,
UPDATE_SUPPORT_RELEASE_NOTES,
UPDATE_SUPPORT_AUTO_UPDATE,
} from "../../../../src/data/update";
import "../../../../src/dialogs/more-info/more-info-content";
import { getEntity } from "../../../../src/fake_data/entity";
@@ -128,6 +129,12 @@ const ENTITIES = [
supported_features:
base_attributes.supported_features + UPDATE_SUPPORT_RELEASE_NOTES,
}),
getEntity("update", "update18", "on", {
...base_attributes,
friendly_name: "Update with auto update",
supported_features:
base_attributes.supported_features + UPDATE_SUPPORT_AUTO_UPDATE,
}),
];
@customElement("demo-more-info-update")
+4 -1
View File
@@ -13,9 +13,12 @@ import { HaComboBox } from "./ha-combo-box";
const rowRenderer: ComboBoxLitRenderer<HassioAddonInfo> = (
item
) => html`<mwc-list-item twoline>
) => html`<mwc-list-item twoline graphic="icon">
<span>${item.name}</span>
<span slot="secondary">${item.slug}</span>
${item.icon
? html`<img slot="graphic" .src="/api/hassio/addons/${item.slug}/icon" />`
: ""}
</mwc-list-item>`;
@customElement("ha-addon-picker")
+4 -3
View File
@@ -2,6 +2,7 @@ import type {
HassEntityAttributeBase,
HassEntityBase,
} from "home-assistant-js-websocket";
import { BINARY_STATE_ON } from "../common/const";
import { supportsFeature } from "../common/entity/supports-feature";
import { HomeAssistant } from "../types";
@@ -10,6 +11,7 @@ export const UPDATE_SUPPORT_SPECIFIC_VERSION = 2;
export const UPDATE_SUPPORT_PROGRESS = 4;
export const UPDATE_SUPPORT_BACKUP = 8;
export const UPDATE_SUPPORT_RELEASE_NOTES = 16;
export const UPDATE_SUPPORT_AUTO_UPDATE = 32;
interface UpdateEntityAttributes extends HassEntityAttributeBase {
current_version: string | null;
@@ -30,9 +32,8 @@ export const updateUsesProgress = (entity: UpdateEntity): boolean =>
typeof entity.attributes.in_progress === "number";
export const updateCanInstall = (entity: UpdateEntity): boolean =>
supportsFeature(entity, UPDATE_SUPPORT_INSTALL) &&
entity.attributes.latest_version !== entity.attributes.current_version &&
entity.attributes.latest_version !== entity.attributes.skipped_version;
entity.state === BINARY_STATE_ON &&
supportsFeature(entity, UPDATE_SUPPORT_INSTALL);
export const updateIsInstalling = (entity: UpdateEntity): boolean =>
updateUsesProgress(entity) || !!entity.attributes.in_progress;
+6
View File
@@ -167,12 +167,18 @@ export interface ZwaveJSNodeMetadata {
wakeup: string;
reset: string;
device_database_url: string;
comments: ZWaveJSNodeComment[];
}
export interface ZWaveJSNodeConfigParams {
[key: string]: ZWaveJSNodeConfigParam;
}
export interface ZWaveJSNodeComment {
level: "info" | "warning" | "error";
text: string;
}
export interface ZWaveJSNodeConfigParam {
property: number;
value: any;
@@ -96,6 +96,13 @@ class MoreInfoMediaPlayer extends LitElement {
.path=${stateObj.attributes.is_volume_muted
? mdiVolumeOff
: mdiVolumeHigh}
.label=${this.hass.localize(
`ui.card.media_player.${
stateObj.attributes.is_volume_muted
? "media_volume_unmute"
: "media_volume_mute"
}`
)}
@click=${this._toggleMute}
></ha-icon-button>
`
@@ -105,11 +112,17 @@ class MoreInfoMediaPlayer extends LitElement {
<ha-icon-button
action="volume_down"
.path=${mdiVolumeMinus}
.label=${this.hass.localize(
"ui.card.media_player.media_volume_down"
)}
@click=${this._handleClick}
></ha-icon-button>
<ha-icon-button
action="volume_up"
.path=${mdiVolumePlus}
.label=${this.hass.localize(
"ui.card.media_player.media_volume_up"
)}
@click=${this._handleClick}
></ha-icon-button>
`
@@ -14,6 +14,7 @@ import {
UpdateEntity,
updateIsInstalling,
updateReleaseNotes,
UPDATE_SUPPORT_AUTO_UPDATE,
UPDATE_SUPPORT_BACKUP,
UPDATE_SUPPORT_INSTALL,
UPDATE_SUPPORT_PROGRESS,
@@ -130,14 +131,16 @@ class MoreInfoUpdate extends LitElement {
: ""}
<hr />
<div class="actions">
<mwc-button
@click=${this._handleSkip}
.disabled=${skippedVersion ||
this.stateObj.state === "off" ||
updateIsInstalling(this.stateObj)}
>
${this.hass.localize("ui.dialogs.more_info_control.update.skip")}
</mwc-button>
${supportsFeature(this.stateObj, UPDATE_SUPPORT_AUTO_UPDATE)
? ""
: html`<mwc-button
@click=${this._handleSkip}
.disabled=${skippedVersion ||
this.stateObj.state === "off" ||
updateIsInstalling(this.stateObj)}
>
${this.hass.localize("ui.dialogs.more_info_control.update.skip")}
</mwc-button>`}
${supportsFeature(this.stateObj, UPDATE_SUPPORT_INSTALL)
? html`
<mwc-button
+1 -1
View File
@@ -246,8 +246,8 @@ class ConfigUrlForm extends LitElement {
if (isComponentLoaded(this.hass, "cloud")) {
fetchCloudStatus(this.hass).then((cloudStatus) => {
this._cloudStatus = cloudStatus;
if (cloudStatus.logged_in) {
this._cloudStatus = cloudStatus;
this._showCustomExternalUrl = this._externalUrlValue !== null;
}
});
@@ -75,7 +75,7 @@ export class HaDeviceEntitiesCard extends LitElement {
this._entityRows = [];
this.entities.forEach((entry) => {
if (entry.disabled_by || entry.hidden_by) {
if (entry.disabled_by) {
if (this._extDisabledEntityEntries) {
hiddenEntities.push(
this._extDisabledEntityEntries[entry.entity_id] || entry
@@ -167,7 +167,11 @@ export class HaDeviceEntitiesCard extends LitElement {
computeStateName(stateObj),
this.deviceName.toLowerCase()
);
if (name) {
if (entry.hidden_by) {
config.name = `${
name || computeStateName(stateObj)
} (${this.hass.localize("ui.panel.config.devices.entities.hidden")})`;
} else if (name) {
config.name = name;
}
}
@@ -19,6 +19,7 @@ import { customElement, property, state } from "lit/decorators";
import { classMap } from "lit/directives/class-map";
import memoizeOne from "memoize-one";
import { debounce } from "../../../../../common/util/debounce";
import "../../../../../components/ha-alert";
import "../../../../../components/ha-card";
import "../../../../../components/ha-icon-next";
import "../../../../../components/ha-select";
@@ -130,7 +131,7 @@ class ZWaveJSNodeConfig extends SubscribeMixin(LitElement) {
></hass-error-screen>`;
}
if (!this._config) {
if (!this._config || !this._nodeMetadata) {
return html`<hass-loading-screen></hass-loading-screen>`;
}
@@ -178,20 +179,27 @@ class ZWaveJSNodeConfig extends SubscribeMixin(LitElement) {
</em>
</p>
</div>
<ha-card>
${this._config
? html`
${Object.entries(this._config).map(
([id, item]) => html` <ha-settings-row
class="config-item"
.configId=${id}
.narrow=${this.narrow}
>
${this._generateConfigBox(id, item)}
</ha-settings-row>`
${this._nodeMetadata.comments.length > 0
? html`
<div>
${this._nodeMetadata.comments.map(
(comment) => html`<ha-alert .alertType=${comment.level}>
${comment.text}
</ha-alert>`
)}
`
: ``}
</div>
`
: ``}
<ha-card>
${Object.entries(this._config).map(
([id, item]) => html` <ha-settings-row
class="config-item"
.configId=${id}
.narrow=${this.narrow}
>
${this._generateConfigBox(id, item)}
</ha-settings-row>`
)}
</ha-card>
</ha-config-section>
</hass-tabs-subpage>
+11
View File
@@ -117,6 +117,10 @@ const REDIRECTS: Redirects = {
component: "lovelace",
redirect: "/config/lovelace/resources",
},
backup: {
component: "backup",
redirect: "/config/backup",
},
people: {
component: "person",
redirect: "/config/person",
@@ -184,6 +188,13 @@ class HaPanelMy extends LitElement {
super.connectedCallback();
const path = this.route.path.substring(1);
if (path === "backup" && isComponentLoaded(this.hass, "hassio")) {
navigate("/hassio/backups", {
replace: true,
});
return;
}
if (path.startsWith("supervisor")) {
if (!isComponentLoaded(this.hass, "hassio")) {
this._error = "no_supervisor";
+4 -2
View File
@@ -2463,7 +2463,8 @@
"add_entities_lovelace": "Add to dashboard",
"none": "This device has no entities",
"show_less": "Show less",
"hidden_entities": "+{count} {count, plural,\n one {entity}\n other {entities}\n} not shown"
"hidden_entities": "+{count} {count, plural,\n one {entity}\n other {entities}\n} not shown",
"hidden": "Hidden"
},
"confirm_rename_entity_ids": "Do you also want to rename the entity IDs of your entities?",
"confirm_rename_entity_ids_warning": "This will not change any configuration (like automations, scripts, scenes, dashboards) that is currently using these entities! You will have to update them yourself to use the new entity IDs!",
@@ -4049,7 +4050,8 @@
"update": "Update the historic statistic values from ''{metadata_unit}'' to ''{state_unit}''",
"clear": "Delete all old statistic data for this entity"
}
}
},
"adjust_sum": "Adjust sum"
}
}
},
+3 -3
View File
@@ -5915,9 +5915,9 @@ __metadata:
linkType: hard
"caniuse-lite@npm:^1.0.30001259":
version: 1.0.30001261
resolution: "caniuse-lite@npm:1.0.30001261"
checksum: d894662312ecbdd772f0a258c4a45cac93605247b127b25649052353e0b981abfd0b445f469650943b612adc236fd510ae61c1293f3e77c68af7411d1b66574a
version: 1.0.30001322
resolution: "caniuse-lite@npm:1.0.30001322"
checksum: 48609d1808c69034a74ab6df9db8cffd847e12da6979e150f364cc8e2a4310fce1f2811382ca57b3b4111c0182f7c67edfde3cd4159c29537fc232596aecf48b
languageName: node
linkType: hard