Skip to content

Commit

Permalink
Merge branch 'dev' into fix/AppThemeColorDarkDefault
Browse files Browse the repository at this point in the history
  • Loading branch information
Nezz authored May 14, 2024
2 parents 416f4e1 + 099ea61 commit ea65652
Show file tree
Hide file tree
Showing 27 changed files with 505 additions and 429 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cast_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
steps:
- name: Check out files from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].5
with:
ref: dev

Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
steps:
- name: Check out files from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].5
with:
ref: master

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].5
- name: Setup Node
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].5
- name: Setup Node
uses: actions/[email protected]
with:
Expand All @@ -76,7 +76,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].5
- name: Setup Node
uses: actions/[email protected]
with:
Expand All @@ -100,7 +100,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].5
- name: Setup Node
uses: actions/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/[email protected].4
uses: actions/[email protected].5
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/demo_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
steps:
- name: Check out files from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].5
with:
ref: dev

Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
steps:
- name: Check out files from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].5
with:
ref: master

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/design_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
steps:
- name: Check out files from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].5

- name: Setup Node
uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/design_preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
if: github.repository == 'home-assistant/frontend' && contains(github.event.pull_request.labels.*.name, 'needs design preview')
steps:
- name: Check out files from GitHub
uses: actions/[email protected].4
uses: actions/[email protected].5

- name: Setup Node
uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
contents: write
steps:
- name: Checkout the repository
uses: actions/[email protected].4
uses: actions/[email protected].5

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
contents: write # Required to upload release assets
steps:
- name: Checkout the repository
uses: actions/[email protected].4
uses: actions/[email protected].5

- name: Verify version
uses: home-assistant/actions/helpers/verify-version@master
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
script/release
- name: Upload release assets
uses: softprops/[email protected].4
uses: softprops/[email protected].5
with:
files: |
dist/*.whl
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/translations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/[email protected].4
uses: actions/[email protected].5

- name: Upload Translations
run: |
Expand Down
508 changes: 254 additions & 254 deletions .yarn/releases/yarn-4.2.1.cjs → .yarn/releases/yarn-4.2.2.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.2.1.cjs
yarnPath: .yarn/releases/yarn-4.2.2.cjs
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
"@polymer/paper-tabs": "3.1.0",
"@polymer/polymer": "3.5.1",
"@thomasloven/round-slider": "0.6.0",
"@vaadin/combo-box": "24.3.11",
"@vaadin/vaadin-themable-mixin": "24.3.11",
"@vaadin/combo-box": "24.3.12",
"@vaadin/vaadin-themable-mixin": "24.3.12",
"@vibrant/color": "3.2.1-alpha.1",
"@vibrant/core": "3.2.1-alpha.1",
"@vibrant/quantizer-mmcq": "3.2.1-alpha.1",
Expand All @@ -112,7 +112,7 @@
"hls.js": "patch:hls.js@npm%3A1.5.7#~/.yarn/patches/hls.js-npm-1.5.7-f5bbd3d060.patch",
"home-assistant-js-websocket": "9.3.0",
"idb-keyval": "6.2.1",
"intl-messageformat": "10.5.11",
"intl-messageformat": "10.5.12",
"js-yaml": "4.1.0",
"leaflet": "1.9.4",
"leaflet-draw": "1.0.4",
Expand Down Expand Up @@ -191,7 +191,7 @@
"@web/dev-server-rollup": "0.4.1",
"babel-loader": "9.1.3",
"babel-plugin-template-html-minifier": "4.1.0",
"chai": "5.1.0",
"chai": "5.1.1",
"del": "7.1.0",
"eslint": "8.57.0",
"eslint-config-airbnb-base": "15.0.0",
Expand All @@ -206,7 +206,7 @@
"eslint-plugin-wc": "2.1.0",
"fancy-log": "2.0.0",
"fs-extra": "11.2.0",
"glob": "10.3.12",
"glob": "10.3.14",
"gulp": "5.0.0",
"gulp-json-transform": "0.5.0",
"gulp-rename": "2.0.0",
Expand All @@ -231,7 +231,7 @@
"rollup-plugin-terser": "7.0.2",
"rollup-plugin-visualizer": "5.12.0",
"serve-handler": "6.1.5",
"sinon": "17.0.1",
"sinon": "17.0.2",
"source-map-url": "0.4.1",
"systemjs": "6.15.1",
"tar": "7.1.0",
Expand All @@ -257,5 +257,5 @@
"[email protected]": "patch:sortablejs@npm%3A1.15.2#~/.yarn/patches/sortablejs-npm-1.15.2-73347ae85a.patch",
"[email protected]": "patch:leaflet-draw@npm%3A1.0.4#./.yarn/patches/leaflet-draw-npm-1.0.4-0ca0ebcf65.patch"
},
"packageManager": "[email protected].1"
"packageManager": "[email protected].2"
}
10 changes: 9 additions & 1 deletion src/common/entity/get_states.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@ export const FIXED_DOMAIN_STATES = {
input_button: [],
lawn_mower: ["error", "paused", "mowing", "docked"],
light: ["on", "off"],
lock: ["jammed", "locked", "locking", "unlocked", "unlocking"],
lock: [
"jammed",
"locked",
"locking",
"unlocked",
"unlocking",
"opening",
"open",
],
media_player: [
"off",
"on",
Expand Down
4 changes: 4 additions & 0 deletions src/data/logbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ export const localizeStateMessage = (
return localize(`${LOGBOOK_LOCALIZE_PATH}.is_locking`);
case "unlocking":
return localize(`${LOGBOOK_LOCALIZE_PATH}.is_unlocking`);
case "opening":
return localize(`${LOGBOOK_LOCALIZE_PATH}.is_opening`);
case "open":
return localize(`${LOGBOOK_LOCALIZE_PATH}.is_opened`);
case "locked":
return localize(`${LOGBOOK_LOCALIZE_PATH}.was_locked`);
case "jammed":
Expand Down
1 change: 1 addition & 0 deletions src/data/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export type ScriptConfig = ManualScriptConfig | BlueprintScriptConfig;

export interface ManualScriptConfig {
alias: string;
description?: string;
sequence: Action | Action[];
icon?: string;
mode?: (typeof MODES)[number];
Expand Down
25 changes: 16 additions & 9 deletions src/data/script_i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,19 @@ const tryDescribeAction = <T extends ActionType>(
const config = action as ActionTypes["service"];

const targets: string[] = [];
if (config.target) {
const targetOrData = config.target || config.data;
if (targetOrData) {
for (const [key, name] of Object.entries({
area_id: "areas",
device_id: "devices",
entity_id: "entities",
floor_id: "floors",
label_id: "labels",
})) {
if (!(key in config.target)) {
if (!(key in targetOrData)) {
continue;
}
const keyConf: string[] = Array.isArray(config.target[key])
? config.target[key]
: [config.target[key]];
const keyConf: string[] = ensureArray(targetOrData[key]) || [];

for (const targetThing of keyConf) {
if (isTemplate(targetThing)) {
Expand Down Expand Up @@ -195,8 +194,12 @@ const tryDescribeAction = <T extends ActionType>(
(config.service && isTemplate(config.service))
) {
return hass.localize(
`${actionTranslationBaseKey}.service.description.service_based_on_template`,
{ targets: formatListWithAnds(hass.locale, targets) }
targets.length
? `${actionTranslationBaseKey}.service.description.service_based_on_template`
: `${actionTranslationBaseKey}.service.description.service_based_on_template_no_targets`,
{
targets: formatListWithAnds(hass.locale, targets),
}
);
}

Expand All @@ -208,7 +211,9 @@ const tryDescribeAction = <T extends ActionType>(

if (config.metadata) {
return hass.localize(
`${actionTranslationBaseKey}.service.description.service_name`,
targets.length
? `${actionTranslationBaseKey}.service.description.service_name`
: `${actionTranslationBaseKey}.service.description.service_name_no_targets`,
{
domain: domainToName(hass.localize, domain),
name: service || config.service,
Expand All @@ -218,7 +223,9 @@ const tryDescribeAction = <T extends ActionType>(
}

return hass.localize(
`${actionTranslationBaseKey}.service.description.service_based_on_name`,
targets.length
? `${actionTranslationBaseKey}.service.description.service_based_on_name`
: `${actionTranslationBaseKey}.service.description.service_based_on_name_no_targets`,
{
name: service
? `${domainToName(hass.localize, domain)}: ${service}`
Expand Down
2 changes: 2 additions & 0 deletions src/fake_data/entity_component_icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ export const ENTITY_COMPONENT_ICONS: Record<string, ComponentIcons> = {
locking: "mdi:lock-clock",
unlocked: "mdi:lock-open",
unlocking: "mdi:lock-clock",
opening: "mdi:lock-clock",
open: "mdi:lock-open-variant",
},
},
},
Expand Down
13 changes: 9 additions & 4 deletions src/panels/config/automation/blueprint-automation-editor.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import "@material/mwc-button/mwc-button";
import { HassEntity } from "home-assistant-js-websocket";
import { html } from "lit";
import { html, nothing } from "lit";
import { customElement, property } from "lit/decorators";
import "../../../components/ha-alert";
import { BlueprintAutomationConfig } from "../../../data/automation";
import { fetchBlueprints } from "../../../data/blueprint";
import { HaBlueprintGenericEditor } from "../blueprint/blueprint-generic-editor";
import "../../../components/ha-markdown";

@customElement("blueprint-automation-editor")
export class HaBlueprintAutomationEditor extends HaBlueprintGenericEditor {
Expand All @@ -26,7 +27,7 @@ export class HaBlueprintAutomationEditor extends HaBlueprintGenericEditor {
${this.hass.localize("ui.panel.config.automation.editor.migrate")}
</mwc-button>
</ha-alert>`
: ""}
: nothing}
${this.stateObj?.state === "off"
? html`
<ha-alert alert-type="info">
Expand All @@ -42,8 +43,12 @@ export class HaBlueprintAutomationEditor extends HaBlueprintGenericEditor {
`
: ""}
${this.config.description
? html`<p class="description">${this.config.description}</p>`
: ""}
? html`<ha-markdown
class="description"
breaks
.content=${this.config.description}
></ha-markdown>`
: nothing}
${this.renderCard()}
`;
}
Expand Down
4 changes: 2 additions & 2 deletions src/panels/config/automation/manual-automation-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ export class HaManualAutomationEditor extends LitElement {
</mwc-button>
</ha-alert>
`
: ""}
: nothing}
${this.config.description
? html`<ha-markdown
class="description"
breaks
.content=${this.config.description}
></ha-markdown>`
: ""}
: nothing}
<div class="header">
<h2 id="triggers-heading" class="name">
${this.hass.localize(
Expand Down
13 changes: 11 additions & 2 deletions src/panels/config/script/blueprint-script-editor.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { html } from "lit";
import "@material/mwc-button/mwc-button";
import { html, nothing } from "lit";
import { customElement, property } from "lit/decorators";
import "../../../components/ha-alert";
import { BlueprintScriptConfig } from "../../../data/script";
import { fetchBlueprints } from "../../../data/blueprint";
import { HaBlueprintGenericEditor } from "../blueprint/blueprint-generic-editor";
import "../../../components/ha-markdown";

@customElement("blueprint-script-editor")
export class HaBlueprintScriptEditor extends HaBlueprintGenericEditor {
Expand All @@ -22,7 +24,14 @@ export class HaBlueprintScriptEditor extends HaBlueprintGenericEditor {
${this.hass.localize("ui.panel.config.script.editor.migrate")}
</mwc-button>
</ha-alert>`
: ""}
: nothing}
${this.config.description
? html`<ha-markdown
class="description"
breaks
.content=${this.config.description}
></ha-markdown>`
: nothing}
${this.renderCard()}
`;
}
Expand Down
Loading

0 comments on commit ea65652

Please sign in to comment.