Compare commits

...

271 Commits

Author SHA1 Message Date
Bram Kragten
a181189a49 20230801.0 (#17450) 2023-08-01 11:16:30 +02:00
Bram Kragten
f792e708a3 Bumped version to 20230801.0 2023-08-01 11:12:56 +02:00
Bram Kragten
41643b20e7 Change event logbook message (#17449) 2023-08-01 10:44:15 +02:00
Joost Lekkerkerker
ece676e3dc Make required asterisk consistent (#17403) 2023-08-01 09:41:34 +02:00
karwosts
85c3d8ecd8 Add missing states in media_player state picker (#17418) 2023-08-01 09:41:00 +02:00
karwosts
3c62f5597a Display choose option alias if configured (#17429) 2023-08-01 09:39:32 +02:00
renovate[bot]
76388114aa Update dependency eslint to v8.46.0 (#17443) 2023-07-31 20:08:49 -04:00
Bram Kragten
3e60d2e850 Don't show wrong info in logbook (#17439) 2023-07-31 20:25:57 +02:00
Bram Kragten
2a9ef7d91f Align event state display (#17442) 2023-07-31 18:27:35 +02:00
Bram Kragten
4612099e88 Fix weather more info date display (#17440) 2023-07-31 17:54:39 +02:00
renovate[bot]
f953ec6e1c Update dependency eslint-plugin-import to v2.28.0 (#17437)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-31 09:34:48 -04:00
Joost Lekkerkerker
a5cd350d25 Fix unknown event type bug (#17426)
* Fix unknown event type bug

* Update src/data/logbook.ts

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

---------

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2023-07-31 13:31:39 +02:00
Bram Kragten
0ee231ee85 Fix demo (#17438)
* Fix demo

Fix energy and notification in demo

* Update config_entries.ts
2023-07-31 06:16:46 -04:00
renovate[bot]
b154607552 Update dependency eslint-config-prettier to v8.9.0 (#17432) 2023-07-30 10:47:55 -04:00
renovate[bot]
d3ba19b0e0 Update typescript-eslint monorepo to v6.2.0 (#17419) 2023-07-27 21:20:44 -04:00
Franck Nijhof
626b51112f 20230725.0 (#17407) 2023-07-25 18:02:12 +02:00
Franck Nijhof
de4d517918 Bumped version to 20230725.0 2023-07-25 17:35:49 +02:00
renovate[bot]
89b5a082e5 Update CodeMirror (#17376)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-24 11:54:57 -04:00
Franck Nijhof
5ed767804c Complete service translation support in service dev tools (#17399) 2023-07-24 17:43:31 +02:00
Franck Nijhof
17c9e91092 Adjust default icon of event entity (#17401) 2023-07-24 17:43:20 +02:00
renovate[bot]
02f01aba0e Update vaadinWebComponents monorepo to v24.1.4 (#17397) 2023-07-24 10:35:43 -04:00
Franck Nijhof
4fd5dfd6ae Add My support for companion app settings (#17398) 2023-07-24 15:57:13 +02:00
renovate[bot]
2c7e17ce89 Update dependency @types/luxon to v3.3.1 (#17396) 2023-07-24 01:17:23 -04:00
Miguel Camba
d6e279e8f4 Add device_class PH, including default icon (#17385) 2023-07-23 18:50:40 +02:00
Steve Repsher
e21f951368 Enable cache in CI and locally for ESLint and Prettier (#17384) 2023-07-22 19:52:57 +02:00
renovate[bot]
c7cf49de05 Update dependency hls.js to v1.4.10 (#17383)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-21 23:25:23 -04:00
G Johansson
ec58862f3e Implement forecast types for Weather (#15028)
* Implement forecast types

* editor

* Fix twice_daily

* All cards

* Review comments

* hasforecast

* card-editor

* forecast default

* Review comments

* fix entity row

* Remove legacy option

* Check if selected forecast is supported when picking entity

* Always show weather_to_show selector

* comments

* Update types.ts

* Hourly before twice-daily

* Expose forecast via WS instead of as state attributes

* Unsubscribe on disconnect

* lint

* prettier

* Fix _forecastSupported

* Improve conditions for subscribing to forecast updates

* Teach weather entity row and more info to subscribe

* Fix subscribing

* Deduplicate code in getForecast

* Simplify

* Tweak subscribe logic

* Address review comments

---------

Co-authored-by: Erik <erik@montnemery.com>
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2023-07-21 17:30:59 +02:00
Franck Nijhof
0eebc9095c Add event entity (#17332) 2023-07-21 12:18:32 +02:00
karwosts
3189ef0701 Fix dialog-edit-view yaml editor (#17374) 2023-07-21 08:51:41 +02:00
karwosts
308d4b0a62 Fix Options flow missing submit button & finish button. (#17361)
* Fix missing submit button in options flow

* Fix missing header and finish button at end of options flow

* load config translations for options flow

* one more revert
2023-07-20 21:02:08 -04:00
renovate[bot]
795831d4cf Update typescript-eslint monorepo to v6.1.0 (#17370) 2023-07-20 20:47:12 -04:00
renovate[bot]
406f868642 Update dependency webpack to v5.88.2 (#17372) 2023-07-20 20:36:44 -04:00
karwosts
a1748260d3 Always show translated labels for ha-form-multi_select (#17360) 2023-07-20 16:15:59 +02:00
karwosts
09e26c8fd7 Missing translation in data-table (#17356) 2023-07-20 16:15:19 +02:00
karwosts
11fa9d1ed8 Fix guiMode toggle bugs in element-editor (#17282) 2023-07-20 16:14:32 +02:00
renovate[bot]
38ea25cf5a Lock file maintenance (#17357)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-19 23:10:47 -04:00
Franck Nijhof
3ce0fc0a2a Add My support for Assist dev tools (#17342) 2023-07-19 17:45:38 -04:00
karwosts
e6a3bd4b8c Add a missing translation (#17351) 2023-07-19 18:11:20 +02:00
renovate[bot]
f8fcf304d4 Lock file maintenance (#17344)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-19 13:35:47 +02:00
renovate[bot]
efc442da5b Lock file maintenance (#17341)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-19 13:08:09 +02:00
Erik Montnemery
8171b02b75 Allow changing channel from the thread configuration panel (#17285) 2023-07-19 10:48:43 +02:00
renovate[bot]
88259c8de0 Update dependency @rollup/plugin-commonjs to v25.0.3 (#17337)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-18 13:42:30 -04:00
Paul Bottein
61ab08519f Use device battery entity for vacuum more info (#17328) 2023-07-18 17:21:03 +02:00
Paul Bottein
1250eac11b Use ha-outlined icon button in lock more info (#17339) 2023-07-18 17:18:05 +02:00
Will Adler
d323db8479 Update self-sufficiency card title and tooltip (#17241) 2023-07-18 17:17:31 +02:00
Steve Repsher
c71fd055a4 Expand use of prettier to all tracked files (#17311) 2023-07-18 17:16:33 +02:00
renovate[bot]
493f1d1b50 Update dependency @material/web to v1.0.0-pre.13 (#17303)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-18 16:45:10 +02:00
Paul Bottein
38b68bffa6 Hide no theme option when required (#17338) 2023-07-18 16:08:04 +02:00
puddly
11b2cf9e22 Use the user-provided name when sorting devices (#17297) 2023-07-18 15:23:39 +02:00
Paul Bottein
4a044fc40e Improve default theme wording (#17336)
* Improve default theme wording

* Remove home assistant translation
2023-07-18 13:22:20 +00:00
Paul Bottein
000288aecb Change button to plus and minus to inc/dec position (#17194) 2023-07-18 15:01:00 +02:00
Bram Kragten
d56273ec25 Use nominatim from openstreetmap for location search in onboarding (#17287)
* Use nominatim from openstreetmap for location search in onboarding

* Update text, add user agent

* Handle errors better, add email address

* remove detect text

* Use `ui.common.search`

* Update attribution location

* Apply suggestions from code review

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>

* Update src/translations/en.json

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>

* Remove unused style

* Increase line-height

* Apply suggestions

---------

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
2023-07-18 15:00:41 +02:00
Franck Nijhof
bc3295d851 Add prefix support to text selector (#17335) 2023-07-18 11:57:20 +02:00
Bram Kragten
d7e58a00ca Add support for registering config panels (#17296) 2023-07-18 09:56:07 +02:00
renovate[bot]
0ce93263e9 Update typescript-eslint monorepo to v6 (major) (#17299)
* Update typescript-eslint monorepo to v6

* Remove duplicate values from log severity enum

* Rename ActionHandler interface to avoid class conflict

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Steve Repsher <steverep@users.noreply.github.com>
2023-07-17 20:26:40 +00:00
Paul Bottein
4946c00d34 Add last_used option for pipeline and explicit default (#17329)
* Add last-used option for pipeline and explicit default

* Default to last used
2023-07-17 12:57:43 -04:00
renovate[bot]
4c9066a4b0 Update dependency eslint to v8.45.0 (#17330)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-17 12:37:31 -04:00
renovate[bot]
486cfd1d91 Update dependency hls.js to v1.4.9 (#17326)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-17 09:37:41 -04:00
dependabot[bot]
2564fb91db Bump actions/labeler from 4.2.0 to 4.3.0 (#17327) 2023-07-17 07:55:20 -04:00
renovate[bot]
4b40405cc4 Update tsparticles to v2.11.0 (#17318) 2023-07-16 20:52:13 -04:00
Skyler Carlson
3d0f2adf9f Update wording in UI when restoring partial backup (#17319) 2023-07-16 18:09:48 +00:00
renovate[bot]
bcfdb27e25 Update dependency eslint-config-airbnb-typescript to v17.1.0 (#17320) 2023-07-16 12:43:16 -04:00
renovate[bot]
c173ffd181 Update dependency google-timezones-json to v1.2.0 (#17321) 2023-07-16 12:41:06 -04:00
renovate[bot]
e81cac0d03 Update babel monorepo to v7.22.9 (#17317) 2023-07-15 16:08:15 -04:00
renovate[bot]
d756daded4 Update dependency eslint-plugin-unused-imports to v3 (#17312)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-14 22:21:56 -04:00
renovate[bot]
cb0bc762b1 Update dependency prettier to v3 (#17215)
* Update dependency prettier to v3

* Update config and remove .prettierignore

* Reformat

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Steve Repsher <steverep@users.noreply.github.com>
2023-07-14 17:40:17 +00:00
renovate[bot]
9bf76a07b8 Update dependency @octokit/rest to v20 (#17307)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-14 12:10:52 -04:00
karwosts
7546d1950e Make action-choose options collapsible (#17239)
* Make action-choose options collapsible

* padding changes
2023-07-14 10:01:00 +02:00
renovate[bot]
5e197334f6 Update octokit monorepo to v6 (major) (#17269)
Update octokit monorepo to v6

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-14 04:57:20 +00:00
renovate[bot]
27bfa130f3 Update typescript-eslint monorepo to v5.62.0 (#17298) 2023-07-13 18:56:45 -04:00
Simon Lamon
9b3710f8bd Use translation keys for Network configuration pages (#17261)
* Network labels

* Remove quotes

* Update translations to include data and linting

* IPV6 => IPv6
2023-07-13 18:32:36 +02:00
Denis Shulyaka
1fe02e8d6c Add current humidity to humidifier history chart (#17288)
* Add current humidity to humidifier history chart

* state-humidifier-on-color
2023-07-13 17:04:04 +02:00
Paul Bottein
8bb2cbe767 Refactor lock and alarm panel code dialog (#17254) 2023-07-13 16:42:08 +02:00
Paul Bottein
510f9dbb12 Don't show paste from clipboard card when user search for a card (#17295) 2023-07-13 16:36:18 +02:00
Paul Bottein
df765515ec Use icon button to switch between code and editor (#17294) 2023-07-13 16:35:53 +02:00
Paul Bottein
56e82eab03 Add icon to edit card overflow menu (#17293) 2023-07-13 16:34:42 +02:00
Paul Bottein
efc8ed5c94 Add condition selector for blueprint (#17278) 2023-07-13 16:33:56 +02:00
Paul Bottein
e2ec3b63ce Fix autocorrect and spellcheck for ha-textfield (#17274) 2023-07-13 16:33:12 +02:00
karwosts
158a816f7a Consistently treat standby as a non-active state for media_player (#17289)
Consistently treat standby as an off state for media_player
2023-07-13 13:20:51 +02:00
Domantas Petrauskas
3a4d2db8ff Fix overflow on sensor card (#17284) 2023-07-13 09:34:20 +02:00
Paulus Schoutsen
5ed348aa56 Add download button to assist sentence parser dev tool (#17265)
* Add download button to assist sentence parser dev tool

* Use outlined button

* BLOCK
2023-07-12 11:54:33 -04:00
renovate[bot]
52d717a86b Update dependency glob to v10.3.3 (#17281)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-12 09:10:21 -04:00
Paul Bottein
606b96f6fd Fix history issue when closing more info dialog by clicking update (#17257)
* Fix history issue when closing more info dialog by clicking update

* Remove hideMoreInfoDialog function
2023-07-11 13:00:12 +00:00
Bram Kragten
33b9786ae7 start_pause is only supported on entities that don't have STATE sup… (#17147)
* `start_pause` is only support on entities that don't have `STATE` support

* Update hui-vacuum-commands-tile-feature.ts

* Add comment
2023-07-11 14:54:38 +02:00
karwosts
04ec380ce0 Prune empty value_template field from numeric_state (#17272) 2023-07-11 14:38:36 +02:00
Paul Bottein
9866a3217e Prevent items in add integration dialog from flickering (#17260) 2023-07-11 14:35:37 +02:00
renovate[bot]
9f55c06dfc Update dependency glob to v10.3.2 (#17270)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-10 21:44:18 -04:00
dependabot[bot]
2298d2b7ca Bump semver from 5.7.1 to 5.7.2 (#17271)
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-10 21:42:49 -04:00
Bram Kragten
e46f0224c6 Add support for service translations (#17264)
* Add support for service translations

* Add selector translation support
2023-07-10 20:37:04 -04:00
Paulus Schoutsen
bf4cf310f3 Bump HAWS to 8.2.0 (#17263) 2023-07-10 18:37:15 +00:00
renovate[bot]
b1a909d302 Update dependency babel-loader to v9.1.3 (#17262)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-10 14:09:07 -04:00
Paul Bottein
bffdfcf61c Fix notification error when calling service (#17255) 2023-07-10 15:01:16 +02:00
Paul Bottein
228b75ae83 Simplify script/automation action description with nested conditions/triggers (#17252) 2023-07-10 13:33:50 +02:00
Bram Kragten
35a427afad Update download-translations.js 2023-07-10 13:17:35 +02:00
Bram Kragten
1f5a8b4e7e Merge branch 'master' into dev 2023-07-10 13:16:32 +02:00
renovate[bot]
f98eaf0c2d Update vaadinWebComponents monorepo to v24.1.3 (#17250)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-10 13:15:43 +02:00
karwosts
d66a8a65b6 Fix a browser hang with charts in grids (#17244) 2023-07-10 13:13:46 +02:00
Till
3bf8739a7c Fix missing autocomplete in energy settings (#17218) 2023-07-10 13:12:15 +02:00
Steve Repsher
456eba1d88 Add pull request labeler (#17199) 2023-07-10 13:08:46 +02:00
Philip Allgaier
a1771cc919 Clearly show if there are no ignored or disabled integrations (#17251) 2023-07-10 13:08:15 +02:00
Paul Bottein
289c380a6a Remove unused device class translations (#17253) 2023-07-10 10:30:03 +00:00
Denis Shulyaka
f35b493d2e humidifier cards: support null target humidity (#17240)
remove target humidity if not provided
2023-07-10 11:15:27 +02:00
dependabot[bot]
e01ad86da9 Bump actions/setup-node from 3.6.0 to 3.7.0 (#17246)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-10 09:51:30 +02:00
renovate[bot]
f8e09921c3 Update dependency @lit-labs/virtualizer to v2.0.4 (#17219)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-09 19:40:21 -04:00
karwosts
0974d86bfd Localize the statistics search label (#17223)
* Localize the statistics search label

* switch to common search
2023-07-09 18:39:51 -04:00
renovate[bot]
fdf5abd0f9 Update dependency @codemirror/view to v6.14.1 (#17225)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-09 17:37:14 -04:00
renovate[bot]
487ff4afcf Update babel monorepo (#17233)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-09 17:35:21 -04:00
renovate[bot]
13d686bd67 Update dependency core-js to v3.31.1 (#17224) 2023-07-09 00:09:31 -04:00
renovate[bot]
4ea88613bd Update dependency lit to v2.7.6 (#17220) 2023-07-08 20:22:26 -04:00
karwosts
e8c7f8cffc Don't automatically capitalize climate states (#17217)
* Don't auto-capitalize climate states

* more states
2023-07-08 14:03:21 -04:00
Franck Nijhof
1beab0449f Fix missing translations of password field in cloud signup (#17213) 2023-07-08 13:23:30 -04:00
renovate[bot]
3191801fa7 Update babel monorepo to v7.22.6 (#17201)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-07 11:04:15 -04:00
renovate[bot]
6a22503285 Update dependency magic-string to v0.30.1 (#17202)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-07 11:00:31 -04:00
renovate[bot]
6b66b7f1fa Update dependency hls.js to v1.4.8 (#17197) 2023-07-06 19:57:08 -04:00
renovate[bot]
0b31d9b943 Update dependency @octokit/plugin-retry to v5.0.5 (#17196) 2023-07-06 19:51:37 -04:00
renovate[bot]
e1be4751a1 Update typescript-eslint monorepo to v5.61.0 (#17195) 2023-07-06 16:07:56 -04:00
puddly
155e9d9e95 Default the ZHA channel change dialog's preferred channel to auto (#17178) 2023-07-06 09:55:31 +02:00
karwosts
3d2734eb88 Fix sensor card to not crash when it finds no state history (#17181) 2023-07-06 09:46:42 +02:00
Philip Allgaier
9ac3f745b3 Show "Configured" header on integrations dashboard for clarity (#17115) 2023-07-06 09:42:15 +02:00
Bram Kragten
9f74af56ed Update download-translations.js 2023-07-05 17:32:08 +02:00
Bram Kragten
b1f5776eb3 Merge branch 'dev' 2023-07-05 17:23:55 +02:00
Bram Kragten
c95232fecb Update download-translations.js 2023-07-05 17:23:24 +02:00
Bram Kragten
c60a235ad2 Merge branch 'dev' 2023-07-05 17:08:21 +02:00
Bram Kragten
cc8ab184e3 Update download-translations.js 2023-07-05 17:05:13 +02:00
Bram Kragten
ad8d3c7fa8 Fix non optional response service, variable field disabled (#17171) 2023-07-05 14:53:19 +00:00
Bram Kragten
507f22a5cd Update of core or OS will disconnect (#17170) 2023-07-05 16:49:35 +02:00
Bram Kragten
d7e0dac4e7 20230705.1 (#17169) 2023-07-05 15:47:43 +02:00
Bram Kragten
1b0423eb42 Bumped version to 20230705.1 2023-07-05 15:36:47 +02:00
Bram Kragten
9125520d8f Patch leaflet draw (#17168) 2023-07-05 15:22:50 +02:00
Bram Kragten
3390dda7be Fix integration card design gallery (#17167) 2023-07-05 15:22:22 +02:00
renovate[bot]
dcae8b9790 Pin dependency @types/luxon to 3.3.0 (#17164)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-05 11:43:13 +00:00
Bram Kragten
1b503a6af1 Convert and filter backend translations to old format (#17161) 2023-07-05 13:29:42 +02:00
Bram Kragten
8bd09edec0 Fix automation translations + gallery (#17166) 2023-07-05 13:27:38 +02:00
Bram Kragten
c8de1ff74c 20230705.0 (#17165) 2023-07-05 09:18:17 +02:00
Bram Kragten
44aca9688d Bumped version to 20230705.0 2023-07-05 09:11:23 +02:00
Bram Kragten
9d457d52e8 Fix schedule and calendar timezone handling (#17157) 2023-07-05 09:10:01 +02:00
Bram Kragten
72dbe8e7ab Guard for missing translations (#17160) 2023-07-05 09:01:02 +02:00
renovate[bot]
371dadfeeb Update vaadinWebComponents monorepo to v24.1.2 (#17142)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-05 00:05:38 -04:00
Simon Lamon
9cf8ec4cbb Make voice assistant translatable in dialog (#17163) 2023-07-04 20:42:36 +02:00
Bram Kragten
7584404d31 Fix cast build (#17162) 2023-07-04 20:41:40 +02:00
Bram Kragten
75b6b9cfd9 Ask confirmation before deleting a schedule item (#17158) 2023-07-04 12:13:26 +02:00
renovate[bot]
94808b75b3 Update Yarn to v3.6.1 (#17153)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-04 09:37:59 +02:00
renovate[bot]
dc19f94bfa Update dependency @types/qrcode to v1.5.1 (#17154)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-04 09:37:00 +02:00
renovate[bot]
9374e38db2 Update dependency eslint to v8.44.0 (#17156)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-04 09:36:13 +02:00
Bram Kragten
b309c64d7b 20230703.0 (#17150) 2023-07-03 19:05:09 +02:00
Bram Kragten
db78dd8762 Bumped version to 20230703.0 2023-07-03 19:03:32 +02:00
Joakim Sørensen
4588eb3b75 Send undefined as version if auto is selected (#17148) 2023-07-03 17:04:36 +02:00
Bram Kragten
d427d9e7f6 Integrations header: center warning/error text (#17141)
Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
2023-07-03 13:36:29 +00:00
Bram Kragten
a3b87a6e7b Fix supervisor not loading Firefox (#17146) 2023-07-03 13:25:59 +00:00
Bram Kragten
6a2cad1af3 Fix device automations from device page (#17145) 2023-07-03 15:24:19 +02:00
Bram Kragten
21caac4240 Don't show fractions in energy percentage gauges (#17140) 2023-07-03 10:56:40 +02:00
renovate[bot]
0735b6475a Update dependency @material/web to v1.0.0-pre.12 (#17138)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-02 14:42:59 +02:00
Simon Lamon
7dbb419c30 Make automation editor card headers translateable (actions) (#17027) 2023-07-02 14:29:54 +02:00
renovate[bot]
a477120f13 Update dependency typescript to v5.1.6 (#17139)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-01 23:30:29 -04:00
renovate[bot]
a7ed71d404 Update dependency @lrnwebcomponents/simple-tooltip to v7.0.11 (#17124) 2023-07-01 18:31:58 -04:00
karwosts
08716c8e11 Gauge card form fields can be decimal (#17123) 2023-07-01 16:02:20 -04:00
Bram Kragten
4b8d7b27e3 Fix device automation description (#17133) 2023-07-01 15:54:30 -04:00
renovate[bot]
c29a2f35c3 Update dependency typescript to v5.1.5 (#17129)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-01 15:41:06 -04:00
renovate[bot]
f8b9888636 Update dependency webpack to v5.88.1 (#17135)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-01 15:40:16 -04:00
renovate[bot]
2d45532707 Update dependency glob to v10.3.1 (#17128)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-01 15:36:58 -04:00
renovate[bot]
5d4402a53b Update dependency hls.js to v1.4.7 (#17130)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-01 15:36:15 -04:00
renovate[bot]
60af8c7303 Update dependency lint-staged to v13.2.3 (#17131)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-01 15:34:42 -04:00
Bram Kragten
8f3d89da4f 20230630.0 (#17120) 2023-06-30 17:18:39 +02:00
Bram Kragten
ff59e31530 Bumped version to 20230630.0 2023-06-30 17:16:29 +02:00
Paul Bottein
23ac7501b3 Reorder config entries in device pages (#17105) 2023-06-30 17:15:49 +02:00
Bram Kragten
d6f8941098 Warn when punctuation is used in conversation trigger (#17119) 2023-06-30 17:14:58 +02:00
Philip Allgaier
e5146512d5 Fix disabled domain text color in entity settings (#17114) 2023-06-30 17:14:04 +02:00
Allen Porter
b43c6f9fa3 Allow changing a single event to recurring event (#17112) 2023-06-30 17:13:21 +02:00
renovate[bot]
5579713ed5 Update typescript-eslint monorepo to v5.60.1 (#17109)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-30 17:12:38 +02:00
karwosts
e7c47ef65c Name field in helper forms should not init in the error state (#17111) 2023-06-30 17:06:46 +02:00
renovate[bot]
ede7daad1a Update dependency @lrnwebcomponents/simple-tooltip to v7.0.10 (#17116)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-30 17:05:44 +02:00
Bram Kragten
5e84f2a173 Fix ignoring config flow (#17118) 2023-06-30 16:37:53 +02:00
Kevin
90df43c205 Fix ignoring dicovered devices (#17117) 2023-06-30 16:15:32 +02:00
Bram Kragten
3563541f8f 20230629.0 (#17108) 2023-06-29 18:50:03 +02:00
Bram Kragten
a09d71291b Update discovered/disabled/ignored integrations (#17107) 2023-06-29 18:47:24 +02:00
Bram Kragten
a7100b9678 Bumped version to 20230629.0 2023-06-29 18:33:59 +02:00
Bram Kragten
42d6e6dc51 Replace integration error/warning banner with subtitle (#17103) 2023-06-29 17:26:51 +02:00
Bram Kragten
a5c7f261c8 dont split a string 2023-06-29 17:14:05 +02:00
Bram Kragten
f712b76ccf Update compute_state_display.ts 2023-06-29 16:56:24 +02:00
Paul Bottein
82a8b8fd5d Same order in device dashboard and device page for config entries (#17104) 2023-06-29 16:09:27 +02:00
Bram Kragten
a227d7a2cf Fix ha-menu-button not hidden (#17102) 2023-06-29 15:09:58 +02:00
Philip Allgaier
b5eb18e163 Ensure domain titles are loaded for quick reload items (#17100) 2023-06-29 14:53:08 +02:00
Bram Kragten
82ae04e070 Integration dashboard: don't stretch items (#17099) 2023-06-29 10:51:14 +00:00
Paul Bottein
8f617fe754 Allow to search statistic by statistics id and name (#17098) 2023-06-29 12:51:00 +02:00
Paul Bottein
77d24f4129 Show position on sidebar card and hide arrow on panel card (#17092) 2023-06-29 09:27:49 +00:00
Bram Kragten
6cc207752f Empty response when changing service (#17091) 2023-06-29 10:31:16 +02:00
karwosts
b96ad65f48 Add summations to gas/solar/water energy graph tooltips (#17084) 2023-06-29 09:57:37 +02:00
karwosts
ab1759f11d Clear template-not-supported error when switching services in devtools (#17090) 2023-06-29 09:54:18 +02:00
Philip Allgaier
b539a939b4 Pass missing time zone info to dev tool state (#17087) 2023-06-29 09:48:53 +02:00
Philip Allgaier
82cc667012 Add min/max support for prompt dialog (e.g. used for card moving) (#17085) 2023-06-29 09:40:55 +02:00
Philip Allgaier
fc86c82540 Remove weird colon from integration setup error text (#17086) 2023-06-29 09:40:09 +02:00
karwosts
6d1ea41449 Fab spacer for zha table (#17082) 2023-06-28 15:50:25 +00:00
Bram Kragten
50f4a1abc5 20230628.0 (#17080) 2023-06-28 17:30:13 +02:00
Bram Kragten
f6d06f5e26 Remove time from assist dev tools (#17079) 2023-06-28 17:19:47 +02:00
Bram Kragten
de7f055419 Bumped version to 20230628.0 2023-06-28 17:19:04 +02:00
Paul Bottein
c3c6c63169 Add move card to position on dashboard editor (#17077)
* Add move card to position on dashboard editor

* Feedbacks
2023-06-28 15:14:10 +00:00
Bram Kragten
6fea7a7106 Move integration sections into their own container (#17078) 2023-06-28 14:58:32 +00:00
Bram Kragten
ce88c594b7 Submit assist dev tools on enter (#17073) 2023-06-28 16:48:32 +02:00
Bram Kragten
e2daa89941 Add space for FAB on addon page (#17076) 2023-06-28 16:48:06 +02:00
Denis Shulyaka
81bd4a247b Humidifier action (#17056)
* Add action attribute to humidifier

* Humidifier: Use action instead of state if that is available

* rebase

---------

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2023-06-28 16:47:39 +02:00
karwosts
345aef8d65 Add fab spacer for backups table (#17075) 2023-06-28 14:37:18 +00:00
Paul Bottein
eaeb37da4d Update humidifier Ui with current humidity and action (#17072) 2023-06-28 16:14:18 +02:00
Bram Kragten
c0613545e7 Make helper forms lazy load (#17068) 2023-06-28 15:55:46 +02:00
Bram Kragten
e6d77af438 Make space for fab (#17070) 2023-06-28 15:55:12 +02:00
Bram Kragten
625da46da9 Fix assist devtools default language (#17071) 2023-06-28 15:50:43 +02:00
Bram Kragten
7727bf7901 Tweak lovelace editor position badge (#17069) 2023-06-28 15:10:33 +02:00
Philip Allgaier
24e531a16c Catch exception if diagnostics are not supported for domain (#17067) 2023-06-28 12:48:37 +00:00
Philip Allgaier
32a9b13af0 Translate message that script/automation is unavailable (#17066) 2023-06-28 12:38:10 +00:00
Bram Kragten
c90c4d88af Fix discovery flow title (#17065) 2023-06-28 14:29:35 +02:00
Bram Kragten
cd3bec08f7 Refactor integration card (#17061) 2023-06-28 14:09:02 +02:00
karwosts
8945650b62 Show card positions in edit dashboard mode (#17055) 2023-06-28 14:01:21 +02:00
karwosts
5ac9a6c9cc Sort tooltips in energy graphs and filter zeros (#17057) 2023-06-28 14:00:10 +02:00
Bram Kragten
ce9380e4d7 Fix menu button when sidebar is always_hidden (#17059) 2023-06-28 13:34:48 +02:00
Bram Kragten
927c6dd778 Fix state display in vacuum more info (#17063) 2023-06-28 13:31:26 +02:00
Philip Allgaier
952bcff8c8 Handle "unknown" for date, time and datetime entities (#17043) 2023-06-28 10:45:34 +00:00
Paul Bottein
73e1b4b1d1 Add basic assist dev tools (#17062) 2023-06-28 10:40:59 +00:00
Bram Kragten
cbe8be1573 Add response variable support to service action (#17046) 2023-06-27 17:12:38 +00:00
Bram Kragten
6b4300950d Add response UI to stop action (#17045) 2023-06-27 19:02:05 +02:00
Bram Kragten
c3c062cc29 Unsubscribe from supervisor collection immediately (#17047)
* Unsubscribe from supervisor collection immediately

* bump home-assistant-js-websocket
2023-06-27 18:57:08 +02:00
Bram Kragten
b15754a6a7 Ingress: offer to start addon on ingress page (#16458)
Co-authored-by: Joakim Sørensen <ludeeus@ludeeus.dev>
2023-06-27 18:49:24 +02:00
Paul Bottein
343708cdaa Align humidifier thermostat card (#17054) 2023-06-27 18:36:56 +02:00
Bram Kragten
3b8ea5edbe Add keyfunction to datatable virtualizer (#17049) 2023-06-27 18:29:37 +02:00
Bram Kragten
4761036816 Show if script is unavailable and why (#17051) 2023-06-27 18:28:53 +02:00
Bram Kragten
3bb5e95c50 Show if automation is unavailable and why (#17048) 2023-06-27 18:28:20 +02:00
Bram Kragten
9e5774525f Add service response support to dev tools (#17044)
* Add service response support to dev tools

* Change to `response_variable`
2023-06-27 18:22:02 +02:00
Denis Shulyaka
349311a18d humidifier card: display the current humidity (#14645)
* humidifier card: display the value of current humidity sensor

Signed-off-by: Denis Shulyaka <Shulyaka@gmail.com>

* rename set-values and current-humidity to main-humidity and secondary-humidity

* removed more-info dialog for current-humidity

* swap target and current humidity

* remove current humidity rounding

* use current_humidity attribute

* Add current_humidity attribute

* prettier

* Revert hui-humidifier-card-editor.ts

* Revert types.ts

* Revert en.json

* Update hui-humidifier-card.ts

* Update hui-humidifier-card.ts

* prettier

* Use formatNumber

* Apply suggestions from code review

* Swap back current humidity and target humidity

---------

Signed-off-by: Denis Shulyaka <Shulyaka@gmail.com>
2023-06-27 17:24:45 +02:00
Paul Bottein
48b6c2a925 Add animation for locking and unlocking state (#17053) 2023-06-27 15:23:46 +00:00
karwosts
381c9f97d6 Bar chart should start from zero (#16815) 2023-06-27 17:21:23 +02:00
Simon Lamon
9a116d4022 Update dialog-add-user input fields (#17039) 2023-06-27 17:19:56 +02:00
Simon Lamon
d63d3a681c Fix split area into separate devices and entities (#17017) 2023-06-27 17:19:19 +02:00
karwosts
3111c29049 Fix group more-info to show the state of the group entity (#17052) 2023-06-27 16:54:18 +02:00
Bram Kragten
87aad75cc7 Add UI for conversation trigger (#17037) 2023-06-27 10:58:27 +02:00
Paulus Schoutsen
d656269d75 Remove attribution from Assist dialog (#17038) 2023-06-26 23:18:57 +02:00
Marc Mueller
d169ff6a96 Update build system (#17040) 2023-06-26 19:24:03 +00:00
Franck Nijhof
06d9517e27 Add identify device class to button (#17036) 2023-06-26 15:47:06 +02:00
Paulus Schoutsen
a637b7db75 Automatically refresh when showing debug for a pipeline in progress (#17030) 2023-06-26 13:15:20 +00:00
Philip Allgaier
96a6261a09 Automatic casing of nouns based on language (#17035) 2023-06-26 14:58:14 +02:00
ildar170975
a3f0c428f8 Update hui-glance-card.ts: fix padding & margin for a focused entity (#17005)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2023-06-26 12:25:14 +00:00
Philip Allgaier
b40a3224fc Add "Clear" button to template editor + confirmation dialog (#17020) 2023-06-26 12:21:08 +00:00
Philip Allgaier
68fb98454f Fix logbook for binary sensor (missing device class) (#17034) 2023-06-26 10:50:51 +00:00
Philip Allgaier
3803bdc8da Add missing aria-label to integration configure button (#17033) 2023-06-26 10:33:05 +00:00
Paul Bottein
1dfd859a2d Circular slider improvements (#17008) 2023-06-26 11:49:11 +02:00
karwosts
f77f7b3c36 Catch errors when describeTrigger throws an exception (#17022) 2023-06-26 11:47:22 +02:00
karwosts
82463c2ef6 Fix overview failing to render in some cases with toUpperCase exception (#17021) 2023-06-26 11:42:32 +02:00
karwosts
e53ae0b333 Add plant domain to enumerated states list (#17026) 2023-06-26 11:39:13 +02:00
karwosts
b6ed8acd02 Dont mark blueprint fields with defaults as required (#16785) 2023-06-26 11:38:39 +02:00
renovate[bot]
897f118547 Update dependency @material/web to v1.0.0-pre.11 (#17012)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-26 11:35:13 +02:00
renovate[bot]
d961f5be5f Update typescript-eslint monorepo to v5.60.0 (#17004)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-26 11:34:30 +02:00
renovate[bot]
96d6687724 Update dependency sinon to v15.2.0 (#17013)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-26 11:33:39 +02:00
renovate[bot]
a77167e9d9 Update dependency @lrnwebcomponents/simple-tooltip to v7.0.5 (#17014)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-26 11:32:51 +02:00
renovate[bot]
d2199dfa34 Update dependency webpack to v5.88.0 (#17025)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-26 11:29:07 +02:00
renovate[bot]
0f0d1d6e6f Update dependency glob to v10.3.0 (#17024)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-26 11:26:52 +02:00
karwosts
9bcbb6f914 Support cut/copy/paste in dashboard UI editor (#16707) 2023-06-26 11:14:14 +02:00
renovate[bot]
2929bf5b1a Update CodeMirror (#17031)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-26 08:50:53 +00:00
karwosts
976fcab146 Don't apply brightness filter to plant icons (#17029) 2023-06-26 10:02:41 +02:00
karwosts
655cf053c7 Include blueprint type in row id key (#16998) 2023-06-26 09:59:43 +02:00
Philip Allgaier
152ca75499 Adjust codemirror gutter background color (#17018) 2023-06-26 09:58:59 +02:00
Joakim Sørensen
1645208f62 Export base create config functions (#17007) 2023-06-26 09:50:43 +02:00
karwosts
3528f5c7aa Fix dialog-device-registry-detail missing labels (#17001) 2023-06-26 09:50:21 +02:00
J. Nick Koston
76490cc690 Fix media player list when there are entities not in the registry (#17015) 2023-06-24 08:37:38 +02:00
renovate[bot]
bf18deb83c Update dependency @rollup/plugin-commonjs to v25.0.2 (#17000)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-23 00:28:22 +02:00
Petro31
f19dcba1ce Update _dismissAll to use persistent_notification.dismiss_all service (#16997) 2023-06-22 14:28:07 +02:00
Bram Kragten
b3fa134198 Add haStyleScrollbar to hass-tabs-subpage (#16993) 2023-06-22 09:53:06 +00:00
Bram Kragten
80c57fa326 Don't allow to change the domain in entity registry settings (#16800) 2023-06-22 11:09:02 +02:00
Joakim Sørensen
b748fee321 Allow selecting CIFS version in mount dialog (#16833) 2023-06-22 10:58:26 +02:00
Paul Bottein
1ee67937ec Simplify usage on clipboard for automations and scripts (#16989) 2023-06-22 10:55:39 +02:00
Paul Bottein
cc41dbcb0b 20230608.0 (#16825) 2023-06-08 15:09:26 +02:00
Bram Kragten
fcffa1a750 20230607.0 (#16812) 2023-06-07 12:17:34 +02:00
Bram Kragten
e3ee8f307a 20230606.0 (#16798) 2023-06-06 16:40:21 +02:00
Bram Kragten
871f0f9e0d 20230605.0 (#16787) 2023-06-05 19:19:02 +02:00
Bram Kragten
82fd56efe7 20230601.1 (#16728) 2023-06-01 18:07:46 +02:00
401 changed files with 10901 additions and 5565 deletions

View File

@@ -6,3 +6,6 @@ updates:
interval: weekly
time: "06:00"
open-pull-requests-limit: 10
labels:
- Dependencies
- GitHub Actions

31
.github/labeler.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
Build:
- build-scripts/**
- .browserslistrc
- gulpfile.js
Cast:
- cast/src/**
- src/cast/**
Demo:
- demo/src/**
- src/fake_data/**
Design:
- gallery/src/**
- src/fake_data/**
Dependencies:
- package.json
- renovate.json
- yarn.lock
- .yarn/**
- .yarnrc.yml
- .nvmrc
GitHub Actions:
- .github/workflows/**
- .github/*.yml
Supervisor:
- hassio/src/**

View File

@@ -1,8 +1,8 @@
categories:
- title: 'Dependency updates'
- title: "Dependency updates"
collapse-after: 3
labels:
- 'dependencies'
- "Dependencies"
template: |
## What's Changed

View File

@@ -26,7 +26,7 @@ jobs:
ref: dev
- name: Setup Node
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v3.7.0
with:
node-version-file: ".nvmrc"
cache: yarn
@@ -62,7 +62,7 @@ jobs:
ref: master
- name: Setup Node
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v3.7.0
with:
node-version-file: ".nvmrc"
cache: yarn

View File

@@ -26,7 +26,7 @@ jobs:
- name: Check out files from GitHub
uses: actions/checkout@v3.5.3
- name: Setup Node
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v3.7.0
with:
node-version-file: ".nvmrc"
cache: yarn
@@ -36,6 +36,14 @@ jobs:
run: yarn dedupe --check
- name: Build resources
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data gather-gallery-pages
- name: Setup lint cache
uses: actions/cache@v3.3.1
with:
path: |
node_modules/.cache/prettier
node_modules/.cache/eslint
key: lint-${{ github.sha }}
restore-keys: lint-
- name: Run eslint
run: yarn run lint:eslint --quiet
- name: Run tsc
@@ -49,7 +57,7 @@ jobs:
- name: Check out files from GitHub
uses: actions/checkout@v3.5.3
- name: Setup Node
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v3.7.0
with:
node-version-file: ".nvmrc"
cache: yarn
@@ -67,7 +75,7 @@ jobs:
- name: Check out files from GitHub
uses: actions/checkout@v3.5.3
- name: Setup Node
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v3.7.0
with:
node-version-file: ".nvmrc"
cache: yarn
@@ -85,7 +93,7 @@ jobs:
- name: Check out files from GitHub
uses: actions/checkout@v3.5.3
- name: Setup Node
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v3.7.0
with:
node-version-file: ".nvmrc"
cache: yarn

View File

@@ -17,44 +17,44 @@ jobs:
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['javascript']
language: ["javascript"]
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
steps:
- name: Checkout repository
uses: actions/checkout@v3.5.3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
- name: Checkout repository
uses: actions/checkout@v3.5.3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

View File

@@ -27,7 +27,7 @@ jobs:
ref: dev
- name: Setup Node
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v3.7.0
with:
node-version-file: ".nvmrc"
cache: yarn
@@ -63,7 +63,7 @@ jobs:
ref: master
- name: Setup Node
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v3.7.0
with:
node-version-file: ".nvmrc"
cache: yarn

View File

@@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@v3.5.3
- name: Setup Node
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v3.7.0
with:
node-version-file: ".nvmrc"
cache: yarn

View File

@@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@v3.5.3
- name: Setup Node
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v3.7.0
with:
node-version-file: ".nvmrc"
cache: yarn

15
.github/workflows/labeler.yaml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: "Pull Request Labeler"
on: pull_request_target
jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Apply labels
uses: actions/labeler@v4.3.0
with:
sync-labels: true

View File

@@ -28,7 +28,7 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}
- name: Setup Node
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v3.7.0
with:
node-version-file: ".nvmrc"
cache: yarn

View File

@@ -34,7 +34,7 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}
- name: Setup Node
uses: actions/setup-node@v3.6.0
uses: actions/setup-node@v3.7.0
with:
node-version-file: ".nvmrc"
cache: yarn

View File

@@ -1,9 +1,3 @@
build
translations/*
node_modules/*
hass_frontend/*
pip-selfcheck.json
# vscode
.vscode/*
!.vscode/extensions.json
CLA.md
CODE_OF_CONDUCT.md
LICENSE.md

6
.vscode/launch.json vendored
View File

@@ -9,9 +9,7 @@
"webRoot": "${workspaceFolder}/hass_frontend",
"disableNetworkCache": true,
"preLaunchTask": "Develop Frontend",
"outFiles": [
"${workspaceFolder}/hass_frontend/frontend_latest/*.js"
]
"outFiles": ["${workspaceFolder}/hass_frontend/frontend_latest/*.js"]
},
{
"name": "Debug Gallery",
@@ -39,6 +37,6 @@
"webRoot": "${workspaceFolder}/cast/dist",
"disableNetworkCache": true,
"preLaunchTask": "Develop Cast"
},
}
]
}

2
.vscode/tasks.json vendored
View File

@@ -197,7 +197,7 @@
"type": "gulp",
"task": "setup-and-fetch-nightly-translations",
"problemMatcher": []
}
}
],
"inputs": [
{

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -8,4 +8,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
yarnPath: .yarn/releases/yarn-3.6.0.cjs
yarnPath: .yarn/releases/yarn-3.6.1.cjs

View File

@@ -1,6 +1,7 @@
import fs from "fs/promises";
import gulp from "gulp";
import mapStream from "map-stream";
import transform from "gulp-json-transform";
const inDirFrontend = "translations/frontend";
const inDirBackend = "translations/backend";
@@ -41,8 +42,33 @@ function checkHtml() {
});
}
// Backend translations do not currently pass HTML check so are excluded here for now
function convertBackendTranslations(data, _file) {
const output = { component: {} };
if (!data.component) {
return output;
}
Object.keys(data.component).forEach((domain) => {
if (!("entity_component" in data.component[domain])) {
return;
}
output.component[domain] = { entity_component: {} };
Object.keys(data.component[domain].entity_component).forEach((key) => {
output.component[domain].entity_component[key] =
data.component[domain].entity_component[key];
});
});
return output;
}
gulp.task("convert-backend-translations", function () {
return gulp
.src([`${inDirBackend}/*.json`])
.pipe(transform((data, file) => convertBackendTranslations(data, file)))
.pipe(gulp.dest(inDirBackend));
});
gulp.task("check-translations-html", function () {
// We exclude backend translations because they are not compliant with the HTML rule for now
return gulp.src([`${inDirFrontend}/*.json`]).pipe(checkHtml());
});

View File

@@ -142,4 +142,5 @@ module.exports = {
createCastConfig,
createHassioConfig,
createGalleryConfig,
createRollupConfig,
};

View File

@@ -253,4 +253,5 @@ module.exports = {
createCastConfig,
createHassioConfig,
createGalleryConfig,
createWebpackConfig,
};

View File

@@ -1,3 +1,3 @@
self.addEventListener("fetch", function(event) {
self.addEventListener("fetch", (event) => {
event.respondWith(fetch(event.request));
});

View File

@@ -1,21 +1,21 @@
import { cast } from "chromecast-caf-receiver";
import { framework } from "../receiver/cast_framework";
const castContext = cast.framework.CastReceiverContext.getInstance();
const castContext = framework.CastReceiverContext.getInstance();
const playerManager = castContext.getPlayerManager();
playerManager.setMessageInterceptor(
cast.framework.messages.MessageType.LOAD,
framework.messages.MessageType.LOAD,
(loadRequestData) => {
const media = loadRequestData.media;
// Special handling if it came from Google Assistant
if (media.entity) {
media.contentId = media.entity;
media.streamType = cast.framework.messages.StreamType.LIVE;
media.streamType = framework.messages.StreamType.LIVE;
media.contentType = "application/vnd.apple.mpegurl";
// @ts-ignore
media.hlsVideoSegmentFormat =
cast.framework.messages.HlsVideoSegmentFormat.FMP4;
framework.messages.HlsVideoSegmentFormat.FMP4;
}
return loadRequestData;
}

View File

@@ -1,3 +1,3 @@
import { cast } from "chromecast-caf-receiver";
import { framework } from "./cast_framework";
export const castContext = cast.framework.CastReceiverContext.getInstance();
export const castContext = framework.CastReceiverContext.getInstance();

View File

@@ -0,0 +1,3 @@
import type { cast as ReceiverCast } from "chromecast-caf-receiver";
export const framework = (cast as unknown as typeof ReceiverCast).framework;

View File

@@ -1,4 +1,4 @@
import { cast } from "chromecast-caf-receiver";
import { framework } from "./cast_framework";
import { CAST_NS } from "../../../src/cast/const";
import { HassMessage } from "../../../src/cast/receiver_messages";
import "../../../src/resources/custom-card-support";
@@ -34,14 +34,14 @@ const setTouchControlsVisibility = (visible: boolean) => {
let timeOut: number | undefined;
const playDummyMedia = (viewTitle?: string) => {
const loadRequestData = new cast.framework.messages.LoadRequestData();
const loadRequestData = new framework.messages.LoadRequestData();
loadRequestData.autoplay = true;
loadRequestData.media = new cast.framework.messages.MediaInformation();
loadRequestData.media = new framework.messages.MediaInformation();
loadRequestData.media.contentId =
"https://cast.home-assistant.io/images/google-nest-hub.png";
loadRequestData.media.contentType = "image/jpeg";
loadRequestData.media.streamType = cast.framework.messages.StreamType.NONE;
const metadata = new cast.framework.messages.GenericMediaMetadata();
loadRequestData.media.streamType = framework.messages.StreamType.NONE;
const metadata = new framework.messages.GenericMediaMetadata();
metadata.title = viewTitle;
loadRequestData.media.metadata = metadata;
@@ -86,10 +86,10 @@ const showMediaPlayer = () => {
}
};
const options = new cast.framework.CastReceiverOptions();
const options = new framework.CastReceiverOptions();
options.disableIdleTimeout = true;
options.customNamespaces = {
[CAST_NS]: cast.framework.system.MessageType.JSON,
[CAST_NS]: framework.system.MessageType.JSON,
};
castContext.addCustomMessageListener(
@@ -98,8 +98,7 @@ castContext.addCustomMessageListener(
(ev: ReceivedMessage<HassMessage>) => {
// We received a show Lovelace command, stop media from playing, hide media player and show Lovelace controller
if (
playerManager.getPlayerState() !==
cast.framework.messages.PlayerState.IDLE
playerManager.getPlayerState() !== framework.messages.PlayerState.IDLE
) {
playerManager.stop();
} else {
@@ -114,7 +113,7 @@ castContext.addCustomMessageListener(
const playerManager = castContext.getPlayerManager();
playerManager.setMessageInterceptor(
cast.framework.messages.MessageType.LOAD,
framework.messages.MessageType.LOAD,
(loadRequestData) => {
if (
loadRequestData.media.contentId ===
@@ -128,25 +127,24 @@ playerManager.setMessageInterceptor(
// Special handling if it came from Google Assistant
if (media.entity) {
media.contentId = media.entity;
media.streamType = cast.framework.messages.StreamType.LIVE;
media.streamType = framework.messages.StreamType.LIVE;
media.contentType = "application/vnd.apple.mpegurl";
// @ts-ignore
media.hlsVideoSegmentFormat =
cast.framework.messages.HlsVideoSegmentFormat.FMP4;
framework.messages.HlsVideoSegmentFormat.FMP4;
}
return loadRequestData;
}
);
playerManager.addEventListener(
cast.framework.events.EventType.MEDIA_STATUS,
framework.events.EventType.MEDIA_STATUS,
(event) => {
if (
event.mediaStatus?.playerState ===
cast.framework.messages.PlayerState.IDLE &&
event.mediaStatus?.playerState === framework.messages.PlayerState.IDLE &&
event.mediaStatus?.idleReason &&
event.mediaStatus?.idleReason !==
cast.framework.messages.IdleReason.INTERRUPTED
framework.messages.IdleReason.INTERRUPTED
) {
// media finished or stopped, return to default Lovelace
showLovelaceController();

View File

@@ -1,3 +1,3 @@
self.addEventListener("fetch", function(event) {
self.addEventListener("fetch", (event) => {
event.respondWith(fetch(event.request));
});

View File

@@ -1,20 +1,18 @@
import { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
export const mockConfigEntries = (hass: MockHomeAssistant) => {
hass.mockWS("config_entries/get_matching", () => [
{
entry_id: "co2signal",
domain: "co2signal",
title: "CO2 Signal",
source: "user",
state: "loaded",
supports_options: false,
supports_remove_device: false,
supports_unload: true,
pref_disable_new_entities: false,
pref_disable_polling: false,
disabled_by: null,
reason: null,
},
]);
hass.mockWS("config_entries/get", () => ({
entry_id: "co2signal",
domain: "co2signal",
title: "Electricity Maps",
source: "user",
state: "loaded",
supports_options: false,
supports_remove_device: false,
supports_unload: true,
pref_disable_new_entities: false,
pref_disable_polling: false,
disabled_by: null,
reason: null,
}));
};

View File

@@ -1,16 +1,20 @@
import { PersistentNotification } from "../../../src/data/persistent_notification";
import { PersistentNotificationMessage } from "../../../src/data/persistent_notification";
import { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
export const mockPersistentNotification = (hass: MockHomeAssistant) => {
hass.mockWS("persistent_notification/get", () =>
Promise.resolve([
{
created_at: new Date().toISOString(),
message: "There was motion detected in the backyard.",
notification_id: "demo-1",
title: "Motion Detected!",
status: "unread",
hass.mockWS("persistent_notification/subscribe", (_msg, _hass, onChange) => {
onChange!({
type: "added",
notifications: {
"demo-1": {
created_at: new Date().toISOString(),
message: "There was motion detected in the backyard.",
notification_id: "demo-1",
title: "Motion Detected!",
status: "unread",
},
},
] as PersistentNotification[])
);
} as PersistentNotificationMessage);
return () => {};
});
};

View File

@@ -72,6 +72,7 @@ const generateSumStatistics = (
min: null,
max: null,
last_reset: 0,
change: add,
state: initValue + sum,
sum,
});
@@ -103,8 +104,8 @@ const generateCurvedStatistics = (
let half = false;
const now = new Date();
while (end > currentDate && currentDate < now) {
const add = Math.random() * maxDiff;
sum += i * add;
const add = i * (Math.random() * maxDiff);
sum += add;
statistics.push({
start: currentDate.getTime(),
end: currentDate.getTime(),
@@ -112,6 +113,7 @@ const generateCurvedStatistics = (
min: null,
max: null,
last_reset: 0,
change: add,
state: initValue + sum,
sum: metered ? sum : null,
});

View File

@@ -4,53 +4,63 @@ subtitle: The difference between remove/delete and add/create.
---
# Remove vs Delete
Remove and Delete are quite similar, but can be frustrating if used inconsistently.
## Remove
Take away and set aside, but kept in existence.
For example:
* Removing a user's permission
* Removing a user from a group
* Removing links between items
* Removing a widget
* Removing a link
* Removing an item from a cart
- Removing a user's permission
- Removing a user from a group
- Removing links between items
- Removing a widget
- Removing a link
- Removing an item from a cart
## Delete
Erase, rendered nonexistent or nonrecoverable.
For example:
* Deleting a field
* Deleting a value in a field
* Deleting a task
* Deleting a group
* Deleting a permission
* Deleting a calendar event
- Deleting a field
- Deleting a value in a field
- Deleting a task
- Deleting a group
- Deleting a permission
- Deleting a calendar event
# Add vs Create
In most cases, Create can be paired with Delete, and Add can be paired with Remove.
## Add
An already-exisiting item.
For example:
* Adding a permission to a user
* Adding a user to a group
* Adding links between items
* Adding a widget
* Adding a link
* Adding an item to a cart
- Adding a permission to a user
- Adding a user to a group
- Adding links between items
- Adding a widget
- Adding a link
- Adding an item to a cart
## Create
Something made from scratch.
For example:
* Creating a new field
* Creating a new value in a field
* Creating a new task
* Creating a new group
* Creating a new permission
* Creating a new calendar event
- Creating a new field
- Creating a new value in a field
- Creating a new task
- Creating a new group
- Creating a new permission
- Creating a new calendar event
Based on this is [UX magazine article](https://uxmag.com/articles/ui-copy-remove-vs-delete2-banner).

View File

@@ -162,6 +162,7 @@ export class DemoAutomationDescribeAction extends LitElement {
super.firstUpdated(changedProps);
const hass = provideHass(this);
hass.updateTranslations(null, "en");
hass.updateTranslations("config", "en");
hass.addEntities(ENTITIES);
}

View File

@@ -89,6 +89,7 @@ export class DemoAutomationDescribeCondition extends LitElement {
super.firstUpdated(changedProps);
const hass = provideHass(this);
hass.updateTranslations(null, "en");
hass.updateTranslations("config", "en");
hass.addEntities(ENTITIES);
}

View File

@@ -40,6 +40,7 @@ const triggers = [
},
{ platform: "sun", event: "sunset" },
{ platform: "time_pattern" },
{ platform: "time_pattern", hours: "*", minutes: "/5", seconds: "10" },
{ platform: "webhook" },
{ platform: "persistent_notification" },
{
@@ -51,6 +52,11 @@ const triggers = [
{ platform: "tag" },
{ platform: "time", at: "15:32" },
{ platform: "template" },
{ platform: "conversation", command: "Turn on the lights" },
{
platform: "conversation",
command: ["Turn on the lights", "Turn the lights on"],
},
{ platform: "event", event_type: "homeassistant_started" },
];
@@ -100,6 +106,7 @@ export class DemoAutomationDescribeTrigger extends LitElement {
super.firstUpdated(changedProps);
const hass = provideHass(this);
hass.updateTranslations(null, "en");
hass.updateTranslations("config", "en");
hass.addEntities(ENTITIES);
}

View File

@@ -85,17 +85,16 @@ class DemoHaAutomationEditorAction extends LitElement {
.value=${this.data[sampleIdx]}
>
${["light", "dark"].map(
(slot) =>
html`
<ha-automation-action
slot=${slot}
.hass=${this.hass}
.actions=${this.data[sampleIdx]}
.sampleIdx=${sampleIdx}
.disabled=${this._disabled}
@value-changed=${valueChanged}
></ha-automation-action>
`
(slot) => html`
<ha-automation-action
slot=${slot}
.hass=${this.hass}
.actions=${this.data[sampleIdx]}
.sampleIdx=${sampleIdx}
.disabled=${this._disabled}
@value-changed=${valueChanged}
></ha-automation-action>
`
)}
</demo-black-white-row>
`

View File

@@ -121,17 +121,16 @@ class DemoHaAutomationEditorCondition extends LitElement {
.value=${this.data[sampleIdx]}
>
${["light", "dark"].map(
(slot) =>
html`
<ha-automation-condition
slot=${slot}
.hass=${this.hass}
.conditions=${this.data[sampleIdx]}
.sampleIdx=${sampleIdx}
.disabled=${this._disabled}
@value-changed=${valueChanged}
></ha-automation-condition>
`
(slot) => html`
<ha-automation-condition
slot=${slot}
.hass=${this.hass}
.conditions=${this.data[sampleIdx]}
.sampleIdx=${sampleIdx}
.disabled=${this._disabled}
@value-changed=${valueChanged}
></ha-automation-condition>
`
)}
</demo-black-white-row>
`

View File

@@ -25,6 +25,7 @@ import { HaDeviceTrigger } from "../../../../src/panels/config/automation/trigge
import { HaStateTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-state";
import { HaMQTTTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-mqtt";
import "../../../../src/panels/config/automation/trigger/ha-automation-trigger";
import { HaConversationTrigger } from "../../../../src/panels/config/automation/trigger/types/ha-automation-trigger-conversation";
const SCHEMAS: { name: string; triggers: Trigger[] }[] = [
{
@@ -112,6 +113,16 @@ const SCHEMAS: { name: string; triggers: Trigger[] }[] = [
name: "Device Trigger",
triggers: [{ platform: "device", ...HaDeviceTrigger.defaultConfig }],
},
{
name: "Sentence",
triggers: [
{ platform: "conversation", ...HaConversationTrigger.defaultConfig },
{
platform: "conversation",
command: ["Turn on the lights", "Turn the lights on"],
},
],
},
];
@customElement("demo-automation-editor-trigger")
@@ -156,17 +167,16 @@ class DemoHaAutomationEditorTrigger extends LitElement {
.value=${this.data[sampleIdx]}
>
${["light", "dark"].map(
(slot) =>
html`
<ha-automation-trigger
slot=${slot}
.hass=${this.hass}
.triggers=${this.data[sampleIdx]}
.sampleIdx=${sampleIdx}
.disabled=${this._disabled}
@value-changed=${valueChanged}
></ha-automation-trigger>
`
(slot) => html`
<ha-automation-trigger
slot=${slot}
.hass=${this.hass}
.triggers=${this.data[sampleIdx]}
.sampleIdx=${sampleIdx}
.disabled=${this._disabled}
@value-changed=${valueChanged}
></ha-automation-trigger>
`
)}
</demo-black-white-row>
`

View File

@@ -10,7 +10,6 @@ As a community, we are proud of our logo. Follow these guidelines to ensure it a
![Logo](/images/logo.png)
## Using the icon
Our icon is a shorter and most used version of our logo. The icon can exist without the wordmark, the wordmark should never exist without the icon.
@@ -21,7 +20,7 @@ Our icon is a shorter and most used version of our logo. The icon can exist with
The pretty blue logo with a background shadow, pictured top left, is our primary logo. It should only be used with black, white, and non-duotone photography.
When needed you can use our logo without a shadow, as seen as the second variant.
When needed you can use our logo without a shadow, as seen as the second variant.
The outlined logo should only be used on packaging.

View File

@@ -11,6 +11,7 @@ subtitle: An alert displays a short, important message in a way that attracts th
</style>
# Alert `<ha-alert>`
The alert offers four severity levels that set a distinctive icon and color.
<ha-alert alert-type="error">
@@ -35,38 +36,46 @@ The alert offers four severity levels that set a distinctive icon and color.
2. [Implementation](#implementation)
### Resources
| Type | Link | Status |
|----------------|----------------------------------|-----------|
| Type | Link | Status |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| Design | <a href="https://www.figma.com/community/file/967153512097289521/Home-Assistant-DesignKit" rel="noopener noreferrer" target="_blank">Home Assistant DesignKit</a> (Figma) | Available |
| Implementation | <a href="https://github.com/home-assistant/frontend/blob/dev/src/components/ha-alert.ts" rel="noopener noreferrer" target="_blank">Web Component</a> (GitHub) | Available |
| Implementation | <a href="https://github.com/home-assistant/frontend/blob/dev/src/components/ha-alert.ts" rel="noopener noreferrer" target="_blank">Web Component</a> (GitHub) | Available |
## Guidelines
### Usage
An alert displays a short, important message in a way that attracts the user's attention without interrupting the user's task.
### Anatomy
*Documentation coming soon*
_Documentation coming soon_
### Error alert
Error alerts
*Real world example coming soon*
_Real world example coming soon_
### Warning alert
Warning alerts
*Real world example coming soon*
_Real world example coming soon_
### Info alert
Info alerts
*Real world example coming soon*
_Real world example coming soon_
### Success alert
Success alerts
*Real world example coming soon*
_Real world example coming soon_
### Placement
### Accessibility
(WAI-ARIA: [https://www.w3.org/TR/wai-aria-practices/#alert](https://www.w3.org/TR/wai-aria-practices/#alert))
When the component is dynamically displayed, the content is automatically announced by most screen readers. At this time, screen readers do not inform users of alerts that are present when the page loads.
@@ -78,6 +87,7 @@ Actions must have a tab index of 0 so that they can be reached by keyboard-only
## Implementation
### Example Usage
**Alert type**
<ha-alert alert-type="error">
@@ -96,17 +106,12 @@ Actions must have a tab index of 0 so that they can be reached by keyboard-only
This is an success alert — check it out!
</ha-alert>
```html
<ha-alert alert-type="error">
This is an error alert — check it out!
</ha-alert>
<ha-alert alert-type="error"> This is an error alert — check it out! </ha-alert>
<ha-alert alert-type="warning">
This is a warning alert — check it out!
</ha-alert>
<ha-alert alert-type="info">
This is an info alert — check it out!
</ha-alert>
<ha-alert alert-type="info"> This is an info alert — check it out! </ha-alert>
<ha-alert alert-type="success">
This is a success alert — check it out!
</ha-alert>
@@ -154,13 +159,14 @@ The `title ` option should not be used without a description.
**Slotted icon**
*Documentation coming soon*
_Documentation coming soon_
### API
**Properties/Attributes**
| Name | Type | Default | Description |
|-------------|---------|---------|-------------------------------------------------------|
| ----------- | ------- | ------- | ----------------------------------------------------- |
| title | string | `` | Title to display. |
| alertType | string | `info` | Severity level that set a distinctive icon and color. |
| dismissable | boolean | `false` | Gives the option to close the alert. |
@@ -170,8 +176,8 @@ The `title ` option should not be used without a description.
**Events**
*Documentation coming soon*
_Documentation coming soon_
**CSS Custom Properties**
*Documentation coming soon*
_Documentation coming soon_

View File

@@ -10,23 +10,23 @@ export class DemoHaCircularSlider extends LitElement {
private current = 22;
@state()
private value = 19;
private low = 19;
@state()
private high = 25;
@state()
private changingValue?: number;
private changingLow?: number;
@state()
private changingHigh?: number;
private _valueChanged(ev) {
this.value = ev.detail.value;
private _lowChanged(ev) {
this.low = ev.detail.value;
}
private _valueChanging(ev) {
this.changingValue = ev.detail.value;
private _lowChanging(ev) {
this.changingLow = ev.detail.value;
}
private _highChanged(ev) {
@@ -63,19 +63,40 @@ export class DemoHaCircularSlider extends LitElement {
<div class="card-content">
<p class="title"><b>Single</b></p>
<ha-control-circular-slider
@value-changed=${this._valueChanged}
@value-changing=${this._valueChanging}
.value=${this.value}
@value-changed=${this._lowChanged}
@value-changing=${this._lowChanging}
.value=${this.low}
.current=${this.current}
step="1"
min="10"
max="30"
></ha-control-circular-slider>
<div>
Value: ${this.value} °C
Low: ${this.low} °C
<br />
Changing:
${this.changingValue != null ? `${this.changingValue} °C` : "-"}
${this.changingLow != null ? `${this.changingLow} °C` : "-"}
</div>
</div>
</ha-card>
<ha-card>
<div class="card-content">
<p class="title"><b>Inverted</b></p>
<ha-control-circular-slider
inverted
@value-changed=${this._highChanged}
@value-changing=${this._highChanging}
.value=${this.high}
.current=${this.current}
step="1"
min="10"
max="30"
></ha-control-circular-slider>
<div>
High: ${this.high} °C
<br />
Changing:
${this.changingHigh != null ? `${this.changingHigh} °C` : "-"}
</div>
</div>
</ha-card>
@@ -84,11 +105,11 @@ export class DemoHaCircularSlider extends LitElement {
<p class="title"><b>Dual</b></p>
<ha-control-circular-slider
dual
@low-changed=${this._valueChanged}
@low-changing=${this._valueChanging}
@low-changed=${this._lowChanged}
@low-changing=${this._lowChanging}
@high-changed=${this._highChanged}
@high-changing=${this._highChanging}
.low=${this.value}
.low=${this.low}
.high=${this.high}
.current=${this.current}
step="1"
@@ -96,10 +117,10 @@ export class DemoHaCircularSlider extends LitElement {
max="30"
></ha-control-circular-slider>
<div>
Low value: ${this.value} °C
Low value: ${this.low} °C
<br />
Low changing:
${this.changingValue != null ? `${this.changingValue} °C` : "-"}
${this.changingLow != null ? `${this.changingLow} °C` : "-"}
<br />
High value: ${this.high} °C
<br />
@@ -132,6 +153,10 @@ export class DemoHaCircularSlider extends LitElement {
--control-circular-slider-background: #ff9800;
--control-circular-slider-background-opacity: 0.3;
}
ha-control-circular-slider[inverted] {
--control-circular-slider-color: #2196f3;
--control-circular-slider-background: #2196f3;
}
ha-control-circular-slider[dual] {
--control-circular-slider-high-color: #2196f3;
--control-circular-slider-low-color: #ff9800;

View File

@@ -5,28 +5,32 @@ subtitle: Dialogs provide important prompts in a user flow.
# Material Design 3
Our dialogs are based on the latest version of Material Design. Specs and guidelines can be found on its [website](https://m3.material.io/components/dialogs/overview).
Our dialogs are based on the latest version of Material Design. Specs and guidelines can be found on its [website](https://m3.material.io/components/dialogs/overview).
# Highlighted guidelines
## Content
* A best practice is to always use a title, even if it is optional by Material guidelines.
* People mainly read the title and a button. Put the most important information in those two.
* Try to avoid user generated content in the title, this could make the title unreadable long.
* If users become unsure, they read the description. Make sure this explains what will happen.
* Strive for minimalism.
- A best practice is to always use a title, even if it is optional by Material guidelines.
- People mainly read the title and a button. Put the most important information in those two.
- Try to avoid user generated content in the title, this could make the title unreadable long.
- If users become unsure, they read the description. Make sure this explains what will happen.
- Strive for minimalism.
## Buttons and X-icon
* Keep the labels short, for example `Save`, `Delete`, `Enable`.
* Dialog with actions must always have a discard button. On desktop a `Cancel` button and X-icon, on mobile only the X-icon.
* Destructive actions should be a red warning button.
* Alert or confirmation dialogs only have buttons and no X-icon.
* Try to avoid three buttons in one dialog. Especially when you leave the dialog task unfinished.
- Keep the labels short, for example `Save`, `Delete`, `Enable`.
- Dialog with actions must always have a discard button. On desktop a `Cancel` button and X-icon, on mobile only the X-icon.
- Destructive actions should be a red warning button.
- Alert or confirmation dialogs only have buttons and no X-icon.
- Try to avoid three buttons in one dialog. Especially when you leave the dialog task unfinished.
## Example
### Confirmation dialog
> **Delete dashboard?**
>
>
> Dashboard [dashboard name] will be permanently deleted from Home Assistant.
>
>
> Cancel / Delete

View File

@@ -32,7 +32,6 @@ Error color gauge
Gauge with background color
<ha-gauge value="75" style="--gauge-color: var(--info-color); --primary-background-color: lightgray"></ha-gauge>
## CSS variables
### Gauge

View File

@@ -497,24 +497,23 @@ class DemoHaSelector extends LitElement implements ProvideHassElement {
<demo-black-white-row .title=${info.name} .value=${this.data[idx]}>
${["light", "dark"].map((slot) =>
Object.entries(info.input).map(
([key, value]) =>
html`
<ha-settings-row narrow slot=${slot}>
<span slot="heading">${value?.name || key}</span>
<span slot="description">${value?.description}</span>
<ha-selector
.hass=${this.hass}
.selector=${value!.selector}
.key=${key}
.label=${this._label ? value!.name : undefined}
.value=${data[key] ?? value!.default}
.disabled=${this._disabled}
.required=${this._required}
@value-changed=${valueChanged}
.helper=${this._helper ? "Helper text" : undefined}
></ha-selector>
</ha-settings-row>
`
([key, value]) => html`
<ha-settings-row narrow slot=${slot}>
<span slot="heading">${value?.name || key}</span>
<span slot="description">${value?.description}</span>
<ha-selector
.hass=${this.hass}
.selector=${value!.selector}
.key=${key}
.label=${this._label ? value!.name : undefined}
.value=${data[key] ?? value!.default}
.disabled=${this._disabled}
.required=${this._required}
@value-changed=${valueChanged}
.helper=${this._helper ? "Helper text" : undefined}
></ha-selector>
</ha-settings-row>
`
)
)}
</demo-black-white-row>

View File

@@ -30,7 +30,7 @@ For the switch / toggle there are always two variables, one for the on / checked
The track element (background rounded rectangle that the round circular handle travels on) is set to being half transparent, so the final color will also be impacted by the color behind the track.
`switch-checked-color` / `switch-unchecked-color`
Set both the color of the round handle and the track behind it. If you want to control them separately, use the variables below instead.
Set both the color of the round handle and the track behind it. If you want to control them separately, use the variables below instead.
`switch-checked-button-color` / `switch-unchecked-button-color`
Color of the round handle

View File

@@ -20,9 +20,8 @@ export class DemoHaTip extends LitElement {
<ha-card header="ha-tip ${mode} demo">
<div class="card-content">
${tips.map(
(tip) => html`<ha-tip .hass=${provideHass(this)}
>${tip}</ha-tip
>`
(tip) =>
html`<ha-tip .hass=${provideHass(this)}>${tip}</ha-tip>`
)}
</div>
</ha-card>

View File

@@ -7,18 +7,21 @@ title: Home
This portal aims to aid designers and developers on improving the Home Assistant interface. It consists of working code, resources and guidelines.
## Home Assistant interface
The Home Assistant frontend allows users to browse and control the state of their home, manage their automations and configure integrations. The frontend is designed as a mobile-first experience. It is a progressive web application and offers an app-like experience to our users. The Home Assistant frontend needs to be fast. But it also needs to work on a wide range of old devices.
### Material Design
The Home Assistant interface is based on Material Design. It's a design system created by Google to quickly build high-quality digital experiences. Components and guidelines that are custom made for Home Assistant are documented on this portal. For all other components check <a href="https://material.io" rel="noopener noreferrer" target="_blank">material.io</a>.
## Designers
We want to make it as easy for designers to contribute as it is for developers. Theres a lot a designer can contribute to:
- Meet us at <a href="https://discord.gg/BPBc8rZ9" rel="noopener noreferrer" target="_blank">devs_ux Discord</a>. Feel free to share your designs, user test or strategic ideas.
- Start designing with our <a href="https://www.figma.com/community/file/967153512097289521/Home-Assistant-DesignKit" rel="noopener noreferrer" target="_blank">Figma DesignKit</a>.
- Find the lates UX <a href="https://github.com/home-assistant/frontend/discussions?discussions_q=label%3Aux" rel="noopener noreferrer" target="_blank">discussions</a> and <a href="https://github.com/home-assistant/frontend/labels/ux" rel="noopener noreferrer" target="_blank">issues</a> on GitHub. Everyone can start a new issue or discussion!
## Developers
Everything you need to get started developing can be found in our <a href="https://developers.home-assistant.io" rel="noopener noreferrer" target="_blank">Home Assistant Developer Docs</a>.

View File

@@ -4,4 +4,4 @@ title: Date-Time Format (Numeric)
This pages lists all supported languages with their available date-time formats.
Formatting function: `const formatDateTimeNumeric: (dateObj: Date, locale: FrontendLocaleData) => string`
Formatting function: `const formatDateTimeNumeric: (dateObj: Date, locale: FrontendLocaleData) => string`

View File

@@ -4,4 +4,4 @@ title: Date-Time Format (Seconds)
This pages lists all supported languages with their available date-time formats.
Formatting function: `const formatDateTimeWithSeconds: (dateObj: Date, locale: FrontendLocaleData) => string`
Formatting function: `const formatDateTimeWithSeconds: (dateObj: Date, locale: FrontendLocaleData) => string`

View File

@@ -4,4 +4,4 @@ title: Date-Time Format (Short w/ Year)
This pages lists all supported languages with their available date-time formats.
Formatting function: `const formatShortDateTimeWithYear: (dateObj: Date, locale: FrontendLocaleData) => string`
Formatting function: `const formatShortDateTimeWithYear: (dateObj: Date, locale: FrontendLocaleData) => string`

View File

@@ -4,4 +4,4 @@ title: Date-Time Format (Short)
This pages lists all supported languages with their available date-time formats.
Formatting function: `const formatShortDateTime: (dateObj: Date, locale: FrontendLocaleData) => string`
Formatting function: `const formatShortDateTime: (dateObj: Date, locale: FrontendLocaleData) => string`

View File

@@ -4,4 +4,4 @@ title: Date-Time Format
This pages lists all supported languages with their available date-time formats.
Formatting function: `const formatDateTime: (dateObj: Date, locale: FrontendLocaleData) => string`
Formatting function: `const formatDateTime: (dateObj: Date, locale: FrontendLocaleData) => string`

View File

@@ -4,4 +4,4 @@ title: Date Format (Numeric)
This pages lists all supported languages with their available (numeric) date formats.
Formatting function: `const formatDateNumeric: (dateObj: Date, locale: FrontendLocaleData) => string`
Formatting function: `const formatDateNumeric: (dateObj: Date, locale: FrontendLocaleData) => string`

View File

@@ -4,4 +4,4 @@ title: Time Format (Seconds)
This pages lists all supported languages with their available time formats.
Formatting function: `const formatTimeWithSeconds: (dateObj: Date, locale: FrontendLocaleData) => string`
Formatting function: `const formatTimeWithSeconds: (dateObj: Date, locale: FrontendLocaleData) => string`

View File

@@ -4,4 +4,4 @@ title: Time Format (Weekday)
This pages lists all supported languages with their available time formats.
Formatting function: `const formatTimeWeekday: (dateObj: Date, locale: FrontendLocaleData) => string`
Formatting function: `const formatTimeWeekday: (dateObj: Date, locale: FrontendLocaleData) => string`

View File

@@ -4,4 +4,4 @@ title: Time Format
This pages lists all supported languages with their available time formats.
Formatting function: `const formatTime: (dateObj: Date, locale: FrontendLocaleData) => string`
Formatting function: `const formatTime: (dateObj: Date, locale: FrontendLocaleData) => string`

View File

@@ -135,6 +135,14 @@ const ENTITIES = [
getEntity("text", "unavailable", "unavailable", {
friendly_name: "Message",
}),
getEntity("event", "unavailable", "unavailable", {
friendly_name: "Empty remote",
}),
getEntity("event", "doorbell", "2023-07-17T21:26:11.615+00:00", {
friendly_name: "Doorbell",
device_class: "doorbell",
event_type: "Ding-Dong",
}),
];
const CONFIGS = [
@@ -154,6 +162,7 @@ const CONFIGS = [
- input_number.number
- sensor.humidity
- text.message
- event.doorbell
`,
},
{
@@ -246,6 +255,7 @@ const CONFIGS = [
- input_number.unavailable
- input_select.unavailable
- text.unavailable
- event.unavailable
`,
},
{

View File

@@ -1,6 +1,7 @@
---
title: Introduction
---
Dashboards have many different cards. Each card allows the user to tell
a different story about what is going on in their house. These cards
are very customizable, as no household is the same.

View File

@@ -35,6 +35,7 @@ const SENSOR_DEVICE_CLASSES = [
"nitrogen_monoxide",
"nitrous_oxide",
"ozone",
"ph",
"pm1",
"pm10",
"pm25",

View File

@@ -265,6 +265,8 @@ export class DemoIntegrationCard extends LitElement {
></ha-config-flow-card>
`
)}
</div>
<div class="container">
${configEntries.map(
(info) => html`
<ha-integration-card
@@ -338,10 +340,10 @@ export class DemoIntegrationCard extends LitElement {
return css`
.container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
grid-gap: 16px 16px;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
grid-gap: 8px 8px;
padding: 8px 16px 16px;
margin-bottom: 64px;
margin-bottom: 16px;
}
.container > * {

View File

@@ -6,197 +6,217 @@ title: "User Test: Configuration menu"
At the end of last year, we created one Configuration menu by merging Supervisor. In the next iteration, we want to organize our menu by creating logical grouping and combining duplicated features. We are conducting this test to see if we are on the right track.
* Anyone could join
* Respondents recruited on Twitter, Reddit and Home Assistant Forum
* This test is open for 10 days
* UsabilityHub for user test
* Figma for prototype
* 6 questions
* 3 tasks
* Due to some limitations by UsabilityHub, it only worked on desktop
- Anyone could join
- Respondents recruited on Twitter, Reddit and Home Assistant Forum
- This test is open for 10 days
- UsabilityHub for user test
- Figma for prototype
- 6 questions
- 3 tasks
- Due to some limitations by UsabilityHub, it only worked on desktop
# Results
915 respondents took part in this test and they gave 407 comments. In general there isnt a significant difference between:
* How long a respondent has been using Home Assistant
* Installation method
* How many visits to its Home Assistant in the past 3 months
* Home Assistant expertise
- How long a respondent has been using Home Assistant
- Installation method
- How many visits to its Home Assistant in the past 3 months
- Home Assistant expertise
## Overall menu change
This prototype organized our menu by creating logical grouping and combining duplicated features. What do people think of this change?
### Stats
* 2% (21) Like extremely
* 30% (276) Like very much
* 53% (481) Neutral
* 12% (108) Dislike very much
* 3% (26) Dislike extremely
*3 respondents passed*
- 2% (21) Like extremely
- 30% (276) Like very much
- 53% (481) Neutral
- 12% (108) Dislike very much
- 3% (26) Dislike extremely
_3 respondents passed_
### Comments summary
**Like**
* Clean and decluttered
* Style looks better
* Faster to use
* Merging Supervisor into different pages
* Moving Developer tools to Settings
- Clean and decluttered
- Style looks better
- Faster to use
- Merging Supervisor into different pages
- Moving Developer tools to Settings
**Dislike**
* Moving Developer tools to Settings
* More clicks for scripts and helpers
* Too many changes at once causes a high learning curve
* Removing the word `Integrations` makes it harder to find them
* Difference between `Addons` and `Services` is a bit subtle
* No clear distinction between `Developer` and `System`
* Material Design got the Google image
- Moving Developer tools to Settings
- More clicks for scripts and helpers
- Too many changes at once causes a high learning curve
- Removing the word `Integrations` makes it harder to find them
- Difference between `Addons` and `Services` is a bit subtle
- No clear distinction between `Developer` and `System`
- Material Design got the Google image
**Suggestions**
* More top level menu items for example logs.
* What are settings and what not? Maybe better to name it `Configuration`
* Devices are a first-class citizen in the domain of Home Assistant, and so shouldn't be tucked away in "Settings"
* Rename Developer tools (or make it only for Home Assistant developers)
* Separate administration (for instance creating users / adding lights etc) from development activities (creating automations and scripts)
* Search Bar in Settings
* Feature to put menu items in sidebar
* Unification of add-ons and integrations
* Adding New hints to show what changed
* Give `About` a less prominent size
* Accordion view option which puts every tab below
* Dev mode and a Prod Mode
* Always show config menu (on bigger screens)
- More top level menu items for example logs.
- What are settings and what not? Maybe better to name it `Configuration`
- Devices are a first-class citizen in the domain of Home Assistant, and so shouldn't be tucked away in "Settings"
- Rename Developer tools (or make it only for Home Assistant developers)
- Separate administration (for instance creating users / adding lights etc) from development activities (creating automations and scripts)
- Search Bar in Settings
- Feature to put menu items in sidebar
- Unification of add-ons and integrations
- Adding New hints to show what changed
- Give `About` a less prominent size
- Accordion view option which puts every tab below
- Dev mode and a Prod Mode
- Always show config menu (on bigger screens)
### Conclusion
We should keep our focus on organizing our menu by creating logical grouping and combining duplicated features. With these changes we make more people happy:
* Reconsider putting `Logs` as a top-level menu item
* Add a search bar
* Use the word `Integrations` with `Devices & Services`
* Moving `Developer tools` to `Settings` is a good idea
* Rename `Developer tools` to for example `Tools`
* Add `New` explanation popups to what has changed
* We could rename `Configuration` to `Settings`
* Give `About` a less prominent size
- Reconsider putting `Logs` as a top-level menu item
- Add a search bar
- Use the word `Integrations` with `Devices & Services`
- Moving `Developer tools` to `Settings` is a good idea
- Rename `Developer tools` to for example `Tools`
- Add `New` explanation popups to what has changed
- We could rename `Configuration` to `Settings`
- Give `About` a less prominent size
## Helpers
In Home Assistant you can create toggles, text fields, number sliders, timers and counters. Also known as `Helpers`. Where should they be placed?
### Stats
* 78% (709) respondents are using helpers. They use it for:
* 92% (645) automations and scenes
* 62% (422) dashboards
* 43% (296) virtual devices
- 78% (709) respondents are using helpers. They use it for:
- 92% (645) automations and scenes
- 62% (422) dashboards
- 43% (296) virtual devices
### Comments summary
Some respondents commented that they think `Helpers` shouldnt be listed under `Automations & Services`. Although almost all respondents use it for that specific purpose.
### Conclusion
Helpers is, in addition to `Automations & Services`, also partly seen as virtual devices and dashboard entities.
* We might consider promoting them in their own top-level menu item
* Rename `Helpers` to something with `controls`
Helpers is, in addition to `Automations & Services`, also partly seen as virtual devices and dashboard entities.
- We might consider promoting them in their own top-level menu item
- Rename `Helpers` to something with `controls`
## Add person
The first task in this user test was to add a person. Since this has not changed in the current menu structure, this should be an easy assignment. How do people experience the navigation to this feature?
### Stats
95% reached the goal screen and 98% marked the task as completed. There were 18 common paths.
After the task we asked how easy it was to add a person.
* 41% (378) Extremely easy
* 48% (440) Fairly easy
* 7% (67) Neutral
* 2% (19) Somewhat difficult
* 1% (11) Very difficult
- 41% (378) Extremely easy
- 48% (440) Fairly easy
- 7% (67) Neutral
- 2% (19) Somewhat difficult
- 1% (11) Very difficult
### Comments summary
*No mentionable comments *
_No mentionable comments _
### Conclusion
This test showed that the current navigation design works.
## YAML
In Home Assistant you can make configuration changes in YAML files. To make these changes take effect you have to reload your YAML in the UI or do a restart. How are people doing this and can they find it in this new design?
### Stats
83% reached the goal screen and 87% marked the task as completed. There were 59 common paths.
After the task we asked how easy it was to reload the YAML changes.
* 4% (40) Extremely easy
* 22% (204) Fairly easy
* 20% (179) Neutral
* 37% (336) Somewhat difficult
* 17% (156) Very difficult
- 4% (40) Extremely easy
- 22% (204) Fairly easy
- 20% (179) Neutral
- 37% (336) Somewhat difficult
- 17% (156) Very difficult
And we asked if they have seen that we've moved some functionality from current `Server Controls` to `Developer Tools`.
* 57% (517) Yes
* 43% (398) No
- 57% (517) Yes
- 43% (398) No
### Comments summary
**Like**
* YAML in Developer tools
- YAML in Developer tools
**Dislike**
* Hidden restart and reload
* YAML in Developer Tools
* Combining `Developer tools` with `Server management`
* Reload Home Assistant button isn't clear what it does
* Reload/restart Home Assistant in Developer Tools
- Hidden restart and reload
- YAML in Developer Tools
- Combining `Developer tools` with `Server management`
- Reload Home Assistant button isn't clear what it does
- Reload/restart Home Assistant in Developer Tools
**Suggestions**
* Reload all YAML button
* Dev mode and a Prod Mode
* Show restart/reload as buttons in System instead of overflow menu
* Explain that you can reload YAML when you want to restart your system
* YAML reloading under System
- Reload all YAML button
- Dev mode and a Prod Mode
- Show restart/reload as buttons in System instead of overflow menu
- Explain that you can reload YAML when you want to restart your system
- YAML reloading under System
### Conclusion
This test showed two different kinds of user groups: UI and YAML users.
* Moving `Developer tools` to `Settings` is a good idea
* YAML users want reload YAML and Home Assistant restart in `System`
* Move the restart and reload button to the `System` page from the overflow menu
* Add suggestion to reload YAML when a user wants to restart
* Add reload all YAML button
This test showed two different kinds of user groups: UI and YAML users.
- Moving `Developer tools` to `Settings` is a good idea
- YAML users want reload YAML and Home Assistant restart in `System`
- Move the restart and reload button to the `System` page from the overflow menu
- Add suggestion to reload YAML when a user wants to restart
- Add reload all YAML button
## Logs
### Stats
70% reached the goal screen and 77% marked the task as completed. There were 48 common paths.
After the task we asked to find out why your Elgato light isn't working.
* 6% (57) Extremely easy
* 28% (254) Fairly easy
* 21% (188) Neutral
* 21% (196) Somewhat difficult
* 24% (220) Very difficult
- 6% (57) Extremely easy
- 28% (254) Fairly easy
- 21% (188) Neutral
- 21% (196) Somewhat difficult
- 24% (220) Very difficult
### Comments summary
**Suggestions**
* Log errors on the integration page
* Problem solving center
- Log errors on the integration page
- Problem solving center
### Conclusion
Although this test shows that a large number of respondents manage to complete the task, they find it difficult to find out the light isnt working.
* Add logs errors/warnings to the integration page
* Reconsider putting `Logs` as a top-level menu item
- Add logs errors/warnings to the integration page
- Reconsider putting `Logs` as a top-level menu item
## Learnings for next user test
* Explain that topic is closed for comments so that you can do this test without any influence
* Mobile test should work on mobile
* Testing on an iPad got some bugs
* People like doing these kind of test and we should do them more often
- Explain that topic is closed for comments so that you can do this test without any influence
- Mobile test should work on mobile
- Testing on an iPad got some bugs
- People like doing these kind of test and we should do them more often

View File

@@ -2,7 +2,7 @@
title: "User types"
---
We have defined three user types for Home Assistant. They are a lean segmentation of users that helps us make decisions throughout the product. User types differ from traditional personas in that the segmentation criteria arent demographic and dont personify a group into a single character with a fictitious background story.
We have defined three user types for Home Assistant. They are a lean segmentation of users that helps us make decisions throughout the product. User types differ from traditional personas in that the segmentation criteria arent demographic and dont personify a group into a single character with a fictitious background story.
# Outgrowers

View File

@@ -114,11 +114,22 @@ class HassioAddonInfo extends LitElement {
@state() private _error?: string;
private _fetchDataTimeout?: number;
private _addonStoreInfo = memoizeOne(
(slug: string, storeAddons: StoreAddon[]) =>
storeAddons.find((addon) => addon.slug === slug)
);
public disconnectedCallback() {
super.disconnectedCallback();
if (this._fetchDataTimeout) {
clearInterval(this._fetchDataTimeout);
this._fetchDataTimeout = undefined;
}
}
protected render(): TemplateResult {
const addonStoreInfo =
!this.addon.detached && !this.addon.available
@@ -533,14 +544,13 @@ class HassioAddonInfo extends LitElement {
<code slot="description"> ${this.addon.hostname} </code>
</ha-settings-row>
${metrics.map(
(metric) =>
html`
<supervisor-metric
.description=${metric.description}
.value=${metric.value ?? 0}
.tooltip=${metric.tooltip}
></supervisor-metric>
`
(metric) => html`
<supervisor-metric
.description=${metric.description}
.value=${metric.value ?? 0}
.tooltip=${metric.tooltip}
></supervisor-metric>
`
)}`
: ""}
</div>
@@ -592,7 +602,10 @@ class HassioAddonInfo extends LitElement {
</ha-progress-button>
`
: html`
<ha-progress-button @click=${this._startClicked}>
<ha-progress-button
@click=${this._startClicked}
.progress=${this.addon.state === "startup"}
>
${this.supervisor.localize("addon.dashboard.start")}
</ha-progress-button>
`
@@ -672,9 +685,36 @@ class HassioAddonInfo extends LitElement {
super.updated(changedProps);
if (changedProps.has("addon")) {
this._loadData();
if (
!this._fetchDataTimeout &&
this.addon &&
"state" in this.addon &&
this.addon.state === "startup"
) {
// Addon is starting up, wait for it to start
this._scheduleDataUpdate();
}
}
}
private _scheduleDataUpdate() {
this._fetchDataTimeout = window.setTimeout(async () => {
const addon = await fetchHassioAddonInfo(this.hass, this.addon.slug);
if (addon.state !== "startup") {
this._fetchDataTimeout = undefined;
this.addon = addon;
const eventdata = {
success: true,
response: undefined,
path: "start",
};
fireEvent(this, "hass-api-called", eventdata);
} else {
this._scheduleDataUpdate();
}
}, 500);
}
private async _loadData(): Promise<void> {
if ("state" in this.addon && this.addon.state === "started") {
this._metrics = await fetchHassioStats(

View File

@@ -384,28 +384,30 @@ export class SupervisorBackupContent extends LitElement {
: undefined;
let checkedItems = 0;
this[section].forEach((item) => {
templates.push(html`<ha-formfield
.label=${html`<supervisor-formfield-label
.label=${item.name}
.iconPath=${section === "addons" ? mdiPuzzle : mdiFolder}
.imageUrl=${section === "addons" &&
!this.onboarding &&
atLeastVersion(this.hass.config.version, 0, 105) &&
addons?.get(item.slug)?.icon
? `/api/hassio/addons/${item.slug}/icon`
: undefined}
.version=${item.version}
templates.push(
html`<ha-formfield
.label=${html`<supervisor-formfield-label
.label=${item.name}
.iconPath=${section === "addons" ? mdiPuzzle : mdiFolder}
.imageUrl=${section === "addons" &&
!this.onboarding &&
atLeastVersion(this.hass.config.version, 0, 105) &&
addons?.get(item.slug)?.icon
? `/api/hassio/addons/${item.slug}/icon`
: undefined}
.version=${item.version}
>
</supervisor-formfield-label>`}
>
</supervisor-formfield-label>`}
>
<ha-checkbox
.item=${item}
.checked=${item.checked}
.section=${section}
@change=${this._updateSectionEntry}
>
</ha-checkbox>
</ha-formfield>`);
<ha-checkbox
.item=${item}
.checked=${item.checked}
.section=${section}
@change=${this._updateSectionEntry}
>
</ha-checkbox>
</ha-formfield>`
);
if (item.checked) {
checkedItems++;

View File

@@ -137,6 +137,9 @@ class HassioAddons extends LitElement {
--mdc-text-field-fill-color: var(--sidebar-background-color);
--mdc-text-field-idle-line-color: var(--divider-color);
}
.content {
margin-bottom: 72px;
}
`,
];
}

View File

@@ -194,7 +194,7 @@ class HassioBackupDialog
}
if (
!(await showConfirmationDialog(this, {
title: "Are you sure you want partially to restore this backup?",
title: "Are you sure you want to restore this partial backup?",
confirmText: "restore",
dismissText: "cancel",
}))

View File

@@ -168,25 +168,24 @@ export class DialogHassioNetwork
${this._accessPoints.accesspoints
.filter((ap) => ap.ssid)
.map(
(ap) =>
html`
<mwc-list-item
twoline
@click=${this._selectAP}
.activated=${ap.ssid ===
this._wifiConfiguration?.ssid}
.ap=${ap}
>
<span>${ap.ssid}</span>
<span slot="secondary">
${ap.mac} -
${this.supervisor.localize(
"dialog.network.signal_strength"
)}:
${ap.signal}
</span>
</mwc-list-item>
`
(ap) => html`
<mwc-list-item
twoline
@click=${this._selectAP}
.activated=${ap.ssid ===
this._wifiConfiguration?.ssid}
.ap=${ap}
>
<span>${ap.ssid}</span>
<span slot="secondary">
${ap.mac} -
${this.supervisor.localize(
"dialog.network.signal_strength"
)}:
${ap.signal}
</span>
</mwc-list-item>
`
)}
</mwc-list>
`

View File

@@ -157,10 +157,11 @@ class HassioRegistriesDialog extends LitElement {
}
public focus(): void {
this.updateComplete.then(() =>
(
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
)?.focus()
this.updateComplete.then(
() =>
(
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
)?.focus()
);
}

View File

@@ -209,10 +209,11 @@ class HassioRepositoriesDialog extends LitElement {
}
public focus() {
this.updateComplete.then(() =>
(
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
)?.focus()
this.updateComplete.then(
() =>
(
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
)?.focus()
);
}

View File

@@ -16,6 +16,7 @@ import "../../../src/components/ha-icon-button";
import {
fetchHassioAddonInfo,
HassioAddonDetails,
startHassioAddon,
} from "../../../src/data/hassio/addon";
import { extractApiErrorMessage } from "../../../src/data/hassio/common";
import {
@@ -23,7 +24,10 @@ import {
validateHassioSession,
} from "../../../src/data/hassio/ingress";
import { Supervisor } from "../../../src/data/supervisor/supervisor";
import { showAlertDialog } from "../../../src/dialogs/generic/show-dialog-box";
import {
showAlertDialog,
showConfirmationDialog,
} from "../../../src/dialogs/generic/show-dialog-box";
import "../../../src/layouts/hass-loading-screen";
import "../../../src/layouts/hass-subpage";
import { HomeAssistant, Route } from "../../../src/types";
@@ -34,17 +38,20 @@ class HassioIngressView extends LitElement {
@property({ attribute: false }) public supervisor!: Supervisor;
@property() public route!: Route;
@property({ attribute: false }) public route!: Route;
@property() public ingressPanel = false;
@property({ type: Boolean }) public ingressPanel = false;
@property({ type: Boolean }) public narrow = false;
@state() private _addon?: HassioAddonDetails;
@property({ type: Boolean })
public narrow = false;
@state() private _loadingMessage?: string;
private _sessionKeepAlive?: number;
private _fetchDataTimeout?: number;
public disconnectedCallback() {
super.disconnectedCallback();
@@ -52,16 +59,23 @@ class HassioIngressView extends LitElement {
clearInterval(this._sessionKeepAlive);
this._sessionKeepAlive = undefined;
}
if (this._fetchDataTimeout) {
clearInterval(this._fetchDataTimeout);
this._fetchDataTimeout = undefined;
}
}
protected render(): TemplateResult {
if (!this._addon) {
return html` <hass-loading-screen></hass-loading-screen> `;
return html`<hass-loading-screen
.message=${this._loadingMessage}
></hass-loading-screen>`;
}
const iframe = html`<iframe
title=${this._addon.name}
src=${this._addon.ingress_url!}
@load=${this._checkLoaded}
>
</iframe>`;
@@ -125,19 +139,20 @@ class HassioIngressView extends LitElement {
}
}
protected updated(changedProps: PropertyValues) {
super.updated(changedProps);
protected willUpdate(changedProps: PropertyValues) {
super.willUpdate(changedProps);
if (!changedProps.has("route")) {
return;
}
const addon = this.route.path.substr(1);
const addon = this.route.path.substring(1);
const oldRoute = changedProps.get("route") as this["route"] | undefined;
const oldAddon = oldRoute ? oldRoute.path.substr(1) : undefined;
const oldAddon = oldRoute ? oldRoute.path.substring(1) : undefined;
if (addon && addon !== oldAddon) {
this._loadingMessage = undefined;
this._fetchData(addon);
}
}
@@ -145,33 +160,29 @@ class HassioIngressView extends LitElement {
private async _fetchData(addonSlug: string) {
const createSessionPromise = createHassioSession(this.hass);
let addon;
let addon: HassioAddonDetails;
try {
addon = await fetchHassioAddonInfo(this.hass, addonSlug);
} catch (err: any) {
await this.updateComplete;
await showAlertDialog(this, {
text: "Unable to fetch add-on info to start Ingress",
text:
this.supervisor.localize("ingress.error_addon_info") ||
"Unable to fetch add-on info to start Ingress",
title: "Supervisor",
});
await nextRender();
history.back();
navigate("/hassio/store", { replace: true });
return;
}
if (!addon.ingress_url) {
if (!addon.version) {
await this.updateComplete;
await showAlertDialog(this, {
text: "Add-on does not support Ingress",
title: addon.name,
});
await nextRender();
history.back();
return;
}
if (addon.state !== "started") {
await showAlertDialog(this, {
text: "Add-on is not running. Please start it first",
text:
this.supervisor.localize("ingress.error_addon_not_installed") ||
"The add-on is not installed. Please install it first",
title: addon.name,
});
await nextRender();
@@ -179,13 +190,94 @@ class HassioIngressView extends LitElement {
return;
}
let session;
if (!addon.ingress_url) {
await this.updateComplete;
await showAlertDialog(this, {
text:
this.supervisor.localize("ingress.error_addon_not_supported") ||
"This add-on does not support Ingress",
title: addon.name,
});
await nextRender();
history.back();
return;
}
if (!addon.state || !["startup", "started"].includes(addon.state)) {
await this.updateComplete;
const confirm = await showConfirmationDialog(this, {
text:
this.supervisor.localize("ingress.error_addon_not_running") ||
"The add-on is not running. Do you want to start it now?",
title: addon.name,
confirmText:
this.supervisor.localize("ingress.start_addon") || "Start add-on",
dismissText: this.supervisor.localize("common.no") || "No",
});
if (confirm) {
try {
this._loadingMessage =
this.supervisor.localize("ingress.addon_starting") ||
"The add-on is starting, this can take some time...";
await startHassioAddon(this.hass, addonSlug);
fireEvent(this, "supervisor-collection-refresh", {
collection: "addon",
});
this._fetchData(addonSlug);
return;
} catch (e) {
await showAlertDialog(this, {
text:
this.supervisor.localize("ingress.error_starting_addon") ||
"Error starting the add-on",
title: addon.name,
});
await nextRender();
navigate(`/hassio/addon/${addon.slug}/logs`, { replace: true });
return;
}
} else {
await nextRender();
navigate(`/hassio/addon/${addon.slug}/info`, { replace: true });
return;
}
}
if (addon.state === "startup") {
// Addon is starting up, wait for it to start
this._loadingMessage =
this.supervisor.localize("ingress.addon_starting") ||
"The add-on is starting, this can take some time...";
this._fetchDataTimeout = window.setTimeout(() => {
this._fetchData(addonSlug);
}, 500);
return;
}
if (addon.state !== "started") {
return;
}
this._loadingMessage = undefined;
if (this._fetchDataTimeout) {
clearInterval(this._fetchDataTimeout);
this._fetchDataTimeout = undefined;
}
let session: string;
try {
session = await createSessionPromise;
} catch (err: any) {
if (this._sessionKeepAlive) {
clearInterval(this._sessionKeepAlive);
}
await showAlertDialog(this, {
text: "Unable to create an Ingress session",
text:
this.supervisor.localize("ingress.error_creating_session") ||
"Unable to create an Ingress session",
title: addon.name,
});
await nextRender();
@@ -207,6 +299,34 @@ class HassioIngressView extends LitElement {
this._addon = addon;
}
private async _checkLoaded(ev): Promise<void> {
if (!this._addon) {
return;
}
if (ev.target.contentDocument.body.textContent === "502: Bad Gateway") {
await this.updateComplete;
showConfirmationDialog(this, {
text:
this.supervisor.localize("ingress.error_addon_not_ready") ||
"The add-on seems to not be ready, it might still be starting. Do you want to try again?",
title: this._addon.name,
confirmText: this.supervisor.localize("ingress.retry") || "Retry",
dismissText: this.supervisor.localize("common.no") || "No",
confirm: async () => {
const addon = this._addon;
this._addon = undefined;
await Promise.all([
this.updateComplete,
new Promise((resolve) => {
setTimeout(resolve, 500);
}),
]);
this._addon = addon;
},
});
}
}
private _toggleMenu(): void {
fireEvent(this, "hass-toggle-menu");
}

View File

@@ -23,6 +23,7 @@ import {
SupervisorObject,
supervisorCollection,
SupervisorKeys,
cleanupSupervisorCollection,
} from "../../src/data/supervisor/supervisor";
import { ProvideHassLitMixin } from "../../src/mixins/provide-hass-lit-mixin";
import { urlSyncMixin } from "../../src/state/url-sync-mixin";
@@ -67,6 +68,10 @@ export class SupervisorBaseElement extends urlSyncMixin(
this._unsubs[unsub]();
delete this._unsubs[unsub];
});
Object.keys(this._collections).forEach((collection) => {
cleanupSupervisorCollection(this.hass.connection, collection);
});
this._collections = {};
this.removeEventListener(
"supervisor-collection-refresh",
this._handleSupervisorStoreRefreshEvent
@@ -114,7 +119,9 @@ export class SupervisorBaseElement extends urlSyncMixin(
private async _handleSupervisorStoreRefreshEvent(ev) {
const collection = ev.detail.collection;
if (atLeastVersion(this.hass.config.version, 2021, 2, 4)) {
this._collections[collection].refresh();
if (collection in this._collections) {
this._collections[collection].refresh();
}
return;
}
@@ -129,11 +136,17 @@ export class SupervisorBaseElement extends urlSyncMixin(
if (this._unsubs[collection]) {
this._unsubs[collection]();
}
this._unsubs[collection] = this._collections[collection].subscribe((data) =>
this._updateSupervisor({
[collection]: data,
})
);
try {
this._unsubs[collection] = this._collections[collection].subscribe(
(data) =>
this._updateSupervisor({
[collection]: data,
})
);
} catch (e) {
// eslint-disable-next-line no-console
console.error(e);
}
}
private async _initSupervisor(): Promise<void> {

View File

@@ -81,14 +81,13 @@ class HassioCoreInfo extends LitElement {
</div>
<div>
${metrics.map(
(metric) =>
html`
<supervisor-metric
.description=${metric.description}
.value=${metric.value ?? 0}
.tooltip=${metric.tooltip}
></supervisor-metric>
`
(metric) => html`
<supervisor-metric
.description=${metric.description}
.value=${metric.value ?? 0}
.tooltip=${metric.tooltip}
></supervisor-metric>
`
)}
</div>
</div>

View File

@@ -154,14 +154,13 @@ class HassioHostInfo extends LitElement {
</ha-settings-row>`
: ""}
${metrics.map(
(metric) =>
html`
<supervisor-metric
.description=${metric.description}
.value=${metric.value ?? 0}
.tooltip=${metric.tooltip}
></supervisor-metric>
`
(metric) => html`
<supervisor-metric
.description=${metric.description}
.value=${metric.value ?? 0}
.tooltip=${metric.tooltip}
></supervisor-metric>
`
)}
</div>
</div>

View File

@@ -178,14 +178,13 @@ class HassioSupervisorInfo extends LitElement {
</div>
<div class="metrics-block">
${metrics.map(
(metric) =>
html`
<supervisor-metric
.description=${metric.description}
.value=${metric.value ?? 0}
.tooltip=${metric.tooltip}
></supervisor-metric>
`
(metric) => html`
<supervisor-metric
.description=${metric.description}
.value=${metric.value ?? 0}
.tooltip=${metric.tooltip}
></supervisor-metric>
`
)}
</div>
</div>

View File

@@ -1,6 +1,9 @@
export default {
"*.?(c|m){js,ts}": ["eslint --fix", "prettier --write"],
"!(/translations)*.{json,css,md,html}": "prettier --write",
"*.?(c|m){js,ts}": [
"eslint --cache --cache-strategy=content --cache-location=node_modules/.cache/eslint/.eslintcache --fix",
"prettier --cache --write",
],
"*.{json,css,md,markdown,html,y?aml}": "prettier --cache --write",
"translations/*/*.json": (files) =>
'printf "%s\n" "Translation files should not be added or modified here. Instead, make the necessary modifications in src/translations/en.json. Other languages are managed externally. Please see https://developers.home-assistant.io/docs/translations/ for details." ' +
files.join(" ") +

View File

@@ -8,10 +8,10 @@
"version": "1.0.0",
"scripts": {
"build": "script/build_frontend",
"lint:eslint": "eslint \"**/src/**/*.{js,ts,html}\" --ignore-path .gitignore",
"format:eslint": "eslint \"**/src/**/*.{js,ts,html}\" --fix --ignore-path .gitignore",
"lint:prettier": "prettier \"**/src/**/*.{js,ts,json,css,md}\" --check",
"format:prettier": "prettier \"**/src/**/*.{js,ts,json,css,md}\" --write",
"lint:eslint": "eslint \"**/src/**/*.{js,ts,html}\" --cache --cache-strategy=content --cache-location=node_modules/.cache/eslint/.eslintcache --ignore-path=.gitignore",
"format:eslint": "eslint \"**/src/**/*.{js,ts,html}\" --cache --cache-strategy=content --cache-location=node_modules/.cache/eslint/.eslintcache --ignore-path=.gitignore --fix",
"lint:prettier": "prettier . --cache --check",
"format:prettier": "prettier . --cache --write",
"lint:types": "tsc",
"lint:lit": "lit-analyzer \"**/src/**/*.ts\" --format markdown --outFile result.md",
"lint": "yarn run lint:eslint && yarn run lint:prettier && yarn run lint:types",
@@ -25,15 +25,15 @@
"license": "Apache-2.0",
"type": "module",
"dependencies": {
"@babel/runtime": "7.22.5",
"@babel/runtime": "7.22.6",
"@braintree/sanitize-url": "6.0.2",
"@codemirror/autocomplete": "6.8.0",
"@codemirror/autocomplete": "6.9.0",
"@codemirror/commands": "6.2.4",
"@codemirror/language": "6.8.0",
"@codemirror/legacy-modes": "6.3.2",
"@codemirror/legacy-modes": "6.3.3",
"@codemirror/search": "6.5.0",
"@codemirror/state": "6.2.1",
"@codemirror/view": "6.13.2",
"@codemirror/view": "6.15.3",
"@egjs/hammerjs": "2.0.17",
"@formatjs/intl-datetimeformat": "6.10.0",
"@formatjs/intl-displaynames": "6.5.0",
@@ -47,12 +47,13 @@
"@fullcalendar/daygrid": "6.1.8",
"@fullcalendar/interaction": "6.1.8",
"@fullcalendar/list": "6.1.8",
"@fullcalendar/luxon3": "6.1.8",
"@fullcalendar/timegrid": "6.1.8",
"@lezer/highlight": "1.1.6",
"@lit-labs/context": "0.3.3",
"@lit-labs/motion": "1.0.3",
"@lit-labs/virtualizer": "2.0.3",
"@lrnwebcomponents/simple-tooltip": "7.0.2",
"@lit-labs/virtualizer": "2.0.4",
"@lrnwebcomponents/simple-tooltip": "7.0.11",
"@material/chips": "=14.0.0-canary.53b3cad2f.0",
"@material/data-table": "=14.0.0-canary.53b3cad2f.0",
"@material/mwc-button": "0.27.0",
@@ -78,7 +79,7 @@
"@material/mwc-top-app-bar": "0.27.0",
"@material/mwc-top-app-bar-fixed": "0.27.0",
"@material/top-app-bar": "=14.0.0-canary.53b3cad2f.0",
"@material/web": "=1.0.0-pre.10",
"@material/web": "=1.0.0-pre.13",
"@mdi/js": "7.2.96",
"@mdi/svg": "7.2.96",
"@polymer/app-layout": "3.1.0",
@@ -93,8 +94,8 @@
"@polymer/paper-toast": "3.0.1",
"@polymer/polymer": "3.5.1",
"@thomasloven/round-slider": "0.6.0",
"@vaadin/combo-box": "24.1.1",
"@vaadin/vaadin-themable-mixin": "24.1.1",
"@vaadin/combo-box": "24.1.4",
"@vaadin/vaadin-themable-mixin": "24.1.4",
"@vibrant/color": "3.2.1-alpha.1",
"@vibrant/core": "3.2.1-alpha.1",
"@vibrant/quantizer-mmcq": "3.2.1-alpha.1",
@@ -104,22 +105,23 @@
"app-datepicker": "5.1.1",
"chart.js": "3.3.2",
"comlink": "4.4.1",
"core-js": "3.31.0",
"core-js": "3.31.1",
"cropperjs": "1.5.13",
"date-fns": "2.30.0",
"date-fns-tz": "2.0.0",
"deep-clone-simple": "1.1.1",
"deep-freeze": "0.0.1",
"fuse.js": "6.6.2",
"google-timezones-json": "1.1.0",
"hls.js": "1.4.6",
"home-assistant-js-websocket": "8.0.1",
"google-timezones-json": "1.2.0",
"hls.js": "1.4.10",
"home-assistant-js-websocket": "8.2.0",
"idb-keyval": "6.2.1",
"intl-messageformat": "10.5.0",
"js-yaml": "4.1.0",
"leaflet": "1.9.4",
"leaflet-draw": "1.0.4",
"lit": "2.7.5",
"lit": "2.7.6",
"luxon": "3.3.0",
"marked": "4.3.0",
"memoize-one": "6.0.0",
"node-vibrant": "3.2.1-alpha.1",
@@ -133,8 +135,8 @@
"sortablejs": "1.15.0",
"superstruct": "1.0.3",
"tinykeys": "2.1.0",
"tsparticles-engine": "2.10.1",
"tsparticles-preset-links": "2.10.1",
"tsparticles-engine": "2.11.0",
"tsparticles-preset-links": "2.11.0",
"unfetch": "5.0.0",
"vis-data": "7.1.6",
"vis-network": "9.1.6",
@@ -150,18 +152,18 @@
"xss": "1.0.14"
},
"devDependencies": {
"@babel/core": "7.22.5",
"@babel/plugin-proposal-decorators": "7.22.5",
"@babel/plugin-transform-runtime": "7.22.5",
"@babel/preset-env": "7.22.5",
"@babel/core": "7.22.9",
"@babel/plugin-proposal-decorators": "7.22.7",
"@babel/plugin-transform-runtime": "7.22.9",
"@babel/preset-env": "7.22.9",
"@babel/preset-typescript": "7.22.5",
"@koa/cors": "4.0.0",
"@octokit/auth-oauth-device": "5.0.2",
"@octokit/plugin-retry": "5.0.4",
"@octokit/rest": "19.0.13",
"@octokit/auth-oauth-device": "6.0.0",
"@octokit/plugin-retry": "6.0.0",
"@octokit/rest": "20.0.1",
"@open-wc/dev-server-hmr": "0.1.4",
"@rollup/plugin-babel": "6.0.3",
"@rollup/plugin-commonjs": "25.0.1",
"@rollup/plugin-commonjs": "25.0.3",
"@rollup/plugin-json": "6.0.0",
"@rollup/plugin-node-resolve": "15.1.0",
"@rollup/plugin-replace": "5.0.2",
@@ -174,36 +176,37 @@
"@types/js-yaml": "4.0.5",
"@types/leaflet": "1.9.3",
"@types/leaflet-draw": "1.0.7",
"@types/luxon": "3.3.1",
"@types/marked": "4.3.1",
"@types/mocha": "10.0.1",
"@types/qrcode": "1.5.0",
"@types/qrcode": "1.5.1",
"@types/serve-handler": "6.1.1",
"@types/sortablejs": "1.15.1",
"@types/tar": "6.1.5",
"@types/webspeechapi": "0.0.29",
"@typescript-eslint/eslint-plugin": "5.59.11",
"@typescript-eslint/parser": "5.59.11",
"@typescript-eslint/eslint-plugin": "6.2.0",
"@typescript-eslint/parser": "6.2.0",
"@web/dev-server": "0.1.38",
"@web/dev-server-rollup": "0.4.1",
"babel-loader": "9.1.2",
"babel-loader": "9.1.3",
"babel-plugin-template-html-minifier": "4.1.0",
"chai": "4.3.7",
"del": "7.0.0",
"eslint": "8.43.0",
"eslint": "8.46.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "17.0.0",
"eslint-config-prettier": "8.8.0",
"eslint-config-airbnb-typescript": "17.1.0",
"eslint-config-prettier": "8.9.0",
"eslint-import-resolver-webpack": "0.13.2",
"eslint-plugin-disable": "2.0.3",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-import": "2.28.0",
"eslint-plugin-lit": "1.8.3",
"eslint-plugin-lit-a11y": "3.0.0",
"eslint-plugin-unused-imports": "2.0.0",
"eslint-plugin-unused-imports": "3.0.0",
"eslint-plugin-wc": "1.5.0",
"esprima": "4.0.1",
"fancy-log": "2.0.0",
"fs-extra": "11.1.1",
"glob": "10.2.7",
"glob": "10.3.3",
"gulp": "4.0.2",
"gulp-flatmap": "1.0.2",
"gulp-json-transform": "0.4.8",
@@ -214,32 +217,32 @@
"husky": "8.0.3",
"instant-mocha": "1.5.1",
"jszip": "3.10.1",
"lint-staged": "13.2.2",
"lint-staged": "13.2.3",
"lit-analyzer": "2.0.0-pre.3",
"lodash.template": "4.5.0",
"magic-string": "0.30.0",
"magic-string": "0.30.1",
"map-stream": "0.0.7",
"merge-stream": "2.0.0",
"mocha": "10.2.0",
"object-hash": "3.0.0",
"open": "9.1.0",
"pinst": "3.0.0",
"prettier": "2.8.8",
"prettier": "3.0.0",
"rollup": "2.79.1",
"rollup-plugin-string": "3.0.0",
"rollup-plugin-terser": "7.0.2",
"rollup-plugin-visualizer": "5.9.2",
"serve-handler": "6.1.5",
"sinon": "15.1.2",
"sinon": "15.2.0",
"source-map-url": "0.4.1",
"systemjs": "6.14.1",
"tar": "6.1.15",
"terser-webpack-plugin": "5.3.9",
"ts-lit-plugin": "2.0.0-pre.1",
"typescript": "5.1.3",
"typescript": "5.1.6",
"vinyl-buffer": "1.0.1",
"vinyl-source-stream": "2.0.0",
"webpack": "5.87.0",
"webpack": "5.88.2",
"webpack-cli": "5.1.4",
"webpack-dev-server": "4.15.1",
"webpack-manifest-plugin": "5.0.0",
@@ -250,11 +253,8 @@
"resolutions": {
"@polymer/polymer": "patch:@polymer/polymer@3.5.1#./.yarn/patches/@polymer/polymer/pr-5569.patch",
"@material/mwc-button@^0.25.3": "^0.27.0",
"sortablejs@1.15.0": "patch:sortablejs@npm%3A1.15.0#./.yarn/patches/sortablejs-npm-1.15.0-f3a393abcc.patch"
"sortablejs@1.15.0": "patch:sortablejs@npm%3A1.15.0#./.yarn/patches/sortablejs-npm-1.15.0-f3a393abcc.patch",
"leaflet-draw@1.0.4": "patch:leaflet-draw@npm%3A1.0.4#./.yarn/patches/leaflet-draw-npm-1.0.4-0ca0ebcf65.patch"
},
"prettier": {
"trailingComma": "es5",
"arrowParens": "always"
},
"packageManager": "yarn@3.6.0"
"packageManager": "yarn@3.6.1"
}

3
prettier.config.js Normal file
View File

@@ -0,0 +1,3 @@
export default {
trailingComma: "es5",
};

View File

@@ -1,10 +1,10 @@
[build-system]
requires = ["setuptools~=62.3", "wheel~=0.37.1"]
requires = ["setuptools~=68.0", "wheel~=0.40.0"]
build-backend = "setuptools.build_meta"
[project]
name = "home-assistant-frontend"
version = "20230608.0"
version = "20230801.0"
license = {text = "Apache-2.0"}
description = "The Home Assistant frontend"
readme = "README.md"

View File

@@ -2,7 +2,7 @@
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
":ignoreModulesAndTests",
":label(dependencies)",
":label(Dependencies)",
":pinVersions",
":prConcurrentLimit10",
":semanticCommitsDisabled",

View File

@@ -1,2 +0,0 @@
# Setuptools v62.3 doesn't support editable installs with just 'pyproject.toml' (PEP 660).
# Keep this file until it does!

View File

@@ -182,6 +182,10 @@ export class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
display: block;
margin-top: 24px;
}
p {
font-size: 14px;
line-height: 20px;
}
`;
}
}

View File

@@ -10,6 +10,7 @@ import {
mdiBookmark,
mdiBrightness5,
mdiBullhorn,
mdiButtonPointer,
mdiCalendar,
mdiCalendarClock,
mdiCarCoolantLevel,
@@ -28,7 +29,6 @@ import {
mdiFormatListBulleted,
mdiFormTextbox,
mdiGauge,
mdiGestureTapButton,
mdiGoogleAssistant,
mdiGoogleCirclesCommunities,
mdiHomeAssistant,
@@ -45,6 +45,7 @@ import {
mdiMoleculeCo,
mdiMoleculeCo2,
mdiPalette,
mdiPh,
mdiProgressClock,
mdiRayVertex,
mdiRemote,
@@ -93,7 +94,7 @@ export const FIXED_DOMAIN_ICONS = {
homekit: mdiHomeAutomation,
image: mdiImage,
image_processing: mdiImageFilterFrames,
input_button: mdiGestureTapButton,
input_button: mdiButtonPointer,
input_datetime: mdiCalendarClock,
input_number: mdiRayVertex,
input_select: mdiFormatListBulleted,
@@ -148,6 +149,7 @@ export const FIXED_DEVICE_CLASS_ICONS = {
nitrogen_monoxide: mdiMolecule,
nitrous_oxide: mdiMolecule,
ozone: mdiMolecule,
ph: mdiPh,
pm1: mdiMolecule,
pm10: mdiMolecule,
pm25: mdiMolecule,
@@ -178,10 +180,12 @@ export const DOMAINS_WITH_CARD = [
"climate",
"cover",
"configurator",
"event",
"input_button",
"input_select",
"input_number",
"input_text",
"humidifier",
"lock",
"media_player",
"number",
@@ -257,7 +261,11 @@ export const DOMAINS_TOGGLE = new Set([
]);
/** Domains that have a dynamic entity image / picture. */
export const DOMAINS_WITH_DYNAMIC_PICTURE = new Set(["camera", "media_player"]);
export const DOMAINS_WITH_DYNAMIC_PICTURE = new Set([
"camera",
"image",
"media_player",
]);
/** Temperature units. */
export const UNIT_C = "°C";

View File

@@ -46,7 +46,10 @@ export const computeAttributeValueDisplay = (
// If invalid URL, exception will be raised
const url = new URL(attributeValue);
if (url.protocol === "http:" || url.protocol === "https:")
return html`<a target="_blank" rel="noreferrer" href=${attributeValue}
return html`<a
target="_blank"
rel="noopener noreferrer"
href=${attributeValue}
>${attributeValue}</a
>`;
} catch (_) {

View File

@@ -50,7 +50,7 @@ export const computeStateDisplay = (
entities: HomeAssistant["entities"],
state?: string
): string => {
const entity = entities[stateObj.entity_id] as
const entity = entities?.[stateObj.entity_id] as
| EntityRegistryDisplayEntry
| undefined;
@@ -169,12 +169,6 @@ export const computeStateDisplayFromEntityAttributes = (
}
}
if (domain === "humidifier") {
if (state === "on" && attributes.humidity) {
return `${attributes.humidity} %`;
}
}
// `counter` `number` and `input_number` domains do not have a unit of measurement but should still use `formatNumber`
if (
domain === "counter" ||
@@ -191,9 +185,15 @@ export const computeStateDisplayFromEntityAttributes = (
// state is a timestamp
if (
["button", "image", "input_button", "scene", "stt", "tts"].includes(
domain
) ||
[
"button",
"event",
"image",
"input_button",
"scene",
"stt",
"tts",
].includes(domain) ||
(domain === "sensor" && attributes.device_class === "timestamp")
) {
try {

View File

@@ -7,6 +7,7 @@ import {
mdiAudioVideoOff,
mdiBluetooth,
mdiBluetoothConnect,
mdiButtonPointer,
mdiCalendar,
mdiCast,
mdiCastConnected,
@@ -15,6 +16,9 @@ import {
mdiCheckCircleOutline,
mdiClock,
mdiCloseCircleOutline,
mdiCrosshairsQuestion,
mdiDoorbell,
mdiEyeCheck,
mdiFan,
mdiFanOff,
mdiGestureTapButton,
@@ -24,6 +28,7 @@ import {
mdiLockAlert,
mdiLockClock,
mdiLockOpen,
mdiMotionSensor,
mdiPackage,
mdiPackageDown,
mdiPackageUp,
@@ -31,6 +36,7 @@ import {
mdiPowerPlugOff,
mdiRestart,
mdiRobot,
mdiRobotConfused,
mdiRobotOff,
mdiSpeaker,
mdiSpeakerOff,
@@ -91,19 +97,25 @@ export const domainIconWithoutDefault = (
return alarmPanelIcon(compareState);
case "automation":
return compareState === "off" ? mdiRobotOff : mdiRobot;
return compareState === "unavailable"
? mdiRobotConfused
: compareState === "off"
? mdiRobotOff
: mdiRobot;
case "binary_sensor":
return binarySensorIcon(compareState, stateObj);
case "button":
switch (stateObj?.attributes.device_class) {
case "identify":
return mdiCrosshairsQuestion;
case "restart":
return mdiRestart;
case "update":
return mdiPackageUp;
default:
return mdiGestureTapButton;
return mdiButtonPointer;
}
case "camera":
@@ -123,6 +135,18 @@ export const domainIconWithoutDefault = (
}
return compareState === "not_home" ? mdiAccountArrowRight : mdiAccount;
case "event":
switch (stateObj?.attributes.device_class) {
case "doorbell":
return mdiDoorbell;
case "button":
return mdiGestureTapButton;
case "motion":
return mdiMotionSensor;
default:
return mdiEyeCheck;
}
case "fan":
return compareState === "off" ? mdiFanOff : mdiFan;

View File

@@ -28,8 +28,17 @@ export const FIXED_DOMAIN_STATES = {
input_button: [],
light: ["on", "off"],
lock: ["jammed", "locked", "locking", "unlocked", "unlocking"],
media_player: ["idle", "off", "paused", "playing", "standby"],
media_player: [
"off",
"on",
"idle",
"playing",
"paused",
"standby",
"buffering",
],
person: ["home", "not_home"],
plant: ["ok", "problem"],
remote: ["on", "off"],
scene: [],
schedule: ["on", "off"],
@@ -134,6 +143,7 @@ const FIXED_DOMAIN_ATTRIBUTE_STATES = {
},
humidifier: {
device_class: ["humidifier", "dehumidifier"],
action: ["off", "idle", "humidifying", "drying"],
},
media_player: {
device_class: ["tv", "speaker", "receiver"],
@@ -184,6 +194,7 @@ const FIXED_DOMAIN_ATTRIBUTE_STATES = {
"nitrogen_monoxide",
"nitrous_oxide",
"ozone",
"ph",
"pm1",
"pm10",
"pm25",
@@ -248,6 +259,11 @@ export const getStates = (
result.push("home", "not_home");
}
break;
case "event":
if (attribute === "event_type") {
result.push(...state.attributes.event_types);
}
break;
case "fan":
if (attribute === "preset_mode") {
result.push(...state.attributes.preset_modes);

View File

@@ -6,7 +6,7 @@ export function stateActive(stateObj: HassEntity, state?: string): boolean {
const domain = computeDomain(stateObj.entity_id);
const compareState = state !== undefined ? state : stateObj?.state;
if (["button", "input_button", "scene"].includes(domain)) {
if (["button", "event", "input_button", "scene"].includes(domain)) {
return compareState !== UNAVAILABLE;
}

View File

@@ -110,3 +110,15 @@ export const stateColorProperties = (
return undefined;
};
export const stateColorBrightness = (stateObj: HassEntity): string => {
if (
stateObj.attributes.brightness &&
computeDomain(stateObj.entity_id) !== "plant"
) {
// lowest brightness will be around 50% (that's pretty dark)
const brightness = stateObj.attributes.brightness;
return `brightness(${(brightness + 245) / 5}%)`;
}
return "";
};

View File

@@ -17,12 +17,13 @@ export const stripPrefixFromEntityName = (
if (lowerCasedEntityName.startsWith(lowerCasedPrefixWithSuffix)) {
const newName = entityName.substring(lowerCasedPrefixWithSuffix.length);
// If first word already has an upper case letter (e.g. from brand name)
// leave as-is, otherwise capitalize the first word.
return hasUpperCase(newName.substr(0, newName.indexOf(" ")))
? newName
: newName[0].toUpperCase() + newName.slice(1);
if (newName.length) {
// If first word already has an upper case letter (e.g. from brand name)
// leave as-is, otherwise capitalize the first word.
return hasUpperCase(newName.substr(0, newName.indexOf(" ")))
? newName
: newName[0].toUpperCase() + newName.slice(1);
}
}
}

View File

@@ -0,0 +1,27 @@
import memoizeOne from "memoize-one";
import "../../resources/intl-polyfill";
import { FrontendLocaleData } from "../../data/translation";
export const formatListWithAnds = (
locale: FrontendLocaleData,
list: string[]
) => formatConjunctionList(locale).format(list);
export const formatListWithOrs = (locale: FrontendLocaleData, list: string[]) =>
formatDisjunctionList(locale).format(list);
const formatConjunctionList = memoizeOne(
(locale: FrontendLocaleData) =>
new Intl.ListFormat(locale.language, {
style: "long",
type: "conjunction",
})
);
const formatDisjunctionList = memoizeOne(
(locale: FrontendLocaleData) =>
new Intl.ListFormat(locale.language, {
style: "long",
type: "disjunction",
})
);

View File

@@ -0,0 +1,19 @@
// In a few languages nouns are always capitalized. This helper
// indicates if for a given language that is the case.
import { capitalizeFirstLetter } from "../string/capitalize-first-letter";
export const useCapitalizedNouns = (language: string): boolean => {
switch (language) {
case "de":
case "lb":
return true;
default:
return false;
}
};
export const autoCaseNoun = (noun: string, language: string): string =>
useCapitalizedNouns(language)
? capitalizeFirstLetter(noun)
: noun.toLocaleLowerCase(language);

View File

@@ -38,7 +38,7 @@ export type LocalizeKeys =
// Tweaked from https://www.raygesualdo.com/posts/flattening-object-keys-with-typescript-types
export type FlattenObjectKeys<
T extends Record<string, any>,
Key extends keyof T = keyof T
Key extends keyof T = keyof T,
> = Key extends string
? T[Key] extends Record<string, unknown>
? `${Key}.${FlattenObjectKeys<T[Key]>}`

View File

@@ -108,23 +108,24 @@ export default class HaChartBase extends LitElement {
? html`<div class="chartLegend">
<ul>
${this.data.datasets.map(
(dataset, index) => html`<li
.datasetIndex=${index}
@click=${this._legendClick}
class=${classMap({
hidden: this._hiddenDatasets.has(index),
})}
.title=${dataset.label}
>
<div
class="bullet"
style=${styleMap({
backgroundColor: dataset.backgroundColor as string,
borderColor: dataset.borderColor as string,
(dataset, index) =>
html`<li
.datasetIndex=${index}
@click=${this._legendClick}
class=${classMap({
hidden: this._hiddenDatasets.has(index),
})}
></div>
<div class="label">${dataset.label}</div>
</li>`
.title=${dataset.label}
>
<div
class="bullet"
style=${styleMap({
backgroundColor: dataset.backgroundColor as string,
borderColor: dataset.borderColor as string,
})}
></div>
<div class="label">${dataset.label}</div>
</li>`
)}
</ul>
</div>`
@@ -156,18 +157,19 @@ export default class HaChartBase extends LitElement {
<div>
<ul>
${this._tooltip.body.map(
(item, i) => html`<li>
<div
class="bullet"
style=${styleMap({
backgroundColor: this._tooltip!.labelColors[i]
.backgroundColor as string,
borderColor: this._tooltip!.labelColors[i]
.borderColor as string,
})}
></div>
${item.lines.join("\n")}
</li>`
(item, i) =>
html`<li>
<div
class="bullet"
style=${styleMap({
backgroundColor: this._tooltip!.labelColors[i]
.backgroundColor as string,
borderColor: this._tooltip!.labelColors[i]
.borderColor as string,
})}
></div>
${item.lines.join("\n")}
</li>`
)}
</ul>
</div>

View File

@@ -328,23 +328,94 @@ class StateHistoryChartLine extends LitElement {
}
});
} else if (domain === "humidifier") {
const hasAction = states.states.some(
(entityState) => entityState.attributes?.action
);
const hasCurrent = states.states.some(
(entityState) => entityState.attributes?.current_humidity
);
const hasHumidifying =
hasAction &&
states.states.some(
(entityState: LineChartState) =>
entityState.attributes?.action === "humidifying"
);
const hasDrying =
hasAction &&
states.states.some(
(entityState: LineChartState) =>
entityState.attributes?.action === "drying"
);
addDataSet(
`${this.hass.localize("ui.card.humidifier.target_humidity_entity", {
name: name,
})}`
);
addDataSet(
`${this.hass.localize("ui.card.humidifier.on_entity", {
name: name,
})}`,
true
);
if (hasCurrent) {
addDataSet(
`${this.hass.localize(
"ui.card.humidifier.current_humidity_entity",
{
name: name,
}
)}`
);
}
// If action attribute is available, we used it to shade the area below the humidity.
// If action attribute is not available, we shade the area when the device is on
if (hasHumidifying) {
addDataSet(
`${this.hass.localize("ui.card.humidifier.humidifying", {
name: name,
})}`,
true,
computedStyles.getPropertyValue("--state-humidifier-on-color")
);
} else if (hasDrying) {
addDataSet(
`${this.hass.localize("ui.card.humidifier.drying", {
name: name,
})}`,
true,
computedStyles.getPropertyValue("--state-humidifier-on-color")
);
} else {
addDataSet(
`${this.hass.localize("ui.card.humidifier.on_entity", {
name: name,
})}`,
true
);
}
states.states.forEach((entityState) => {
if (!entityState.attributes) return;
const target = safeParseFloat(entityState.attributes.humidity);
// If the current humidity is not available, then we fill up to the target humidity
const current = hasCurrent
? safeParseFloat(entityState.attributes?.current_humidity)
: target;
const series = [target];
series.push(entityState.state === "on" ? target : null);
if (hasCurrent) {
series.push(current);
}
if (hasHumidifying) {
series.push(
entityState.attributes?.action === "humidifying" ? current : null
);
} else if (hasDrying) {
series.push(
entityState.attributes?.action === "drying" ? current : null
);
} else {
series.push(entityState.state === "on" ? current : null);
}
pushData(new Date(entityState.last_changed), series);
});
} else {

View File

@@ -184,7 +184,17 @@ export class StateHistoryCharts extends LitElement {
};
protected shouldUpdate(changedProps: PropertyValues): boolean {
return !(changedProps.size === 1 && changedProps.has("hass"));
if (changedProps.size === 1 && changedProps.has("hass")) {
return false;
}
if (
changedProps.size === 1 &&
changedProps.has("_maxYWidth") &&
changedProps.get("_maxYWidth") === this._maxYWidth
) {
return false;
}
return true;
}
protected willUpdate() {

View File

@@ -166,7 +166,7 @@ class StatisticsChart extends LitElement {
},
},
y: {
beginAtZero: false,
beginAtZero: this.chartType === "bar",
ticks: {
maxTicksLimit: 7,
},

View File

@@ -338,7 +338,8 @@ export class HaDataTable extends LitElement {
<div class="mdc-data-table__content">
<div class="mdc-data-table__row" role="row">
<div class="mdc-data-table__cell grows center" role="cell">
${this.noDataText || "No data"}
${this.noDataText ||
this.hass.localize("ui.components.data-table.no-data")}
</div>
</div>
</div>
@@ -349,6 +350,7 @@ export class HaDataTable extends LitElement {
class="mdc-data-table__content scroller ha-scrollbar"
@scroll=${this._saveScrollPos}
.items=${this._items}
.keyFunction=${this._keyFunction}
.renderItem=${this._renderRow}
></lit-virtualizer>
`}
@@ -357,6 +359,8 @@ export class HaDataTable extends LitElement {
`;
}
private _keyFunction = (row: DataTableRowData) => row[this.id] || row;
private _renderRow = (row: DataTableRowData, index: number) => {
// not sure how this happens...
if (!row) {

View File

@@ -36,12 +36,11 @@ interface AreaDevices {
devices: string[];
}
const rowRenderer: ComboBoxLitRenderer<AreaDevices> = (
item
) => html`<mwc-list-item twoline>
<span>${item.name}</span>
<span slot="secondary">${item.devices.length} devices</span>
</mwc-list-item>`;
const rowRenderer: ComboBoxLitRenderer<AreaDevices> = (item) =>
html`<mwc-list-item twoline>
<span>${item.name}</span>
<span slot="secondary">${item.devices.length} devices</span>
</mwc-list-item>`;
@customElement("ha-area-devices-picker")
export class HaAreaDevicesPicker extends SubscribeMixin(LitElement) {

View File

@@ -17,7 +17,7 @@ const NO_AUTOMATION_KEY = "NO_AUTOMATION";
const UNKNOWN_AUTOMATION_KEY = "UNKNOWN_AUTOMATION";
export abstract class HaDeviceAutomationPicker<
T extends DeviceAutomation
T extends DeviceAutomation,
> extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;

View File

@@ -45,12 +45,11 @@ export type HaDevicePickerDeviceFilterFunc = (
export type HaDevicePickerEntityFilterFunc = (entity: HassEntity) => boolean;
const rowRenderer: ComboBoxLitRenderer<Device> = (item) => html`<mwc-list-item
.twoline=${!!item.area}
>
<span>${item.name}</span>
<span slot="secondary">${item.area}</span>
</mwc-list-item>`;
const rowRenderer: ComboBoxLitRenderer<Device> = (item) =>
html`<mwc-list-item .twoline=${!!item.area}>
<span>${item.name}</span>
<span slot="secondary">${item.area}</span>
</mwc-list-item>`;
@customElement("ha-device-picker")
export class HaDevicePicker extends SubscribeMixin(LitElement) {
@@ -231,19 +230,23 @@ export class HaDevicePicker extends SubscribeMixin(LitElement) {
);
}
const outputDevices = inputDevices.map((device) => ({
id: device.id,
name: computeDeviceName(
const outputDevices = inputDevices.map((device) => {
const name = computeDeviceName(
device,
this.hass,
deviceEntityLookup[device.id]
),
area:
device.area_id && areaLookup[device.area_id]
? areaLookup[device.area_id].name
: this.hass.localize("ui.components.device-picker.no_area"),
strings: [device.name || ""],
}));
);
return {
id: device.id,
name: name,
area:
device.area_id && areaLookup[device.area_id]
? areaLookup[device.area_id].name
: this.hass.localize("ui.components.device-picker.no_area"),
strings: [name || ""],
};
});
if (!outputDevices.length) {
return [
{

View File

@@ -130,9 +130,9 @@ class HaEntitiesPickerLight extends LitElement {
private _getEntityFilter = memoizeOne(
(
value: string[] | undefined,
entityFilter: HaEntityPickerEntityFilterFunc | undefined
): HaEntityPickerEntityFilterFunc =>
value: string[] | undefined,
entityFilter: HaEntityPickerEntityFilterFunc | undefined
): HaEntityPickerEntityFilterFunc =>
(stateObj: HassEntity) =>
(!value || !value.includes(stateObj.entity_id)) &&
(!entityFilter || entityFilter(stateObj))

Some files were not shown because too many files have changed in this diff Show More