Skip to content

Commit 56913a1

Browse files
authored
Merge pull request #148 from sviete/beta
20210707.2
2 parents 06cda5f + b1d47db commit 56913a1

File tree

199 files changed

+14700
-4644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+14700
-4644
lines changed

.github/workflows/release.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
- published
77

88
env:
9-
WHEELS_TAG: 3.8-alpine3.12
109
PYTHON_VERSION: 3.8
1110
NODE_VERSION: 12.1
1211

@@ -64,6 +63,9 @@ jobs:
6463
strategy:
6564
matrix:
6665
arch: ["aarch64", "armhf", "armv7", "amd64", "i386"]
66+
tag:
67+
- "3.8-alpine3.12"
68+
- "3.9-alpine3.13"
6769
steps:
6870
- name: Download requirements.txt
6971
uses: actions/download-artifact@v2
@@ -73,7 +75,7 @@ jobs:
7375
- name: Build wheels
7476
uses: home-assistant/wheels@master
7577
with:
76-
tag: ${{ env.WHEELS_TAG }}
78+
tag: ${{ matrix.tag }}
7779
arch: ${{ matrix.arch }}
7880
wheels-host: ${{ secrets.WHEELS_HOST }}
7981
wheels-key: ${{ secrets.WHEELS_KEY }}

build-scripts/bundle.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ const paths = require("./paths.js");
55

66
// Files from NPM Packages that should not be imported
77
module.exports.ignorePackages = ({ latestBuild }) => [
8-
// Bloats bundle and it's not used.
9-
path.resolve(require.resolve("moment"), "../locale"),
108
// Part of yaml.js and only used for !!js functions that we don't use
119
require.resolve("esprima"),
1210
];

build-scripts/gulp/entry-html.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,15 +302,23 @@ gulp.task("gen-index-hassio-prod", async () => {
302302

303303
function writeHassioEntrypoint(latestEntrypoint, es5Entrypoint) {
304304
fs.mkdirSync(paths.hassio_output_root, { recursive: true });
305+
// Safari 12 and below does not have a compliant ES2015 implementation of template literals, so we ship ES5
305306
fs.writeFileSync(
306307
path.resolve(paths.hassio_output_root, "entrypoint.js"),
307308
`
308-
try {
309-
new Function("import('${latestEntrypoint}')")();
310-
} catch (err) {
309+
function loadES5() {
311310
var el = document.createElement('script');
312311
el.src = '${es5Entrypoint}';
313312
document.body.appendChild(el);
313+
}
314+
if (/.*Version\\/(?:11|12)(?:\\.\\d+)*.*Safari\\//.test(navigator.userAgent)) {
315+
loadES5();
316+
} else {
317+
try {
318+
new Function("import('${latestEntrypoint}')")();
319+
} catch (err) {
320+
loadES5();
321+
}
314322
}
315323
`,
316324
{ encoding: "utf-8" }

build-scripts/gulp/webpack.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Tasks to run webpack.
2+
const fs = require("fs");
23
const gulp = require("gulp");
34
const webpack = require("webpack");
45
const WebpackDevServer = require("webpack-dev-server");
@@ -18,6 +19,13 @@ const bothBuilds = (createConfigFunc, params) => [
1819
createConfigFunc({ ...params, latestBuild: false }),
1920
];
2021

22+
const isWsl =
23+
fs.existsSync("/proc/version") &&
24+
fs
25+
.readFileSync("/proc/version", "utf-8")
26+
.toLocaleLowerCase()
27+
.includes("microsoft");
28+
2129
/**
2230
* @param {{
2331
* compiler: import("webpack").Compiler,
@@ -78,10 +86,11 @@ const prodBuild = (conf) =>
7886

7987
gulp.task("webpack-watch-app", () => {
8088
// This command will run forever because we don't close compiler
81-
webpack(createAppConfig({ isProdBuild: false, latestBuild: true })).watch(
82-
{ ignored: /build-translations/ },
83-
doneHandler()
84-
);
89+
webpack(
90+
process.env.ES5
91+
? bothBuilds(createAppConfig, { isProdBuild: false })
92+
: createAppConfig({ isProdBuild: false, latestBuild: true })
93+
).watch({ ignored: /build-translations/, poll: isWsl }, doneHandler());
8594
gulp.watch(
8695
path.join(paths.translations_src, "en.json"),
8796
gulp.series("build-translations", "copy-translations-app")
@@ -137,7 +146,7 @@ gulp.task("webpack-watch-hassio", () => {
137146
isProdBuild: false,
138147
latestBuild: true,
139148
})
140-
).watch({ ignored: /build-translations/ }, doneHandler());
149+
).watch({ ignored: /build-translations/, poll: isWsl }, doneHandler());
141150

142151
gulp.watch(
143152
path.join(paths.translations_src, "en.json"),

cast/src/receiver/entrypoint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const showMediaPlayer = () => {
4848
--logo-repeat: no-repeat;
4949
--playback-logo-image: url('https://www.home-assistant.io/images/home-assistant-logo.svg');
5050
--theme-hue: 200;
51-
--progress-color: #03a9f4;
51+
--progress-color: #ff9800;
5252
--splash-image: url('https://home-assistant.io/images/cast/splash.png');
5353
--splash-size: cover;
5454
}

hassio/src/addon-view/config/hassio-addon-config.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class HassioAddonConfig extends LitElement {
134134
></ha-form>`
135135
: html` <ha-yaml-editor
136136
@value-changed=${this._configChanged}
137-
.schema=${ADDON_YAML_SCHEMA}
137+
.yamlSchema=${ADDON_YAML_SCHEMA}
138138
></ha-yaml-editor>`}
139139
${this._error ? html` <div class="errors">${this._error}</div> ` : ""}
140140
${!this._yamlMode ||
@@ -269,6 +269,9 @@ class HassioAddonConfig extends LitElement {
269269

270270
private async _saveTapped(ev: CustomEvent): Promise<void> {
271271
const button = ev.currentTarget as any;
272+
const options: Record<string, unknown> = this._yamlMode
273+
? this._editor?.value
274+
: this._options;
272275
const eventdata = {
273276
success: true,
274277
response: undefined,
@@ -282,13 +285,13 @@ class HassioAddonConfig extends LitElement {
282285
const validation = await validateHassioAddonOption(
283286
this.hass,
284287
this.addon.slug,
285-
this._editor?.value
288+
options
286289
);
287290
if (!validation.valid) {
288291
throw Error(validation.message);
289292
}
290293
await setHassioAddonOption(this.hass, this.addon.slug, {
291-
options: this._yamlMode ? this._editor?.value : this._options,
294+
options,
292295
});
293296

294297
this._configHasChanged = false;

hassio/src/addon-view/info/hassio-addon-info.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -892,10 +892,19 @@ class HassioAddonInfo extends LitElement {
892892

893893
private async _openChangelog(): Promise<void> {
894894
try {
895-
const content = await fetchHassioAddonChangelog(
896-
this.hass,
897-
this.addon.slug
898-
);
895+
let content = await fetchHassioAddonChangelog(this.hass, this.addon.slug);
896+
if (
897+
content.includes(`# ${this.addon.version}`) &&
898+
content.includes(`# ${this.addon.version_latest}`)
899+
) {
900+
const newcontent = content.split(`# ${this.addon.version}`)[0];
901+
if (newcontent.includes(`# ${this.addon.version_latest}`)) {
902+
// Only change the content if the new version still exist
903+
// if the changelog does not have the newests version on top
904+
// this will not be true, and we don't modify the content
905+
content = newcontent;
906+
}
907+
}
899908
showHassioMarkdownDialog(this, {
900909
title: this.supervisor.localize("addon.dashboard.changelog"),
901910
content,

hassio/src/components/supervisor-formfield-label.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class SupervisorFormfieldLabel extends LitElement {
2929
static get styles(): CSSResultGroup {
3030
return css`
3131
:host {
32-
cursor: pointer;
3332
display: flex;
3433
align-items: center;
3534
}

0 commit comments

Comments
 (0)