Compare commits

..

37 Commits

Author SHA1 Message Date
Bram Kragten
0ab8f8fd7c Merge pull request #11043 from home-assistant/dev 2021-12-29 10:51:08 +01:00
Bram Kragten
86b9eb0bd7 Bumped version to 20211229.0 2021-12-29 10:37:39 +01:00
Paulus Schoutsen
011cbe7d22 Bump HAWS to 6.0.1 (#11042) 2021-12-28 22:27:58 -08:00
Bram Kragten
9b0b2c5b71 Merge pull request #11033 from home-assistant/dev 2021-12-27 20:59:22 +01:00
Bram Kragten
be72bf7b3c Bumped version to 20211227.0 2021-12-27 20:45:56 +01:00
Paulus Schoutsen
3e062ba673 Show error screen when connection fails (#11030) 2021-12-27 11:43:38 +01:00
Paulus Schoutsen
322d965539 Bump HAWS to 6 (#11031) 2021-12-27 11:38:59 +01:00
Bram Kragten
7b840527b5 Fix gauge on ios 15.2 (#10992) 2021-12-26 21:56:24 -08:00
Marius
dced053ba2 Take out 'Stop' (#11024) 2021-12-26 21:55:17 -08:00
Joakim Sørensen
fe4322e64b Remove stop button for all installation types (#10987) 2021-12-21 14:28:51 +01:00
Bram Kragten
0800c702fb Merge pull request #10981 from home-assistant/dev 2021-12-20 14:01:20 +01:00
Bram Kragten
b6d6e2fd4b Fix demo loadFragmentTranslation 2021-12-20 13:42:52 +01:00
Bram Kragten
2bbb1bfa7e Bumped version to 20211220.0 2021-12-20 13:36:32 +01:00
Bram Kragten
e2af8ac3cc Fix theme updating entities card (#10979) 2021-12-20 12:14:54 +01:00
Philip Allgaier
25ff5fef14 More granular control for row interaction catching and cursor (#10971) 2021-12-20 10:27:43 +01:00
Philip Allgaier
2f9c088091 Make "Timers" plural on server control reload page (#10972) 2021-12-20 10:26:35 +01:00
Philip Allgaier
50c397901b Show correct cursor if tap_action is set to "none" (#10963) 2021-12-20 10:26:02 +01:00
Philip Allgaier
1f7d4c25d4 Add word wrap to device model and manufacturer (#10941) 2021-12-20 10:24:44 +01:00
Philip Allgaier
29819fac23 Ensure button and automation row inputs are clickable on mobile (#10940) 2021-12-20 10:24:07 +01:00
Paulus Schoutsen
cc301df57d Force reconnect when triggered from external bus (#10938) 2021-12-20 09:59:45 +01:00
Joakim Sørensen
7d5b566312 Disable repository removal if used for installed add-ons (#10922) 2021-12-17 22:21:46 -08:00
Joakim Sørensen
07cd68f5d0 Always send homeassistant for partial restore (#10927) 2021-12-16 13:57:08 -08:00
Joakim Sørensen
99bf6fa781 Handle update-complete event on add-on page (#10929) 2021-12-16 12:39:21 -08:00
Joakim Sørensen
bfad1eb5ac Add bottom margin to update card (#10948) 2021-12-16 12:33:46 -08:00
Bram Kragten
b7bd7c1065 Merge pull request #10930 from home-assistant/dev 2021-12-15 13:48:42 +01:00
Bram Kragten
61bae5da64 Merge pull request #10880 from home-assistant/dev 2021-12-12 13:49:22 +01:00
Bram Kragten
bdd13db8cf Merge pull request #10869 from home-assistant/dev 2021-12-11 17:32:55 +01:00
Paulus Schoutsen
cdc3d11181 Merge pull request #10846 from home-assistant/dev 2021-12-09 14:05:30 -08:00
Paulus Schoutsen
8f729e2a95 Merge pull request #10818 from home-assistant/dev 2021-12-06 15:21:37 -08:00
Paulus Schoutsen
bc9195f7d5 20211203.0 (#10788)
* Fix thingktalk dialog (#10600)

* Add picture uploader to area (#10544)

* Update image-cropper-dialog.ts

* WebRTC fix for Safari (#10602)

* Update MDI to v6.5.95 (#10618)

* Remove deprecated icons (#10622)

* Improve startup experience by removing AppBar skeleton (#10569)

* Correct ZHA LQI sort in device children dialog (#10616)

* Remove add-on store tab (#10624)

* Add markers-updated to ha-locations-editor (#10601)

* Use ha-form for onboarding-create-user (#10604)

* Fix datatable checkbox width (#10631)

* Move updates (#10626)

* Add correct button label to "no_state" statistics fix dialog (#10628)

* Update Lovelace Cast app ID (#10592)

* Cast fixes (#10598)

* Remove customize UI (#10632)

* Show updates on dashboard for dev (#10637)

* Area Card (#10141)

Co-authored-by: Philip Allgaier <mail@spacegaier.de>
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Bumped version to 20211117.0

* Fix back button color (#10650)

* Fix active tab (#10654)

* Remove ha-alert actionText (#10646)

* Use ha-formfield around backup checkbox (#10653)

* Simplify launch screen svg (#10643)

* Always render groups/areas in a single column (#10655)

* Send error message to sender (#10660)

* Add frequency device class for sensor (#10621)

* Fix color over slotted image in ha-alert (#10652)

* Make ha-chip-set slot-able (#10647)

* Remove core note on update page (#10661)

* Add iconColor to ha-config-navigation entries (#10658)

* Use white for icons with backgound (#10672)

* Fix color overlay in ha-alert content (#10674)

* Add scenes and scripts as buttons in footer of area cards (#10673)

* Add scenes and scripts as chips in footer of area cards

* Remove unused chips config type

* Update src/panels/lovelace/common/generate-lovelace-config.ts

Co-authored-by: Zack Barett <arnett.zackary@gmail.com>

* Fix typing

Co-authored-by: Zack Barett <arnett.zackary@gmail.com>

* Fix dark main-content and split gallery demo (#10675)

* Make "Show more" show everything starting from yesterday (#10533)

* Use component to ensure relative-time in Glance card gets updated (#10666)

* Limit setting up supervisor subscriptions to the supervisor panel (#10680)

* Remove first part of the update description (#10669)

* Fixing typo in #10626 (#10686)

* Bumped version to 20211123.0

* Update background colors of navigation icons (#10691)

* Render update card on add-on page (#10681)

* Fix addon slug (#10693)

* Improve device information when via device is unknown (#10685)

* Don't make button disabled on error (#10699)

* Use app-header-text-color (#10711)

* Finish up config changes (#10710)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Fix typo on config page + adjust icon color (#10713)

* Add ha-faded (#10651)

* Use `ha-icon-button` in `ha-icon-overflow-menu` (#10692)

* Prevent errors in `more-info-climate` if no modes are provided despite support flags (#10694)

* Make "Energy distribution today" translatable (#10696)

* Default to yaml editing when there are multiple states in condition (#10481)

* Filter out disabled entities in the statistics dev tools (#10677)

* Convert cover UI to Lit + ensure proper tilt rendering (#10671)

* Fixed ellipsis usage on graph legend entries. (#10707)

* Ensure required translations are loaded in safe-mode (#10709)

* Ensure markdown card input is a string (#10705)

* Fix chip text color variable overrides (#10722)

* Ensure `conditional` rows getting `state_color` value (#10708)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Fixed invalid hour handling in AMPM mode (#10717)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Installation type property during onboarding was misspelled (#10721)

* Dashboard tweaks (#10729)

* Tweak how scenes behave in generated lovelace (#10730)

* Bumped version to 20211130.0

* Improve hls stream view error handling (#10714)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Move companion app config from sidebar to configuration dashboard (#10733)

* Move companion app config from sidebar to configuration dashboard

* Remove translation refrence

* Fix typo (#10734)

* Revert 10711 (#10736)

* Use backend for day month stats in energy dashboard (#10728)

* Handle 0 updates and show back on supervisor panels (#10744)

* Hide ha-icon-next if narrow (#10746)

* Change the area of scenes in editor (#10731)

* Fix faded element in change log (#10737)

* Updated text (#10747)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Focus Add-ons & Backups in config panel when clicking Supervisor in sidebar (#10745)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Add SmartStart/QR scan support for Z-Wave JS (#10726)

* Show disabled entity names on the device page (#10743)

* Show disabled entity names on the device page

* Update src/panels/config/devices/device-detail/ha-device-entities-card.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Bumped version to 20211201.0

* Fix pointer/more-info inconsistencies for entity rows (#10025)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Make graph colors themable (#10698)

* Use puzzle for addons and blur entries on click (#10755)

* Fix create backup checkbox (#10756)

* Use unit system definitions for weather units (#10657)

* handle ha-radio and ha-checkbox in ha-formfield (#10759)

* Fix SU sidebar issues (#10757)

* Use add-ons for mobile header (#10760)

* Hide updates for dev as well (#10761)

* Remove thingtalk cleanup create new automation dialog (#10748)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Add missing translation (#10769)

* Update hui-graph-header-footer.ts (#10476)

* Group entities in area card by domain (#10767)

* Group entities in area card by domain

* Update hui-area-card.ts

* Update

* Add background color when no image

* Add camera support

* exclude unavailable states

* Update hui-area-card.ts

* Use chips for button rows (#10770)

* Bumped version to 20211202.0

* Show add devices fab on devices page for ZJS (#10771)

* Add default icons for button entities (#10774)

* Remove handling of the supervisor panel from the sidebar (#10773)

* Tweak ZJS dashboard (#10772)

* Guard for non numeric states (#10775)

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Use correct styling for cloud certificate dialog (#10782)

* Allow overriding device class (#10777)

* Restore flex alignment for select and input-select rows (#10783)

* Add support for local only users (#10784)

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Differentiate between assigned and targeting scene/automations/script (#10781)

* Add provisioned device overview to zwave js (#10785)

* Use groupBy (#10786)

* Ensure we always have an active theme name (fixes dark theme issues) (#10780)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* safari doesnt support overflow-wrap: anywhere

* Fix entity marker (#10787)

* Bumped version to 20211203.0

Co-authored-by: Allen Porter <allen@thebends.org>
Co-authored-by: Michael Irigoyen <michael@irigoyen.dev>
Co-authored-by: Lasse Rosenow <10547444+LasseRosenow@users.noreply.github.com>
Co-authored-by: David F. Mulcahey <david.mulcahey@me.com>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
Co-authored-by: Philip Allgaier <mail@spacegaier.de>
Co-authored-by: Zack Barett <arnett.zackary@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: Laszlo Magyar <lmagyar1973@gmail.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Nathan Orick <cnathanorick@gmail.com>
Co-authored-by: Luca Cavalli <lcavalli@users.noreply.github.com>
Co-authored-by: amitfin <amittein@gmail.com>
Co-authored-by: Matthias de Baat <hello@matthiasdebaat.com>
Co-authored-by: rianadon <ryanadolf123@gmail.com>
Co-authored-by: Carlos Garcia Saura <CarlosGS@users.noreply.github.com>
2021-12-03 09:36:27 -08:00
Bram Kragten
7f1a321075 Merge pull request #10590 from home-assistant/dev 2021-11-09 22:06:29 +01:00
Bram Kragten
72b9f8636d Merge pull request #10578 from home-assistant/dev 2021-11-08 18:54:44 +01:00
Bram Kragten
c9cd316c0c Play dummy media to prevent app from closing (#10531) 2021-11-08 13:04:22 +01:00
Bram Kragten
6cf3580fb4 Merge pull request #10506 from home-assistant/dev 2021-11-03 11:02:34 +01:00
Bram Kragten
5d91aefb55 Merge pull request #10453 from home-assistant/dev 2021-10-28 20:24:05 +02:00
Bram Kragten
e3c0530941 Merge pull request #10426 from home-assistant/dev 2021-10-27 21:16:47 +02:00
Paulus Schoutsen
2c9223ed80 Merge pull request #10415 from home-assistant/dev (#10415)
* Use MWC components for ha-form (#10120)

* Dont create icon for supervisor (#10191)

* Fix import (#10206)

* Add "gas" device_class to customize (and sort existing ones) (#10196)

* Make zone names readable on map in dark mode (#10195)

* Tweak ha-form (#10194)

* Extract black/white row into component (#10212)

* Extract black/white row into component

* Remove unused import

* Fix dirty check/leaving automation editor (#10211)

* Add selector demo to gallery (#10213)

* Fix icon overlay for person badges (#10201)

* Convert iframe panel to Lit (#10216)

* Allow disabling an ha-form (#10218)

* Fix alarm panel badge (#10221)

* Add missing validation text (#10225)

* Apply flat polyfill globally (#10222)

* Add ha-bar to gallery (#10242)

* Handle text overflow for tabs (#10239)

* Remove "battery" device class from fixed icon list (#10246)

* Add ha-chip to gallery (#10252)

* Add netlify build script for gallery (#10253)

* Add ha-label-badge to gallery (#10248)

* Use correct build url (#10258)

* Remove "Hass.io" from translation (#10257)

* Update demo template (#10256)

* Add WebRTC stream player (#10193)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Add tamper device class for binary sensor (#10268)

* Fix missing translatable energy texts (#10230)

* Consolidate all icon button logic into `<ha-icon-button>` + ensure tooltip (#9230)

* Fix sizing / positioning error for trace graph node with subsequent branches (#10049)

* Initial support for entity category (#10266)

* Add support for device configuration URL (#10251)

* Add support for device configuration URL

* Lint

* Tweak text

* Bump mdc/mwc to 0.25.2 (#10271)

* Bumped version to 20211014.0

* Warn if iframe won't be able to load the website (#10217)

* Disable ha-form while submitting entry flow (#10290)

* Convert all warning classes to ha-alert (#10289)

* ABC automation types + use MWC (#10287)

* Add "capitalize" option to `hui-timestamp-display` (#10280)

* Add additional binary device classes to inversion list (#10152)

* Fix energy onboarding `add_solar_production` button (#10275) (#10286)

* Unify default dashboard name (#10254)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Fix icon buttons in Safari (#10293)

* Only render badge value if there is no icon and no image (#10310)

* Update MDI to v6.3.95 (#10313)

* Rename `stream_type` to `frontend_stream_type` (#10298)

* Fix translation key energy distribution solar (#10316)

* Prevent mwc-list-item from opening up quick-bar (#10317)

* Remove element resize hook (#10300)

* Improve WebRTC stream error handling and cleanup (#10302)

* Fix formatting of weather extrema temperatures (#10306)

* Ensure current active dark modes gets used for manually set themes (#10307)

* Add views dropdown and footer actions to the "move to view" dialog (#10172)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Icon Picker (#10161)

* Use maxLiveSyncPlaybackRate in ha-hls-player (#10323)

* Revise grid neutrality energy dashboard card, modify energy dashboard presentation to match (#10054)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Fix `ha-icon-button` in `ha-file-upload` (#10328)

* Use error for protection mode alert (#10315)

* Change unsupported reason container to software (#10325)

* Migrate all paper checkbox elements to mwc (#10329)

* Migrate all paper-radio elements to mwc-radio (#10327)

* Correct grid neutrality card tooltip, make consistent with new colors (#10326)

* Fix select options for add-on config (#10330)

* Migrate all paper dialogs to mwc (#10333)

* Stack gas and solar sources (#10244)

* Set default value when enabling optional value (#10247)

* Fix overflow icon color in backup dialog (#10331)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Convert default state icons (#10223)

* Convert default state icons

* update

* Update cast/src/launcher/layout/hc-cast.ts

Co-authored-by: Philip Allgaier <mail@spacegaier.de>

* Update ha-config-core.js

* Update

* Finish

* Add siren icon

* FIx

* Add curtain icons

Co-authored-by: Philip Allgaier <mail@spacegaier.de>

* Use secondary-text-color for trailing icon (#10340)

* Use svg icons for default panels (#10342)

* Tweak icon picker a bit (#10319)

* Add support for `no-state` and `entity-no-longer-available` statistic… (#10345)

* Change dark mode input fill color (#10341)

* Replace paper progress with mwc-linear-progess (#10339)

* Bumped version to 20211020.0

* Add auto slider/box mode to number entity (#10272)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Correct automation editor event action translation (#10355)

* Convert cloud account config to Lit (#10350)

* Restore proper state badge image behavior (#10369)

* Add to do list support to markdown (#10129)

* Catch error if input_datetime state is incorrect (#10237)

* Update MDI to v6.4.95 (#10389)

* Remove deprecated icons that where replaced (#10371)

* Make all automation type pickers use natural width to be able to show… (#10391)

* Trim device name from entities on device page (#10285)

* Update markdown card to allow word to be broken (#10387)

* Fix Full Calendar Background color (#10373)

* Add additional properties to zwave_js device info panel (#10132)

* Fix various `slugify()` issues + add tests (#10383)

* Add stopPropagation to move click handlers (#10379)

* Use ha-chip for alarm control panel card (#10393)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Fix timezone issues with date formatting for ES5 (#10370)

* Add automation editor to gallery (#10392)

* Use ha-chip instead of ha-label-badge for add-on capabilities (#10398)

* Do not close edit dialog when more info is escaped (#10249)

* Ensure Sortable is recreated when card editors are reopened (#10382)

* Ensure explicit `false` values from customize form get stored (#10381)

* Add running device class to binary sensor (#10400)

* Ensure consistent card look on device config page (#10386)

* Add "Keep me logged in" checkbox within login flow (#10226)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Update delay label (#10284)

* Introduced ha-icon-overflow-menu component (#10352)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Use ha-alert to warn about logs from custom integrations (#10396)

* Add support for hiding current weather in forecast card (#10267)

* Allow configuration_url to point to an internal panel (#10395)

* Bump Lit (#10409)

* Bump format js (#10405)

* Bump codemirror (#10404)

* Bump and patch material elements (#10406)

* Add blueprint scripts (#9504)

* Make device classes in logbook translatable (#10376)

* Improve device info add to Lovelace (#10413)

* Add navigation option from more-info to history (#9717)

* Move entities to center column on device page (#10412)

* Bumped version to 20211026.0

* Shrink new section titles in more-info dialog a bit (#10414)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
Co-authored-by: Philip Allgaier <mail@spacegaier.de>
Co-authored-by: Jack Wilsdon <jack.wilsdon@gmail.com>
Co-authored-by: Josh McCarty <josh@joshmccarty.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Allen Porter <allen.porter@gmail.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: chriss158 <edgi@arcor.de>
Co-authored-by: Kyle Niewiada <aav7fl@users.noreply.github.com>
Co-authored-by: MartinT <44962077+MartinTuroci@users.noreply.github.com>
Co-authored-by: Michael Irigoyen <michael@irigoyen.dev>
Co-authored-by: Allen Porter <allen@thebends.org>
Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
Co-authored-by: uvjustin <46082645+uvjustin@users.noreply.github.com>
Co-authored-by: Will Adler <will@wtadler.com>
Co-authored-by: Rogério Ribeiro <zroger499@gmail.com>
Co-authored-by: Zack Barett <arnett.zackary@gmail.com>
Co-authored-by: Raman Gupta <7243222+raman325@users.noreply.github.com>
Co-authored-by: Nathan Orick <cnathanorick@gmail.com>
Co-authored-by: Tobias Kündig <tobias@offline.ch>
Co-authored-by: Marc Hörsken <mback2k@users.noreply.github.com>
2021-10-26 13:35:46 -07:00
23 changed files with 189 additions and 115 deletions

View File

@@ -133,6 +133,7 @@ class HassioAddonInfo extends LitElement {
.narrow=${this.narrow}
.supervisor=${this.supervisor}
.addonSlug=${this.addon.slug}
@update-complete=${this._updateComplete}
></update-available-card>
`
: ""}
@@ -865,6 +866,15 @@ class HassioAddonInfo extends LitElement {
}
}
private _updateComplete() {
const eventdata = {
success: true,
response: undefined,
path: "install",
};
fireEvent(this, "hass-api-called", eventdata);
}
private async _installClicked(ev: CustomEvent): Promise<void> {
const button = ev.currentTarget as any;
button.progress = true;

View File

@@ -350,9 +350,7 @@ export class SupervisorBackupContent extends LitElement {
if (folders?.length) {
data.folders = folders;
}
if (this.homeAssistant) {
data.homeassistant = this.homeAssistant;
}
data.homeassistant = this.homeAssistant;
return data;
}

View File

@@ -1,5 +1,6 @@
import "@polymer/paper-tooltip/paper-tooltip";
import "@material/mwc-button/mwc-button";
import { mdiDelete } from "@mdi/js";
import { mdiDelete, mdiDeleteOff } from "@mdi/js";
import "@polymer/paper-input/paper-input";
import type { PaperInputElement } from "@polymer/paper-input/paper-input";
import "@polymer/paper-item/paper-item";
@@ -15,6 +16,7 @@ import { createCloseHeading } from "../../../../src/components/ha-dialog";
import "../../../../src/components/ha-icon-button";
import {
fetchHassioAddonsInfo,
HassioAddonInfo,
HassioAddonRepository,
} from "../../../../src/data/hassio/addon";
import { extractApiErrorMessage } from "../../../../src/data/hassio/common";
@@ -60,11 +62,24 @@ class HassioRepositoriesDialog extends LitElement {
.sort((a, b) => caseInsensitiveStringCompare(a.name, b.name))
);
private _filteredUsedRepositories = memoizeOne(
(repos: HassioAddonRepository[], addons: HassioAddonInfo[]) =>
repos
.filter((repo) =>
addons.some((addon) => addon.repository === repo.slug)
)
.map((repo) => repo.slug)
);
protected render(): TemplateResult {
if (!this._dialogParams?.supervisor || this._repositories === undefined) {
return html``;
}
const repositories = this._filteredRepositories(this._repositories);
const usedRepositories = this._filteredUsedRepositories(
repositories,
this._dialogParams.supervisor.supervisor.addons
);
return html`
<ha-dialog
.open=${this._opened}
@@ -89,18 +104,32 @@ class HassioRepositoriesDialog extends LitElement {
<div secondary>${repo.maintainer}</div>
<div secondary>${repo.url}</div>
</paper-item-body>
<ha-icon-button
.slug=${repo.slug}
.label=${this._dialogParams!.supervisor.localize(
"dialog.repositories.remove"
)}
.path=${mdiDelete}
@click=${this._removeRepository}
></ha-icon-button>
<div class="delete">
<ha-icon-button
.disabled=${usedRepositories.includes(repo.slug)}
.slug=${repo.slug}
.path=${usedRepositories.includes(repo.slug)
? mdiDeleteOff
: mdiDelete}
@click=${this._removeRepository}
>
</ha-icon-button>
<paper-tooltip
animation-delay="0"
position="bottom"
offset="1"
>
${this._dialogParams!.supervisor.localize(
usedRepositories.includes(repo.slug)
? "dialog.repositories.used"
: "dialog.repositories.remove"
)}
</paper-tooltip>
</div>
</paper-item>
`
)
: html` <paper-item> No repositories </paper-item> `}
: html`<paper-item> No repositories </paper-item>`}
<div class="layout horizontal bottom">
<paper-input
class="flex-auto"
@@ -157,6 +186,9 @@ class HassioRepositoriesDialog extends LitElement {
margin: 32px;
text-align: center;
}
div.delete ha-icon-button {
color: var(--error-color);
}
`,
];
}

View File

@@ -29,6 +29,10 @@ import {
HassioAddonDetails,
updateHassioAddon,
} from "../../../src/data/hassio/addon";
import {
createHassioPartialBackup,
HassioPartialBackupCreateParams,
} from "../../../src/data/hassio/backup";
import {
extractApiErrorMessage,
ignoreSupervisorError,
@@ -99,7 +103,7 @@ class UpdateAvailableCard extends LitElement {
@state() private _addonInfo?: HassioAddonDetails;
@state() private _updating = false;
@state() private _action: "backup" | "update" | null = null;
@state() private _error?: string;
@@ -134,7 +138,7 @@ class UpdateAvailableCard extends LitElement {
name: this._name,
})}
</p>`
: !this._updating
: this._action === null
? html`
${this._changelogContent
? html`
@@ -168,13 +172,18 @@ class UpdateAvailableCard extends LitElement {
: html`<ha-circular-progress alt="Updating" size="large" active>
</ha-circular-progress>
<p class="progress-text">
${this.supervisor.localize("update_available.updating", {
name: this._name,
version: this._version_latest,
})}
${this._action === "update"
? this.supervisor.localize("update_available.updating", {
name: this._name,
version: this._version_latest,
})
: this.supervisor.localize(
"update_available.creating_backup",
{ name: this._name }
)}
</p>`}
</div>
${this._version !== this._version_latest && !this._updating
${this._version !== this._version_latest && this._action === null
? html`
<div class="card-actions">
${changelog
@@ -310,16 +319,37 @@ class UpdateAvailableCard extends LitElement {
private async _update() {
this._error = undefined;
this._updating = true;
if (this._shouldCreateBackup) {
let backupArgs: HassioPartialBackupCreateParams;
if (this._updateType === "addon") {
backupArgs = {
name: `addon_${this.addonSlug}_${this._version}`,
addons: [this.addonSlug!],
homeassistant: false,
};
} else {
backupArgs = {
name: `${this._updateType}_${this._version}`,
folders: ["homeassistant"],
homeassistant: true,
};
}
this._action = "backup";
try {
await createHassioPartialBackup(this.hass, backupArgs);
} catch (err: any) {
this._error = extractApiErrorMessage(err);
this._action = null;
return;
}
}
this._action = "update";
try {
if (this._updateType === "addon") {
await updateHassioAddon(
this.hass,
this.addonSlug!,
this._shouldCreateBackup
);
await updateHassioAddon(this.hass, this.addonSlug!);
} else if (this._updateType === "core") {
await updateCore(this.hass, this._shouldCreateBackup);
await updateCore(this.hass);
} else if (this._updateType === "os") {
await updateOS(this.hass);
} else if (this._updateType === "supervisor") {
@@ -328,7 +358,7 @@ class UpdateAvailableCard extends LitElement {
} catch (err: any) {
if (this.hass.connection.connected && !ignoreSupervisorError(err)) {
this._error = extractApiErrorMessage(err);
this._updating = false;
this._action = null;
return;
}
}

View File

@@ -46,6 +46,7 @@ class UpdateAvailableDashboard extends LitElement {
update-available-card {
margin: auto;
margin-top: 16px;
margin-bottom: 24px;
max-width: 600px;
}
`;

View File

@@ -102,7 +102,7 @@
"fuse.js": "^6.0.0",
"google-timezones-json": "^1.0.2",
"hls.js": "^1.0.11",
"home-assistant-js-websocket": "^5.11.3",
"home-assistant-js-websocket": "^6.0.1",
"idb-keyval": "^5.1.3",
"intl-messageformat": "^9.9.1",
"js-yaml": "^4.1.0",

View File

@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name="home-assistant-frontend",
version="20211215.0",
version="20211229.0",
description="The Home Assistant frontend",
url="https://github.com/home-assistant/frontend",
author="The Home Assistant Authors",

View File

@@ -199,13 +199,16 @@ export const DOMAINS_HIDE_DEFAULT_MORE_INFO = [
"select",
];
/** Domains that render an input element instead of a text value when rendered in a row.
/** Domains that render an input element instead of a text value when displayed in a row.
* Those rows should then not show a cursor pointer when hovered (which would normally
* be the default) unless the element itself enforces it (e.g. a button). Also those elements
* should not act as a click target to open the more info dialog (the row name and state icon
* still do of course) as the click might instead e.g. activate the input field that this row shows.
* still do of course) as the click should instead e.g. activate the input field or toggle
* the button that this row shows.
*/
export const DOMAINS_INPUT_ROW = [
"automation",
"button",
"cover",
"fan",
"group",
@@ -223,6 +226,7 @@ export const DOMAINS_INPUT_ROW = [
"script",
"select",
"switch",
"vacuum",
];
/** Domains that should have the history hidden in the more info dialog. */

View File

@@ -8,6 +8,10 @@ import { FrontendLocaleData } from "../data/translation";
import { getValueInPercentage, normalize } from "../util/calculate";
import { isSafari } from "../util/is_safari";
// Safari version 15.2 and up behaves differently than other Safari versions.
// https://github.com/home-assistant/frontend/issues/10766
const isSafari152 = isSafari && /Version\/15\.[^0-1]/.test(navigator.userAgent);
const getAngle = (value: number, min: number, max: number) => {
const percentage = getValueInPercentage(normalize(value, min, max), min, max);
return (percentage * 180) / 100;
@@ -113,7 +117,9 @@ export class Gauge extends LitElement {
: undefined
)}
transform=${ifDefined(
isSafari ? `rotate(${this._angle} 50 50)` : undefined
isSafari
? `rotate(${this._angle}${isSafari152 ? "" : " 50 50"})`
: undefined
)}
>
`
@@ -126,7 +132,9 @@ export class Gauge extends LitElement {
: undefined
)}
transform=${ifDefined(
isSafari ? `rotate(${this._angle} 50 50)` : undefined
isSafari
? `rotate(${this._angle}${isSafari152 ? "" : " 50 50"})`
: undefined
)}
>`
}

View File

@@ -302,8 +302,7 @@ export const installHassioAddon = async (
export const updateHassioAddon = async (
hass: HomeAssistant,
slug: string,
backup: boolean
slug: string
): Promise<void> => {
if (atLeastVersion(hass.config.version, 2021, 2, 4)) {
await hass.callWS({
@@ -311,13 +310,11 @@ export const updateHassioAddon = async (
endpoint: `/store/addons/${slug}/update`,
method: "post",
timeout: null,
data: { backup: backup },
});
} else {
await hass.callApi<HassioResponse<void>>(
"POST",
`hassio/addons/${slug}/update`,
{ backup: backup }
`hassio/addons/${slug}/update`
);
}
};

View File

@@ -6,18 +6,15 @@ export const restartCore = async (hass: HomeAssistant) => {
await hass.callService("homeassistant", "restart");
};
export const updateCore = async (hass: HomeAssistant, backup: boolean) => {
export const updateCore = async (hass: HomeAssistant) => {
if (atLeastVersion(hass.config.version, 2021, 2, 4)) {
await hass.callWS({
type: "supervisor/api",
endpoint: "/core/update",
method: "post",
timeout: null,
data: { backup: backup },
});
} else {
await hass.callApi<HassioResponse<void>>("POST", `hassio/core/update`, {
backup: backup,
});
await hass.callApi<HassioResponse<void>>("POST", `hassio/core/update`);
}
};

View File

@@ -110,7 +110,7 @@ export class ExternalMessaging {
},
});
} else if (msg.command === "restart") {
this.connection.socket.close();
this.connection.reconnect(true);
this.fireMessage({
id: msg.id,
type: "result",

View File

@@ -271,7 +271,10 @@ export const provideHass = (
updateStates,
updateTranslations,
addTranslations,
loadFragmentTranslation: async (_fragment: string) => hass().localize,
loadFragmentTranslation: async (fragment: string) => {
await updateTranslations(fragment);
return hass().localize;
},
addEntities,
mockWS(type, callback) {
wsCommands[type] = callback;

View File

@@ -34,8 +34,6 @@ const panelUrl = (path: string) => {
export class HomeAssistantAppEl extends QuickBarMixin(HassElement) {
@state() private _route: Route;
@state() private _error = false;
private _panelUrl: string;
private _haVersion?: string;
@@ -44,8 +42,6 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) {
private _visiblePromiseResolve?: () => void;
private _visibleLaunchScreen = true;
constructor() {
super();
const path = curPath();
@@ -62,27 +58,22 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) {
this._panelUrl = panelUrl(path);
}
protected render() {
if (this._isHassComplete() && this.hass) {
return html`
<home-assistant-main
.hass=${this.hass}
.route=${this._route}
></home-assistant-main>
`;
}
return "";
protected renderHass() {
return html`
<home-assistant-main
.hass=${this.hass}
.route=${this._route}
></home-assistant-main>
`;
}
update(changedProps) {
super.update(changedProps);
// Remove launch screen if main gui is loaded
if (this._isHassComplete() && this._visibleLaunchScreen) {
this._visibleLaunchScreen = false;
if (this.hass?.states && this.hass.config && this.hass.services) {
this.render = this.renderHass;
this.update = super.update;
removeLaunchScreen();
}
super.update(changedProps);
}
protected firstUpdated(changedProps) {
@@ -129,10 +120,9 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) {
});
// Render launch screen info box (loading data / error message)
if (!this._isHassComplete() && this._visibleLaunchScreen) {
renderLaunchScreenInfoBox(
html`<ha-init-page .error=${this._error}></ha-init-page>`
);
// if Home Assistant is not loaded yet.
if (this.render !== this.renderHass) {
this._renderInitInfo(false);
}
}
@@ -188,7 +178,7 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) {
if (window.hassConnection) {
result = await window.hassConnection;
} else {
// In the edge case that
// In the edge case that core.ts loads before app.ts
result = await new Promise((resolve) => {
window.hassConnectionReady = resolve;
});
@@ -198,7 +188,7 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) {
this._haVersion = conn.haVersion;
this.initializeHass(auth, conn);
} catch (err: any) {
this._error = true;
this._renderInitInfo(true);
}
}
@@ -255,12 +245,10 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) {
}
}
private _isHassComplete(): boolean {
if (this.hass?.states && this.hass.config && this.hass.services) {
return true;
}
return false;
private _renderInitInfo(error: boolean) {
renderLaunchScreenInfoBox(
html`<ha-init-page .error=${error}></ha-init-page>`
);
}
}

View File

@@ -118,9 +118,9 @@ export class HaDeviceCard extends LitElement {
word-wrap: break-word;
}
.manuf,
.entity-id,
.model {
color: var(--secondary-text-color);
word-wrap: break-word;
}
`;
}

View File

@@ -218,9 +218,11 @@ class ZHADeviceCard extends SubscribeMixin(LitElement) {
.device .manuf {
color: var(--secondary-text-color);
margin-bottom: 20px;
word-wrap: break-word;
}
.extra-info {
margin-top: 8px;
word-wrap: break-word;
}
state-badge {
cursor: pointer;

View File

@@ -5,7 +5,6 @@ import "@polymer/paper-input/paper-input";
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
import { customElement, property, state } from "lit/decorators";
import { componentsWithService } from "../../../common/config/components_with_service";
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
import "../../../components/buttons/ha-call-service-button";
import "../../../components/ha-card";
import { checkCoreConfig } from "../../../data/core";
@@ -158,20 +157,6 @@ export class HaConfigServerControl extends LitElement {
"ui.panel.config.server_control.section.server_management.restart"
)}
</ha-call-service-button>
${!isComponentLoaded(this.hass, "hassio")
? html`<ha-call-service-button
class="warning"
.hass=${this.hass}
domain="homeassistant"
service="stop"
confirmation=${this.hass.localize(
"ui.panel.config.server_control.section.server_management.confirm_stop"
)}
>${this.hass.localize(
"ui.panel.config.server_control.section.server_management.stop"
)}
</ha-call-service-button>`
: ""}
</div>
</ha-card>

View File

@@ -163,16 +163,16 @@ class HuiEntitiesCard extends LitElement implements LovelaceCard {
if (!this._config || !this._hass) {
return;
}
const oldHass = changedProps.get("hass") as HomeAssistant | undefined;
const oldHass = changedProps.get("_hass") as HomeAssistant | undefined;
const oldConfig = changedProps.get("_config") as
| EntitiesCardConfig
| undefined;
if (
!oldHass ||
!oldConfig ||
oldHass.themes !== this.hass.themes ||
oldConfig.theme !== this._config.theme
(changedProps.has("_hass") &&
(!oldHass || oldHass.themes !== this._hass.themes)) ||
(changedProps.has("_config") &&
(!oldConfig || oldConfig.theme !== this._config.theme))
) {
applyThemesOnElement(this, this._hass.themes, this._config.theme);
}

View File

@@ -33,6 +33,13 @@ class HuiGenericEntityRow extends LitElement {
@property({ type: Boolean }) public hideName = false;
// Allows to control if this row should capture the user interaction, e.g. with its
// toggle switch, button or input field. Some domains dynamically decide what to show
// => static determination will not work => the caller has to pass the desired value in.
// Same applies for custom components that want to override the default behavior.
// Default behavior is controlled by DOMAINS_INPUT_ROW.
@property({ type: Boolean }) public catchInteraction?;
protected render(): TemplateResult {
if (!this.hass || !this.config) {
return html``;
@@ -50,8 +57,11 @@ class HuiGenericEntityRow extends LitElement {
}
const domain = computeDomain(this.config.entity);
// By default, we always show a pointer, since if there is no explicit configuration provided,
// the frontend always assumes "more-info" in the action handler. We only need to hide the pointer
// if the tap action is explicitly set to "none".
const pointer = !(
this.config.tap_action && this.config.tap_action.action !== "none"
this.config.tap_action && this.config.tap_action.action === "none"
);
const hasSecondary = this.secondaryText || this.config.secondary_info;
@@ -144,7 +154,7 @@ class HuiGenericEntityRow extends LitElement {
: ""}
</div>`
: html``}
${!DOMAINS_INPUT_ROW.includes(domain)
${this.catchInteraction ?? !DOMAINS_INPUT_ROW.includes(domain)
? html` <div
class="text-content ${classMap({
pointer,

View File

@@ -41,11 +41,18 @@ class HuiToggleEntityRow extends LitElement implements LovelaceRow {
`;
}
const showToggle =
stateObj.state === "on" ||
stateObj.state === "off" ||
UNAVAILABLE_STATES.includes(stateObj.state);
return html`
<hui-generic-entity-row .hass=${this.hass} .config=${this._config}>
${stateObj.state === "on" ||
stateObj.state === "off" ||
UNAVAILABLE_STATES.includes(stateObj.state)
<hui-generic-entity-row
.hass=${this.hass}
.config=${this._config}
.catchInteraction=${!showToggle}
>
${showToggle
? html`
<ha-entity-toggle
.hass=${this.hass}

View File

@@ -1419,7 +1419,7 @@
},
"server_control": {
"caption": "Server Controls",
"description": "Restart and stop the Home Assistant server",
"description": "Validate and restart the Home Assistant server",
"section": {
"validation": {
"heading": "Configuration validation",
@@ -1461,7 +1461,8 @@
"telegram": "Telegram notify services",
"smtp": "SMTP notify services",
"mqtt": "Manually configured MQTT entities",
"rpi_gpio": "Raspberry Pi GPIO entities"
"rpi_gpio": "Raspberry Pi GPIO entities",
"timer": "Timers"
},
"server_management": {
"heading": "Server management",
@@ -4466,7 +4467,8 @@
"repositories": {
"title": "Manage add-on repositories",
"add": "Add",
"remove": "Remove"
"remove": "Remove",
"used": "Repository is in use for installed add-ons and can't be removed."
},
"restart_addon": {
"confirm_text": "Restart add-on",

View File

@@ -7,9 +7,9 @@ export const removeLaunchScreen = () => {
}
};
export const renderLaunchScreenInfoBox = (element: TemplateResult) => {
export const renderLaunchScreenInfoBox = (content: TemplateResult) => {
const infoBoxElement = document.getElementById("ha-launch-screen-info-box");
if (infoBoxElement) {
render(element, infoBoxElement);
render(content, infoBoxElement);
}
};

View File

@@ -9113,7 +9113,7 @@ fsevents@^1.2.7:
gulp-rename: ^2.0.0
gulp-zopfli-green: ^3.0.1
hls.js: ^1.0.11
home-assistant-js-websocket: ^5.11.3
home-assistant-js-websocket: ^6.0.1
html-minifier: ^4.0.0
husky: ^1.3.1
idb-keyval: ^5.1.3
@@ -9184,10 +9184,10 @@ fsevents@^1.2.7:
languageName: unknown
linkType: soft
"home-assistant-js-websocket@npm:^5.11.3":
version: 5.11.3
resolution: "home-assistant-js-websocket@npm:5.11.3"
checksum: 3ab90e5105c5f379d77fb23ab53eaec2789be7bf1fd507a7520d9cf329d36942b8e978a591b822cff96100630d43bd036a4e25e2f49c40d0c56a111808fb90a5
"home-assistant-js-websocket@npm:^6.0.1":
version: 6.0.1
resolution: "home-assistant-js-websocket@npm:6.0.1"
checksum: 566d6de6a4eb0e05ca434a45433cfe6fdd6b5cb2008e9a165709e08335df1c9b70903564c479ab8d48c6f5468a9784f47697192f9023170d2d86d43a461d6126
languageName: node
linkType: hard