Compare commits

...

190 Commits

Author SHA1 Message Date
Bram Kragten
50e559487d Merge branch 'rc' 2024-02-05 14:45:51 +01:00
Bram Kragten
4cd02c81bb Merge branch 'dev' into rc 2024-02-05 14:45:33 +01:00
Bram Kragten
55c6d3a7c4 Bumped version to 20240205.0 2024-02-05 14:45:17 +01:00
renovate[bot]
242f3813bc Update vaadinWebComponents monorepo to v24.3.5 (#19684)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-05 13:32:18 +00:00
renovate[bot]
aa93cb17a7 Update dependency @lit-labs/motion to v1.0.7 (#19650)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-05 13:30:44 +00:00
renovate[bot]
4692d885d1 Update dependency @codemirror/language to v6.10.1 (#19688)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-05 13:30:21 +00:00
Cody C
b39ac984f9 Fix last input margins in supervisor-network.ts (#19659)
* Fix last input margins in supervisor-network.ts

Resolves #19658

* Update src/panels/config/network/supervisor-network.ts

---------

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2024-02-05 13:28:01 +00:00
renovate[bot]
9894d83e22 Update Yarn to v4.1.0 (#19634)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-05 14:12:49 +01:00
Cody C
113083a241 Avoid unnecessary redirect on empty state card page (#19643)
Avoid unnecessary redirect on hui-empty-state-card page
2024-02-05 13:53:52 +01:00
Cody C
32971cc875 Remove flag that sets icon as required when creating a new dashboard (#19640)
Less friction to create a new dashboard. Moreover, an icon isn't actually required in order to create the dashboard anyway. See https://github.com/home-assistant/frontend/issues/19639
2024-02-05 13:41:37 +01:00
Bram Kragten
137f59feb1 Remove comments from css (#19689)
remove comments from css
2024-02-05 13:39:47 +01:00
Paulus Schoutsen
6675121b85 Allow deselecting all values (#19677) 2024-02-05 12:48:18 +01:00
Paul Bottein
aed0a35c9c Fix button card color when off (#19685) 2024-02-05 12:47:23 +01:00
Paul Bottein
65a8518d99 Increase drop zone for automation editor (#19687) 2024-02-05 12:35:34 +01:00
dependabot[bot]
cb690e9d4e Bump release-drafter/release-drafter from 5 to 6 (#19683)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-02-05 08:59:50 +01:00
renovate[bot]
5da67de95f Update dependency magic-string to v0.30.6 (#19651)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-04 21:04:01 +01:00
renovate[bot]
b9609f2154 Update dependency husky to v9.0.10 (#19674)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-04 21:01:29 +01:00
renovate[bot]
aaabb6e1fb Update dependency webpack to v5.90.1 (#19675)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-04 20:35:46 +01:00
renovate[bot]
6561de34f0 Update dependency husky to v9.0.9 (#19672)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-04 16:36:32 +01:00
Cody C
016ff74483 Fix grammar of Storage area messages (#19644) 2024-02-03 14:14:01 +01:00
renovate[bot]
f5e9839b42 Update dependency lint-staged to v15.2.1 (#19646)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-03 14:12:04 +01:00
Bram Kragten
d044f4d34e 20240202.0Merge branch 'rc' 2024-02-02 16:29:21 +01:00
Bram Kragten
696717dd90 20240202.0Merge branch 'dev' into rc 2024-02-02 16:28:34 +01:00
Bram Kragten
eb3b168975 Bumped version to 20240202.0 2024-02-02 16:28:10 +01:00
Bram Kragten
aa400ce6ab Reload entity component icons when missing (#19629)
* Reload entity component icons when missing

* Improve typing, improve caching

* Make copy

* review suggestion

* overload

* Update icons.ts

* Update icons.ts
2024-02-02 16:26:47 +01:00
Paulus Schoutsen
682f9a0f04 Clean up the overlapping history in the CSV download (#19622)
* Clean up the overlapping history in the CSV download

* Speed up merge

* undefined unit

* Fix targetPickerValue handling
2024-02-02 16:06:29 +01:00
Paulus Schoutsen
e478038206 Remove refresh button from history panel (#19631) 2024-02-02 15:21:29 +01:00
Paul Bottein
259a9a4f58 Fix assist devices search bar color (#19627) 2024-02-02 12:12:43 +01:00
Bram Kragten
b08d1ae7e9 Update button focus style to match tile focus style (#19608) 2024-02-02 12:02:54 +01:00
renovate[bot]
3970fdd070 Update dependency hls.js to v1.5.3 (#19619)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-02 11:46:33 +01:00
renovate[bot]
946445b2df Update dependency eslint-plugin-lit-a11y to v4.1.2 (#19626)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-02 11:45:09 +01:00
renovate[bot]
17b090af58 Update typescript-eslint monorepo to v6.20.0 (#19613)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-02 11:44:43 +01:00
karwosts
6690a0e4b1 Add names to map path tooltip (#19565)
* Add names to map path tooltip

* Apply suggestions from code review

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

* prettier

---------

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2024-02-02 11:40:31 +01:00
Paul Bottein
c291448ffa Improve automation drag and drop interaction (#19624) 2024-02-02 11:31:01 +01:00
renovate[bot]
6f831699be Update dependency husky to v9.0.7 (#19612)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-02 09:37:14 +01:00
Bram Kragten
fb73bfb964 Only show more info on graphs when mouse is used (#19606)
only show more info on graphs when mouse is used
2024-02-01 17:57:08 +01:00
Bram Kragten
28a0d216f9 Fix race in lovelace (#19609) 2024-02-01 17:56:46 +01:00
Bram Kragten
69f2566526 Matter tweaks (#19607) 2024-02-01 17:56:37 +01:00
Yosi Levy
7b3797502a RTL simplification and updates (#19586)
* RTL simplification and updates

* Fixes

* Fix weird icon offset when mwc-list-item is in a concat html``

* Additional updates
2024-02-01 14:29:00 +01:00
Paul Bottein
cf960be07e Fix item path for default in choose automation action (#19602) 2024-02-01 14:05:01 +01:00
Paulus Schoutsen
8a410d6c82 Add error checking to download button (#19596)
Clean up history panel + add better error checking
2024-02-01 09:25:52 +01:00
Bram Kragten
22c3132638 20240131.0 (#19595) 2024-01-31 19:02:00 +01:00
Bram Kragten
ce32de6e23 20240131.0 (#19594) 2024-01-31 19:00:50 +01:00
Bram Kragten
b6bc88e460 Merge branch 'dev' of https://github.com/home-assistant/frontend into dev 2024-01-31 18:55:23 +01:00
Bram Kragten
6e00806f1a Update state-control-circular-slider-style.ts 2024-01-31 18:54:56 +01:00
Bram Kragten
d9fa148c49 Merge branch 'master' into dev 2024-01-31 18:52:58 +01:00
Bram Kragten
939b3a8092 Update button card styles (#19591) 2024-01-31 18:48:58 +01:00
Bram Kragten
95920ba710 Default to error correction Q when there is a center image (#19593)
default to error correction Q when there is a center image
2024-01-31 18:48:45 +01:00
Bram Kragten
462ac79890 Bumped version to 20240131.0 2024-01-31 18:35:09 +01:00
Paul Bottein
601a165b2a Disable reorder for readonly automation and disabled block (#19592) 2024-01-31 17:48:22 +01:00
Bram Kragten
62bb9b1a87 Add QR code selector (#19588) 2024-01-31 16:31:54 +01:00
Paul Bottein
b60ba35a9f Don't allow dragging parent into child element in automation editor (#19589) 2024-01-31 16:28:20 +01:00
Bram Kragten
c97c3f2fc4 Fix disabled users picker (#19590)
fix disabled users picker
2024-01-31 15:26:37 +00:00
Bram Kragten
ed888200f9 Add support for re-auth flows in repairs (#19587) 2024-01-31 15:06:01 +01:00
Bram Kragten
f4859320eb Add icon to areas (#19585)
* Add icon to areas

* Fix gallery

---------

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
2024-01-31 13:18:43 +00:00
Marcel van der Veldt
b159f4c074 Add matter device info and actions (#19578)
* add matter device info panel (WIP)

* actually enable card on device page

* fix remove fabric

* add some translation labels

* add dialog to interview node

* do not show info for bridged devices

* first device action

* add ping node action and dialog

* ping should be always available

* update model for MatterCommissioningParameters

* add basic support for open commissioning window

* move fabric management to dialog

* review

* Add link to thread panel

---------

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2024-01-31 14:16:21 +01:00
Cody C
b700e08d52 Simplify MFA onboarding styling & flow (#19584)
Align MFA onboarding flow

* Aligns QR Code to centre to make scanning on mobile easier
* Removes background from manual key text
* Re-adds spacing to bottom of form so it is not hard up against the code entry form
2024-01-31 10:51:07 +01:00
karwosts
c1bdd679ff Promote edit dashboard button out of overflow menu (#19345) 2024-01-31 10:45:10 +01:00
Paulus Schoutsen
b728b9efc4 Allow mobile apps to provide QR code functionality (#19570)
* Add QR code scanner to external bus

* Make `hasQRScanner` a version number
2024-01-31 10:44:21 +01:00
David F. Mulcahey
8acae63939 Update ZHA reconfigure device dialog to show accurate cluster configuration statuses (#19527) 2024-01-31 09:50:55 +01:00
Bram Kragten
374f5ee1be Update thread preferred router (#19580) 2024-01-31 00:58:03 +01:00
karwosts
528533a2dd Combine climate graph with temperature device_classes (#19485) 2024-01-31 00:33:28 +01:00
Maxim A
2b18db8525 Add Y axis limits options for historical charts (#19297)
* Add Y axis limit options for historical charts

* Fir formatting according to linter

* Revert statistic graph changes

* Cleanup local tests leftover

* Show fit Y fit option only if limits are set
2024-01-31 00:18:14 +01:00
Joni Käki-Mäkelä
6cd8ee9253 Disable pointer-events for tile-card .icon-container class that don't have a "button" role (#19497)
Set pointer-events to none for icon containers that don't have button role
2024-01-31 00:15:41 +01:00
karwosts
e45709fffc Fix map icon color (#19567)
* Fix map icon color

* different solution

* updates from code review
2024-01-30 23:57:35 +01:00
Simon Lamon
28c21b1041 Localize trigger state in automation editor (#19554)
* trigger state

* Lokalize

* don't change existing trigger

* space

* Fixes
2024-01-30 23:36:39 +01:00
G Johansson
0919f0e89e Add new TURN_ON and TURN_OFF Climate feature flags (#19523) 2024-01-30 15:11:08 +01:00
Paul Bottein
64fc58ddd2 Always allow reorder for triggers, conditions, actions and options (#19574)
* Move up and down action to overflow menu

* Always enable reorder mode on desktop

* Use media query helper
2024-01-30 15:06:02 +01:00
Joakim Plate
568e9ebc38 Add volume flow rate (#19344) 2024-01-30 15:03:39 +01:00
renovate[bot]
33888beb63 Update dependency marked to v11.2.0 (#19572)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-30 14:55:16 +01:00
renovate[bot]
0bc6f9152a Update dependency webpack to v5.90.0 (#19541)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-30 14:54:45 +01:00
renovate[bot]
17fd0de102 Update dependency @lrnwebcomponents/simple-tooltip to v8 (#19138)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-30 14:52:45 +01:00
Simon Lamon
f98e66a409 Allow description placeholders in all repair flow title options (#19553)
Add description placeholders
2024-01-30 14:50:15 +01:00
Paul Bottein
314499005d Clean domain icons (#19533)
* Use state icon inside alarm control panel card

* Add domain icon component and clean old files

* Clean code

* Migrate area card

* Remove some icon rules

* Update ha-bar-media-player.ts

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

* Update ha-domain-icon.ts

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

---------

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2024-01-30 14:49:39 +01:00
renovate[bot]
6dcc70f6fc Update dependency husky to v9 (#19550)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-30 14:30:09 +01:00
Yosi Levy
5e40bb55eb RTL fixes (#19563) 2024-01-30 14:27:40 +01:00
Cody C
476457fe2e Clarify wording of Thread network messaging (#19564)
* Removes ambiguity of many "may" statements, which are virtually certainly.
* Fix some typos / grammatical errors
2024-01-30 14:24:58 +01:00
karwosts
4c314928c6 Bigger touch target for mobile map history trace (#19569) 2024-01-30 14:21:10 +01:00
Bram Kragten
73460c7d8a Fix more info remote (#19575) 2024-01-30 13:51:12 +01:00
Cody C
767b2b6b9c Add documentation link to ZHA pairing mode page (#19518)
Add pairing instructions docs link to ZHA Add Devices page

While we ask people to refer to the instructions of their device, they may need some further support to locate this. We can direct them to the ZHA documentation.
2024-01-30 13:39:57 +01:00
Joakim Sørensen
0944b1e9d3 Simplify GtHub markdown alerts (#19536)
Simplify GtHub merkdown alerts
2024-01-30 13:37:47 +01:00
karwosts
623ac88166 Fix trace graph for non-safari & safari (#19557) 2024-01-30 13:23:53 +01:00
karwosts
3a204d889f Fix QR codes (#19552) 2024-01-30 13:07:58 +01:00
Bram Kragten
107f0da88b Allow config flow to show error per field (#19522) 2024-01-30 12:24:45 +01:00
karwosts
86bbff36ea Delete all refresh tokens (attempt #2) (#19547)
* Add a button to delete all refresh tokens (#18680)

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

* Don't delete LL tokens. Don't delete the current token

* Update src/data/auth.ts

Co-authored-by: Simon Lamon <32477463+silamon@users.noreply.github.com>

* typing

---------

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
Co-authored-by: Simon Lamon <32477463+silamon@users.noreply.github.com>
2024-01-29 18:07:44 +01:00
renovate[bot]
42a52f9a1c Update dependency @material/web to v1.2.0 (#19546)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-29 15:01:48 +01:00
renovate[bot]
ade8687d7b Update formatjs monorepo (#19561)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-29 14:58:05 +01:00
dependabot[bot]
e1341a1961 Bump actions/upload-artifact from 4.2.0 to 4.3.0 (#19562)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-29 09:25:41 +01:00
renovate[bot]
74282e9afe Update dependency hls.js to v1.5.2 (#19559)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-28 19:45:50 +00:00
renovate[bot]
687c9753a0 Update babel monorepo to v7.23.9 (#19558)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-28 14:38:06 -05:00
renovate[bot]
4825163b20 Update dependency chai to v5.0.3 (#19556)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-28 14:35:39 -05:00
renovate[bot]
a37bea3701 Update dependency @types/tar to v6.1.11 (#19555)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-28 14:34:04 -05:00
renovate[bot]
0d8f9351cc Update dependency @codemirror/view to v6.23.1 (#19540) 2024-01-27 21:36:37 -05:00
renovate[bot]
692774f6c4 Update dependency @bundle-stats/plugin-webpack-filter to v4.9.2 (#19545) 2024-01-27 21:34:02 -05:00
Stanisław Czajka
6ee1404eef Fixed volume slider alignment (#19534) 2024-01-26 16:26:11 +00:00
Yosi Levy
97652bd2f6 Various RTL fixes (#19495)
* Various RTL fixes

* Additional RTL

* Additional fixes

* Revert ha-dialog

* Improve margin-title

* Additional fixes

* Additional fixes

* Fix prettier

* More fixes

* Additional fixes

* Fix prettier

* Fix prettier again

* Additional updates

* Additional fixes

* Final fixes (left only)
2024-01-26 17:15:27 +01:00
renovate[bot]
a566479ddc Update typescript-eslint monorepo to v6.19.1 (#19529)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-25 17:35:14 +00:00
Cody C
44e62fbb04 Fix text alignment on mobile devices for zha-add-devices-page.ts (#19517)
discovery_text ("Make sure your devices are in pairing mode. Check the instructions of your device on how to do this.") is showing left aligned on mobile, which is inconsistent with the discovered_text ("Devices will show up here once discovered.") underneath.
2024-01-25 18:23:23 +01:00
Michael
1f9e919762 Add info about removing of unused tokens (#19479)
add info about removing of unused tokens
2024-01-25 18:21:52 +01:00
Paulus Schoutsen
973752b974 Refactor suggest card function (#19528) 2024-01-25 18:21:30 +01:00
Bram Kragten
75bbc33fa2 Bumped version to 20240125.0 2024-01-25 13:32:28 +01:00
Bram Kragten
59a3a35b19 Handle cast connect different instance better (#19526) 2024-01-25 13:00:55 +01:00
Bram Kragten
b224ec50e4 Add automation/editor/show command to external bus (#19524) 2024-01-25 00:01:10 +01:00
Bram Kragten
2925ef3db0 Add support for service icons (#19507)
* Add service icons

* Fix lint

---------

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
2024-01-24 19:21:08 +00:00
Erik Montnemery
c2d71ac789 Allow inverting switch_as_x cover, lock, valve (#19324)
* Allow inverting switch_as_x cover, lock, valve

* Reconfigure invert option via options flow

* Don't reopen dialog

* Add explanation for invert option

* Address review comments

* Hide switch_as_x options flow
2024-01-24 18:32:35 +01:00
Paul Bottein
85f086d02e Improve icon translations support (#19516)
* Use slot for icon picker

* Use icon translations for disabled entities in device page

* Don't use fallback for light effect

* Fix device class

* Fix climate hvac mode

* Migrate fan direction to icon translations

* Remove attribute fallback

* Rename variable

* Update src/panels/lovelace/card-features/hui-climate-hvac-modes-card-feature.ts

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

---------

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2024-01-24 18:31:06 +01:00
Paul Bottein
beb3454f8d Hide fallback when dragging items in sidebar (#19521) 2024-01-24 18:16:59 +01:00
renovate[bot]
807d08d8eb Update dependency core-js to v3.35.1 (#19519) 2024-01-23 21:11:52 -05:00
Bram Kragten
cc4cfe1b5c Add set_conversation_response action (#19512) 2024-01-23 13:16:49 +01:00
G Johansson
88f67230fc Preview for time_date helper (#19476) 2024-01-23 12:04:23 +01:00
renovate[bot]
d335dd4b83 Update dependency @types/luxon to v3.4.2 (#19514)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-22 19:43:05 -05:00
renovate[bot]
98e3dbceb5 Update dependency @bundle-stats/plugin-webpack-filter to v4.9.1 (#19513)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-22 20:15:44 +01:00
Paul Bottein
1c9ea0a9d9 Add stateValue parameter to ha-state-icon (#19508)
* Add state value option to entityIcon

* Migrate lock, valve and cover more info to icon translations

* Migrate tile card

* Remove domain icon from area card

* Use attribute
2024-01-22 20:10:08 +01:00
Paulus Schoutsen
f6af73b222 Allow expanding a history graph card (#19481)
* Allow expanding a history graph card

* Update styling
2024-01-22 12:53:04 -05:00
Simon Lamon
9354ed927b Localize sun condition in automation editor (#19473)
Sun condition
2024-01-22 18:17:20 +01:00
karwosts
545d140dcf Various leaflet map bugfixes (#19475)
* Various leaflet map bugfixes

* move pan to updated
2024-01-22 18:12:25 +01:00
Steve Repsher
634122657c Fix incompatible object/array property types (3 of 3) (#19510) 2024-01-22 18:03:42 +01:00
Steve Repsher
349344161a Fix incompatible object/array property types (2 of 3) (#19482) 2024-01-22 16:04:58 +01:00
Joakim Sørensen
28a8863f45 Allow for lists inside GitHub alerts when redered in markdown (#19505)
* Allow for lists inside GitHub alerts when redered in markdown

* simplify
2024-01-22 16:03:07 +01:00
karwosts
5c72c38c0d Revert "Add a button to delete all refresh tokens" (#19480) 2024-01-22 15:57:06 +01:00
renovate[bot]
fffed0f5e1 Update vaadinWebComponents monorepo to v24.3.4 (#19506)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-22 08:21:23 -05:00
Bram Kragten
bf4b76864d Adjust check focus behaviour for todo list (#19472)
* Adjust check focus behaviour for todo list

* improve aria
2024-01-22 13:58:35 +01:00
dependabot[bot]
10ad0010cf Bump actions/cache from 3.3.3 to 4.0.0 (#19502)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-22 09:04:58 +01:00
dependabot[bot]
3a99a7de78 Bump actions/upload-artifact from 4.1.0 to 4.2.0 (#19503)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-22 08:59:58 +01:00
Franck Nijhof
69139b35e1 Clean up updater remains (#19501) 2024-01-21 23:07:40 +01:00
renovate[bot]
55a5739e77 Update dependency @babel/helper-define-polyfill-provider to v0.5.0 (#19496)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-21 15:26:07 -05:00
renovate[bot]
a8b48b4619 Update dependency prettier to v3.2.4 (#19483)
* Update dependency prettier to v3.2.4

* Reformat

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Steve Repsher <steverep@users.noreply.github.com>
2024-01-21 06:09:59 +00:00
Steve Repsher
dcb3accdb8 Fix incompatible object/array property types (1 of 3) (#19450) 2024-01-19 20:16:15 +00:00
Cody C
45398f84cb Update hassio-addon-dashboard.ts to fix back button issue (#19477) 2024-01-19 21:06:29 +01:00
Joakim Sørensen
319cf64977 Do not "load" forever if null is returned for release notes (#19478) 2024-01-19 21:05:11 +01:00
Bram Kragten
646c02d855 Implement more attribute icons (#19469) 2024-01-19 20:55:16 +01:00
renovate[bot]
77dd2a87d9 Update formatjs monorepo (#19471)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-19 17:58:51 +01:00
Joakim Sørensen
51059e99a5 Add support for new GitHub alerts (#19470) 2024-01-19 17:10:46 +01:00
Bram Kragten
809df848ef Use entity registry icon directly (#19466) 2024-01-19 14:42:20 +00:00
Paul Bottein
619675318c Remove wrong usage of aria-hidden (#19454) 2024-01-19 15:28:46 +01:00
Bram Kragten
081636b3e7 Add support for icon translations (#19406)
* Add support for icon translations

* Use slot for icons

* Update more-info-climate.ts

* Review and fixes

* Update entity-registry-settings-editor.ts
2024-01-19 14:55:02 +01:00
Steve Repsher
b969144f50 Initialize more boolean properties (#19452) 2024-01-19 09:43:00 +01:00
Steve Repsher
24bfa4919a Fix property visibility mismatches (2 of 2) (#19448) 2024-01-19 09:39:41 +01:00
renovate[bot]
fcc9a80103 Update formatjs monorepo (#19453)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-19 01:08:10 -05:00
renovate[bot]
99a365fb49 Lock file maintenance (#19451)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-19 00:45:56 -05:00
renovate[bot]
6a95177b32 Update typescript-eslint monorepo to v6.19.0 (#19447)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-18 14:56:50 -05:00
Bram Kragten
ca68eaab38 Update cast idle logo (#19443) 2024-01-18 17:05:25 +01:00
Bram Kragten
7ce9a937b1 20240104.0 (#19284) 2024-01-04 17:48:13 +01:00
Paul Bottein
456c011f3e Fix thermostat and humidifier card rendering when off (#19281)
* Fix thermostat and humidifier card rendering when off

* Fix action color
2024-01-04 17:44:58 +01:00
Bram Kragten
a31b9f1b4d Fix due date when no time in certain timezones (#19280)
* Fix due date when no time in certain timezones

* Update dialog-todo-item-editor.ts
2024-01-04 17:44:57 +01:00
Bram Kragten
a1cf18468b Remove overflow hidden from profile (#19279) 2024-01-04 17:44:56 +01:00
Bram Kragten
f147a5e909 fix valve entities row (#19278) 2024-01-04 17:44:55 +01:00
Franck Nijhof
8d541595b8 Update getStates to support valves (#19277) 2024-01-04 17:44:54 +01:00
Bram Kragten
32fd8270d7 Fix turning valve on/off (#19269) 2024-01-04 17:44:53 +01:00
Bram Kragten
efddbfcfa0 Fix circular progress size + fix bug in assist pipeline debug (#19268) 2024-01-04 17:44:53 +01:00
karwosts
0b20725f5f Fix select view dialog (#19267)
* Fix select view dialog

* add import
2024-01-04 17:44:52 +01:00
renovate[bot]
030566c1e8 Update dependency marked to v11.1.1 (#19254) 2024-01-04 17:44:51 +01:00
Bram Kragten
fef2c44cb8 Bumped version to 20240104.0 2024-01-04 17:44:16 +01:00
Bram Kragten
b99b13251f 20240103.3 (#19263) 2024-01-03 15:03:00 +01:00
Bram Kragten
288d173a4d Bumped version to 20240103.3 2024-01-03 15:02:14 +01:00
Bram Kragten
2c69fe8c53 Fix checking todo item that dont support due date (#19262)
* Fix checking todo item that dont support due date

* make cleaner

* Revert "make cleaner"

This reverts commit fa33b33614.

* Update dialog-todo-item-editor.ts

* do check in 1 place
2024-01-03 15:00:24 +01:00
Paul Bottein
62dafac72b Display edit button for climate fan mode feature (#19259) 2024-01-03 15:00:23 +01:00
karwosts
22929672a0 Remove tile pointer/ripple/index when it has no action (#19137)
* Remove tile pointer/ripple/index when it has no action

* update

* Apply suggestions from code review

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>

---------

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
2024-01-03 15:00:22 +01:00
Bram Kragten
ae0eac3415 Bumped version to 20240103.0 2024-01-03 15:00:06 +01:00
Bram Kragten
4ea7d826bc 20240103.1 (#19258) 2024-01-03 12:37:44 +01:00
Bram Kragten
336214d97f Revert conditional rendering of condition (#19257)
* Fix conditionally showing `triggered by`

* revert conditional rendering

* Update add-automation-element-dialog.ts

* Update add-automation-element-dialog.ts
2024-01-03 12:29:30 +01:00
Bram Kragten
c9a0ae6e2d Bumped version to 20240103.1 2024-01-03 12:29:10 +01:00
Bram Kragten
0bc69fb9b3 20240103.0 (#19256) 2024-01-03 10:55:23 +01:00
Bram Kragten
6e7366bf69 Calculate used domains on open of action dialog (#19255) 2024-01-03 10:38:51 +01:00
Bram Kragten
8ee4aa9e63 Bumped version to 20240103.0 2024-01-03 10:38:30 +01:00
Bram Kragten
386c3ea1ca 20240102.0 (#19234) 2024-01-02 20:02:03 +01:00
Simon Lamon
c2f3e43ee5 Set default values for required and disabled for labeled slider (#19246)
Set default values
2024-01-02 20:01:15 +01:00
Bram Kragten
7354988ec9 Move notification services to main list (#19235) 2024-01-02 20:01:14 +01:00
Bram Kragten
53dedc6c65 Bumped version to 20240102.0 2024-01-02 18:49:50 +01:00
Bram Kragten
de3b9a5bb2 Give todo and calendar edit static header (#19233) 2024-01-02 18:48:59 +01:00
Bram Kragten
8d496e1511 Update add-automation-element-dialog.ts 2024-01-02 18:48:06 +01:00
JLo
01bd88ce10 New copy for device trigger in automation editor (#19232)
New copy for device trigger in automation editor: 
"Set of conditions provided by your device. Great way to start."
2024-01-02 18:44:33 +01:00
Josh McCarty
18b5fd59a6 Add missing device classes for entity-registry-settings-editor (#19231)
* Add connectivity device class for binary sensors

* Add update device class

* Separate connectivity and update
2024-01-02 18:44:32 +01:00
Bram Kragten
750c1d5013 Change format of service description (#19229) 2024-01-02 18:44:31 +01:00
Bram Kragten
f2226cdec2 Use brand icons in actions (#19227) 2024-01-02 18:44:30 +01:00
Bram Kragten
c125ec087a Remove references to "service call" from actions (#19226) 2024-01-02 18:44:29 +01:00
Bram Kragten
f099f66065 Automation editor tweaks (#19225)
* Automation editor tweaks

* fix styling
2024-01-02 18:44:28 +01:00
JLo
4fcf99faa7 Review on automation editor text (#19223)
- Added `.` to bloc descriptions
- Changed "Other" into "OTher triggers" "Other conditions" and "Other actions"
- Adapted a few descriptions
2024-01-02 18:44:28 +01:00
karwosts
2add88ccc2 Localize a device action string (#19203) 2024-01-02 18:44:27 +01:00
Bram Kragten
aa94ec7949 20240101.0 (#19217) 2024-01-01 14:08:07 +01:00
Bram Kragten
7b4ecfd30a 20231228.0 (#19170) 2023-12-28 15:34:42 +01:00
Bram Kragten
9d9e789f4b 20231227.0 (#19157) 2023-12-27 17:29:11 +01:00
Paul Bottein
6ce613acd2 20231208.2 (#18971) 2023-12-08 14:50:28 +01:00
Paul Bottein
aa38e2d409 20231208.1 (#18962) 2023-12-08 10:36:45 +01:00
Paul Bottein
fce4e5e382 20231206.0 (#18925) 2023-12-06 14:24:48 +01:00
Bram Kragten
eb5e7ba3f3 20231205.0 (#18916) 2023-12-05 18:10:37 +01:00
Bram Kragten
ae2e8e7402 20231204.0 (#18882) 2023-12-04 12:10:33 +01:00
Bram Kragten
b854d23431 20231130.0 (#18843) 2023-11-30 17:19:47 +01:00
Bram Kragten
ef735d65cf 20231129.1 (#18811) 2023-11-29 15:31:24 +01:00
Bram Kragten
2803e6aa95 20231129.0 (#18809) 2023-11-29 12:53:12 +01:00
540 changed files with 9160 additions and 7223 deletions

View File

@@ -2,12 +2,12 @@
"name": "Home Assistant Frontend",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
"context": "..",
},
"appPort": "8124:8123",
"postStartCommand": "script/bootstrap",
"containerEnv": {
"WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}"
"WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}",
},
"customizations": {
"vscode": {
@@ -16,7 +16,7 @@
"esbenp.prettier-vscode",
"runem.lit-plugin",
"github.vscode-pull-request-github",
"eamodio.gitlens"
"eamodio.gitlens",
],
"settings": {
"files.eol": "\n",
@@ -27,17 +27,17 @@
"editor.renderWhitespace": "boundary",
"editor.rulers": [80],
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"files.trimTrailingWhitespace": true,
"terminal.integrated.shell.linux": "/usr/bin/zsh",
"gitlens.showWelcomeOnInstall": false,
"gitlens.showWhatsNewAfterUpgrades": false,
"workbench.startupEditor": "none"
}
}
}
"workbench.startupEditor": "none",
},
},
},
}

View File

@@ -37,7 +37,7 @@ jobs:
- 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.3
uses: actions/cache@v4.0.0
with:
path: |
node_modules/.cache/prettier
@@ -89,7 +89,7 @@ jobs:
env:
IS_TEST: "true"
- name: Upload bundle stats
uses: actions/upload-artifact@v4.1.0
uses: actions/upload-artifact@v4.3.0
with:
name: frontend-bundle-stats
path: build/stats/*.json
@@ -113,7 +113,7 @@ jobs:
env:
IS_TEST: "true"
- name: Upload bundle stats
uses: actions/upload-artifact@v4.1.0
uses: actions/upload-artifact@v4.3.0
with:
name: supervisor-bundle-stats
path: build/stats/*.json

View File

@@ -57,14 +57,14 @@ jobs:
run: tar -czvf translations.tar.gz translations
- name: Upload build artifacts
uses: actions/upload-artifact@v4.1.0
uses: actions/upload-artifact@v4.3.0
with:
name: wheels
path: dist/home_assistant_frontend*.whl
if-no-files-found: error
- name: Upload translations
uses: actions/upload-artifact@v4.1.0
uses: actions/upload-artifact@v4.3.0
with:
name: translations
path: translations.tar.gz

View File

@@ -18,6 +18,6 @@ jobs:
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,39 +0,0 @@
diff --git a/modular/sortable.complete.esm.js b/modular/sortable.complete.esm.js
index 02e9f2d6bebeb430fe6e7c1cc3f9c3c9df051f14..bb8268b0844a1faa4108cc92c0be2a3dbaf23f83 100644
--- a/modular/sortable.complete.esm.js
+++ b/modular/sortable.complete.esm.js
@@ -1657,7 +1657,7 @@ Sortable.prototype =
target = parent; // store last element
}
/* jshint boss:true */
- while (parent = parent.parentNode);
+ while (parent = parent.parentNode || parent.getRootNode().host);
}
_unhideGhostForTarget();
diff --git a/modular/sortable.core.esm.js b/modular/sortable.core.esm.js
index b04c8b4634f7c6b4ef1aadbb48afe6564306dea9..39a107163c8c336ebd669b5ea8a936af87e1c1e7 100644
--- a/modular/sortable.core.esm.js
+++ b/modular/sortable.core.esm.js
@@ -1657,7 +1657,7 @@ Sortable.prototype =
target = parent; // store last element
}
/* jshint boss:true */
- while (parent = parent.parentNode);
+ while (parent = parent.parentNode || parent.getRootNode().host);
}
_unhideGhostForTarget();
diff --git a/modular/sortable.esm.js b/modular/sortable.esm.js
index 6ec7ed1bb557e21c2578200161e989c65d23150b..0a05475a22904472fac6c13f524c674da76584b0 100644
--- a/modular/sortable.esm.js
+++ b/modular/sortable.esm.js
@@ -1657,7 +1657,7 @@ Sortable.prototype =
target = parent; // store last element
}
/* jshint boss:true */
- while (parent = parent.parentNode);
+ while (parent = parent.parentNode || parent.getRootNode().host);
}
_unhideGhostForTarget();

View File

@@ -0,0 +1,73 @@
diff --git a/modular/sortable.core.esm.js b/modular/sortable.core.esm.js
index 93ba17509e2e8583ab241fea6845fbe714c584a2..de0651ddb5dced30d36f7d764da0dd0b441f523f 100644
--- a/modular/sortable.core.esm.js
+++ b/modular/sortable.core.esm.js
@@ -1461,7 +1461,7 @@ Sortable.prototype = /** @lends Sortable.prototype */{
}
target = parent; // store last element
}
- /* jshint boss:true */ while (parent = parent.parentNode);
+ /* jshint boss:true */ while (parent = parent.parentNode || parent.getRootNode().host);
}
_unhideGhostForTarget();
}
@@ -1781,11 +1781,16 @@ Sortable.prototype = /** @lends Sortable.prototype */{
}
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
capture();
- if (elLastChild && elLastChild.nextSibling) {
- // the last draggable element is not the last node
- el.insertBefore(dragEl, elLastChild.nextSibling);
- } else {
- el.appendChild(dragEl);
+ try {
+ if (elLastChild && elLastChild.nextSibling) {
+ // the last draggable element is not the last node
+ el.insertBefore(dragEl, elLastChild.nextSibling);
+ } else {
+ el.appendChild(dragEl);
+ }
+ }
+ catch(err) {
+ return completed(false);
}
parentEl = el; // actualization
@@ -1802,7 +1807,13 @@ Sortable.prototype = /** @lends Sortable.prototype */{
targetRect = getRect(target);
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
capture();
- el.insertBefore(dragEl, firstChild);
+ try {
+ el.insertBefore(dragEl, firstChild);
+ }
+ catch(err) {
+ return completed(false);
+ }
+
parentEl = el; // actualization
changed();
@@ -1849,12 +1860,17 @@ Sortable.prototype = /** @lends Sortable.prototype */{
_silent = true;
setTimeout(_unsilent, 30);
capture();
- if (after && !nextSibling) {
- el.appendChild(dragEl);
- } else {
- target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
- }
+ try {
+ if (after && !nextSibling) {
+ el.appendChild(dragEl);
+ } else {
+ target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
+ }
+ }
+ catch(err) {
+ return completed(false);
+ }
// Undo chrome's scroll adjustment (has no effect on other browsers)
if (scrolledPastTop) {
scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);

File diff suppressed because one or more lines are too long

View File

@@ -6,4 +6,4 @@ enableGlobalCache: false
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-4.0.2.cjs
yarnPath: .yarn/releases/yarn-4.1.0.cjs

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

@@ -31,11 +31,11 @@ import "./hc-layout";
@customElement("hc-cast")
class HcCast extends LitElement {
@property() public auth!: Auth;
@property({ attribute: false }) public auth!: Auth;
@property() public connection!: Connection;
@property({ attribute: false }) public connection!: Connection;
@property() public castManager!: CastManager;
@property({ attribute: false }) public castManager!: CastManager;
@state() private askWrite = false;
@@ -241,6 +241,8 @@ class HcCast extends LitElement {
mwc-button ha-svg-icon {
margin-right: 8px;
margin-inline-end: 8px;
margin-inline-start: initial;
height: 18px;
}

View File

@@ -10,13 +10,13 @@ import "../../../../src/components/ha-card";
@customElement("hc-layout")
class HcLayout extends LitElement {
@property() public subtitle?: string | undefined;
@property() public subtitle?: string;
@property() public auth?: Auth;
@property({ attribute: false }) public auth?: Auth;
@property() public connection?: Connection;
@property({ attribute: false }) public connection?: Connection;
@property() public user?: HassUser;
@property({ attribute: false }) public user?: HassUser;
protected render(): TemplateResult {
return html`

View File

@@ -12,8 +12,8 @@ class HcLaunchScreen extends LitElement {
return html`
<div class="container">
<img
alt="Home Assistant logo on left, Nabu Casa logo on right, and red heart in center"
src="https://www.home-assistant.io/images/blog/2018-09-thinking-big/social.png"
alt="Nabu Casa logo on left, Home Assistant logo on right, and red heart in center"
src="https://cast.home-assistant.io/images/nabu-loves-hass.png"
/>
<div class="status">
${this.hass ? "Connected" : "Not Connected"}
@@ -45,6 +45,8 @@ class HcLaunchScreen extends LitElement {
}
.status {
padding-right: 54px;
padding-inline-end: 54px;
padding-inline-start: initial;
}
`;
}

View File

@@ -205,7 +205,6 @@ export class HcMain extends HassElement {
expires_in: 0,
}),
});
this._hassUUID = msg.hassUUID;
} catch (err: any) {
const errorMessage = this._getErrorMessage(err);
this._error = errorMessage;
@@ -225,6 +224,17 @@ export class HcMain extends HassElement {
this.hass.connection.close();
}
this.initializeHass(auth, connection);
if (this._hassUUID !== msg.hassUUID) {
this._hassUUID = msg.hassUUID;
this._lovelacePath = null;
this._urlPath = undefined;
this._lovelaceConfig = undefined;
if (this._unsubLovelace) {
this._unsubLovelace();
this._unsubLovelace = undefined;
}
resourcesLoaded = false;
}
this._error = undefined;
this._sendStatus();
}
@@ -233,7 +243,7 @@ export class HcMain extends HassElement {
this._showDemo = false;
// We should not get this command before we are connected.
// Means a client got out of sync. Let's send status to them.
if (!this.hass) {
if (!this.hass?.connected) {
this._sendStatus(msg.senderId!);
this._error = "Cannot show Lovelace because we're not connected.";
this._sendError(
@@ -284,6 +294,7 @@ export class HcMain extends HassElement {
this._lovelaceConfig = undefined;
if (this._unsubLovelace) {
this._unsubLovelace();
this._unsubLovelace = undefined;
}
const llColl = atLeastVersion(this.hass.connection.haVersion, 0, 107)
? getLovelaceCollection(this.hass.connection, msg.urlPath)

View File

@@ -13,7 +13,7 @@ export interface DemoCardConfig {
class DemoCard extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
@property() public config!: DemoCardConfig;
@property({ attribute: false }) public config!: DemoCardConfig;
@property({ type: Boolean }) public showConfig = false;

View File

@@ -10,7 +10,7 @@ import "../ha-demo-options";
@customElement("demo-cards")
class DemoCards extends LitElement {
@property() public configs!: DemoCardConfig[];
@property({ attribute: false }) public configs!: DemoCardConfig[];
@property({ attribute: false }) public hass!: HomeAssistant;

View File

@@ -1,19 +1,19 @@
import { LitElement, css, html } from "lit";
import { customElement, property } from "lit/decorators";
import { customElement, property, state } from "lit/decorators";
import { applyThemesOnElement } from "../../../src/common/dom/apply_themes_on_element";
import "../../../src/components/ha-formfield";
import "../../../src/components/ha-switch";
import "./demo-more-info";
import "../ha-demo-options";
import { HomeAssistant } from "../../../src/types";
import "../ha-demo-options";
import "./demo-more-info";
@customElement("demo-more-infos")
class DemoMoreInfos extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
@property() public entities!: [];
@property({ type: Array }) public entities!: string[];
@property({ attribute: false }) _showConfig: boolean = false;
@state() private _showConfig = false;
render() {
return html`

View File

@@ -10,6 +10,7 @@ import { mockHassioSupervisor } from "../../../../demo/src/stubs/hassio_supervis
import { computeInitialHaFormData } from "../../../../src/components/ha-form/compute-initial-ha-form-data";
import "../../../../src/components/ha-form/ha-form";
import type { HaFormSchema } from "../../../../src/components/ha-form/types";
import type { AreaRegistryEntry } from "../../../../src/data/area_registry";
import { getEntity } from "../../../../src/fake_data/entity";
import { provideHass } from "../../../../src/fake_data/provide_hass";
import { HomeAssistant } from "../../../../src/types";
@@ -97,22 +98,25 @@ const DEVICES = [
},
];
const AREAS = [
const AREAS: AreaRegistryEntry[] = [
{
area_id: "backyard",
name: "Backyard",
icon: null,
picture: null,
aliases: [],
},
{
area_id: "bedroom",
name: "Bedroom",
icon: "mdi:bed",
picture: null,
aliases: [],
},
{
area_id: "livingroom",
name: "Livingroom",
icon: "mdi:sofa",
picture: null,
aliases: [],
},

View File

@@ -9,6 +9,7 @@ import { mockEntityRegistry } from "../../../../demo/src/stubs/entity_registry";
import { mockHassioSupervisor } from "../../../../demo/src/stubs/hassio_supervisor";
import "../../../../src/components/ha-selector/ha-selector";
import "../../../../src/components/ha-settings-row";
import type { AreaRegistryEntry } from "../../../../src/data/area_registry";
import { BlueprintInput } from "../../../../src/data/blueprint";
import { showDialog } from "../../../../src/dialogs/make-dialog-manager";
import { getEntity } from "../../../../src/fake_data/entity";
@@ -93,22 +94,25 @@ const DEVICES = [
},
];
const AREAS = [
const AREAS: AreaRegistryEntry[] = [
{
area_id: "backyard",
name: "Backyard",
icon: null,
picture: null,
aliases: [],
},
{
area_id: "bedroom",
name: "Bedroom",
icon: "mdi:bed",
picture: null,
aliases: [],
},
{
area_id: "livingroom",
name: "Livingroom",
icon: "mdi:sofa",
picture: null,
aliases: [],
},

View File

@@ -65,15 +65,23 @@ const CONFIGS = [
>> ...by using additional greater-than signs right next to each other...
> > > ...or with spaces between arrows.
> **Warning** Hey there
> This is a warning with a title
> [!NOTE]
> This is a GitHub note alert
> **Note**
> This is a note
> [!TIP]
> This is a GitHub tip alert
> **Note**
> This is a multiline note
> Lorem ipsum...
> [!IMPORTANT]
> This is a GitHub important alert
> [!WARNING]
> This is a GitHub warning alert
> [!CAUTION]
> This is a GitHub caution alert
> [!TIP]
> - This is a list entry in GitHub tip alert
## Lists

View File

@@ -79,6 +79,18 @@ const CONFIGS = [
color: pink
`,
},
{
heading: "Whole tile tap action",
config: `
- type: tile
entity: switch.tv_outlet
color: pink
tap_action:
action: toggle
icon_tap_action:
action: none
`,
},
{
heading: "Unknown entity",
config: `

View File

@@ -53,6 +53,7 @@ const SENSOR_DEVICE_CLASSES = [
"volatile_organic_compounds_parts",
"voltage",
"volume",
"volume_flow_rate",
"water",
"weight",
"wind_speed",
@@ -344,6 +345,7 @@ export class DemoEntityState extends LitElement {
title: "Icon",
template: (entry) => html`
<state-badge
.hass=${hass}
.stateObj=${entry.stateObj}
.stateColor=${true}
></state-badge>

View File

@@ -243,6 +243,8 @@ export class HassioAddonStore extends LitElement {
}
.advanced a {
margin-left: 0.5em;
margin-inline-start: 0.5em;
margin-inline-end: initial;
color: var(--primary-color);
}
`;

View File

@@ -250,7 +250,9 @@ class HassioAddonDashboard extends LitElement {
}
if (path === "uninstall") {
window.history.back();
if (this.isConnected) {
navigate(this._backPath);
}
} else if (path === "install") {
this.addon = await fetchHassioAddonInfo(this.hass, this.addon!.slug);
} else {

View File

@@ -1188,11 +1188,13 @@ class HassioAddonInfo extends LitElement {
}
.addon-header {
padding-left: 8px;
padding-inline-start: 8px;
padding-inline-end: initial;
font-size: 24px;
color: var(--ha-card-header-color, --primary-text-color);
}
.addon-version {
float: right;
float: var(--float-end);
font-size: 15px;
vertical-align: middle;
}

View File

@@ -395,6 +395,8 @@ export class HassioBackups extends LitElement {
.selected-txt {
font-weight: bold;
padding-left: 16px;
padding-inline-start: 16px;
padding-inline-end: initial;
color: var(--primary-text-color);
}
.table-header .selected-txt {
@@ -405,6 +407,8 @@ export class HassioBackups extends LitElement {
}
.header-toolbar .header-btns {
margin-right: -12px;
margin-inline-end: -12px;
margin-inline-start: initial;
}
.header-btns > mwc-button,
.header-btns > ha-icon-button {

View File

@@ -60,6 +60,10 @@ class HassioCardContent extends LitElement {
static get styles(): CSSResultGroup {
return css`
:host {
direction: ltr;
}
ha-svg-icon {
margin-right: 24px;
margin-left: 8px;

View File

@@ -72,7 +72,7 @@ const _computeAddons = (addons): AddonCheckboxItem[] =>
export class SupervisorBackupContent extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
@property() public localize?: LocalizeFunc;
@property({ attribute: false }) public localize?: LocalizeFunc;
@property({ attribute: false }) public supervisor?: Supervisor;
@@ -316,6 +316,8 @@ export class SupervisorBackupContent extends LitElement {
display: flex;
flex-direction: column;
margin-left: 30px;
margin-inline-start: 30px;
margin-inline-end: initial;
}
ha-formfield.password {
display: block;
@@ -324,6 +326,8 @@ export class SupervisorBackupContent extends LitElement {
.backup-types {
display: flex;
margin-left: -13px;
margin-inline-start: -13px;
margin-inline-end: initial;
}
.sub-header {
margin-top: 8px;

View File

@@ -37,6 +37,8 @@ class SupervisorFormfieldLabel extends LitElement {
}
.label {
margin-right: 4px;
margin-inline-end: 4px;
margin-inline-start: initial;
}
.version {
color: var(--secondary-text-color);
@@ -45,6 +47,8 @@ class SupervisorFormfieldLabel extends LitElement {
max-height: 22px;
max-width: 22px;
margin-right: 8px;
margin-inline-end: 8px;
margin-inline-start: initial;
}
`;
}

View File

@@ -64,6 +64,8 @@ class SupervisorMetric extends LitElement {
.value {
width: 48px;
padding-right: 4px;
padding-inline-start: initial;
padding-inline-end: 4px;
flex-shrink: 0;
}
`;

View File

@@ -27,8 +27,7 @@ const SCHEMA = memoizeOne(
class HassioBackupLocationDialog extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
@property({ attribute: false })
public _dialogParams?: HassioBackupLocationDialogParams;
@state() private _dialogParams?: HassioBackupLocationDialogParams;
@state() private _data?: { default_backup_mount: string | null };

View File

@@ -138,6 +138,9 @@ class HassioCreateBackupDialog extends LitElement {
haStyle,
haStyleDialog,
css`
:host {
direction: var(--direction);
}
ha-circular-progress {
display: block;
text-align: center;

View File

@@ -597,6 +597,8 @@ export class DialogHassioNetwork
mwc-button.scan {
margin-left: 8px;
margin-inline-start: 8px;
margin-inline-end: initial;
}
.container {

View File

@@ -229,6 +229,8 @@ class HassioRegistriesDialog extends LitElement {
ha-icon-button {
color: var(--error-color);
margin-right: -10px;
margin-inline-end: -10px;
margin-inline-start: initial;
}
`,
];

View File

@@ -195,6 +195,8 @@ class HassioRepositoriesDialog extends LitElement {
}
mwc-button {
margin-left: 8px;
margin-inline-start: 8px;
margin-inline-end: initial;
}
ha-circular-progress {
display: block;

View File

@@ -360,7 +360,7 @@ class HassioIngressView extends LitElement {
}
.main-title {
margin: 0 0 0 24px;
margin: var(--margin-title);
line-height: 20px;
flex-grow: 1;
}

View File

@@ -19,10 +19,14 @@ export const hassioStyle = css`
letter-spacing: var(--paper-font-headline_-_letter-spacing);
line-height: var(--paper-font-headline_-_line-height);
padding-left: 8px;
padding-inline-start: 8px;
padding-inline-end: initial;
}
.description {
margin-top: 4px;
padding-left: 8px;
padding-inline-start: 8px;
padding-inline-end: initial;
}
.card-group {
display: grid;

View File

@@ -73,6 +73,8 @@ class HassioSystem extends LitElement {
color: var(--primary-text-color);
font-size: 2em;
padding-left: 8px;
padding-inline-start: 8px;
padding-inline-end: initial;
margin-bottom: 8px;
}
hassio-supervisor-log {

View File

@@ -2,7 +2,7 @@ export default {
"*.?(c|m){js,ts}": [
"eslint --cache --cache-strategy=content --cache-location=node_modules/.cache/eslint/.eslintcache --fix",
"prettier --cache --write",
"lit-analyzer",
"lit-analyzer --quiet",
],
"*.{json,css,md,markdown,html,y?aml}": "prettier --cache --write",
"translations/*/*.json": (files) =>

View File

@@ -25,24 +25,24 @@
"license": "Apache-2.0",
"type": "module",
"dependencies": {
"@babel/runtime": "7.23.8",
"@babel/runtime": "7.23.9",
"@braintree/sanitize-url": "7.0.0",
"@codemirror/autocomplete": "6.12.0",
"@codemirror/commands": "6.3.3",
"@codemirror/language": "6.10.0",
"@codemirror/language": "6.10.1",
"@codemirror/legacy-modes": "6.3.3",
"@codemirror/search": "6.5.5",
"@codemirror/state": "6.4.0",
"@codemirror/view": "6.23.0",
"@codemirror/view": "6.23.1",
"@egjs/hammerjs": "2.0.17",
"@formatjs/intl-datetimeformat": "6.12.0",
"@formatjs/intl-displaynames": "6.6.4",
"@formatjs/intl-datetimeformat": "6.12.2",
"@formatjs/intl-displaynames": "6.6.6",
"@formatjs/intl-getcanonicallocales": "2.3.0",
"@formatjs/intl-listformat": "7.5.3",
"@formatjs/intl-locale": "3.4.3",
"@formatjs/intl-numberformat": "8.9.0",
"@formatjs/intl-pluralrules": "5.2.10",
"@formatjs/intl-relativetimeformat": "11.2.10",
"@formatjs/intl-listformat": "7.5.5",
"@formatjs/intl-locale": "3.4.5",
"@formatjs/intl-numberformat": "8.10.0",
"@formatjs/intl-pluralrules": "5.2.12",
"@formatjs/intl-relativetimeformat": "11.2.12",
"@fullcalendar/core": "6.1.10",
"@fullcalendar/daygrid": "6.1.10",
"@fullcalendar/interaction": "6.1.10",
@@ -51,10 +51,10 @@
"@fullcalendar/timegrid": "6.1.10",
"@lezer/highlight": "1.2.0",
"@lit-labs/context": "0.4.1",
"@lit-labs/motion": "1.0.6",
"@lit-labs/motion": "1.0.7",
"@lit-labs/observers": "2.0.2",
"@lit-labs/virtualizer": "2.0.12",
"@lrnwebcomponents/simple-tooltip": "7.0.18",
"@lrnwebcomponents/simple-tooltip": "8.0.0",
"@material/chips": "=14.0.0-canary.53b3cad2f.0",
"@material/data-table": "=14.0.0-canary.53b3cad2f.0",
"@material/mwc-base": "0.27.0",
@@ -80,7 +80,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.1.1",
"@material/web": "=1.2.0",
"@mdi/js": "7.4.47",
"@mdi/svg": "7.4.47",
"@polymer/paper-item": "3.0.1",
@@ -89,8 +89,8 @@
"@polymer/paper-toast": "3.0.1",
"@polymer/polymer": "3.5.1",
"@thomasloven/round-slider": "0.6.0",
"@vaadin/combo-box": "24.3.3",
"@vaadin/vaadin-themable-mixin": "24.3.3",
"@vaadin/combo-box": "24.3.5",
"@vaadin/vaadin-themable-mixin": "24.3.5",
"@vibrant/color": "3.2.1-alpha.1",
"@vibrant/core": "3.2.1-alpha.1",
"@vibrant/quantizer-mmcq": "3.2.1-alpha.1",
@@ -100,7 +100,7 @@
"app-datepicker": "5.1.1",
"chart.js": "4.4.1",
"comlink": "4.4.1",
"core-js": "3.35.0",
"core-js": "3.35.1",
"cropperjs": "1.6.1",
"date-fns": "2.30.0",
"date-fns-tz": "2.0.0",
@@ -109,16 +109,16 @@
"element-internals-polyfill": "1.3.10",
"fuse.js": "7.0.0",
"google-timezones-json": "1.2.0",
"hls.js": "1.5.1",
"hls.js": "1.5.3",
"home-assistant-js-websocket": "9.1.0",
"idb-keyval": "6.2.1",
"intl-messageformat": "10.5.8",
"intl-messageformat": "10.5.11",
"js-yaml": "4.1.0",
"leaflet": "1.9.4",
"leaflet-draw": "1.0.4",
"lit": "2.8.0",
"luxon": "3.4.4",
"marked": "11.1.1",
"marked": "11.2.0",
"memoize-one": "6.0.0",
"node-vibrant": "3.2.1-alpha.1",
"proxy-polyfill": "0.3.2",
@@ -149,13 +149,13 @@
"xss": "1.0.14"
},
"devDependencies": {
"@babel/core": "7.23.7",
"@babel/helper-define-polyfill-provider": "0.4.4",
"@babel/plugin-proposal-decorators": "7.23.7",
"@babel/plugin-transform-runtime": "7.23.7",
"@babel/preset-env": "7.23.8",
"@babel/core": "7.23.9",
"@babel/helper-define-polyfill-provider": "0.5.0",
"@babel/plugin-proposal-decorators": "7.23.9",
"@babel/plugin-transform-runtime": "7.23.9",
"@babel/preset-env": "7.23.9",
"@babel/preset-typescript": "7.23.3",
"@bundle-stats/plugin-webpack-filter": "4.8.4",
"@bundle-stats/plugin-webpack-filter": "4.9.2",
"@koa/cors": "5.0.0",
"@lokalise/node-api": "12.1.0",
"@octokit/auth-oauth-device": "6.0.1",
@@ -175,21 +175,21 @@
"@types/js-yaml": "4.0.9",
"@types/leaflet": "1.9.8",
"@types/leaflet-draw": "1.0.11",
"@types/luxon": "3.4.1",
"@types/luxon": "3.4.2",
"@types/mocha": "10.0.6",
"@types/qrcode": "1.5.5",
"@types/serve-handler": "6.1.4",
"@types/sortablejs": "1.15.7",
"@types/tar": "6.1.10",
"@types/tar": "6.1.11",
"@types/ua-parser-js": "0.7.39",
"@types/webspeechapi": "0.0.29",
"@typescript-eslint/eslint-plugin": "6.18.1",
"@typescript-eslint/parser": "6.18.1",
"@typescript-eslint/eslint-plugin": "6.20.0",
"@typescript-eslint/parser": "6.20.0",
"@web/dev-server": "0.1.38",
"@web/dev-server-rollup": "0.4.1",
"babel-loader": "9.1.3",
"babel-plugin-template-html-minifier": "4.1.0",
"chai": "5.0.0",
"chai": "5.0.3",
"del": "7.1.0",
"eslint": "8.56.0",
"eslint-config-airbnb-base": "15.0.0",
@@ -199,7 +199,7 @@
"eslint-plugin-disable": "2.0.3",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-lit": "1.11.0",
"eslint-plugin-lit-a11y": "4.1.1",
"eslint-plugin-lit-a11y": "4.1.2",
"eslint-plugin-unused-imports": "3.0.0",
"eslint-plugin-wc": "2.0.4",
"fancy-log": "2.0.0",
@@ -212,19 +212,19 @@
"gulp-rename": "2.0.0",
"gulp-zopfli-green": "6.0.1",
"html-minifier-terser": "7.2.0",
"husky": "8.0.3",
"husky": "9.0.10",
"instant-mocha": "1.5.2",
"jszip": "3.10.1",
"lint-staged": "15.2.0",
"lint-staged": "15.2.1",
"lit-analyzer": "2.0.3",
"lodash.template": "4.5.0",
"magic-string": "0.30.5",
"magic-string": "0.30.6",
"map-stream": "0.0.7",
"mocha": "10.2.0",
"object-hash": "3.0.0",
"open": "10.0.3",
"pinst": "3.0.0",
"prettier": "3.2.2",
"prettier": "3.2.4",
"rollup": "2.79.1",
"rollup-plugin-string": "3.0.0",
"rollup-plugin-terser": "7.0.2",
@@ -240,7 +240,7 @@
"typescript": "5.3.3",
"vinyl-buffer": "1.0.1",
"vinyl-source-stream": "2.0.0",
"webpack": "5.89.0",
"webpack": "5.90.1",
"webpack-cli": "5.1.4",
"webpack-dev-server": "4.15.1",
"webpack-manifest-plugin": "5.0.0",
@@ -255,8 +255,8 @@
"lit": "2.8.0",
"clean-css": "5.3.3",
"@lit/reactive-element": "1.6.3",
"sortablejs@1.15.0": "patch:sortablejs@npm%3A1.15.0#./.yarn/patches/sortablejs-npm-1.15.0-f3a393abcc.patch",
"sortablejs@1.15.2": "patch:sortablejs@npm%3A1.15.2#~/.yarn/patches/sortablejs-npm-1.15.2-73347ae85a.patch",
"leaflet-draw@1.0.4": "patch:leaflet-draw@npm%3A1.0.4#./.yarn/patches/leaflet-draw-npm-1.0.4-0ca0ebcf65.patch"
},
"packageManager": "yarn@4.0.2"
"packageManager": "yarn@4.1.0"
}

View File

@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "home-assistant-frontend"
version = "20240112.0"
version = "20240205.0"
license = {text = "Apache-2.0"}
description = "The Home Assistant frontend"
readme = "README.md"

View File

@@ -34,7 +34,7 @@ export class HaAuthFlow extends LitElement {
@property() public oauth2State?: string;
@property() public localize!: LocalizeFunc;
@property({ attribute: false }) public localize!: LocalizeFunc;
@property({ attribute: false }) public step?: DataEntryFlowStep;
@@ -93,6 +93,8 @@ export class HaAuthFlow extends LitElement {
<style>
ha-auth-flow .store-token {
margin-left: -16px;
margin-inline-start: -16px;
margin-inline-end: initial;
}
a.forgot-password {
color: var(--primary-color);

View File

@@ -149,6 +149,8 @@ export class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
text-decoration: none;
color: var(--primary-text-color);
margin-right: 16px;
margin-inline-end: 16px;
margin-inline-start: initial;
}
h1 {
font-size: 28px;

View File

@@ -18,9 +18,9 @@ declare global {
@customElement("ha-pick-auth-provider")
export class HaPickAuthProvider extends LitElement {
@property() public authProviders: AuthProvider[] = [];
@property({ attribute: false }) public authProviders: AuthProvider[] = [];
@property() public localize!: LocalizeFunc;
@property({ attribute: false }) public localize!: LocalizeFunc;
protected render() {
return html`

View File

@@ -1,6 +1,7 @@
/** Constants to be used in the frontend. */
import {
mdiAccount,
mdiAirFilter,
mdiAlert,
mdiAngleAcute,
@@ -18,7 +19,6 @@ import {
mdiChatSleep,
mdiClipboardList,
mdiClock,
mdiCloudUpload,
mdiCog,
mdiCommentAlert,
mdiCounter,
@@ -48,11 +48,14 @@ import {
mdiMoleculeCo2,
mdiPalette,
mdiPh,
mdiPipe,
mdiProgressClock,
mdiRayVertex,
mdiRemote,
mdiRobot,
mdiRobotMower,
mdiRobotVacuum,
mdiRoomService,
mdiScriptText,
mdiSineWave,
mdiSpeakerMessage,
@@ -62,6 +65,7 @@ import {
mdiThermometerLines,
mdiThermostat,
mdiTimerOutline,
mdiToggleSwitch,
mdiTransmissionTower,
mdiWater,
mdiWaterPercent,
@@ -70,6 +74,7 @@ import {
mdiWeatherRainy,
mdiWeatherWindy,
mdiWeight,
mdiWhiteBalanceSunny,
mdiWifi,
} from "@mdi/js";
@@ -79,6 +84,9 @@ import { mdiHomeAssistant } from "../resources/home-assistant-logo-svg";
// Arrays with values should be alphabetically sorted if order doesn't matter.
// Each constant should have a description what it is supposed to be used for.
/** Icon to use when no icon specified for service. */
export const DEFAULT_SERVICE_ICON = mdiRoomService;
/** Icon to use when no icon specified for domain. */
export const DEFAULT_DOMAIN_ICON = mdiBookmark;
@@ -86,20 +94,23 @@ export const DEFAULT_DOMAIN_ICON = mdiBookmark;
export const FIXED_DOMAIN_ICONS = {
air_quality: mdiAirFilter,
alert: mdiAlert,
automation: mdiRobot,
calendar: mdiCalendar,
climate: mdiThermostat,
configurator: mdiCog,
conversation: mdiMicrophoneMessage,
counter: mdiCounter,
datetime: mdiCalendarClock,
date: mdiCalendar,
datetime: mdiCalendarClock,
demo: mdiHomeAssistant,
device_tracker: mdiAccount,
google_assistant: mdiGoogleAssistant,
group: mdiGoogleCirclesCommunities,
homeassistant: mdiHomeAssistant,
homekit: mdiHomeAutomation,
image: mdiImage,
image_processing: mdiImageFilterFrames,
image: mdiImage,
input_boolean: mdiToggleSwitch,
input_button: mdiButtonPointer,
input_datetime: mdiCalendarClock,
input_number: mdiRayVertex,
@@ -111,6 +122,7 @@ export const FIXED_DOMAIN_ICONS = {
notify: mdiCommentAlert,
number: mdiRayVertex,
persistent_notification: mdiBell,
person: mdiAccount,
plant: mdiFlower,
proximity: mdiAppleSafari,
remote: mdiRemote,
@@ -122,12 +134,12 @@ export const FIXED_DOMAIN_ICONS = {
simple_alarm: mdiBell,
siren: mdiBullhorn,
stt: mdiMicrophoneMessage,
sun: mdiWhiteBalanceSunny,
text: mdiFormTextbox,
todo: mdiClipboardList,
time: mdiClock,
timer: mdiTimerOutline,
todo: mdiClipboardList,
tts: mdiSpeakerMessage,
updater: mdiCloudUpload,
vacuum: mdiRobotVacuum,
wake_word: mdiChatSleep,
weather: mdiWeatherPartlyCloudy,
@@ -180,6 +192,7 @@ export const FIXED_DEVICE_CLASS_ICONS = {
volatile_organic_compounds_parts: mdiMolecule,
voltage: mdiSineWave,
volume: mdiCarCoolantLevel,
volume_flow_rate: mdiPipe,
water: mdiWater,
weight: mdiWeight,
wind_speed: mdiWeatherWindy,

View File

@@ -41,7 +41,9 @@ export const applyThemesOnElement = (
// If there is no explicitly desired dark mode provided, we automatically
// use the active one from `themes`.
const darkMode =
themeSettings?.dark !== undefined ? themeSettings.dark : themes.darkMode;
themeSettings?.dark !== undefined
? themeSettings.dark
: themes?.darkMode || false;
let cacheKey = themeToApply;
let themeRules: Partial<ThemeVars> = {};

View File

@@ -1,36 +0,0 @@
/** Return an icon representing a alarm panel state. */
import {
mdiShieldLock,
mdiShieldAirplane,
mdiShieldHome,
mdiShieldMoon,
mdiSecurity,
mdiShieldOutline,
mdiBellRing,
mdiShieldOff,
mdiShield,
} from "@mdi/js";
export const alarmPanelIcon = (state?: string) => {
switch (state) {
case "armed_away":
return mdiShieldLock;
case "armed_vacation":
return mdiShieldAirplane;
case "armed_home":
return mdiShieldHome;
case "armed_night":
return mdiShieldMoon;
case "armed_custom_bypass":
return mdiSecurity;
case "pending":
return mdiShieldOutline;
case "triggered":
return mdiBellRing;
case "disarmed":
return mdiShieldOff;
default:
return mdiShield;
}
};

View File

@@ -1,92 +1,59 @@
/** Return an icon representing a battery state. */
import {
mdiBattery,
mdiBattery10,
mdiBattery20,
mdiBattery30,
mdiBattery40,
mdiBattery50,
mdiBattery60,
mdiBattery70,
mdiBattery80,
mdiBattery90,
mdiBatteryAlert,
mdiBatteryAlertVariantOutline,
mdiBatteryCharging,
mdiBatteryCharging10,
mdiBatteryCharging20,
mdiBatteryCharging30,
mdiBatteryCharging40,
mdiBatteryCharging50,
mdiBatteryCharging60,
mdiBatteryCharging70,
mdiBatteryCharging80,
mdiBatteryCharging90,
mdiBatteryChargingOutline,
mdiBatteryUnknown,
} from "@mdi/js";
import { HassEntity } from "home-assistant-js-websocket";
const BATTERY_ICONS = {
10: mdiBattery10,
20: mdiBattery20,
30: mdiBattery30,
40: mdiBattery40,
50: mdiBattery50,
60: mdiBattery60,
70: mdiBattery70,
80: mdiBattery80,
90: mdiBattery90,
100: mdiBattery,
10: "mdi:battery-10",
20: "mdi:battery-20",
30: "mdi:battery-30",
40: "mdi:battery-40",
50: "mdi:battery-50",
60: "mdi:battery-60",
70: "mdi:battery-70",
80: "mdi:battery-80",
90: "mdi:battery-90",
100: "mdi:battery",
};
const BATTERY_CHARGING_ICONS = {
10: mdiBatteryCharging10,
20: mdiBatteryCharging20,
30: mdiBatteryCharging30,
40: mdiBatteryCharging40,
50: mdiBatteryCharging50,
60: mdiBatteryCharging60,
70: mdiBatteryCharging70,
80: mdiBatteryCharging80,
90: mdiBatteryCharging90,
100: mdiBatteryCharging,
10: "mdi:battery-charging-10",
20: "mdi:battery-charging-20",
30: "mdi:battery-charging-30",
40: "mdi:battery-charging-40",
50: "mdi:battery-charging-50",
60: "mdi:battery-charging-60",
70: "mdi:battery-charging-70",
80: "mdi:battery-charging-80",
90: "mdi:battery-charging-90",
100: "mdi:battery-charging",
};
export const batteryStateIcon = (
batteryState: HassEntity,
batteryChargingState?: HassEntity
) => {
const battery = batteryState.state;
const batteryCharging =
batteryChargingState && batteryChargingState.state === "on";
return batteryIcon(battery, batteryCharging);
export const batteryIcon = (stateObj: HassEntity, state?: string) => {
const level = state ?? stateObj.state;
return batteryLevelIcon(level);
};
export const batteryIcon = (
batteryState: number | string,
batteryCharging?: boolean
) => {
const batteryValue = Number(batteryState);
export const batteryLevelIcon = (
batteryLevel: number | string,
isBatteryCharging?: boolean
): string => {
const batteryValue = Number(batteryLevel);
if (isNaN(batteryValue)) {
if (batteryState === "off") {
return mdiBattery;
if (batteryLevel === "off") {
return "mdi:battery";
}
if (batteryState === "on") {
return mdiBatteryAlert;
if (batteryLevel === "on") {
return "mdi:battery-alert";
}
return mdiBatteryUnknown;
return "mdi:battery-unknown";
}
const batteryRound = Math.round(batteryValue / 10) * 10;
if (batteryCharging && batteryValue >= 10) {
if (isBatteryCharging && batteryValue >= 10) {
return BATTERY_CHARGING_ICONS[batteryRound];
}
if (batteryCharging) {
return mdiBatteryChargingOutline;
if (isBatteryCharging) {
return "mdi:battery-charging-outline";
}
if (batteryValue <= 5) {
return mdiBatteryAlertVariantOutline;
return "mdi:battery-alert-variant-outline";
}
return BATTERY_ICONS[batteryRound];
};

View File

@@ -1,108 +0,0 @@
import {
mdiAlertCircle,
mdiBattery,
mdiBatteryCharging,
mdiBatteryOutline,
mdiBrightness5,
mdiBrightness7,
mdiCheckboxMarkedCircle,
mdiCheckNetworkOutline,
mdiCloseNetworkOutline,
mdiCheckCircle,
mdiCropPortrait,
mdiDoorClosed,
mdiDoorOpen,
mdiFire,
mdiGarage,
mdiGarageOpen,
mdiHome,
mdiHomeOutline,
mdiLock,
mdiLockOpen,
mdiMusicNote,
mdiMusicNoteOff,
mdiMotionSensor,
mdiMotionSensorOff,
mdiPackage,
mdiPackageUp,
mdiPlay,
mdiPowerPlug,
mdiPowerPlugOff,
mdiRadioboxBlank,
mdiSnowflake,
mdiSmokeDetector,
mdiSmokeDetectorAlert,
mdiSmokeDetectorVariant,
mdiSmokeDetectorVariantAlert,
mdiSquare,
mdiSquareOutline,
mdiStop,
mdiThermometer,
mdiVibrate,
mdiWater,
mdiWaterOff,
mdiWindowClosed,
mdiWindowOpen,
} from "@mdi/js";
import { HassEntity } from "home-assistant-js-websocket";
/** Return an icon representing a binary sensor state. */
export const binarySensorIcon = (state?: string, stateObj?: HassEntity) => {
const is_off = state === "off";
switch (stateObj?.attributes.device_class) {
case "battery":
return is_off ? mdiBattery : mdiBatteryOutline;
case "battery_charging":
return is_off ? mdiBattery : mdiBatteryCharging;
case "carbon_monoxide":
return is_off ? mdiSmokeDetector : mdiSmokeDetectorAlert;
case "cold":
return is_off ? mdiThermometer : mdiSnowflake;
case "connectivity":
return is_off ? mdiCloseNetworkOutline : mdiCheckNetworkOutline;
case "door":
return is_off ? mdiDoorClosed : mdiDoorOpen;
case "garage_door":
return is_off ? mdiGarage : mdiGarageOpen;
case "power":
return is_off ? mdiPowerPlugOff : mdiPowerPlug;
case "gas":
case "problem":
case "safety":
case "tamper":
return is_off ? mdiCheckCircle : mdiAlertCircle;
case "smoke":
return is_off ? mdiSmokeDetectorVariant : mdiSmokeDetectorVariantAlert;
case "heat":
return is_off ? mdiThermometer : mdiFire;
case "light":
return is_off ? mdiBrightness5 : mdiBrightness7;
case "lock":
return is_off ? mdiLock : mdiLockOpen;
case "moisture":
return is_off ? mdiWaterOff : mdiWater;
case "motion":
return is_off ? mdiMotionSensorOff : mdiMotionSensor;
case "occupancy":
return is_off ? mdiHomeOutline : mdiHome;
case "opening":
return is_off ? mdiSquare : mdiSquareOutline;
case "plug":
return is_off ? mdiPowerPlugOff : mdiPowerPlug;
case "presence":
return is_off ? mdiHomeOutline : mdiHome;
case "running":
return is_off ? mdiStop : mdiPlay;
case "sound":
return is_off ? mdiMusicNoteOff : mdiMusicNote;
case "update":
return is_off ? mdiPackage : mdiPackageUp;
case "vibration":
return is_off ? mdiCropPortrait : mdiVibrate;
case "window":
return is_off ? mdiWindowClosed : mdiWindowOpen;
default:
return is_off ? mdiRadioboxBlank : mdiCheckboxMarkedCircle;
}
};

View File

@@ -1,132 +1,12 @@
/** Return an icon representing a cover state. */
import {
mdiArrowUpBox,
mdiArrowDownBox,
mdiGarage,
mdiGarageOpen,
mdiGateArrowRight,
mdiGate,
mdiGateOpen,
mdiDoorOpen,
mdiDoorClosed,
mdiCircle,
mdiWindowShutter,
mdiWindowShutterOpen,
mdiBlindsHorizontal,
mdiBlindsHorizontalClosed,
mdiRollerShade,
mdiRollerShadeClosed,
mdiWindowClosed,
mdiWindowOpen,
mdiArrowExpandHorizontal,
mdiArrowUp,
mdiArrowCollapseHorizontal,
mdiArrowDown,
mdiCircleSlice8,
mdiArrowSplitVertical,
mdiCurtains,
mdiCurtainsClosed,
mdiArrowExpandHorizontal,
mdiArrowUp,
} from "@mdi/js";
import { HassEntity } from "home-assistant-js-websocket";
export const coverIcon = (state?: string, stateObj?: HassEntity): string => {
const open = state !== "closed";
switch (stateObj?.attributes.device_class) {
case "garage":
switch (state) {
case "opening":
return mdiArrowUpBox;
case "closing":
return mdiArrowDownBox;
case "closed":
return mdiGarage;
default:
return mdiGarageOpen;
}
case "gate":
switch (state) {
case "opening":
case "closing":
return mdiGateArrowRight;
case "closed":
return mdiGate;
default:
return mdiGateOpen;
}
case "door":
return open ? mdiDoorOpen : mdiDoorClosed;
case "damper":
return open ? mdiCircle : mdiCircleSlice8;
case "shutter":
switch (state) {
case "opening":
return mdiArrowUpBox;
case "closing":
return mdiArrowDownBox;
case "closed":
return mdiWindowShutter;
default:
return mdiWindowShutterOpen;
}
case "curtain":
switch (state) {
case "opening":
return mdiArrowSplitVertical;
case "closing":
return mdiArrowCollapseHorizontal;
case "closed":
return mdiCurtainsClosed;
default:
return mdiCurtains;
}
case "blind":
switch (state) {
case "opening":
return mdiArrowUpBox;
case "closing":
return mdiArrowDownBox;
case "closed":
return mdiBlindsHorizontalClosed;
default:
return mdiBlindsHorizontal;
}
case "shade":
switch (state) {
case "opening":
return mdiArrowUpBox;
case "closing":
return mdiArrowDownBox;
case "closed":
return mdiRollerShadeClosed;
default:
return mdiRollerShade;
}
case "window":
switch (state) {
case "opening":
return mdiArrowUpBox;
case "closing":
return mdiArrowDownBox;
case "closed":
return mdiWindowClosed;
default:
return mdiWindowOpen;
}
}
switch (state) {
case "opening":
return mdiArrowUpBox;
case "closing":
return mdiArrowDownBox;
case "closed":
return mdiWindowClosed;
default:
return mdiWindowOpen;
}
};
export const computeOpenIcon = (stateObj: HassEntity): string => {
switch (stateObj.attributes.device_class) {
case "awning":

View File

@@ -0,0 +1,16 @@
import { HassEntity } from "home-assistant-js-websocket";
export const deviceTrackerIcon = (stateObj: HassEntity, state?: string) => {
const compareState = state ?? stateObj.state;
if (stateObj?.attributes.source_type === "router") {
return compareState === "home" ? "mdi:lan-connect" : "mdi:lan-disconnect";
}
if (
["bluetooth", "bluetooth_le"].includes(stateObj?.attributes.source_type)
) {
return compareState === "home" ? "mdi:bluetooth-connect" : "mdi:bluetooth";
}
return compareState === "not_home"
? "mdi:account-arrow-right"
: "mdi:account";
};

View File

@@ -1,301 +0,0 @@
import {
mdiAccount,
mdiAccountArrowRight,
mdiAirHumidifier,
mdiAirHumidifierOff,
mdiAudioVideo,
mdiAudioVideoOff,
mdiBluetooth,
mdiBluetoothConnect,
mdiButtonPointer,
mdiCalendar,
mdiCast,
mdiCastConnected,
mdiCastOff,
mdiChartSankey,
mdiCheckCircleOutline,
mdiClock,
mdiCloseCircleOutline,
mdiCrosshairsQuestion,
mdiDoorbell,
mdiEyeCheck,
mdiFan,
mdiFanOff,
mdiGestureTapButton,
mdiLanConnect,
mdiLanDisconnect,
mdiLock,
mdiLockAlert,
mdiLockClock,
mdiLockOpen,
mdiMeterGas,
mdiMotionSensor,
mdiPackage,
mdiPackageDown,
mdiPackageUp,
mdiPipeValve,
mdiPowerPlug,
mdiPowerPlugOff,
mdiRestart,
mdiRobot,
mdiRobotConfused,
mdiRobotOff,
mdiSpeaker,
mdiSpeakerOff,
mdiSpeakerPause,
mdiSpeakerPlay,
mdiSwapHorizontal,
mdiTelevision,
mdiTelevisionOff,
mdiTelevisionPause,
mdiTelevisionPlay,
mdiToggleSwitchVariant,
mdiToggleSwitchVariantOff,
mdiVideo,
mdiVideoOff,
mdiWaterBoiler,
mdiWaterBoilerOff,
mdiWeatherNight,
mdiWhiteBalanceSunny,
} from "@mdi/js";
import { HassEntity } from "home-assistant-js-websocket";
import { UpdateEntity, updateIsInstalling } from "../../data/update";
import { weatherIcon } from "../../data/weather";
/**
* Return the icon to be used for a domain.
*
* Optionally pass in a state to influence the domain icon.
*/
import { DEFAULT_DOMAIN_ICON, FIXED_DOMAIN_ICONS } from "../const";
import { alarmPanelIcon } from "./alarm_panel_icon";
import { binarySensorIcon } from "./binary_sensor_icon";
import { coverIcon } from "./cover_icon";
import { numberIcon } from "./number_icon";
import { sensorIcon } from "./sensor_icon";
export const domainIcon = (
domain: string,
stateObj?: HassEntity,
state?: string
): string => {
const icon = domainIconWithoutDefault(domain, stateObj, state);
if (icon) {
return icon;
}
// eslint-disable-next-line
console.warn(`Unable to find icon for domain ${domain}`);
return DEFAULT_DOMAIN_ICON;
};
export const domainIconWithoutDefault = (
domain: string,
stateObj?: HassEntity,
state?: string
): string | undefined => {
const compareState = state !== undefined ? state : stateObj?.state;
switch (domain) {
case "alarm_control_panel":
return alarmPanelIcon(compareState);
case "automation":
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 mdiButtonPointer;
}
case "camera":
return compareState === "off" ? mdiVideoOff : mdiVideo;
case "cover":
return coverIcon(compareState, stateObj);
case "device_tracker":
if (stateObj?.attributes.source_type === "router") {
return compareState === "home" ? mdiLanConnect : mdiLanDisconnect;
}
if (
["bluetooth", "bluetooth_le"].includes(stateObj?.attributes.source_type)
) {
return compareState === "home" ? mdiBluetoothConnect : mdiBluetooth;
}
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;
case "humidifier":
return compareState === "off" ? mdiAirHumidifierOff : mdiAirHumidifier;
case "input_boolean":
return compareState === "on"
? mdiCheckCircleOutline
: mdiCloseCircleOutline;
case "input_datetime":
if (!stateObj?.attributes.has_date) {
return mdiClock;
}
if (!stateObj.attributes.has_time) {
return mdiCalendar;
}
break;
case "lock":
switch (compareState) {
case "unlocked":
return mdiLockOpen;
case "jammed":
return mdiLockAlert;
case "locking":
case "unlocking":
return mdiLockClock;
default:
return mdiLock;
}
case "media_player":
switch (stateObj?.attributes.device_class) {
case "speaker":
switch (compareState) {
case "playing":
return mdiSpeakerPlay;
case "paused":
return mdiSpeakerPause;
case "off":
return mdiSpeakerOff;
default:
return mdiSpeaker;
}
case "tv":
switch (compareState) {
case "playing":
return mdiTelevisionPlay;
case "paused":
return mdiTelevisionPause;
case "off":
return mdiTelevisionOff;
default:
return mdiTelevision;
}
case "receiver":
switch (compareState) {
case "off":
return mdiAudioVideoOff;
default:
return mdiAudioVideo;
}
default:
switch (compareState) {
case "playing":
case "paused":
return mdiCastConnected;
case "off":
return mdiCastOff;
default:
return mdiCast;
}
}
case "number": {
const icon = numberIcon(stateObj);
if (icon) {
return icon;
}
break;
}
case "person":
return compareState === "not_home" ? mdiAccountArrowRight : mdiAccount;
case "switch":
switch (stateObj?.attributes.device_class) {
case "outlet":
return compareState === "on" ? mdiPowerPlug : mdiPowerPlugOff;
case "switch":
return compareState === "on"
? mdiToggleSwitchVariant
: mdiToggleSwitchVariantOff;
default:
return mdiToggleSwitchVariant;
}
case "sensor": {
const icon = sensorIcon(stateObj);
if (icon) {
return icon;
}
break;
}
case "sun":
return stateObj?.state === "above_horizon"
? mdiWhiteBalanceSunny
: mdiWeatherNight;
case "switch_as_x":
return mdiSwapHorizontal;
case "threshold":
return mdiChartSankey;
case "update":
return compareState === "on"
? updateIsInstalling(stateObj as UpdateEntity)
? mdiPackageDown
: mdiPackageUp
: mdiPackage;
case "valve":
switch (stateObj?.attributes.device_class) {
case "water":
return mdiPipeValve;
case "gas":
return mdiMeterGas;
default:
return mdiPipeValve;
}
case "water_heater":
return compareState === "off" ? mdiWaterBoilerOff : mdiWaterBoiler;
case "weather":
return weatherIcon(stateObj?.state);
}
if (domain in FIXED_DOMAIN_ICONS) {
return FIXED_DOMAIN_ICONS[domain];
}
return undefined;
};

View File

@@ -211,6 +211,7 @@ const FIXED_DOMAIN_ATTRIBUTE_STATES = {
"volatile_organic_compounds",
"volatile_organic_compounds_parts",
"voltage",
"volume_flow_rate",
],
state_class: ["measurement", "total", "total_increasing"],
},

View File

@@ -1,13 +0,0 @@
/** Return an icon representing a number state. */
import { HassEntity } from "home-assistant-js-websocket";
import { FIXED_DEVICE_CLASS_ICONS } from "../const";
export const numberIcon = (stateObj?: HassEntity): string | undefined => {
const dclass = stateObj?.attributes.device_class;
if (dclass && dclass in FIXED_DEVICE_CLASS_ICONS) {
return FIXED_DEVICE_CLASS_ICONS[dclass];
}
return undefined;
};

View File

@@ -1,25 +0,0 @@
/** Return an icon representing a sensor state. */
import { mdiBattery, mdiThermometer } from "@mdi/js";
import { HassEntity } from "home-assistant-js-websocket";
import { SENSOR_DEVICE_CLASS_BATTERY } from "../../data/sensor";
import { FIXED_DEVICE_CLASS_ICONS, UNIT_C, UNIT_F } from "../const";
import { batteryStateIcon } from "./battery_icon";
export const sensorIcon = (stateObj?: HassEntity): string | undefined => {
const dclass = stateObj?.attributes.device_class;
if (dclass && dclass in FIXED_DEVICE_CLASS_ICONS) {
return FIXED_DEVICE_CLASS_ICONS[dclass];
}
if (dclass === SENSOR_DEVICE_CLASS_BATTERY) {
return stateObj ? batteryStateIcon(stateObj) : mdiBattery;
}
const unit = stateObj?.attributes.unit_of_measurement;
if (unit === UNIT_C || unit === UNIT_F) {
return mdiThermometer;
}
return undefined;
};

View File

@@ -0,0 +1,42 @@
import { HassEntity } from "home-assistant-js-websocket";
import { computeStateDomain } from "./compute_state_domain";
import { updateIcon } from "./update_icon";
import { deviceTrackerIcon } from "./device_tracker_icon";
import { batteryIcon } from "./battery_icon";
export const stateIcon = (
stateObj: HassEntity,
state?: string
): string | undefined => {
const domain = computeStateDomain(stateObj);
const compareState = state ?? stateObj.state;
const dc = stateObj.attributes.device_class;
switch (domain) {
case "update":
return updateIcon(stateObj, compareState);
case "sensor":
if (dc === "battery") {
return batteryIcon(stateObj, compareState);
}
break;
case "device_tracker":
return deviceTrackerIcon(stateObj, compareState);
case "sun":
return compareState === "above_horizon"
? "mdi:white-balance-sunny"
: "mdi:weather-night";
case "input_datetime":
if (!stateObj.attributes.has_date) {
return "mdi:clock";
}
if (!stateObj.attributes.has_time) {
return "mdi:calendar";
}
break;
}
return undefined;
};

View File

@@ -1,12 +0,0 @@
/** Return an icon representing a state. */
import { HassEntity } from "home-assistant-js-websocket";
import { DEFAULT_DOMAIN_ICON } from "../const";
import { computeDomain } from "./compute_domain";
import { domainIcon } from "./domain_icon";
export const stateIconPath = (state?: HassEntity) => {
if (!state) {
return DEFAULT_DOMAIN_ICON;
}
return domainIcon(computeDomain(state.entity_id), state);
};

View File

@@ -0,0 +1,11 @@
import { HassEntity } from "home-assistant-js-websocket";
import { UpdateEntity, updateIsInstalling } from "../../data/update";
export const updateIcon = (stateObj: HassEntity, state?: string) => {
const compareState = state ?? stateObj.state;
return compareState === "on"
? updateIsInstalling(stateObj as UpdateEntity)
? "mdi:package-down"
: "mdi:package-up"
: "mdi:package";
};

View File

@@ -34,4 +34,12 @@ export function setDirectionStyles(direction: string, element: LitElement) {
"--float-end",
direction === "ltr" ? "right" : "left"
);
element.style.setProperty(
"--margin-title",
direction === "ltr" ? "var(--margin-title-ltr)" : "var(--margin-title-rtl)"
);
element.style.setProperty(
"--scale-direction",
direction === "ltr" ? "1" : "-1"
);
}

View File

@@ -10,7 +10,6 @@ import { customElement, property, state } from "lit/decorators";
import { classMap } from "lit/directives/class-map";
import { styleMap } from "lit/directives/style-map";
import { clamp } from "../../common/number/clamp";
import { computeRTL } from "../../common/util/compute_rtl";
import { HomeAssistant } from "../../types";
import { debounce } from "../../common/util/debounce";
@@ -212,12 +211,10 @@ export class HaChartBase extends LitElement {
height: `${
this.height ?? this._chartHeight ?? this.clientWidth / 2
}px`,
"padding-left": `${
computeRTL(this.hass) ? 0 : this._paddingYAxisInternal
}px`,
"padding-right": `${
computeRTL(this.hass) ? this._paddingYAxisInternal : 0
}px`,
"padding-left": `${this._paddingYAxisInternal}`,
"padding-right": 0,
"padding-inline-start": `${this._paddingYAxisInternal}`,
"padding-inline-end": 0,
})}
>
<canvas></canvas>
@@ -433,14 +430,6 @@ export class HaChartBase extends LitElement {
.chartTooltip .bullet {
align-self: baseline;
}
:host([rtl]) .chartLegend .bullet,
:host([rtl]) .chartTooltip .bullet {
margin-right: inherit;
margin-left: 6px;
margin-inline-end: inherit;
margin-inline-start: 6px;
direction: var(--direction);
}
.chartTooltip {
padding: 8px;
font-size: 90%;
@@ -449,12 +438,13 @@ export class HaChartBase extends LitElement {
color: white;
border-radius: 4px;
pointer-events: none;
z-index: 1000;
z-index: 1;
-ms-user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
width: 200px;
box-sizing: border-box;
}
:host([rtl]) .chartTooltip {
direction: rtl;
direction: var(--direction);
}
.chartLegend ul,
.chartTooltip ul {

View File

@@ -27,7 +27,7 @@ export class StateHistoryChartLine extends LitElement {
@property({ attribute: false }) public data: LineChartEntity[] = [];
@property() public names?: Record<string, string>;
@property({ attribute: false }) public names?: Record<string, string>;
@property() public unit?: string;
@@ -47,6 +47,12 @@ export class StateHistoryChartLine extends LitElement {
@property({ type: Boolean }) public logarithmicScale = false;
@property({ type: Number }) public minYAxis?: number;
@property({ type: Number }) public maxYAxis?: number;
@property({ type: Boolean }) public fitYData = false;
@state() private _chartData?: ChartData<"line">;
@state() private _entityIds: string[] = [];
@@ -84,7 +90,10 @@ export class StateHistoryChartLine extends LitElement {
changedProps.has("startTime") ||
changedProps.has("endTime") ||
changedProps.has("unit") ||
changedProps.has("logarithmicScale")
changedProps.has("logarithmicScale") ||
changedProps.has("minYAxis") ||
changedProps.has("maxYAxis") ||
changedProps.has("fitYData")
) {
this._chartOptions = {
parsing: false,
@@ -121,6 +130,10 @@ export class StateHistoryChartLine extends LitElement {
},
},
y: {
suggestedMin: this.fitYData ? this.minYAxis : null,
suggestedMax: this.fitYData ? this.maxYAxis : null,
min: this.fitYData ? null : this.minYAxis,
max: this.fitYData ? null : this.maxYAxis,
ticks: {
maxTicksLimit: 7,
},
@@ -207,7 +220,12 @@ export class StateHistoryChartLine extends LitElement {
// @ts-expect-error
locale: numberFormatToLocale(this.hass.locale),
onClick: (e: any) => {
if (!this.clickForMoreInfo) {
if (
!this.clickForMoreInfo ||
!(e.native instanceof MouseEvent) ||
(e.native instanceof PointerEvent &&
e.native.pointerType !== "mouse")
) {
return;
}

View File

@@ -25,7 +25,7 @@ export class StateHistoryChartTimeline extends LitElement {
@property({ type: Boolean }) public narrow = false;
@property() public names?: Record<string, string>;
@property({ attribute: false }) public names?: Record<string, string>;
@property() public unit?: string;
@@ -224,7 +224,11 @@ export class StateHistoryChartTimeline extends LitElement {
// @ts-expect-error
locale: numberFormatToLocale(this.hass.locale),
onClick: (e: any) => {
if (!this.clickForMoreInfo) {
if (
!this.clickForMoreInfo ||
!(e.native instanceof MouseEvent) ||
(e.native instanceof PointerEvent && e.native.pointerType !== "mouse")
) {
return;
}

View File

@@ -54,10 +54,9 @@ export class StateHistoryCharts extends LitElement {
@property({ type: Boolean }) public narrow = false;
@property() public names?: Record<string, string>;
@property({ attribute: false }) public names?: Record<string, string>;
@property({ type: Boolean, attribute: "virtualize", reflect: true })
public virtualize = false;
@property({ type: Boolean, reflect: true }) public virtualize = false;
@property({ attribute: false }) public endTime?: Date;
@@ -75,6 +74,12 @@ export class StateHistoryCharts extends LitElement {
@property({ type: Boolean }) public logarithmicScale = false;
@property({ type: Number }) public minYAxis?: number;
@property({ type: Number }) public maxYAxis?: number;
@property({ type: Boolean }) public fitYData = false;
private _computedStartTime!: Date;
private _computedEndTime!: Date;
@@ -162,6 +167,9 @@ export class StateHistoryCharts extends LitElement {
.chartIndex=${index}
.clickForMoreInfo=${this.clickForMoreInfo}
.logarithmicScale=${this.logarithmicScale}
.minYAxis=${this.minYAxis}
.maxYAxis=${this.maxYAxis}
.fitYData=${this.fitYData}
@y-width-changed=${this._yWidthChanged}
></state-history-chart-line>
</div> `;
@@ -301,6 +309,8 @@ export class StateHistoryCharts extends LitElement {
:host([virtualize]) .entry-container {
padding-left: 1px;
padding-right: 1px;
padding-inline-start: 1px;
padding-inline-end: 1px;
}
.entry-container:not(:first-child) {

View File

@@ -54,7 +54,7 @@ export class StatisticsChart extends LitElement {
StatisticsMetaData
>;
@property() public names?: Record<string, string>;
@property({ attribute: false }) public names?: Record<string, string>;
@property() public unit?: string;

View File

@@ -688,15 +688,12 @@ export class HaDataTable extends LitElement {
padding-left: 16px;
/* @noflip */
padding-right: 0;
/* @noflip */
padding-inline-start: 16px;
/* @noflip */
padding-inline-end: initial;
width: 60px;
}
:host([dir="rtl"]) .mdc-data-table__header-cell--checkbox,
:host([dir="rtl"]) .mdc-data-table__cell--checkbox {
/* @noflip */
padding-left: 0;
/* @noflip */
padding-right: 16px;
}
.mdc-data-table__table {
height: 100%;
@@ -723,11 +720,7 @@ export class HaDataTable extends LitElement {
}
.mdc-data-table__cell--numeric {
text-align: right;
}
:host([dir="rtl"]) .mdc-data-table__cell--numeric {
/* @noflip */
text-align: left;
text-align: var(--float-end);
}
.mdc-data-table__cell--icon {
@@ -753,43 +746,24 @@ export class HaDataTable extends LitElement {
.mdc-data-table__header-cell.sortable.mdc-data-table__header-cell--icon:not(
.not-sorted
) {
text-align: left;
}
:host([dir="rtl"])
.mdc-data-table__header-cell.sortable.mdc-data-table__header-cell--icon:hover,
:host([dir="rtl"])
.mdc-data-table__header-cell.sortable.mdc-data-table__header-cell--icon:not(
.not-sorted
) {
text-align: right;
text-align: var(--float-start);
}
.mdc-data-table__cell--icon:first-child ha-icon,
.mdc-data-table__cell--icon:first-child img,
.mdc-data-table__cell--icon:first-child ha-icon,
.mdc-data-table__cell--icon:first-child ha-svg-icon,
.mdc-data-table__cell--icon:first-child ha-state-icon,
.mdc-data-table__cell--icon:first-child ha-svg-icon {
.mdc-data-table__cell--icon:first-child ha-domain-icon,
.mdc-data-table__cell--icon:first-child ha-service-icon {
margin-left: 8px;
}
:host([dir="rtl"]) .mdc-data-table__cell--icon:first-child ha-icon,
:host([dir="rtl"])
.mdc-data-table__cell--icon:first-child
ha-state-icon,
:host([dir="rtl"])
.mdc-data-table__cell--icon:first-child
ha-svg-icon
:host([dir="rtl"])
.mdc-data-table__cell--icon:first-child
img {
margin-left: auto;
margin-right: 8px;
margin-inline-start: 8px;
margin-inline-end: initial;
}
.mdc-data-table__cell--icon:first-child state-badge {
margin-right: -8px;
}
:host([dir="rtl"]) .mdc-data-table__cell--icon:first-child state-badge {
margin-right: auto;
margin-left: -8px;
margin-inline-end: -8px;
margin-inline-start: initial;
}
.mdc-data-table__cell--overflow-menu,
@@ -822,15 +796,8 @@ export class HaDataTable extends LitElement {
.mdc-data-table__header-cell--icon-button:first-child,
.mdc-data-table__cell--icon-button:first-child {
padding-left: 16px;
}
:host([dir="rtl"])
.mdc-data-table__header-cell--overflow-menu:first-child,
:host([dir="rtl"]) .mdc-data-table__cell--overflow-menu:first-child,
:host([dir="rtl"])
.mdc-data-table__header-cell--overflow-menu:first-child,
:host([dir="rtl"]) .mdc-data-table__cell--overflow-menu:first-child {
padding-left: 8px;
padding-right: 16px;
padding-inline-start: 16px;
padding-inline-end: initial;
}
.mdc-data-table__cell--overflow-menu:last-child,
@@ -838,14 +805,8 @@ export class HaDataTable extends LitElement {
.mdc-data-table__header-cell--icon-button:last-child,
.mdc-data-table__cell--icon-button:last-child {
padding-right: 16px;
}
:host([dir="rtl"])
.mdc-data-table__header-cell--overflow-menu:last-child,
:host([dir="rtl"]) .mdc-data-table__cell--overflow-menu:last-child,
:host([dir="rtl"]) .mdc-data-table__header-cell--icon-button:last-child,
:host([dir="rtl"]) .mdc-data-table__cell--icon-button:last-child {
padding-right: 8px;
padding-left: 16px;
padding-inline-end: 16px;
padding-inline-start: initial;
}
.mdc-data-table__cell--overflow-menu,
.mdc-data-table__header-cell--overflow-menu {
@@ -865,28 +826,15 @@ export class HaDataTable extends LitElement {
letter-spacing: 0.0071428571em;
text-decoration: inherit;
text-transform: inherit;
text-align: left;
}
:host([dir="rtl"]) .mdc-data-table__header-cell {
/* @noflip */
text-align: right;
text-align: var(--float-start);
}
.mdc-data-table__header-cell--numeric {
text-align: right;
text-align: var(--float-end);
}
.mdc-data-table__header-cell--numeric.sortable:hover,
.mdc-data-table__header-cell--numeric.sortable:not(.not-sorted) {
text-align: left;
}
:host([dir="rtl"]) .mdc-data-table__header-cell--numeric {
/* @noflip */
text-align: left;
}
:host([dir="rtl"]) .mdc-data-table__header-cell--numeric.sortable:hover,
:host([dir="rtl"])
.mdc-data-table__header-cell--numeric.sortable:not(.not-sorted) {
text-align: right;
text-align: var(--float-start);
}
/* custom from here */
@@ -907,20 +855,15 @@ export class HaDataTable extends LitElement {
.mdc-data-table__header-cell span {
position: relative;
left: 0px;
}
:host([dir="rtl"]) .mdc-data-table__header-cell span {
left: auto;
right: 0px;
inset-inline-start: 0px;
inset-inline-end: initial;
}
.mdc-data-table__header-cell.sortable {
cursor: pointer;
}
.mdc-data-table__header-cell > * {
transition: left 0.2s ease;
}
:host([dir="rtl"]) .mdc-data-table__header-cell > * {
transition: right 0.2s ease;
transition: var(--float-start) 0.2s ease;
}
.mdc-data-table__header-cell ha-svg-icon {
top: -3px;
@@ -928,35 +871,20 @@ export class HaDataTable extends LitElement {
}
.mdc-data-table__header-cell.not-sorted ha-svg-icon {
left: -20px;
}
:host([dir="rtl"]) .mdc-data-table__header-cell.not-sorted ha-svg-icon {
right: -20px;
inset-inline-start: -20px;
inset-inline-end: initial;
}
.mdc-data-table__header-cell.sortable:not(.not-sorted) span,
.mdc-data-table__header-cell.sortable.not-sorted:hover span {
left: 24px;
}
:host([dir="rtl"])
.mdc-data-table__header-cell.sortable:not(.not-sorted)
span,
:host([dir="rtl"])
.mdc-data-table__header-cell.sortable.not-sorted:hover
span {
left: auto;
right: 24px;
inset-inline-start: 24px;
inset-inline-end: initial;
}
.mdc-data-table__header-cell.sortable:not(.not-sorted) ha-svg-icon,
.mdc-data-table__header-cell.sortable:hover.not-sorted ha-svg-icon {
left: 12px;
}
:host([dir="rtl"])
.mdc-data-table__header-cell.sortable:not(.not-sorted)
ha-svg-icon,
:host([dir="rtl"])
.mdc-data-table__header-cell.sortable:hover.not-sorted
ha-svg-icon {
left: auto;
right: 12px;
inset-inline-start: 12px;
inset-inline-end: initial;
}
.table-header {
border-bottom: 1px solid var(--divider-color);
@@ -964,6 +892,8 @@ export class HaDataTable extends LitElement {
search-input {
display: block;
flex: 1;
--mdc-text-field-fill-color: var(--sidebar-background-color);
--mdc-text-field-idle-line-color: transparent;
}
slot[name="header"] {
display: block;

View File

@@ -9,6 +9,7 @@ import {
localizeWeekdays,
localizeMonths,
} from "../common/datetime/localize_date";
import { mainWindow } from "../common/dom/get_main_window";
// Set the current date to the left picker instead of the right picker because the right is hidden
const CustomDateRangePicker = Vue.extend({
@@ -157,7 +158,7 @@ class DateRangePickerElement extends WrappedElement {
min-width: initial !important;
max-height: var(--date-range-picker-max-height);
overflow-y: auto;
}
}
.daterangepicker:before {
display: none;
}
@@ -267,15 +268,37 @@ class DateRangePickerElement extends WrappedElement {
.calendar-table {
padding: 0 !important;
}
.daterangepicker.ltr {
.calendar-time {
direction: ltr;
text-align: left;
}
.daterangepicker.ltr {
direction: var(--direction);
text-align: var(--float-start);
}
.vue-daterange-picker{
min-width: unset !important;
display: block !important;
}
`;
if (mainWindow.document.dir === "rtl") {
style.innerHTML += `
.daterangepicker .calendar-table .next span {
transform: rotate(135deg);
-webkit-transform: rotate(135deg);
}
.daterangepicker .calendar-table .prev span {
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}
.daterangepicker td.start-date {
border-radius: 0 50% 50% 0;
}
.daterangepicker td.end-date {
border-radius: 50% 0 0 50%;
}
`;
}
const shadowRoot = this.shadowRoot!;
shadowRoot.appendChild(style);
// Stop click events from reaching the document, otherwise it will close the picker immediately.

View File

@@ -25,7 +25,7 @@ export abstract class HaDeviceAutomationPicker<
@property() public deviceId?: string;
@property() public value?: T;
@property({ type: Object }) public value?: T;
@state() private _automations: T[] = [];

View File

@@ -84,9 +84,11 @@ export class HaDevicePicker extends LitElement {
@property({ type: Array, attribute: "exclude-devices" })
public excludeDevices?: string[];
@property() public deviceFilter?: HaDevicePickerDeviceFilterFunc;
@property({ attribute: false })
public deviceFilter?: HaDevicePickerDeviceFilterFunc;
@property() public entityFilter?: HaDevicePickerEntityFilterFunc;
@property({ attribute: false })
public entityFilter?: HaDevicePickerEntityFilterFunc;
@property({ type: Boolean }) public disabled = false;

View File

@@ -12,7 +12,7 @@ import type {
class HaDevicesPicker extends LitElement {
@property({ attribute: false }) public hass?: HomeAssistant;
@property() public value?: string[];
@property({ type: Array }) public value?: string[];
@property() public helper?: string;
@@ -36,17 +36,19 @@ class HaDevicesPicker extends LitElement {
@property({ type: Array, attribute: "exclude-domains" })
public excludeDomains?: string[];
@property({ attribute: "picked-device-label" })
@property({ type: Array, attribute: "include-device-classes" })
public includeDeviceClasses?: string[];
@property({ attribute: "picked-device-label" })
public pickedDeviceLabel?: string;
@property({ attribute: "pick-device-label" }) public pickDeviceLabel?: string;
@property() public deviceFilter?: HaDevicePickerDeviceFilterFunc;
@property({ attribute: false })
public deviceFilter?: HaDevicePickerDeviceFilterFunc;
@property() public entityFilter?: HaDevicePickerEntityFilterFunc;
@property({ attribute: false })
public entityFilter?: HaDevicePickerEntityFilterFunc;
protected render() {
if (!this.hass) {

View File

@@ -1,22 +1,25 @@
import { html, LitElement } from "lit";
import { HassEntity } from "home-assistant-js-websocket";
import { html, LitElement, nothing } from "lit";
import { customElement, property } from "lit/decorators";
import { batteryStateIcon } from "../../common/entity/battery_icon";
import "../ha-svg-icon";
import { batteryLevelIcon } from "../../common/entity/battery_icon";
import "../ha-icon";
@customElement("ha-battery-icon")
export class HaBatteryIcon extends LitElement {
@property() public batteryStateObj;
@property({ attribute: false }) public batteryStateObj?: HassEntity;
@property() public batteryChargingStateObj;
@property({ attribute: false }) public batteryChargingStateObj?: HassEntity;
protected render() {
if (!this.batteryStateObj) return nothing;
return html`
<ha-svg-icon
.path=${batteryStateIcon(
this.batteryStateObj,
this.batteryChargingStateObj
<ha-icon
.icon=${batteryLevelIcon(
this.batteryStateObj.state,
this.batteryChargingStateObj?.state === "on"
)}
></ha-svg-icon>
></ha-icon>
`;
}
}

View File

@@ -73,7 +73,8 @@ class HaEntitiesPickerLight extends LitElement {
@property({ attribute: "pick-entity-label" }) public pickEntityLabel?: string;
@property() public entityFilter?: HaEntityPickerEntityFilterFunc;
@property({ attribute: false })
public entityFilter?: HaEntityPickerEntityFilterFunc;
protected render() {
if (!this.hass) {

View File

@@ -1,8 +1,8 @@
import { HassEntity } from "home-assistant-js-websocket";
import { html, LitElement, PropertyValues, nothing } from "lit";
import { customElement, property, query } from "lit/decorators";
import { LitElement, PropertyValues, html, nothing } from "lit";
import { customElement, property, query, state } from "lit/decorators";
import { computeAttributeNameDisplay } from "../../common/entity/compute_attribute_display";
import { ValueChangedEvent, HomeAssistant } from "../../types";
import { HomeAssistant, ValueChangedEvent } from "../../types";
import "../ha-combo-box";
import type { HaComboBox } from "../ha-combo-box";
@@ -37,7 +37,7 @@ class HaEntityAttributePicker extends LitElement {
@property() public helper?: string;
@property({ type: Boolean }) private _opened = false;
@state() private _opened = false;
@query("ha-combo-box", true) private _comboBox!: HaComboBox;
@@ -47,15 +47,17 @@ class HaEntityAttributePicker extends LitElement {
protected updated(changedProps: PropertyValues) {
if (changedProps.has("_opened") && this._opened) {
const state = this.entityId ? this.hass.states[this.entityId] : undefined;
(this._comboBox as any).items = state
? Object.keys(state.attributes)
const entityState = this.entityId
? this.hass.states[this.entityId]
: undefined;
(this._comboBox as any).items = entityState
? Object.keys(entityState.attributes)
.filter((key) => !this.hideAttributes?.includes(key))
.map((key) => ({
value: key,
label: computeAttributeNameDisplay(
this.hass.localize,
state,
entityState,
this.hass.entities,
key
),

View File

@@ -25,16 +25,6 @@ interface HassEntityWithCachedName extends HassEntity, ScorableTextItem {
export type HaEntityPickerEntityFilterFunc = (entity: HassEntity) => boolean;
// eslint-disable-next-line lit/prefer-static-styles
const rowRenderer: ComboBoxLitRenderer<HassEntityWithCachedName> = (item) =>
html`<ha-list-item graphic="avatar" .twoline=${!!item.entity_id}>
${item.state
? html`<state-badge slot="graphic" .stateObj=${item}></state-badge>`
: ""}
<span>${item.friendly_name}</span>
<span slot="secondary">${item.entity_id}</span>
</ha-list-item>`;
@customElement("ha-entity-picker")
export class HaEntityPicker extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
@@ -102,7 +92,8 @@ export class HaEntityPicker extends LitElement {
@property({ type: Array, attribute: "exclude-entities" })
public excludeEntities?: string[];
@property() public entityFilter?: HaEntityPickerEntityFilterFunc;
@property({ attribute: false })
public entityFilter?: HaEntityPickerEntityFilterFunc;
@property({ type: Boolean }) public hideClearIcon = false;
@@ -127,6 +118,21 @@ export class HaEntityPicker extends LitElement {
private _states: HassEntityWithCachedName[] = [];
private _rowRenderer: ComboBoxLitRenderer<HassEntityWithCachedName> = (
item
) =>
html`<ha-list-item graphic="avatar" .twoline=${!!item.entity_id}>
${item.state
? html`<state-badge
slot="graphic"
.stateObj=${item}
.hass=${this.hass}
></state-badge>`
: ""}
<span>${item.friendly_name}</span>
<span slot="secondary">${item.entity_id}</span>
</ha-list-item>`;
private _getStates = memoizeOne(
(
_opened: boolean,
@@ -326,7 +332,7 @@ export class HaEntityPicker extends LitElement {
.helper=${this.helper}
.allowCustomValue=${this.allowCustomEntity}
.filteredItems=${this._states}
.renderer=${rowRenderer}
.renderer=${this._rowRenderer}
.required=${this.required}
.disabled=${this.disabled}
@opened-changed=${this._openedChanged}

View File

@@ -1,6 +1,6 @@
import { HassEntity } from "home-assistant-js-websocket";
import { LitElement, PropertyValues, html, nothing } from "lit";
import { customElement, property, query } from "lit/decorators";
import { customElement, property, query, state } from "lit/decorators";
import { fireEvent } from "../../common/dom/fire_event";
import { getStates } from "../../common/entity/get_states";
import { HomeAssistant, ValueChangedEvent } from "../../types";
@@ -17,7 +17,7 @@ class HaEntityStatePicker extends LitElement {
@property() public attribute?: string;
@property() public extraOptions?: any[];
@property({ attribute: false }) public extraOptions?: any[];
@property({ type: Boolean }) public autofocus = false;
@@ -34,7 +34,7 @@ class HaEntityStatePicker extends LitElement {
@property() public helper?: string;
@property({ type: Boolean }) private _opened = false;
@state() private _opened = false;
@query("ha-combo-box", true) private _comboBox!: HaComboBox;
@@ -49,16 +49,18 @@ class HaEntityStatePicker extends LitElement {
changedProps.has("attribute") ||
changedProps.has("extraOptions")
) {
const state = this.entityId ? this.hass.states[this.entityId] : undefined;
const stateObj = this.entityId
? this.hass.states[this.entityId]
: undefined;
(this._comboBox as any).items = [
...(this.extraOptions ?? []),
...(this.entityId && state
? getStates(state, this.attribute).map((key) => ({
...(this.entityId && stateObj
? getStates(stateObj, this.attribute).map((key) => ({
value: key,
label: !this.attribute
? this.hass.formatEntityState(state, key)
? this.hass.formatEntityState(stateObj, key)
: this.hass.formatEntityAttributeValue(
state,
stateObj,
this.attribute,
key
),

View File

@@ -140,7 +140,8 @@ export class HaStateLabelBadge extends LitElement {
${!image && showIcon
? html`<ha-state-icon
.icon=${this.icon}
.state=${entityState}
.stateObj=${entityState}
.hass=${this.hass}
></ha-state-icon>`
: ""}
${value && !image && !showIcon
@@ -173,7 +174,6 @@ export class HaStateLabelBadge extends LitElement {
case "scene":
case "sun":
case "timer":
case "updater":
return null;
// @ts-expect-error we don't break and go to default
case "sensor":
@@ -207,7 +207,6 @@ export class HaStateLabelBadge extends LitElement {
case "alarm_control_panel":
case "binary_sensor":
case "device_tracker":
case "updater":
case "person":
case "scene":
case "sun":
@@ -284,8 +283,7 @@ export class HaStateLabelBadge extends LitElement {
--ha-label-badge-label-text-transform: none;
}
ha-label-badge.binary_sensor,
ha-label-badge.updater {
ha-label-badge.binary_sensor {
--ha-label-badge-color: var(--label-badge-blue);
}

View File

@@ -105,6 +105,7 @@ export class HaStatisticPicker extends LitElement {
? html`<state-badge
slot="graphic"
.stateObj=${item.state}
.hass=${this.hass}
></state-badge>`
: ""}
<span>${item.name}</span>

View File

@@ -1,11 +1,11 @@
import { mdiAlert } from "@mdi/js";
import type { HassEntity } from "home-assistant-js-websocket";
import {
css,
CSSResultGroup,
html,
LitElement,
PropertyValues,
css,
html,
nothing,
} from "lit";
import { property, state } from "lit/decorators";
@@ -14,8 +14,8 @@ import { styleMap } from "lit/directives/style-map";
import { computeDomain } from "../../common/entity/compute_domain";
import { computeStateDomain } from "../../common/entity/compute_state_domain";
import {
stateColorCss,
stateColorBrightness,
stateColorCss,
} from "../../common/entity/state_color";
import { iconColorCSS } from "../../common/style/icon_color_css";
import { cameraUrlWithWidthHeight } from "../../data/camera";
@@ -36,8 +36,8 @@ export class StateBadge extends LitElement {
@property() public color?: string;
@property({ type: Boolean, reflect: true, attribute: "icon" })
private _showIcon = true;
// @todo Consider reworking to eliminate need for attribute since it is manipulated internally
@property({ type: Boolean, reflect: true }) public icon = true;
@state() private _iconStyle: { [name: string]: string | undefined } = {};
@@ -83,22 +83,23 @@ export class StateBadge extends LitElement {
</div>`;
}
if (!this._showIcon) {
if (!this.icon) {
return nothing;
}
const domain = stateObj ? computeStateDomain(stateObj) : undefined;
return html`<ha-state-icon
.hass=${this.hass}
style=${styleMap(this._iconStyle)}
data-domain=${ifDefined(domain)}
data-state=${ifDefined(stateObj?.state)}
.icon=${this.overrideIcon}
.state=${stateObj}
.stateObj=${stateObj}
></ha-state-icon>`;
}
public willUpdate(changedProps: PropertyValues) {
public willUpdate(changedProps: PropertyValues<this>) {
super.willUpdate(changedProps);
if (
!changedProps.has("stateObj") &&
@@ -114,7 +115,7 @@ export class StateBadge extends LitElement {
const iconStyle: { [name: string]: string } = {};
let backgroundImage = "";
this._showIcon = true;
this.icon = true;
if (stateObj && this.overrideImage === undefined) {
// hide icon if we have entity picture
@@ -134,7 +135,7 @@ export class StateBadge extends LitElement {
imageUrl = cameraUrlWithWidthHeight(imageUrl, 80, 80);
}
backgroundImage = `url(${imageUrl})`;
this._showIcon = false;
this.icon = false;
if (domain === "update") {
this.style.borderRadius = "0";
} else if (domain === "media_player") {
@@ -180,7 +181,7 @@ export class StateBadge extends LitElement {
imageUrl = this.hass.hassUrl(imageUrl);
}
backgroundImage = `url(${imageUrl})`;
this._showIcon = false;
this.icon = false;
}
this._iconStyle = iconStyle;

View File

@@ -3,7 +3,6 @@ import type { HassEntity } from "home-assistant-js-websocket";
import { css, CSSResultGroup, html, LitElement, nothing } from "lit";
import { customElement, property } from "lit/decorators";
import { computeStateName } from "../../common/entity/compute_state_name";
import { computeRTL } from "../../common/util/compute_rtl";
import type { HomeAssistant } from "../../types";
import "../ha-relative-time";
import "./state-badge";
@@ -16,9 +15,6 @@ class StateInfo extends LitElement {
@property({ type: Boolean }) public inDialog = false;
// property used only in CSS
@property({ type: Boolean, reflect: true }) public rtl = false;
@property() public color?: string;
protected render() {
@@ -29,6 +25,7 @@ class StateInfo extends LitElement {
const name = computeStateName(this.stateObj);
return html`<state-badge
.hass=${this.hass}
.stateObj=${this.stateObj}
.stateColor=${true}
.color=${this.color}
@@ -78,18 +75,6 @@ class StateInfo extends LitElement {
</div>`;
}
protected updated(changedProps) {
super.updated(changedProps);
if (!changedProps.has("hass")) {
return;
}
const oldHass = changedProps.get("hass") as HomeAssistant | undefined;
if (!oldHass || oldHass.locale !== this.hass.locale) {
this.rtl = computeRTL(this.hass);
}
}
static get styles(): CSSResultGroup {
return css`
:host {
@@ -105,17 +90,14 @@ class StateInfo extends LitElement {
.info {
margin-left: 8px;
margin-inline-start: 8px;
margin-inline-end: initial;
display: flex;
flex-direction: column;
justify-content: center;
height: 100%;
min-width: 0;
}
:host([rtl]) .info {
margin-right: 8px;
margin-left: 0;
text-align: right;
text-align: var(--float-start);
}
.name {

View File

@@ -117,7 +117,6 @@ class HaAlert extends LitElement {
margin-right: 0;
margin-inline-start: 8px;
margin-inline-end: 0;
direction: var(--direction);
}
.title {
margin-top: 2px;
@@ -155,6 +154,10 @@ class HaAlert extends LitElement {
.issue-type.success::after {
background-color: var(--success-color);
}
:host ::slotted(ul) {
margin: 0;
padding-inline-start: 20px;
}
`;
}

View File

@@ -8,7 +8,7 @@ import "./ha-multi-textfield";
class AliasesEditor extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
@property() public aliases!: string[];
@property({ type: Array }) public aliases!: string[];
@property({ type: Boolean }) public disabled = false;

View File

@@ -1,4 +1,4 @@
import { mdiChevronRight, mdiSofa } from "@mdi/js";
import { mdiSofa } from "@mdi/js";
import { CSSResultGroup, LitElement, TemplateResult, css, html } from "lit";
import { customElement, property } from "lit/decorators";
import { fireEvent } from "../common/dom/fire_event";
@@ -6,6 +6,7 @@ import { showAreaFilterDialog } from "../dialogs/area-filter/show-area-filter-di
import { HomeAssistant } from "../types";
import "./ha-svg-icon";
import "./ha-textfield";
import "./ha-icon-next";
export type AreaFilterValue = {
hidden?: string[];
@@ -53,11 +54,10 @@ export class HaAreaPicker extends LitElement {
<ha-svg-icon slot="graphic" .path=${mdiSofa}></ha-svg-icon>
<span>${this.label}</span>
<span slot="secondary">${description}</span>
<ha-svg-icon
<ha-icon-next
slot="meta"
.label=${this.hass.localize("ui.common.edit")}
.path=${mdiChevronRight}
></ha-svg-icon>
></ha-icon-next>
</ha-list-item>
`;
}

View File

@@ -1,6 +1,6 @@
import { ComboBoxLitRenderer } from "@vaadin/combo-box/lit";
import { HassEntity } from "home-assistant-js-websocket";
import { html, LitElement, PropertyValues, TemplateResult } from "lit";
import { html, LitElement, nothing, PropertyValues, TemplateResult } from "lit";
import { customElement, property, query, state } from "lit/decorators";
import { classMap } from "lit/directives/class-map";
import memoizeOne from "memoize-one";
@@ -36,8 +36,12 @@ type ScorableAreaRegistryEntry = ScorableTextItem & AreaRegistryEntry;
const rowRenderer: ComboBoxLitRenderer<AreaRegistryEntry> = (item) =>
html`<ha-list-item
graphic="icon"
class=${classMap({ "add-new": item.area_id === "add_new" })}
>
${item.icon
? html`<ha-icon slot="graphic" .icon=${item.icon}></ha-icon>`
: nothing}
${item.name}
</ha-list-item>`;
@@ -54,7 +58,7 @@ export class HaAreaPicker extends LitElement {
@property() public placeholder?: string;
@property({ type: Boolean, attribute: "no-add" })
public noAdd?: boolean;
public noAdd = false;
/**
* Show only areas with entities from specific domains.
@@ -88,9 +92,11 @@ export class HaAreaPicker extends LitElement {
@property({ type: Array, attribute: "exclude-areas" })
public excludeAreas?: string[];
@property() public deviceFilter?: HaDevicePickerDeviceFilterFunc;
@property({ attribute: false })
public deviceFilter?: HaDevicePickerDeviceFilterFunc;
@property() public entityFilter?: (entity: HassEntity) => boolean;
@property({ attribute: false })
public entityFilter?: (entity: HassEntity) => boolean;
@property({ type: Boolean }) public disabled = false;
@@ -133,6 +139,7 @@ export class HaAreaPicker extends LitElement {
area_id: "no_areas",
name: this.hass.localize("ui.components.area-picker.no_areas"),
picture: null,
icon: null,
aliases: [],
},
];
@@ -260,7 +267,9 @@ export class HaAreaPicker extends LitElement {
}
if (areaIds) {
outputAreas = areas.filter((area) => areaIds!.includes(area.area_id));
outputAreas = outputAreas.filter((area) =>
areaIds!.includes(area.area_id)
);
}
if (excludeAreas) {
@@ -275,6 +284,7 @@ export class HaAreaPicker extends LitElement {
area_id: "no_areas",
name: this.hass.localize("ui.components.area-picker.no_match"),
picture: null,
icon: null,
aliases: [],
},
];
@@ -288,6 +298,7 @@ export class HaAreaPicker extends LitElement {
area_id: "add_new",
name: this.hass.localize("ui.components.area-picker.add_new"),
picture: null,
icon: "mdi:plus",
aliases: [],
},
];

View File

@@ -13,14 +13,14 @@ export class HaAreasPicker extends SubscribeMixin(LitElement) {
@property() public label?: string;
@property() public value?: string[];
@property({ type: Array }) public value?: string[];
@property() public helper?: string;
@property() public placeholder?: string;
@property({ type: Boolean, attribute: "no-add" })
public noAdd?: boolean;
public noAdd = false;
/**
* Show only areas with entities from specific domains.
@@ -46,9 +46,11 @@ export class HaAreasPicker extends SubscribeMixin(LitElement) {
@property({ type: Array, attribute: "include-device-classes" })
public includeDeviceClasses?: string[];
@property() public deviceFilter?: HaDevicePickerDeviceFilterFunc;
@property({ attribute: false })
public deviceFilter?: HaDevicePickerDeviceFilterFunc;
@property() public entityFilter?: (entity: HassEntity) => boolean;
@property({ attribute: false })
public entityFilter?: (entity: HassEntity) => boolean;
@property({ attribute: "picked-area-label" })
public pickedAreaLabel?: string;

View File

@@ -0,0 +1,55 @@
import { HassEntity } from "home-assistant-js-websocket";
import { html, LitElement, nothing } from "lit";
import { customElement, property } from "lit/decorators";
import { until } from "lit/directives/until";
import { attributeIcon } from "../data/icons";
import { HomeAssistant } from "../types";
import "./ha-icon";
import "./ha-svg-icon";
@customElement("ha-attribute-icon")
export class HaAttributeIcon extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
@property({ attribute: false }) public stateObj?: HassEntity;
@property() public attribute?: string;
@property() public attributeValue?: string;
@property() public icon?: string;
protected render() {
if (this.icon) {
return html`<ha-icon .icon=${this.icon}></ha-icon>`;
}
if (!this.stateObj || !this.attribute) {
return nothing;
}
if (!this.hass) {
return nothing;
}
const icon = attributeIcon(
this.hass,
this.stateObj,
this.attribute,
this.attributeValue
).then((icn) => {
if (icn) {
return html`<ha-icon .icon=${icn}></ha-icon>`;
}
return nothing;
});
return html`${until(icon)}`;
}
}
declare global {
interface HTMLElementTagNameMap {
"ha-attribute-icon": HaAttributeIcon;
}
}

View File

@@ -13,8 +13,7 @@ class HaAttributeValue extends LitElement {
@property() public attribute!: string;
@property({ type: Boolean, attribute: "hide-unit" })
public hideUnit?: boolean;
@property({ type: Boolean, attribute: "hide-unit" }) public hideUnit = false;
protected render() {
if (!this.stateObj) {

View File

@@ -353,6 +353,8 @@ export class HaBaseTimeInput extends LitElement {
text-transform: var(--mdc-typography-body2-text-transform, inherit);
color: var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87));
padding-left: 4px;
padding-inline-start: 4px;
padding-inline-end: initial;
}
`;
}

View File

@@ -24,7 +24,7 @@ class HaBluePrintPicker extends LitElement {
@property() public domain: BlueprintDomain = "automation";
@property() public blueprints?: Blueprints;
@property({ attribute: false }) public blueprints?: Blueprints;
@property({ type: Boolean }) public disabled = false;

View File

@@ -69,6 +69,7 @@ export class HaButtonToggleGroup extends LitElement {
display: flex;
--mdc-icon-button-size: var(--button-toggle-size, 36px);
--mdc-icon-size: var(--button-toggle-icon-size, 20px);
direction: ltr;
}
mwc-button {
--mdc-shape-small: 0;
@@ -119,19 +120,6 @@ export class HaButtonToggleGroup extends LitElement {
--mdc-shape-small: 4px;
border-right-width: 1px;
}
:host([dir="rtl"]) ha-icon-button:first-child,
:host([dir="rtl"]) mwc-button:first-child {
border-radius: 0 4px 4px 0;
border-right-width: 1px;
--mdc-shape-small: 0 4px 4px 0;
--mdc-button-outline-width: 1px;
}
:host([dir="rtl"]) ha-icon-button:last-child,
:host([dir="rtl"]) mwc-button:last-child {
--mdc-shape-small: 4px 0 0 4px;
border-radius: 4px 0 0 4px;
}
`;
}
}

View File

@@ -37,6 +37,10 @@ export class HaCheckListItem extends CheckListItemBase {
.mdc-deprecated-list-item__graphic {
margin-top: var(--check-list-item-graphic-margin-top);
}
:host([graphic="icon"]) .mdc-deprecated-list-item__graphic {
margin-inline-start: 0;
margin-inline-end: var(--mdc-list-item-graphic-margin, 32px);
}
`,
];
}

View File

@@ -95,14 +95,13 @@ export class HaComboBox extends LitElement {
@property({ attribute: "item-id-path" }) public itemIdPath?: string;
@property() public renderer?: ComboBoxLitRenderer<any>;
@property({ attribute: false }) public renderer?: ComboBoxLitRenderer<any>;
@property({ type: Boolean }) public disabled = false;
@property({ type: Boolean }) public required = false;
@property({ type: Boolean, reflect: true, attribute: "opened" })
public opened?: boolean;
@property({ type: Boolean, reflect: true }) public opened = false;
@query("vaadin-combo-box-light", true) private _comboBox!: ComboBoxLight;

View File

@@ -71,68 +71,49 @@ export type ControlCircularSliderMode = "start" | "end" | "full";
@customElement("ha-control-circular-slider")
export class HaControlCircularSlider extends LitElement {
@property({ type: Boolean, reflect: true })
public disabled = false;
@property({ type: Boolean, reflect: true }) public disabled = false;
@property({ type: Boolean, reflect: true })
public readonly = false;
@property({ type: Boolean, reflect: true }) public readonly = false;
@property({ type: Boolean })
public dual?: boolean;
@property({ type: Boolean }) public dual = false;
@property({ type: String })
public mode?: ControlCircularSliderMode;
@property({ type: String }) public mode?: ControlCircularSliderMode;
@property({ type: Boolean })
public inactive?: boolean;
@property({ type: Boolean }) public inactive = false;
@property({ type: String })
public label?: string;
@property({ type: String }) public label?: string;
@property({ type: String, attribute: "low-label" })
public lowLabel?: string;
@property({ type: String, attribute: "low-label" }) public lowLabel?: string;
@property({ type: String, attribute: "high-label" })
public highLabel?: string;
@property({ type: Number })
public value?: number;
@property({ type: Number }) public value?: number;
@property({ type: Number })
public low?: number;
@property({ type: Number }) public low?: number;
@property({ type: Number })
public high?: number;
@property({ type: Number }) public high?: number;
@property({ type: Number })
public current?: number;
@property({ type: Number }) public current?: number;
@property({ type: Number })
public step = 1;
@property({ type: Number }) public step = 1;
@property({ type: Number })
public min = 0;
@property({ type: Number }) public min = 0;
@property({ type: Number })
public max = 100;
@property({ type: Number }) public max = 100;
@property({ type: Boolean, attribute: "prevent-interaction-on-scroll" })
public preventInteractionOnScroll?: boolean;
public preventInteractionOnScroll = false;
@state()
public _localValue?: number = this.value;
@state() public _localValue?: number = this.value;
@state()
public _localLow?: number = this.low;
@state() public _localLow?: number = this.low;
@state()
public _localHigh?: number = this.high;
@state() public _localHigh?: number = this.high;
@state()
public _activeSlider?: ActiveSlider;
@state() public _activeSlider?: ActiveSlider;
@state()
public _lastSlider?: ActiveSlider;
@state() public _lastSlider?: ActiveSlider;
private _valueToPercentage(value: number) {
return (
@@ -618,11 +599,11 @@ export class HaControlCircularSlider extends LitElement {
targetCircle
? svg`
<!-- Use circle instead of path for interaction (Safari doesn't support well pointer-events with stroke-dasharray) -->
<circle
transform="rotate(${angle} 0 0)"
?data-interaction=${onlyDotInteraction}
<circle
transform="rotate(${angle} 0 0)"
?data-interaction=${onlyDotInteraction}
cx=${RADIUS}
cy="0"
cy="0"
/>
<path
d=${path}

View File

@@ -27,10 +27,10 @@ export class HaControlSelectMenu extends SelectBase {
@query(".select-anchor") protected anchorElement!: HTMLDivElement | null;
@property({ type: Boolean, attribute: "show-arrow" })
public showArrow?: boolean;
public showArrow = false;
@property({ type: Boolean, attribute: "hide-label" })
public hideLabel?: boolean;
public hideLabel = false;
@queryAsync("mwc-ripple") private _ripple!: Promise<Ripple | null>;
@@ -126,9 +126,9 @@ export class HaControlSelectMenu extends SelectBase {
return html`
<div class="icon">
${icon && "path" in icon
${icon && icon.localName === "ha-svg-icon" && "path" in icon
? html`<ha-svg-icon .path=${icon.path}></ha-svg-icon>`
: icon && "icon" in icon
: icon && icon.localName === "ha-icon" && "icon" in icon
? html`<ha-icon .path=${icon.icon}></ha-icon>`
: html`<slot name="icon"></slot>`}
</div>

View File

@@ -5,6 +5,7 @@ import {
LitElement,
nothing,
PropertyValues,
TemplateResult,
} from "lit";
import { customElement, property, state } from "lit/decorators";
import { classMap } from "lit/directives/class-map";
@@ -17,7 +18,7 @@ import "./ha-svg-icon";
export type ControlSelectOption = {
value: string;
label?: string;
icon?: string;
icon?: TemplateResult;
path?: string;
};
@@ -25,7 +26,7 @@ export type ControlSelectOption = {
export class HaControlSelect extends LitElement {
@property({ type: Boolean, reflect: true }) disabled = false;
@property() public options?: ControlSelectOption[];
@property({ attribute: false }) public options?: ControlSelectOption[];
@property() public value?: string;
@@ -183,9 +184,7 @@ export class HaControlSelect extends LitElement {
<div class="content">
${option.path
? html`<ha-svg-icon .path=${option.path}></ha-svg-icon>`
: option.icon
? html`<ha-icon .icon=${option.icon}></ha-icon> `
: nothing}
: option.icon || nothing}
${option.label && !this.hideLabel
? html`<span>${option.label}</span>`
: nothing}

View File

@@ -19,17 +19,13 @@ import "./ha-svg-icon";
@customElement("ha-control-switch")
export class HaControlSwitch extends LitElement {
@property({ type: Boolean, reflect: true })
public disabled = false;
@property({ type: Boolean, reflect: true }) public disabled = false;
@property({ type: Boolean })
public vertical = false;
@property({ type: Boolean }) public vertical = false;
@property({ type: Boolean })
public reversed = false;
@property({ type: Boolean }) public reversed = false;
@property({ type: Boolean, reflect: true })
public checked?: boolean;
@property({ type: Boolean, reflect: true }) public checked = false;
// SVG icon path (if you need a non SVG icon instead, use the provided on icon slot to pass an <ha-icon slot="icon-on"> in)
@property({ type: String }) pathOn?: string;

View File

@@ -269,7 +269,7 @@ export class HaCountryPicker extends LitElement {
@property() public label?: string;
@property() public countries?: string[];
@property({ type: Array }) public countries?: string[];
@property() public helper?: string;

View File

@@ -32,7 +32,6 @@ import { firstWeekdayIndex } from "../common/datetime/first_weekday";
import { formatDate } from "../common/datetime/format_date";
import { formatDateTime } from "../common/datetime/format_date_time";
import { useAmPm } from "../common/datetime/use_am_pm";
import { computeRTLDirection } from "../common/util/compute_rtl";
import { HomeAssistant } from "../types";
import "./date-range-picker";
import "./ha-icon-button";
@@ -47,11 +46,11 @@ export interface DateRangePickerRanges {
export class HaDateRangePicker extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
@property() public startDate!: Date;
@property({ attribute: false }) public startDate!: Date;
@property() public endDate!: Date;
@property({ attribute: false }) public endDate!: Date;
@property() public ranges?: DateRangePickerRanges | false;
@property({ attribute: false }) public ranges?: DateRangePickerRanges | false;
@state() private _ranges?: DateRangePickerRanges;
@@ -61,11 +60,9 @@ export class HaDateRangePicker extends LitElement {
@property({ type: Boolean }) public disabled = false;
@property({ type: Boolean }) private _hour24format = false;
@property({ type: Boolean }) public minimal = false;
@property({ type: String }) private _rtlDirection = "ltr";
@property({ type: Boolean }) private minimal = false;
@state() private _hour24format = false;
@property({ type: Boolean }) public extendedPresets = false;
@@ -236,7 +233,6 @@ export class HaDateRangePicker extends LitElement {
const oldHass = changedProps.get("hass") as HomeAssistant | undefined;
if (!oldHass || oldHass.locale !== this.hass.locale) {
this._hour24format = !useAmPm(this.hass.locale);
this._rtlDirection = computeRTLDirection(this.hass);
}
}
}
@@ -306,11 +302,7 @@ export class HaDateRangePicker extends LitElement {
></ha-icon-button>`}
</div>
${this.ranges !== false && (this.ranges || this._ranges)
? html`<div
slot="ranges"
class="date-range-ranges"
.dir=${this._rtlDirection}
>
? html`<div slot="ranges" class="date-range-ranges">
<mwc-list @action=${this._setDateRange} activatable>
${Object.keys(this.ranges || this._ranges!).map(
(name) => html`<mwc-list-item>${name}</mwc-list-item>`

View File

@@ -0,0 +1,84 @@
import { css, CSSResultGroup, html, LitElement, nothing } from "lit";
import { customElement, property } from "lit/decorators";
import { until } from "lit/directives/until";
import { DEFAULT_DOMAIN_ICON, FIXED_DOMAIN_ICONS } from "../common/const";
import { domainIcon } from "../data/icons";
import { HomeAssistant } from "../types";
import { brandsUrl } from "../util/brands-url";
import "./ha-icon";
@customElement("ha-domain-icon")
export class HaDomainIcon extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
@property() public domain?: string;
@property() public deviceClass?: string;
@property() public icon?: string;
@property({ type: Boolean }) public brandFallback?: boolean;
protected render() {
if (this.icon) {
return html`<ha-icon .icon=${this.icon}></ha-icon>`;
}
if (!this.domain) {
return nothing;
}
if (!this.hass) {
return this._renderFallback();
}
const icon = domainIcon(this.hass, this.domain, this.deviceClass).then(
(icn) => {
if (icn) {
return html`<ha-icon .icon=${icn}></ha-icon>`;
}
return this._renderFallback();
}
);
return html`${until(icon)}`;
}
private _renderFallback() {
if (this.domain! in FIXED_DOMAIN_ICONS) {
return html`
<ha-svg-icon .path=${FIXED_DOMAIN_ICONS[this.domain!]}></ha-svg-icon>
`;
}
if (this.brandFallback) {
const image = brandsUrl({
domain: this.domain!,
type: "icon",
darkOptimized: this.hass.themes?.darkMode,
});
return html`
<img
alt=""
src=${image}
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
`;
}
return html`<ha-svg-icon .path=${DEFAULT_DOMAIN_ICON}></ha-svg-icon>`;
}
static get styles(): CSSResultGroup {
return css`
img {
width: var(--mdc-icon-size, 24px);
}
`;
}
}
declare global {
interface HTMLElementTagNameMap {
"ha-domain-icon": HaDomainIcon;
}
}

View File

@@ -3,6 +3,7 @@ import { styles } from "@material/mwc-drawer/mwc-drawer.css";
import { css, PropertyValues } from "lit";
import { customElement, property } from "lit/decorators";
import { fireEvent } from "../common/dom/fire_event";
import { mainWindow } from "../common/dom/get_main_window";
const blockingElements = (document as any).$blockingElements;
@@ -12,6 +13,8 @@ export class HaDrawer extends DrawerBase {
private _mc?: HammerManager;
private _rtlStyle?: HTMLElement;
protected createAdapter() {
return {
...super.createAdapter(),
@@ -31,8 +34,26 @@ export class HaDrawer extends DrawerBase {
protected updated(changedProps: PropertyValues) {
super.updated(changedProps);
if (changedProps.has("direction")) {
this.mdcRoot.dir = this.direction;
if (mainWindow.document.dir === "rtl") {
this._rtlStyle = document.createElement("style");
this._rtlStyle.innerHTML = `
.mdc-drawer--animate {
transform: translateX(100%);
}
.mdc-drawer--opening {
transform: translateX(0);
}
.mdc-drawer--closing {
transform: translateX(100%);
}
`;
this.shadowRoot!.appendChild(this._rtlStyle);
} else if (this._rtlStyle) {
this.shadowRoot!.removeChild(this._rtlStyle);
}
}
if (changedProps.has("open") && this.open && this.type === "modal") {
this._setupSwipe();
} else if (this._mc) {
@@ -66,6 +87,8 @@ export class HaDrawer extends DrawerBase {
position: fixed;
top: 0;
border-color: var(--divider-color, rgba(0, 0, 0, 0.12));
inset-inline-start: 0 !important;
inset-inline-end: initial !important;
}
.mdc-drawer.mdc-drawer--modal.mdc-drawer--open {
z-index: 200;

View File

@@ -168,12 +168,18 @@ export class HaExpansionPanel extends LitElement {
}
.summary-icon {
transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
direction: var(--direction);
margin-left: 8px;
margin-inline-start: 8px;
margin-inline-end: initial;
}
:host([leftchevron]) .summary-icon {
margin-left: 0;
margin-right: 8px;
margin-inline-start: 0;
margin-inline-end: 8px;
}
#summary {
@@ -188,11 +194,6 @@ export class HaExpansionPanel extends LitElement {
outline: none;
}
.summary-icon {
transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
direction: var(--direction);
}
.summary-icon.expanded {
transform: rotate(180deg);
}

View File

@@ -31,11 +31,11 @@ export class HaFileUpload extends LitElement {
@property() public supports?: string;
@property() public value?: File | File[] | FileList | string;
@property({ type: Object }) public value?: File | File[] | FileList | string;
@property({ type: Boolean }) public multiple = false;
@property({ type: Boolean, reflect: true }) public disabled: boolean = false;
@property({ type: Boolean, reflect: true }) public disabled = false;
@property({ type: Boolean }) public uploading = false;
@@ -282,6 +282,8 @@ export class HaFileUpload extends LitElement {
}
.value ha-svg-icon {
margin-right: 8px;
margin-inline-end: 8px;
margin-inline-start: initial;
}
.big-icon {
--mdc-icon-size: 48px;

View File

@@ -12,9 +12,9 @@ import "../ha-checkbox";
@customElement("ha-form-boolean")
export class HaFormBoolean extends LitElement implements HaFormElement {
@property() public schema!: HaFormBooleanSchema;
@property({ attribute: false }) public schema!: HaFormBooleanSchema;
@property() public data!: HaFormBooleanData;
@property({ attribute: false }) public data!: HaFormBooleanData;
@property() public label!: string;

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