mirror of
https://github.com/home-assistant/frontend.git
synced 2025-09-16 16:39:48 +00:00
Compare commits
12 Commits
dashboard_
...
20240610.1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f43319a3ae | ||
![]() |
e8eefaf1d3 | ||
![]() |
06d82a4925 | ||
![]() |
4991d52fcc | ||
![]() |
0b391eafcf | ||
![]() |
0bb34830f8 | ||
![]() |
4a8bb5034d | ||
![]() |
a8366c6416 | ||
![]() |
8ff8c01bba | ||
![]() |
52f3ff3306 | ||
![]() |
10a5c4dfb4 | ||
![]() |
1a2daf8a7a |
@@ -157,7 +157,7 @@ module.exports.babelOptions = ({ latestBuild, isProdBuild, isTestBuild }) => ({
|
||||
exclude: [
|
||||
path.join(paths.polymer_dir, "src/resources/polyfills"),
|
||||
...[
|
||||
"@formatjs/intl-\\w+",
|
||||
"@formatjs/(?:ecma402-abstract|intl-\\w+)",
|
||||
"@lit-labs/virtualizer/polyfills",
|
||||
"@webcomponents/scoped-custom-element-registry",
|
||||
"element-internals-polyfill",
|
||||
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "home-assistant-frontend"
|
||||
version = "20240610.0"
|
||||
version = "20240610.1"
|
||||
license = {text = "Apache-2.0"}
|
||||
description = "The Home Assistant frontend"
|
||||
readme = "README.md"
|
||||
|
@@ -754,7 +754,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
|
||||
${item.disabled_by && devices.length
|
||||
? html`
|
||||
<ha-menu-item
|
||||
.href=${devices.length === 1
|
||||
href=${devices.length === 1
|
||||
? `/config/devices/device/${devices[0].id}`
|
||||
: `/config/devices/dashboard?historyBack=1&config_entry=${item.entry_id}`}
|
||||
>
|
||||
@@ -769,7 +769,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
|
||||
: ""}
|
||||
${item.disabled_by && services.length
|
||||
? html`<ha-menu-item
|
||||
.href=${services.length === 1
|
||||
href=${services.length === 1
|
||||
? `/config/devices/device/${services[0].id}`
|
||||
: `/config/devices/dashboard?historyBack=1&config_entry=${item.entry_id}`}
|
||||
>
|
||||
@@ -787,7 +787,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
|
||||
${item.disabled_by && entities.length
|
||||
? html`
|
||||
<ha-menu-item
|
||||
.href=${`/config/entities?historyBack=1&config_entry=${item.entry_id}`}
|
||||
href=${`/config/entities?historyBack=1&config_entry=${item.entry_id}`}
|
||||
>
|
||||
<ha-svg-icon
|
||||
.path=${mdiShapeOutline}
|
||||
@@ -827,7 +827,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
|
||||
${this._diagnosticHandler && item.state === "loaded"
|
||||
? html`
|
||||
<ha-menu-item
|
||||
.href=${getConfigEntryDiagnosticsDownloadUrl(item.entry_id)}
|
||||
href=${getConfigEntryDiagnosticsDownloadUrl(item.entry_id)}
|
||||
target="_blank"
|
||||
@click=${this._signUrl}
|
||||
>
|
||||
@@ -1414,14 +1414,17 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
|
||||
ha-alert:first-of-type {
|
||||
margin-top: 16px;
|
||||
}
|
||||
ha-list-item-new {
|
||||
position: relative;
|
||||
}
|
||||
ha-list-item-new.discovered {
|
||||
height: 72px;
|
||||
}
|
||||
ha-list-item-new.config_entry::after {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 8px;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
opacity: 0.12;
|
||||
pointer-events: none;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
export const filterModes = (
|
||||
supportedModes: string[] | undefined,
|
||||
selectedModes: string[] | undefined
|
||||
): string[] =>
|
||||
export const filterModes = <T extends string = string>(
|
||||
supportedModes: T[] | undefined,
|
||||
selectedModes: T[] | undefined
|
||||
): T[] =>
|
||||
selectedModes
|
||||
? selectedModes.filter((mode) => (supportedModes || []).includes(mode))
|
||||
: supportedModes || [];
|
||||
|
@@ -6,7 +6,6 @@ import { styleMap } from "lit/directives/style-map";
|
||||
import memoizeOne from "memoize-one";
|
||||
import { computeDomain } from "../../../common/entity/compute_domain";
|
||||
import { stateColorCss } from "../../../common/entity/state_color";
|
||||
import { supportsFeature } from "../../../common/entity/supports-feature";
|
||||
import "../../../components/ha-control-button";
|
||||
import "../../../components/ha-control-button-group";
|
||||
import "../../../components/ha-control-select";
|
||||
@@ -70,37 +69,18 @@ class HuiAlarmModeCardFeature
|
||||
}
|
||||
}
|
||||
|
||||
private _modes = memoizeOne(
|
||||
(
|
||||
stateObj: AlarmControlPanelEntity,
|
||||
selectedModes: AlarmMode[] | undefined
|
||||
) => {
|
||||
if (!selectedModes) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return (Object.keys(ALARM_MODES) as AlarmMode[]).filter((mode) => {
|
||||
const feature = ALARM_MODES[mode].feature;
|
||||
return (
|
||||
(!feature || supportsFeature(stateObj, feature)) &&
|
||||
selectedModes.includes(mode)
|
||||
);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
private _getCurrentMode(stateObj: AlarmControlPanelEntity) {
|
||||
return this._modes(stateObj, this._config?.modes).find(
|
||||
(mode) => mode === stateObj.state
|
||||
);
|
||||
}
|
||||
private _getCurrentMode = memoizeOne((stateObj: AlarmControlPanelEntity) => {
|
||||
const supportedModes = supportedAlarmModes(stateObj);
|
||||
return supportedModes.find((mode) => mode === stateObj.state);
|
||||
});
|
||||
|
||||
private async _valueChanged(ev: CustomEvent) {
|
||||
if (!this.stateObj) return;
|
||||
const mode = (ev.detail as any).value as AlarmMode;
|
||||
|
||||
if (mode === this.stateObj!.state) return;
|
||||
if (mode === this.stateObj.state) return;
|
||||
|
||||
const oldMode = this._getCurrentMode(this.stateObj!);
|
||||
const oldMode = this._getCurrentMode(this.stateObj);
|
||||
this._currentMode = mode;
|
||||
|
||||
try {
|
||||
@@ -153,6 +133,7 @@ class HuiAlarmModeCardFeature
|
||||
</ha-control-button-group>
|
||||
`;
|
||||
}
|
||||
|
||||
return html`
|
||||
<div class="container">
|
||||
<ha-control-select
|
||||
|
@@ -37,15 +37,16 @@ const HIDE_DOMAIN = new Set([
|
||||
"configurator",
|
||||
"conversation",
|
||||
"device_tracker",
|
||||
"event",
|
||||
"geo_location",
|
||||
"notify",
|
||||
"persistent_notification",
|
||||
"script",
|
||||
"sun",
|
||||
"zone",
|
||||
"event",
|
||||
"tts",
|
||||
"stt",
|
||||
"sun",
|
||||
"todo",
|
||||
"tts",
|
||||
"zone",
|
||||
]);
|
||||
|
||||
const HIDE_PLATFORM = new Set(["mobile_app"]);
|
||||
|
Reference in New Issue
Block a user