Compare commits

..

375 Commits

Author SHA1 Message Date
Bram Kragten
fafad302ba Merge pull request #5931 from home-assistant/dev 2020-05-19 16:05:55 +02:00
Bram Kragten
0c94ad46b2 Bumped version to 20200519.0 2020-05-19 14:29:35 +02:00
Bram Kragten
d9bb40f934 Fix data table worker (#5921) 2020-05-19 13:59:16 +02:00
Bram Kragten
bbc16b6bc8 Cache used icons in memory, use inline icon for dev-tools (#5927) 2020-05-19 13:58:08 +02:00
Bram Kragten
16154e9d8b Change disabled icon to pencil-off (#5930) 2020-05-19 13:57:53 +02:00
Jeff Rescignano
61bd536d7b Update invalid links in README.md (#5926) 2020-05-19 09:54:39 +02:00
HomeAssistant Azure
02c798a8bc [ci skip] Translation update 2020-05-19 00:33:05 +00:00
Paulus Schoutsen
c37a691b9b Remove unused deps (#5916) 2020-05-18 23:09:59 +02:00
Maciej Bieniek
23c68d17e8 Add missing translations to ha-device-entities-card (#5908) 2020-05-18 21:54:58 +02:00
Bram Kragten
0a7f610ad3 Merge pull request #5920 from home-assistant/dev 2020-05-18 20:05:22 +02:00
Bram Kragten
c9e8bd2e5d Fix picture card (#5922) 2020-05-18 20:05:00 +02:00
Paulus Schoutsen
a66d2ca1b9 Use comlink in workers (#5915) 2020-05-18 16:51:46 +02:00
Bram Kragten
d38a0f0366 Bumped version to 20200518.0 2020-05-18 16:14:12 +02:00
Bram Kragten
29759de021 Update ha-entity-picker.ts 2020-05-18 16:14:04 +02:00
Bram Kragten
264759ddf0 Fix entity-filter-card (#5919) 2020-05-18 15:16:56 +02:00
Bram Kragten
91b0bd5b5e Check if attached on rebuild (#5918) 2020-05-18 13:27:58 +02:00
Bram Kragten
a0e2cc7a3a Fix ignored config entries (#5914) 2020-05-18 11:26:32 +02:00
Mat Strange
9e1eb41cbe Added theme to events documentation (#5903) 2020-05-18 11:26:10 +02:00
Maciej Bieniek
c37eb023b0 Add missing translation on developer tool page (#5886) 2020-05-18 11:07:00 +02:00
HomeAssistant Azure
840948ba4a [ci skip] Translation update 2020-05-18 00:33:03 +00:00
J. Nick Koston
8fbdd88b24 Cleanup new ha-config (#5906)
Remove changedProps check as its always true.
2020-05-17 11:59:50 +02:00
HomeAssistant Azure
512d35d2e0 [ci skip] Translation update 2020-05-17 00:33:05 +00:00
Zack Arnett
0321e55a42 EZ (#5901) 2020-05-16 11:15:04 +02:00
Zack Arnett
a1ee9ad48b Card Editor: Documentation per Card (#5888)
* Doc-links

* Comments

* Fix

* Remove unneeded code

* undo the change

* better
2020-05-15 21:50:28 -04:00
HomeAssistant Azure
1ad1fd28f1 [ci skip] Translation update 2020-05-16 00:32:54 +00:00
Bram Kragten
007f8b50b9 Merge pull request #5900 from home-assistant/dev 2020-05-15 22:01:34 +02:00
Bram Kragten
6fe8a87cca Bumped version to 20200515.0 2020-05-15 21:45:59 +02:00
Bram Kragten
5f46679d94 Fix mdc checkbox styling (#5897) 2020-05-15 17:56:47 +02:00
Zack Arnett
18a3f212f3 Calendar Panel: Popup Style (#5895) 2020-05-15 17:22:38 +02:00
Zack Arnett
67a3f5d87b Gauge Card: Fix if value is greater than max (#5887) 2020-05-15 17:21:53 +02:00
Bram Kragten
c88439ba2f Polyfill Intl.PluralRules (#5893) 2020-05-15 14:54:42 +02:00
Bram Kragten
67e17d4016 Fix conditional and custom panel updated > update (#5891) 2020-05-15 14:54:23 +02:00
Bram Kragten
b61cf60faf Migrate card preview to UpdatingElement (#5884) 2020-05-15 09:19:24 +02:00
HomeAssistant Azure
5503853445 [ci skip] Translation update 2020-05-15 00:32:48 +00:00
Bram Kragten
259726f5be Merge pull request #5883 from home-assistant/dev 2020-05-14 20:05:34 +02:00
Bram Kragten
bec42d941b Bumped version to 20200514.1 2020-05-14 18:46:20 +02:00
Bram Kragten
dcbbaf08f9 Set lovelace when restoring view from cache, optimise picture element and thermostat (#5880) 2020-05-14 18:44:38 +02:00
Zack Arnett
349355584a Media Player Row: Fix State Translation (#5881)
* Fix for state display translation

* Comments
2020-05-14 12:38:43 -04:00
Zack Arnett
7ce0b34774 Resizer fix (#5882) 2020-05-14 12:37:38 -04:00
Zack Arnett
dd894758a4 Card Editor: Preview Card Margin fix (#5879) 2020-05-14 18:13:26 +02:00
Zack Arnett
2aa1eb97fd Markdown Card: Fix not rendering on initial load (#5864) 2020-05-14 18:13:06 +02:00
Bram Kragten
4c43ae7b2f Beta fixes (#5878) 2020-05-14 16:03:52 +02:00
Zack Arnett
34e516e0be oops (#5866) 2020-05-14 09:26:06 +02:00
HomeAssistant Azure
7bd3427e76 [ci skip] Translation update 2020-05-14 00:32:37 +00:00
Bram Kragten
6853db693a Merge pull request #5862 from home-assistant/dev 2020-05-14 01:44:59 +02:00
Bram Kragten
252ce1e467 Show loading screen for integration config (#5863) 2020-05-14 01:44:39 +02:00
Bram Kragten
221c12bd61 Bumped version to 20200514.0 2020-05-14 01:12:57 +02:00
Paulus Schoutsen
12edd68874 Remove unused ES5 service worker (#5860) 2020-05-14 01:11:32 +02:00
Bram Kragten
f469753fb1 Dont add all childs at once to view (#5856) 2020-05-14 00:09:52 +02:00
Bram Kragten
c894ecd0e6 Optimise sourcemaps (#5859) 2020-05-14 00:06:39 +02:00
Paulus Schoutsen
2153bc536c Clean up service worker code and fix 404 (#5855) 2020-05-13 13:17:47 -07:00
Bram Kragten
86bbac430c Fix translations for integration config panel (#5854) 2020-05-13 20:49:01 +02:00
Bram Kragten
16ad8a3c01 Open newly added view after adding (#5851) 2020-05-13 19:49:03 +02:00
Bram Kragten
b2af91c83e Fixes for problems caused by not rebuilding (#5850) 2020-05-13 18:51:26 +02:00
Bram Kragten
4c0810f530 Fix typo in property method (#5852) 2020-05-13 18:51:16 +02:00
Paulus Schoutsen
f70130e21f Remove reference to Google Fonts (#5849) 2020-05-13 18:22:53 +02:00
Paulus Schoutsen
6bb7b01d00 Fix demo size_stats 2020-05-13 08:41:35 -07:00
Bram Kragten
51e7aaa805 Merge pull request #5848 from home-assistant/dev 2020-05-13 13:14:23 +02:00
Bram Kragten
54704e53b3 Bumped version to 20200513.0 2020-05-13 12:47:37 +02:00
Bram Kragten
cc46797576 Some fixes in focus and click handling (#5847) 2020-05-13 12:47:09 +02:00
Bram Kragten
7f1fb6f75f Set edit mode to false on card when disabling edit mode. (#5845) 2020-05-13 12:05:29 +02:00
Bram Kragten
2c2a1d204b Graph history fix (#5846) 2020-05-13 12:05:03 +02:00
Paulus Schoutsen
581fafdcc9 Workbox 5 in gulp (#5843) 2020-05-13 11:12:01 +02:00
HomeAssistant Azure
10358abbec [ci skip] Translation update 2020-05-13 00:32:49 +00:00
Bram Kragten
de1ffe67b1 Merge pull request #5840 from home-assistant/dev 2020-05-12 22:24:40 +02:00
Zack Arnett
eb2b24d57c Weather Card: Fix overwritten changes (#5841) 2020-05-12 22:24:20 +02:00
Bram Kragten
825db8a56a Bumped version to 20200512.0 2020-05-12 21:59:06 +02:00
David F. Mulcahey
577a21fc5c Rework ZHA group adds and removes (#5602) 2020-05-12 21:42:29 +02:00
Bram Kragten
1b2841eef9 Recreate cards only on config change (#5839) 2020-05-12 11:09:30 -07:00
Ian Richardson
845511e322 Add 'brightness' as a secondary_info option (#5731) 2020-05-12 12:29:43 -04:00
Bram Kragten
96ab057853 Ignore ResizeObserver loop limit exceeded error (#5838) 2020-05-12 12:17:41 +02:00
HomeAssistant Azure
f85cf0a238 [ci skip] Translation update 2020-05-12 00:33:00 +00:00
Bram Kragten
84a2676a9c compress icons (#5836) 2020-05-11 23:59:29 +02:00
Zack Arnett
466a1af902 Weather Card/Row: Weather Icons as SVG, Themeable, user definable (#5736)
* SVG

* no-unneeded-ternary

* declared ubnused

* moving stuff around

* Few updates

* All svgs in | update row

* No slots

* Remove public/static/images/weather

* style for user defined

* few updates to missing fils

* classes

* wind color
2020-05-11 23:58:17 +02:00
Zack Arnett
ebbe7e805f Gauge Card: Convert to Round Slider (#5510)
* Use round slider for gauge

* Update guage to slider

* Add severity back

* Remove Base Unit

* fix merge

* resize observer

* Update src/panels/lovelace/cards/hui-gauge-card.ts

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

* Update Install Resize Observer to be a helper

* Type import

* Reviews

* Updates to other cards

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-05-11 17:14:02 -04:00
Zack Arnett
c861ee025e Weather Card: Ability to choose Secondary Attribute (#5820) 2020-05-11 22:11:48 +02:00
Paulus Schoutsen
6d0823328d Fix generated Lovelace translating domain names (#5803) 2020-05-11 10:28:05 -07:00
Joakim Sørensen
60be14dc77 Use manifest.issue_tracker for issues URL if not built_in (#5818) 2020-05-11 13:45:00 +02:00
Mat Strange
2d627819d9 Added translation to dev-tools-info-integrations (#5834) 2020-05-11 13:44:32 +02:00
Zack Arnett
cf575f83f5 Weather Card: Switch State and Name (#5795) 2020-05-11 13:44:15 +02:00
HomeAssistant Azure
79935b2d4c [ci skip] Translation update 2020-05-11 00:32:59 +00:00
HomeAssistant Azure
d1cceb2013 [ci skip] Translation update 2020-05-10 00:33:23 +00:00
Bram Kragten
f5da130d51 Merge pull request #5823 from matstrange/dev 2020-05-09 22:18:37 +02:00
Mat Strange
8768304ec5 Returned to no label on disarm/trigger as before 2020-05-09 20:30:44 +01:00
Bram Kragten
f10a5dcdbe Unused import 2020-05-09 21:22:46 +02:00
Bram Kragten
a27428ebcd Simplify enter handling 2020-05-09 21:17:55 +02:00
Bram Kragten
d19acf17c2 Merge pull request #5826 from home-assistant/dev 2020-05-09 21:17:30 +02:00
Bram Kragten
1a0bf861ee Bumped version to 20200509.0 2020-05-09 21:01:00 +02:00
Bram Kragten
db906ad4d0 Bump material (#5812) 2020-05-09 20:59:53 +02:00
Bram Kragten
75ed0f2f99 Fix translation download and add empty languages (#5824) 2020-05-09 20:59:34 +02:00
Bram Kragten
29ed1144d5 Simplify custom icon set, return only 1 icon per call (#5822) 2020-05-09 20:59:02 +02:00
Mat Strange
fa445d4066 Added translation to bade on alarm panel 2020-05-09 12:00:26 +01:00
Erik Montnemery
d10be4ef2d Show cover position slider if cover supports it (#5815) 2020-05-08 22:59:20 +02:00
Joakim Sørensen
7f66d5b8e9 Change target to currentTarget for the click event (#5816) 2020-05-08 16:31:07 -04:00
Bram Kragten
0c8cd680c2 Allow custom icon sets (#5794) 2020-05-08 21:56:25 +02:00
Maciej Bieniek
a7ba1977b4 Add translation for and word on the integration card (#5811)
* Add translation for and word on tje integration card

* Move and to ui.common
2020-05-08 17:43:21 +02:00
Bram Kragten
a960b39235 Bump lit-element and lit-html (#5810) 2020-05-08 14:00:09 +02:00
Bram Kragten
3febf059ec Codesplit Supervisor panel icons (#5809) 2020-05-08 13:10:24 +02:00
Paulus Schoutsen
20203f7bdb Bump home-assistant-js-websocket to 5.1.2 2020-05-07 18:35:14 -07:00
Franck Nijhof
a399d76d06 Add new core configuration UI for external_url & internal_url (#5755) 2020-05-07 18:32:03 -07:00
Franck Nijhof
1ca097c5a0 Add issue_tracker integration manifest property (#5744) 2020-05-07 20:51:46 -04:00
optama
e83ede245d #5761 fix weather forecast card showing hours instead of weekdays (#5799) 2020-05-07 23:19:50 +02:00
Paulus Schoutsen
05ac275780 Fix Leaflet import (#5802) 2020-05-07 13:04:29 -07:00
Paulus Schoutsen
966c0bc06c Remove HTML loader (#5800) 2020-05-07 12:39:19 -07:00
Paulus Schoutsen
abf136dd63 Upgrade web animations (#5801) 2020-05-07 12:31:25 -07:00
Paulus Schoutsen
b6309cfd16 Extract the version extract from webpack config (#5798) 2020-05-07 10:26:02 -07:00
Paulus Schoutsen
b69d5e0fa3 Revert "Use gulp-terser instead of webpack-terser (#5788)" (#5796) 2020-05-07 18:28:51 +02:00
Paulus Schoutsen
5084cde6b9 Split babel config from babel loader config (#5797) 2020-05-07 09:25:02 -07:00
Bram Kragten
ca1cc7ed0d Some little hassio tweaks (#5793) 2020-05-07 16:07:58 +02:00
Joakim Sørensen
808a31db2b Hide auto-update for non advanced users (#5745) 2020-05-07 15:21:52 +02:00
Joakim Sørensen
44ad75aead Implement add-on changelog (#5727) 2020-05-07 15:21:12 +02:00
Joakim Sørensen
0961c9d05e Cleanup and new repository management for add-on store (#5750) 2020-05-07 15:20:51 +02:00
Joakim Sørensen
56754b4d43 New dialogs for the profile (#5780) 2020-05-07 14:42:34 +02:00
Joakim Sørensen
661779ad4e Add localize string for Device info (#5781) 2020-05-07 14:36:45 +02:00
Paulus Schoutsen
cf37ebb652 Use gulp-terser instead of webpack-terser (#5788) 2020-05-07 14:36:17 +02:00
Paulus Schoutsen
82741e490b Optimize icon fetching (#5791) 2020-05-07 13:07:50 +02:00
Paulus Schoutsen
5fed28808e Rename env var TRAVIS to IS_TEST (#5789) 2020-05-07 12:39:18 +02:00
Paulus Schoutsen
321c0cfc84 Minor cleanup (#5787) 2020-05-07 12:38:26 +02:00
Paulus Schoutsen
eba7cedaa6 Reset path on icon change (#5790) 2020-05-07 12:37:14 +02:00
Zack Arnett
71492d0467 Calendar Panel: FullCalendar (#5742)
* WIP

* remove big calendar

* remove file

* Convert to lit

* More

* Ready for the public to see? prob not

* Fix types and imports

* Remove dependencies

* ignore the typing that hasnt been finished in Beta

* Convert paper to MWC

* Styling

* View list as name of view | MWC components version

* Updates action directive for ripple. MWC 14.1.0

* Update

* Updates

* Update height styling

* Toggle Button Group

* Adds Toggle group transition

* style updates

* Few fixes

* Fix Yarn lock from merge | height of celndar as parent

* Update package Json and yarn | remove unneeded pkg

* Remove mwc-list

* Search hass.states for calendars instead of api

* Move function to file in data | event fetch logic

* compute state name

* add ha button menu | refresh

* Remove Event ffetch logic

* copy pasta

* Types

* Fix for toggling

* Translations

* Update ha-button-toggle-group

* Update ha-button-toggle-group.ts

* Update ha-button-toggle-group.ts

* Change mobile view

* Locale in fullcalendar

* Comments

* ha-button-menu trigger slot

* Comments

* icon-x

* Update src/panels/calendar/ha-panel-calendar.ts

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

* Update src/panels/calendar/ha-panel-calendar.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-05-06 17:22:12 -04:00
Bram Kragten
9630a58ea7 Some fixes for icons (#5758) 2020-05-06 14:18:10 -07:00
Joakim Sørensen
89f6f16ba2 Fix removal of option in select helper (#5777) 2020-05-06 19:28:59 +02:00
Bram Kragten
2d646da97f Fix cast navigation on none default dashboard (#5719) 2020-05-06 09:30:18 -07:00
Joakim Sørensen
39b5460598 Fix hassio dev/build (#5776) 2020-05-06 16:27:03 +02:00
Bram Kragten
636429ccfa Bump fecha (#5728) 2020-05-06 12:58:53 +02:00
Erik Montnemery
e5abb95f5c Include QoS and retain in MQTT debug info (#5759) 2020-05-06 12:58:19 +02:00
Jason Knott
c631554eb0 Added options to Lovelace evaluate filter (#5694) 2020-05-06 12:57:11 +02:00
Paulus Schoutsen
db07eeb916 Add step_id to flow in progress type (#5769) 2020-05-06 12:54:32 +02:00
Mat Strange
3216a46e76 Fix Lovelace view config icon preview (#5770) 2020-05-06 12:30:41 +02:00
Bram Kragten
ae6243b7bf Merge pull request #5757 from home-assistant/dev 2020-05-05 17:38:14 +02:00
Bram Kragten
df002d7a67 Merge branch 'master' into dev 2020-05-05 16:50:07 +02:00
Bram Kragten
e8a0632108 Bumped version to 20200505.0 2020-05-05 16:45:21 +02:00
Bram Kragten
0a92c28bac Split up mdi icons (#4379) 2020-05-05 16:40:11 +02:00
Bas Nijholt
d419547463 make color of update-heading in primary-text-color (#5754) 2020-05-05 16:33:06 +02:00
Mat Strange
da392912b3 Grayscale Integration logos when ignored (#5748) 2020-05-05 00:19:33 +02:00
Paulus Schoutsen
9ebee02727 Update device registry type (#5735) 2020-05-04 14:36:28 +02:00
Joakim Sørensen
0bdcfcc42f Supervisor dialogs (#5740) 2020-05-04 14:35:15 +02:00
Bram Kragten
43623a30bc Add English GB, Frysk and Galego (#5730) 2020-05-02 21:56:13 +02:00
Bram Kragten
99e73054a9 Await ignoring before refreshing config flows in progress (#5722) 2020-05-02 20:34:54 +02:00
Joakim Sørensen
108233f3b8 Adds mainPage to hass-tabs-subpage (#5724) 2020-05-02 20:19:17 +02:00
Bram Kragten
8f2a7c95b3 Fix more info header color and page background color (#5716) 2020-05-02 19:51:10 +02:00
Bram Kragten
7fdd525dac Don't show error on open of dialog (#5721)
Fixes #4713
2020-05-02 19:35:11 +02:00
Joakim Sørensen
7ed24137eb Adds padding to ha-label-badge (#5725) 2020-05-02 19:20:47 +02:00
Joakim Sørensen
07cd30eaca Place addon documentation in a card (#5726) 2020-05-02 19:20:20 +02:00
Joakim Sørensen
df8cf66e02 Adds dialog to ask user to restart add-on on configuration changes (#5707)
* Adds dialog to ask user to restart addon on configuration changes

* Apply review suggestions

* Show error in dialog

* Remove unused import

* Update hassio/src/dialogs/suggestRestart.ts

* Rename

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-05-02 19:19:45 +02:00
Bram Kragten
f067bcd877 Bumped version to 20200427.2 2020-05-02 17:28:45 +02:00
Bram Kragten
e11ef55dd8 Update nb.json 2020-05-02 17:25:52 +02:00
Bram Kragten
fa8bd30e83 Don't disable controls when state is unknown (#5687) 2020-05-02 17:23:54 +02:00
Bram Kragten
04a2ff7506 Don't disable thermostat when state is unknown (#5720) 2020-05-02 17:23:20 +02:00
Bram Kragten
bc68e20041 Don't disable thermostat when state is unknown (#5720) 2020-05-02 17:23:00 +02:00
Franck Nijhof
786da25b9f Fix typo and remove Hass.io references (#5717) 2020-05-02 17:02:10 +02:00
Franck Nijhof
c3832d56c3 Don't break Markdown from external sources (#5713) 2020-05-02 15:19:26 +02:00
Joakim Sørensen
79d1a2f458 Add reload buttons to store and snapshot (#5714) 2020-05-02 15:18:57 +02:00
Joakim Sørensen
f16a674a39 Supervisor style changes (#5706) 2020-05-02 14:42:12 +02:00
matstrange
6e38a80efc Optimized some common images with zopflipng (#5697) 2020-05-02 13:57:39 +02:00
Zack Arnett
6a3a1297ad Update Weather images array to hold variants (#5692) 2020-05-01 22:50:49 +02:00
Joakim Sørensen
5ca63a8052 Convert the rest of the panel (#5689) 2020-05-01 16:52:03 +02:00
On Freund
8b04df093c Handle unchanged suggested values (#5688) 2020-05-01 14:10:12 +02:00
Joakim Sørensen
d2a5494335 Adds stage badge (#5685) 2020-05-01 13:24:10 +02:00
Joakim Sørensen
de545e90e2 Adds documentation tab (#5684) 2020-05-01 13:19:24 +02:00
Bram Kragten
57ab7e829b Don't disable controls when state is unknown (#5687) 2020-05-01 13:18:58 +02:00
Joakim Sørensen
6847830575 Use hass-tabs-subpage in add-on view (#5483) 2020-05-01 11:34:52 +02:00
Franck Nijhof
2084ecc4c6 Add NOT condition helper (#5616) 2020-05-01 11:06:35 +02:00
Aidan Timson
b0c27e587e Align discovered integrations to avavliable space (#5672) 2020-05-01 11:04:18 +02:00
On Freund
1687d90d02 Allow passing the current value to config flow input fields (#5603)
* Allow passing the current value to config flow input fields

* Fix lint errors

* Apply suggestions from code review

Co-Authored-By: Bram Kragten <mail@bramkragten.nl>

* Rename current_value to suggested_value to open up more use cases

* Update ha-form-integer.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-05-01 10:36:51 +02:00
Paulus Schoutsen
dfd9bf3c64 Create advanced flow if user in advanced mode (#5612) 2020-05-01 10:23:02 +02:00
Bram Kragten
5a25b9c2f1 Update BUG_REPORT.md 2020-04-30 23:22:09 +02:00
Bram Kragten
bf68101754 Add request for state to issue template 2020-04-30 23:21:43 +02:00
Bram Kragten
487bd8d3fc remove console 2020-04-30 21:41:48 +02:00
Bram Kragten
3ba9c931b9 Optimize scenes config (#5652) 2020-04-30 20:40:43 +02:00
Bram Kragten
8484f7595a Optimize script editor (#5650) 2020-04-30 20:40:23 +02:00
Bram Kragten
ee889d59d4 Don't add disabled entities to lovelace from device page (#5648) 2020-04-30 20:40:10 +02:00
Bram Kragten
ae10330844 Hide scenes from device info page when no entities (#5647) 2020-04-30 20:39:58 +02:00
Bram Kragten
f3e88f6f2e Exclude esprima and drop js-yaml from lovelace chunk (#5649) 2020-04-30 20:39:36 +02:00
Bram Kragten
2abfd0392d Group config entries by integration (#5646) 2020-04-30 20:38:02 +02:00
Bram Kragten
462c1f94d6 Update intl-messageformat (and remove @polymer/app-localize-behavior) (#5671) 2020-04-30 11:20:54 -07:00
Pedro Lamas
f4710891d0 Improved spacing balance for weather forecast (#5673)
* Improved spacing balance for weather forecast

* Removes obsolete styling
2020-04-30 19:43:54 +02:00
Bram Kragten
1fdb6b8034 Prevent recreation of entities row on every update of hass (#5657) 2020-04-29 13:29:53 -07:00
Joakim Sørensen
8029c3d672 Adds more log types to the system tab (#5496)
* Add more log types to the system tab

* Fix lint issues

* Fix more lint issues

* Add loading screen while waiting for logs.

* Only show log selector if advenced user.

* Update hassio/src/system/hassio-supervisor-log.ts

Co-Authored-By: Bram Kragten <mail@bramkragten.nl>

* Log adjustments

* Remove the need for exported ANSI_HTML_STYLE

* Add core as a log provider

* Removed unneeded hints

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-04-29 21:57:31 +02:00
Bram Kragten
61fdee14c6 Fix demo themes (#5643) 2020-04-28 23:13:37 +02:00
Zack Arnett
117e4e468f Weather Card: Switch Importance of Name and State (#5624)
* Improvements to the name and state importance

* Bram Suggestions
2020-04-28 23:12:15 +02:00
Sean Mooney
869ec113f4 Updated repo links on Dev Tools Info panel (#5644)
These were still using the old names of the repos.

home-assistant is now "core" and home-assistant-polymer is now "frontend".
2020-04-28 23:11:53 +02:00
Erik Montnemery
00e7b93011 Improve styling of MQTT debug info (#5626) 2020-04-28 23:11:34 +02:00
Bram Kragten
03e581870a Bumped version to 20200427.1 2020-04-28 23:11:01 +02:00
Erik Montnemery
b04fe141ac Improve styling of MQTT debug info (#5626) 2020-04-28 23:09:20 +02:00
Sean Mooney
b0168fbb85 Updated repo links on Dev Tools Info panel (#5644)
These were still using the old names of the repos.

home-assistant is now "core" and home-assistant-polymer is now "frontend".
2020-04-28 10:03:54 +02:00
Zack Arnett
75ba343b5e Weather Card: Switch Importance of Name and State (#5624)
* Improvements to the name and state importance

* Bram Suggestions
2020-04-27 14:43:23 -04:00
Aidan Timson
88217473f7 Add search to integrations 🔍 (#5593)
Co-Authored-By: Bram Kragten <mail@bramkragten.nl>
2020-04-27 20:42:37 +02:00
Bram Kragten
01e5dfc9b3 Fix demo themes (#5643) 2020-04-27 20:40:30 +02:00
Bram Kragten
58869677bd Merge pull request #5641 from home-assistant/dev 2020-04-27 12:31:02 +02:00
Bram Kragten
032b01aec1 Bumped version to 20200427.0 2020-04-27 11:47:33 +02:00
Bram Kragten
a47c3fa854 Fix entity card state display (#5631) 2020-04-26 23:48:02 -07:00
Paulus Schoutsen
7c6ba1a782 Translation fixes (#5634) 2020-04-26 21:09:05 +02:00
HomeAssistant Azure
0d08f5413b [ci skip] Translation update 2020-04-26 00:32:54 +00:00
Bram Kragten
949cc17a9e Fix alarm panel translations (#5629) 2020-04-25 15:25:33 -07:00
HomeAssistant Azure
607c1a1ef0 [ci skip] Translation update 2020-04-25 00:32:51 +00:00
Zack Arnett
db2dab8227 Slugify title for url (#5621) 2020-04-24 10:59:38 -04:00
Bram Kragten
eb4ba4fc78 Merge pull request #5620 from home-assistant/dev 2020-04-24 16:14:09 +02:00
Bram Kragten
bf888b1547 Bumped version to 20200424.0 2020-04-24 15:57:10 +02:00
Bram Kragten
c468aab9b2 Fix some imports (#5619) 2020-04-24 15:49:25 +02:00
Bram Kragten
a0dae802f2 Optimize automation editor (#5591) 2020-04-24 13:36:51 +02:00
Bram Kragten
14330fbd93 Fix include domains on entity picker (#5615) 2020-04-24 13:36:10 +02:00
Bram Kragten
bf55be7f7f Fix lit/no-invalid-html (#5617) 2020-04-24 13:29:38 +02:00
Paulus Schoutsen
e10987a705 Improve Lovelace take control warning. (#5608) 2020-04-24 10:37:41 +02:00
Bram Kragten
355f40d740 Don't update entity picker items while open (#5588)
* Don't update entity picker items while open

* Update items in updated, when we open the dropdown
2020-04-24 10:36:38 +02:00
Bram Kragten
2503fabe1d Add min width to toolbar icon to prevent tabs jumping (#5590) 2020-04-24 10:36:14 +02:00
Bram Kragten
32c7c0b4f0 Hide config entry title when same as integration name (#5589) 2020-04-24 10:35:56 +02:00
Bram Kragten
301a964a65 Allow to remove config entry name (#5607)
* Allow to remove config entry name

* Add enter handling to prompt
2020-04-24 10:35:43 +02:00
Aidan Timson
49f2fd2af7 Fix integrations fab spacing (#5594)
* Fix integrations fab spacing

* Use is-wide
2020-04-24 10:35:21 +02:00
HomeAssistant Azure
4f518cac2c [ci skip] Translation update 2020-04-24 00:32:51 +00:00
Paulus Schoutsen
8420f73919 Fix translations for Z-Wave & Zigbee (#5606) 2020-04-23 15:51:56 -07:00
Bram Kragten
1ef2d3c7f2 Add max width to integration cards (#5600) 2020-04-23 09:53:27 -04:00
Paulus Schoutsen
fc20fd32f1 Fix a bunch of translation strings (#5597)
* Fix a bunch of translation strings

* Fallback on default if no device class translations
2020-04-23 13:07:40 +02:00
HomeAssistant Azure
13a8bf6993 [ci skip] Translation update 2020-04-23 00:32:48 +00:00
Bram Kragten
b2f424a6f8 Merge pull request #5586 from home-assistant/dev
20200422.0
2020-04-22 12:40:07 +02:00
Bram Kragten
a9d927551c Bumped version to 20200422.0 2020-04-22 12:16:03 +02:00
Zack Arnett
fdf7b516a0 Weather Card: Beautify (#5387)
* Weather card

* Updates

* Remove Precipitation from forecast

* Weather Card :)

* Fix no breaking changes

* Size styles

* Space

* Fix some overlap

* Unavailable

* New unavailable

* Changed to check if less than day

* Updates

* oops

* Little clean up

* styling

* Reviews

* Fix merge

* Lint

* eslint

* New images

* Update src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts

Co-Authored-By: Bram Kragten <mail@bramkragten.nl>

* Reviews

* Reviews

* Comments

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-04-22 12:13:32 +02:00
Erik Montnemery
9a00078169 Display MQTT debug info (#5375)
* Add MQTT debug info

* Refactor

* Fix mistake

* Rewrite, improve display.

* Tweak translations

* Add mqtt-payload.ts

* Apply suggestions from code review

Co-Authored-By: Zack Arnett <arnett.zackary@gmail.com>

* Tweak after adding review comments.

* Rewrite to only render the messages when details is opened

* Adapt to core PR #33752

* Address review comments

* Lint

* Lint

* Address review comments

Co-authored-by: Zack Arnett <arnett.zackary@gmail.com>
2020-04-22 12:01:43 +02:00
Bram Kragten
1dfb632fc4 New layout for integration config (#5580)
* WIP

* Add filter message to device and entities page

* Lokalize

* Missed 2

* Fixed in #5581

* Change to hash
2020-04-22 11:51:50 +02:00
Zack Arnett
1c1f9a6a89 Graph Footer: Cache State History (#5499)
* Cache State History for entity

* State history reset on config change

* Fetching

* reviews

* Merge fixes

* Remove file again ?
2020-04-22 11:33:49 +02:00
Bram Kragten
2b76b3887e Add device automation translations to add automation device dia… (#5573)
* Add device automation translations to add automation device dialog

* Update translations-mixin.ts
2020-04-22 11:12:27 +02:00
Paulus Schoutsen
a49c84032b Mark titles in config flows optional (#5584) 2020-04-22 10:51:53 +02:00
cdce8p
c72bb5b22b Add secondary option for cover entities (#5556)
* Add secondary option for cover entities

* Replace string concatenation

* Check for undefined
2020-04-22 10:50:52 +02:00
Paulus Schoutsen
24a844dddc update translations 2020-04-21 23:51:57 -07:00
HomeAssistant Azure
ae903973a7 [ci skip] Translation update 2020-04-22 00:32:35 +00:00
Paulus Schoutsen
82442bb5ec Fix cast translations (#5582) 2020-04-21 15:02:00 -07:00
nagyrobi
8786302190 Add up/down movement icons to shutter (#5579)
Since window shutters are also moving up and down, add these icons for during movement.
2020-04-21 17:23:37 +02:00
Paulus Schoutsen
d27a17cf8e Get state translations from backend (#5581)
* Get state translations from backend

* Fix tests
2020-04-21 17:15:13 +02:00
HomeAssistant Azure
b4b90ca59d [ci skip] Translation update 2020-04-21 00:33:02 +00:00
HomeAssistant Azure
ecd967a68d [ci skip] Translation update 2020-04-20 00:32:47 +00:00
Paulus Schoutsen
8812340768 Remove iba language 2020-04-18 23:03:13 -07:00
Paulus Schoutsen
659da7bf80 Update translations 2020-04-18 23:01:40 -07:00
HomeAssistant Azure
91eabf3c38 [ci skip] Translation update 2020-04-19 00:32:41 +00:00
Paulus Schoutsen
e355c81e41 Bumped version to 20200418.0 2020-04-18 17:15:29 -07:00
Paulus Schoutsen
d45a674652 Ask specific translations (#5560) 2020-04-18 17:14:25 -07:00
HomeAssistant Azure
f91b46e88c [ci skip] Translation update 2020-04-18 00:32:56 +00:00
Aidan Timson
f57754212c Add Search to Card Picker (#5497)
* Add Search to Card Picker

* Force focus

* Remove autofocus

* Fix from rebase

* Commit suggestion

Co-Authored-By: Bram Kragten <mail@bramkragten.nl>

* Flip autofocus

* Cache cards

* Make cards a property

* Add missing custom cards

* Set cards to render elements

* Commit suggestion

Co-Authored-By: Bram Kragten <mail@bramkragten.nl>

* Update src/panels/lovelace/editor/card-editor/hui-card-picker.ts

Co-Authored-By: Bram Kragten <mail@bramkragten.nl>

* Make card preview max width match columns

* Typo

* Add autofocus where wanted

* Update src/common/search/search-input.ts

Co-Authored-By: Bram Kragten <mail@bramkragten.nl>

* Update src/dialogs/config-flow/step-flow-pick-handler.ts

Co-Authored-By: Bram Kragten <mail@bramkragten.nl>

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-04-17 23:29:49 +02:00
Paulus Schoutsen
97c454aa0d Update domain translation string (#5558) 2020-04-17 09:01:45 -07:00
dependabot[bot]
b516f10a35 Bump https-proxy-agent from 2.2.1 to 2.2.4 (#5559)
Bumps [https-proxy-agent](https://github.com/TooTallNate/node-https-proxy-agent) from 2.2.1 to 2.2.4.
- [Release notes](https://github.com/TooTallNate/node-https-proxy-agent/releases)
- [Commits](https://github.com/TooTallNate/node-https-proxy-agent/compare/2.2.1...2.2.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-04-17 11:45:30 +02:00
HomeAssistant Azure
0ccc788148 [ci skip] Translation update 2020-04-17 00:32:42 +00:00
Bram Kragten
5c941e0afb Remove initial value explanation 2020-04-16 12:55:21 +02:00
HomeAssistant Azure
492e4d2df4 [ci skip] Translation update 2020-04-16 00:32:44 +00:00
Paulus Schoutsen
66f33ad497 Use manfiests to render doc urls (#5549)
* Use manfiests to render doc urls

* Update UI
2020-04-15 13:36:25 -07:00
Aidan Timson
ff81536463 Add loading for initial state on graph (#5448)
* Fix type

* Add loading spinner for initial state

* Move to better position

* Make var not a property

* Make spinner same height as graph

* Fix size

* Make spinner centered

* Adjust spinner position

* Remove boolean and make no state history match height

* Merge

* eslint

* Fix value

Co-Authored-By: Bram Kragten <mail@bramkragten.nl>

* Commit suggestion

Co-Authored-By: Bram Kragten <mail@bramkragten.nl>

* Suggested change

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-04-15 20:54:01 +02:00
Paulus Schoutsen
ba0cba1a2b Update where we load integration titles from (#5546) 2020-04-15 20:47:29 +02:00
Joakim Sørensen
fc7771ec13 Remove npm (#5548) 2020-04-15 20:25:07 +02:00
Joakim Sørensen
4c3069e5b7 Add missing imports (#5547) 2020-04-15 20:15:34 +02:00
Paulus Schoutsen
ed54a185e4 Remove srcset from brands (#5517) 2020-04-15 16:00:16 +02:00
Paulus Schoutsen
4f81085d0f Add entity row that displays static text (#5516)
* Add entity row that displays text

* Remove hass type
2020-04-15 15:59:33 +02:00
David F. Mulcahey
8383caf6a6 Add ability to see Zigbee information for a device (#5445)
* add ability to see zigbee information for a device

* cleanup

* handle resize correctly

* cleanup

* convert to ha-dialog

* Simplify

* Add close button

* Add readonly to code editor

* add class

* eslint fixes

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-04-15 15:36:48 +02:00
HomeAssistant Azure
1b9f224569 [ci skip] Translation update 2020-04-15 00:32:58 +00:00
Bram Kragten
05495af74f Merge pull request #5539 from home-assistant/dev
20200414.0
2020-04-15 00:10:54 +02:00
Bram Kragten
d62da5e924 Merge branch 'master' into dev 2020-04-15 00:00:16 +02:00
Bram Kragten
57d72bd80f Bumped version to 20200414.0 2020-04-14 23:53:01 +02:00
Bram Kragten
681c05c323 Add Lit analyzer (#5538)
* Add lit analyzer

* Update rules
2020-04-14 11:43:56 -07:00
Bram Kragten
3d20d8b208 remove @types/chromecast-caf-sender (#5537)
To prevent a collusion with `@types/chromecast-caf-receiver` that would make `lit-analyzer` fail.
2020-04-14 20:25:03 +02:00
Bram Kragten
4f9d77b906 Remove tslint -> move ts to eslint 2020-04-14 18:09:31 +02:00
Bram Kragten
82f80db558 Update typescript, prettier, tslint -> eslint (#5536)
* Update typescript, prettier, tslint -> eslint

* Organize imports

* Use glob for eslint fix react import
2020-04-14 09:05:45 -07:00
HomeAssistant Azure
b17490f0de [ci skip] Translation update 2020-04-14 00:32:37 +00:00
HomeAssistant Azure
d33c0b4bd1 [ci skip] Translation update 2020-04-13 00:32:47 +00:00
HomeAssistant Azure
7f528c90c3 [ci skip] Translation update 2020-04-12 00:32:55 +00:00
Paulus Schoutsen
c4c4782429 Fix hui-entities-card margin (#5518) 2020-04-11 11:07:27 +02:00
HomeAssistant Azure
5414092309 [ci skip] Translation update 2020-04-11 00:32:38 +00:00
Paulus Schoutsen
b632ea6f86 Add icons to info panel (#5501)
* Add icons to info panel

* Update src/panels/developer-tools/info/integrations-card.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-04-10 13:13:58 +02:00
David F. Mulcahey
bd98ce8c25 Make add devices button available on ZHA coordinator (#5431)
* Make add devices available on ZHA coordinator

* Update src/panels/config/zha/zha-device-card.ts

Co-Authored-By: Bram Kragten <mail@bramkragten.nl>

* Update src/panels/config/zha/zha-device-card.ts

Co-Authored-By: Zack Arnett <arnett.zackary@gmail.com>

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
Co-authored-by: Zack Arnett <arnett.zackary@gmail.com>
2020-04-10 11:57:23 +02:00
Paulus Schoutsen
0c1714ef78 Reload frontend if backend changes (#5489)
* Reload frontend if backend changes

* Better implementation

* Store ha version
2020-04-10 11:55:53 +02:00
Bram Kragten
ee278f111f Convert script config panel to router (#5512)
* Convert script config panel to router

* Update script.ts

* Update ha-config-script.ts
2020-04-10 11:50:06 +02:00
HomeAssistant Azure
47e9eb5a0d [ci skip] Translation update 2020-04-10 00:32:45 +00:00
Bram Kragten
baf5dcbd03 Migrate automations config panel to router (#5509)
* MIgrate automations config panel to router

* Correct link to create new
2020-04-09 10:34:45 -07:00
Bram Kragten
2e2915ec09 Fix first logbook item not being shown (#5491) 2020-04-09 16:06:27 +02:00
Bram Kragten
5f3a6740c1 Fix cast panel view (#5488) 2020-04-09 16:06:06 +02:00
Bram Kragten
b17074d68b Fix sidebar derived style (#5493) 2020-04-09 16:05:39 +02:00
Joakim Sørensen
ac4b2ea70f Import ha-fab (#5494) 2020-04-09 16:05:18 +02:00
Bram Kragten
4e2a9e3d7b fix imports (#5506) 2020-04-09 16:04:23 +02:00
Bram Kragten
75525b9866 Remove sort now that data-table does it (#5508) 2020-04-09 16:04:01 +02:00
Bram Kragten
1e39f22009 Fix map init on connected (#5505) 2020-04-09 16:03:38 +02:00
Bram Kragten
7ba55ab666 Bumped version to 20200407.2 2020-04-09 16:02:53 +02:00
Bram Kragten
0c06517dcc Remove sort now that data-table does it (#5508) 2020-04-09 15:45:18 +02:00
Bram Kragten
cd1bfe1b20 Fix map init on connected (#5505) 2020-04-09 15:44:39 +02:00
Bram Kragten
35c2d8966b fix imports (#5506) 2020-04-09 15:44:20 +02:00
Paulus Schoutsen
cb255ef137 Add icons when adding integration (#5500)
* Add icons when adding integration

* Remove margin from search input and put in parent
2020-04-09 14:44:08 +02:00
HomeAssistant Azure
f9d78a95ad [ci skip] Translation update 2020-04-09 00:32:34 +00:00
Joakim Sørensen
14eb496b1d Import ha-fab (#5494) 2020-04-08 21:24:43 +02:00
Bram Kragten
b390e7bed1 Fix sidebar derived style (#5493) 2020-04-08 20:22:01 +02:00
Bram Kragten
903f92f94a Update developer-tools-state.js 2020-04-08 15:23:22 +02:00
Bram Kragten
ebb20abee0 Make unavailable elements disabled (#5386)
* Make unavailable elements disabled

* Unused

* Add checks for unknown

* Update hui-weather-entity-row.ts
2020-04-08 13:58:36 +02:00
Joakim Sørensen
2253275640 Filter add-ons in the store based on advanced mode (#5486) 2020-04-08 13:49:37 +02:00
Bram Kragten
7ddfe3c80b Fix cast panel view (#5488) 2020-04-08 12:36:52 +02:00
Bram Kragten
4388d82076 Fix gallery translation and add more demos (#5473)
* Fix gallery translation and add more demos

* Update provide_hass.ts

* Update demo-hui-alarm-panel-card.ts
2020-04-08 12:36:29 +02:00
Bram Kragten
4f70ec7dc2 Set correct lang attribute (#5479)
* Set correct lang attribute

* Update lit-localize-lite-mixin.ts

* Update translations-mixin.ts

* Remove lang=""

* Move logic out of mixin
2020-04-08 12:36:06 +02:00
Bram Kragten
a71f42366a Fix first logbook item not being shown (#5491) 2020-04-08 12:23:44 +02:00
HomeAssistant Azure
e9bb9fdafe [ci skip] Translation update 2020-04-08 00:32:43 +00:00
Bram Kragten
dd49ea6f20 Merge pull request #5487 from home-assistant/dev
20200407.1
2020-04-07 21:18:38 +02:00
Bram Kragten
92de202e0b Bumped version to 20200407.1 2020-04-07 20:35:18 +02:00
Bram Kragten
1d02b69f52 Fix execute button on automation list (#5484) 2020-04-07 17:33:44 +02:00
Bram Kragten
1dcd913c04 Merge pull request #5481 from home-assistant/dev
20200407.0
2020-04-07 15:58:47 +02:00
Bram Kragten
471a5f8407 Bumped version to 20200407.0 2020-04-07 15:42:02 +02:00
Bram Kragten
7b97ac2f6f Add padding to no logbook message (#5477) 2020-04-07 15:18:40 +02:00
Bram Kragten
e673d90b3f Allow header of mfa dialog to wrap (#5478) 2020-04-07 15:18:23 +02:00
Zack Arnett
764234f744 Icon pickers (#5453) 2020-04-07 09:03:36 -04:00
Zack Arnett
6ca944b7ef Shopping Cart: CSS HTML updates (#5463)
* Fix css

* click
2020-04-07 09:03:19 -04:00
Bram Kragten
c574556deb Missing imports (#5476) 2020-04-07 13:52:45 +02:00
Bram Kragten
c04e1adea2 Add import for ha-state-icon (#5474)
* Add import for ha-state-icon

* Update ha-config-device-page.ts
2020-04-07 12:18:00 +02:00
HomeAssistant Azure
5eb11349fc [ci skip] Translation update 2020-04-07 00:32:43 +00:00
Paulus Schoutsen
b3beb7ef85 Fix dynamic import in gallery (#5472) 2020-04-06 22:29:52 +02:00
Bram Kragten
ec95000fbc Merge pull request #5471 from home-assistant/dev
20200406.0
2020-04-06 19:51:20 +02:00
Bram Kragten
53f0c01073 Bumped version to 20200406.0 2020-04-06 17:00:16 +02:00
Bram Kragten
42d5349db7 Fix user config UI for mobile (#5469) 2020-04-06 16:42:06 +02:00
Zack Arnett
f36a1bbf4a desc (#5443) 2020-04-06 10:33:57 -04:00
Xiaonan Shen
e9945abf2f Add modal to hui-dialog-delete-card (#5465) 2020-04-06 16:24:30 +02:00
Bram Kragten
71ba192c38 Add error logs to safe mode card (#5452)
* Add error logs to safe mode card

* Remove actions
2020-04-06 16:08:35 +02:00
HomeAssistant Azure
e8a7671c25 [ci skip] Translation update 2020-04-06 00:43:01 +00:00
HomeAssistant Azure
17138f78b8 [ci skip] Translation update 2020-04-05 00:33:00 +00:00
Paulus Schoutsen
46c6f86d6a Always load error log in safe mode (#5442) 2020-04-04 17:46:52 +02:00
Zack Arnett
ae1c519d3a Entity Row: Input Number Slider (#5440) 2020-04-04 17:42:06 +02:00
David F. Mulcahey
fd9299cb3d Fix another ZHA import (#5446) 2020-04-04 17:39:40 +02:00
Pascal Vizeli
a9be870fd3 Update azure-pipelines-release.yml for Azure Pipelines 2020-04-04 13:03:31 +02:00
Pascal Vizeli
34f61fd6dc Update azure-pipelines-release.yml for Azure Pipelines 2020-04-04 13:03:14 +02:00
HomeAssistant Azure
e568e2ae21 [ci skip] Translation update 2020-04-04 00:32:42 +00:00
Pascal Vizeli
0656343a91 Update azure-pipelines-netlify.yml for Azure Pipelines 2020-04-03 18:52:44 +02:00
Paulus Schoutsen
fa2773af9b Nightly build gallery. 2020-04-03 09:48:33 -07:00
Bram Kragten
a438439ce0 Merge pull request #5436 from home-assistant/dev
20200403.0
2020-04-03 18:04:07 +02:00
Bram Kragten
da73c9d83d Bumped version to 20200403.0 2020-04-03 17:47:16 +02:00
Bram Kragten
a8f9f7ac7a Datatable fab padding (#5432)
* Add padding for fab

* Add hasFab property

* Simplify

* Remove query

* Change to empty row
2020-04-03 17:46:19 +02:00
Zack Arnett
006d989943 Edit Options: Overflow Menu Fix (#5433)
* Adds no wrap and removes top and bottom padding

* Small updates for clean up
2020-04-03 17:22:40 +02:00
Bram Kragten
82d6909957 Add rebuild to conditional and always show in edit mode (#5429) 2020-04-03 15:26:18 +02:00
Thomas Lovén
12a7fc9337 Fix outline on mouseover in firefox (#5430) 2020-04-03 15:25:53 +02:00
Bram Kragten
0241334656 Fixes for horizontal stack optimization (#5427) 2020-04-03 13:42:37 +02:00
Bram Kragten
b217291b04 Don't cache all config pages (#5428) 2020-04-03 13:42:23 +02:00
HomeAssistant Azure
aa211df0ad [ci skip] Translation update 2020-04-03 00:32:55 +00:00
Zack Arnett
8eebf51447 Card Picker: Fix Clicking cards (#5425)
* fix

* reviews
2020-04-02 17:52:43 -04:00
Zack Arnett
f5d834d130 fix (#5424) 2020-04-02 17:51:38 -04:00
Zack Arnett
0f2eae4091 Delete Card Action: Undo in Toast (#5405)
* Adding insert card and delete undo

* Fix Toast style

* Localize

* Optional

* Comments
2020-04-02 23:36:08 +02:00
David F. Mulcahey
81d2334f48 Fix element imports in ZHA config panel (#5419) 2020-04-02 20:37:33 +02:00
Bram Kragten
45384205eb Also fix for wide (#5417) 2020-04-02 17:47:20 +02:00
Bram Kragten
4150ac045d Gui editor fixes (#5416)
* Gui editor fixes

* Fix

* Add change mode button to conditional card editor
2020-04-02 17:47:01 +02:00
Bram Kragten
793a704871 Update hui-media-player-entity-row.ts 2020-04-02 17:46:07 +02:00
Bram Kragten
9e2606f1c8 Data table display fixes (#5415) 2020-04-02 16:39:59 +02:00
Bram Kragten
4c4549eb37 Merge pull request #5402 from zsarnett/shopping-card-fix
Shopping List Card: Padding Bottom
2020-04-02 11:37:07 +02:00
HomeAssistant Azure
96f7a4231b [ci skip] Translation update 2020-04-02 00:32:54 +00:00
Zack Arnett
c4cf248a1e Has header padding 2020-04-01 20:24:52 -04:00
Zack Arnett
50717b4d19 PAdding 2020-04-01 19:21:53 -04:00
Bram Kragten
da80a3896d Merge pull request #5399 from home-assistant/dev
20200401.0
2020-04-01 19:40:40 +02:00
Bram Kragten
cc374e0478 Bumped version to 20200401.0 2020-04-01 19:24:44 +02:00
Ian Richardson
26d27f8be9 ♻️ change call-service row to button row (#4744)
* ♻️ change call-service row to button row

* address comments

* cleanup

* address comments

* remove unused function

* address comments

* super

* Add CallServiceConfig back in

* Update types.ts

* Update types.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-04-01 19:18:38 +02:00
Zack Arnett
4767fcbdfc Card Editor: Add Toggle to Dialog (#5245)
* Add Toggle to dialog

* Fix for Stack Cards

* reviews

* Reviews
2020-04-01 19:17:16 +02:00
Bram Kragten
e1b48dd2a2 Always render conditional elements (#5398) 2020-04-01 19:15:48 +02:00
Zack Arnett
087492fc0b Sensor Card: Use Entity card with graph footer (#5322)
* Sensor card changes

* import move

* reviews

* Use spread Operator
2020-04-01 12:12:19 -04:00
Bram Kragten
525703d376 Add link to area on device page (#5396) 2020-04-01 17:39:07 +02:00
Bram Kragten
236bc6aefa Change user dialog (#5397)
* Change user dialog

* Update
2020-04-01 17:38:22 +02:00
Ian Richardson
ec4c29c52c add attribute row (#4723)
*  add attribute row

* accidental import

* Capitalize

* cleanup after rebase

* Update create-row-element.ts

* address comments

* address comments

* Update en.json

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-04-01 11:35:47 -04:00
Bram Kragten
d5ed1c4c41 Clean up theme settings (#5395) 2020-04-01 17:26:38 +02:00
Bram Kragten
dfe808cfb4 Show volume slider on smaller screens (#5385)
* Show volume slider on smaller screens

* Update hui-media-player-entity-row.ts

* Beter deal with unavailable and off states
2020-04-01 17:24:22 +02:00
Zack Arnett
da229d9b65 User in Markdown (#5393) 2020-04-01 11:17:52 -04:00
Zack Arnett
e54d904e4c Weather Row: Generic (#5389)
* Bye lots of hours

* Merge image states into states we have

* add space
2020-04-01 16:58:05 +02:00
Bram Kragten
2e17c96866 Add icons to integration page (#5388) 2020-04-01 11:22:40 +02:00
Ian Richardson
ddeb16463d allow a notification to have no title (#5392) 2020-04-01 11:07:15 +02:00
Ian Richardson
465efa460e handle brightness reporting while light off (#5391) 2020-04-01 11:06:58 +02:00
HomeAssistant Azure
c351402556 [ci skip] Translation update 2020-04-01 00:32:55 +00:00
Hoytron
5f765e8b96 Add feature map history (#5331)
* add feature: show a geocode history on hui-map-card

* refactor feature to use hass cache via rest api and omit osm request

* prepare for PR

* squash duplicates of allEntities to omit duplicated layers on the map

* refactor to use device_tracker entity

* add asdf's .tool-versions file to gitignore

* add lokalize and cleanup

* ajust  logic to match backend api

* add changes to fit new backend behaviour

* fix error in history ts

* cleanup history for map card
2020-03-31 14:25:44 -07:00
Zack Arnett
6f556f69d6 Weather Entity Row: Row Addition (#4959)
* Create file

* Weather Row

* Comments

* Find high and low for hourly

* Add images

* testing

* Weather images in row

* lint

* Updated design

* css changes - dont show high unless it is the high

* Clean

* Sean Suggestion

* Update hui-weather-entity-row.ts

* Reviews

* move tab index

* reviews

* Update src/panels/lovelace/entity-rows/hui-weather-entity-row.ts

Co-Authored-By: Bram Kragten <mail@bramkragten.nl>

* pretty

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-03-31 16:07:05 -04:00
Bram Kragten
2439827eff Revert "Use correct suffix for elevation" (#5382)
This reverts commit b15270dfe2.
2020-03-31 21:25:48 +02:00
Ian Richardson
5f467f82e0 media-row: fix when to show power toggle (#5379) 2020-03-31 19:49:59 +02:00
Ian Richardson
6692fa439a hold/double actions for light-card (#5361)
* hold/double actions for light-card

* lint
2020-03-31 17:52:20 +02:00
imgbot[bot]
0535247bb3 [ImgBot] Optimize images (#5378)
*Total -- 1,745.75kb -> 1,539.81kb (11.8%)

/demo/public/assets/teachingbirds/meteogram.png -- 66.71kb -> 24.48kb (63.31%)
/demo/public/assets/teachingbirds/background_square.png -- 0.76kb -> 0.37kb (51.98%)
/demo/public/assets/arsaboo/icons/security_armed_red.png -- 6.38kb -> 3.67kb (42.5%)
/demo/public/assets/jimpower/background-15.jpg -- 231.78kb -> 159.68kb (31.11%)
/public/static/images/image-broken.svg -- 0.56kb -> 0.42kb (23.99%)
/demo/public/assets/arsaboo/icons/security_disarmed.png -- 4.21kb -> 3.25kb (22.7%)
/demo/public/assets/arsaboo/icons/automation_enabled.png -- 3.96kb -> 3.08kb (22.32%)
/demo/public/assets/jimpower/cardbackK.png -- 10.56kb -> 8.21kb (22.22%)
/demo/public/assets/arsaboo/icons/abode_enabled.png -- 3.98kb -> 3.16kb (20.62%)
/demo/public/assets/arsaboo/icons/ecobee_blank.png -- 2.18kb -> 1.78kb (18.22%)
/demo/public/assets/arsaboo/floorplans/ecobee_blank.png -- 2.17kb -> 1.78kb (17.87%)
/demo/public/assets/arsaboo/icons/automation_disabled.png -- 6.89kb -> 5.73kb (16.82%)
/demo/public/assets/jimpower/home/james_10.jpg -- 73.21kb -> 61.89kb (15.46%)
/demo/public/assets/arsaboo/icons/camera_patio_streaming.png -- 11.63kb -> 9.88kb (14.98%)
/demo/public/assets/arsaboo/icons/Harmony.png -- 3.83kb -> 3.25kb (14.95%)
/demo/public/assets/arsaboo/icons/light_off.png -- 9.53kb -> 8.51kb (10.77%)
/demo/public/assets/arsaboo/icons/tv_enabled.png -- 5.48kb -> 4.90kb (10.69%)
/demo/public/assets/jimpower/home/bus_10.jpg -- 36.36kb -> 32.58kb (10.4%)
/demo/public/assets/kernehed/bella.jpg -- 33.09kb -> 30.29kb (8.44%)
/demo/public/assets/arsaboo/images/camera.backyard.jpg -- 81.15kb -> 74.80kb (7.82%)
/demo/public/assets/kernehed/oscar.jpg -- 25.32kb -> 23.34kb (7.81%)
/demo/public/assets/arsaboo/images/camera.patio.jpg -- 63.13kb -> 58.52kb (7.29%)
/demo/public/assets/arsaboo/images/camera.porch.jpg -- 76.49kb -> 70.95kb (7.25%)
/demo/public/assets/arsaboo/icons/light_on.png -- 12.03kb -> 11.19kb (6.97%)
/demo/public/assets/jimpower/home/tina_4.jpg -- 59.69kb -> 55.92kb (6.31%)
/gallery/public/images/album_cover.jpg -- 26.11kb -> 24.46kb (6.31%)
/demo/public/assets/teachingbirds/clothes_drying_square.jpg -- 31.93kb -> 29.98kb (6.11%)
/demo/public/assets/arsaboo/images/camera.driveway.jpg -- 59.47kb -> 55.84kb (6.1%)
/demo/public/assets/teachingbirds/laundry_running_square.jpg -- 58.68kb -> 55.61kb (5.22%)
/demo/public/assets/kernehed/camera.entre.jpg -- 65.84kb -> 62.49kb (5.09%)
/demo/public/assets/teachingbirds/Stefan_square.jpg -- 11.25kb -> 10.68kb (5.06%)
/demo/public/assets/teachingbirds/isa_square.jpg -- 18.90kb -> 17.98kb (4.88%)
/demo/public/assets/jimpower/security/motion_3.jpg -- 87.09kb -> 82.99kb (4.71%)
/demo/public/assets/teachingbirds/roomba_square.jpg -- 32.23kb -> 30.82kb (4.39%)
/demo/public/assets/teachingbirds/laundry_clean_2_square.jpg -- 31.87kb -> 30.48kb (4.34%)
/demo/public/assets/teachingbirds/folded_clothes_square.jpg -- 28.60kb -> 27.41kb (4.16%)
/demo/public/assets/arsaboo/icons/abode_disabled.png -- 8.74kb -> 8.38kb (4.06%)
/gallery/public/images/netflix.jpg -- 20.19kb -> 19.39kb (4%)
/demo/public/assets/teachingbirds/roomba_bw_square.jpg -- 15.97kb -> 15.34kb (3.97%)
/demo/public/assets/teachingbirds/trash_square.jpg -- 29.50kb -> 28.39kb (3.76%)
/demo/public/assets/teachingbirds/cleaning_square.jpg -- 38.57kb -> 37.19kb (3.59%)
/demo/public/assets/teachingbirds/dryer_square.jpg -- 18.78kb -> 18.16kb (3.32%)
/gallery/public/images/album_cover_2.jpg -- 129.79kb -> 125.62kb (3.21%)
/demo/public/assets/teachingbirds/House_square.jpg -- 40.59kb -> 39.31kb (3.15%)
/demo/public/assets/arsaboo/icons/tv_disabled.png -- 10.24kb -> 9.93kb (3.08%)
/demo/public/assets/teachingbirds/washer_square.jpg -- 20.52kb -> 20.00kb (2.52%)
/demo/public/assets/teachingbirds/mailbox_square.jpg -- 42.97kb -> 41.98kb (2.3%)
/demo/public/assets/teachingbirds/trash_bear_bw_square.jpg -- 17.60kb -> 17.35kb (1.46%)
/demo/public/assets/teachingbirds/guests_square.jpg -- 49.05kb -> 48.38kb (1.38%)
/demo/public/assets/teachingbirds/mailbox_bw_square.jpg -- 19.44kb -> 19.25kb (0.98%)
/demo/public/assets/arsaboo/icons/tv_on2.png -- 0.79kb -> 0.78kb (0.25%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>

Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com>
2020-03-31 16:50:20 +02:00
Thomas Lovén
a0a4fcaf5f Allow custom cards in card picker (#5122)
* Allow custom cards in card picker

* Lint. "Custom:" prefix to card names

* Address review comments

* Simplifications. Translation fixes.

* Less magic

* Move CUSTOM_TYPE_PREFIX

* Update hui-card-picker.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-03-31 16:20:09 +02:00
Zack Arnett
454d81facc View Editor: Badge Preview (#5335)
* Badge Preview

* Move Badge preview

* Clean

* Error card + clean

* remove try catch
2020-03-31 13:30:52 +02:00
Bram Kragten
0bfa8260fa Merge pull request #5372 from dmulcahey/dm/zha-tables-clear-selections
Clear selections in ZHA data tables
2020-03-31 13:25:50 +02:00
Bram Kragten
f2124f1c95 Merge pull request #5373 from zsarnett/entity-card-fix
Entity Card: Fix Value clipping in editor
2020-03-31 13:24:34 +02:00
HomeAssistant Azure
451bc2370a [ci skip] Translation update 2020-03-31 00:32:48 +00:00
Zack Arnett
0b17642c31 Fix editor value clipping 2020-03-30 20:19:18 -04:00
David Mulcahey
214dc25576 clear selections 2020-03-30 20:01:04 -04:00
Zack Arnett
158eddfd44 Entity Card: Card Addition (#4971)
* Review to changed Src translations

* Reviews

* side by side theme

* Allow user to specify unit

* Add unit back update for headerfooter and editor

* Clean

* Unavailable for attribute that doesn't exist

* fix merge

* Fix from rebasing

* reviews

* Localize State

* fix for localize

* css

* reviews

* Break the rules
2020-03-30 19:49:02 -04:00
Pascal Vizeli
5daa6dbd25 [skip ci] Simplify release pipeline 2020-03-30 22:52:27 +02:00
Pascal Vizeli
645ef3e61f [skip ci] Simplify release pipeline 2020-03-30 22:51:42 +02:00
1029 changed files with 49583 additions and 26433 deletions

View File

@@ -1,80 +0,0 @@
{
"extends": ["airbnb-base", "prettier"],
"parserOptions": {
"ecmaVersion": "2020",
"ecmaFeatures": {
"jsx": true,
"modules": true
}
},
"settings": {
"react": {
"pragma": "h",
"version": "15.0"
},
"import/resolver": {
"webpack": {
"config": "webpack.config.js"
}
}
},
"globals": {
"__DEV__": false,
"__DEMO__": false,
"__BUILD__": false,
"__VERSION__": false,
"__STATIC_PATH__": false,
"Polymer": true,
"webkitSpeechRecognition": false,
"ResizeObserver": false
},
"env": {
"browser": true,
"mocha": true
},
"rules": {
"class-methods-use-this": 0,
"new-cap": 0,
"prefer-template": 0,
"object-shorthand": 0,
"func-names": 0,
"prefer-arrow-callback": 0,
"no-underscore-dangle": 0,
"no-var": 0,
"strict": 0,
"prefer-spread": 0,
"no-plusplus": 0,
"no-bitwise": 0,
"comma-dangle": 0,
"vars-on-top": 0,
"no-continue": 0,
"no-param-reassign": 0,
"no-multi-assign": 0,
"radix": 0,
"no-alert": 0,
"no-return-await": 0,
"prefer-destructuring": 0,
"no-restricted-globals": [2, "event"],
"prefer-promise-reject-errors": 0,
"import/prefer-default-export": 0,
"import/no-unresolved": 0,
"import/extensions": [2, "ignorePackages"],
"object-curly-newline": 0,
"default-case": 0,
"react/jsx-no-bind": [2, { "ignoreRefs": true }],
"react/jsx-no-duplicate-props": 2,
"react/self-closing-comp": 2,
"react/prefer-es6-class": 2,
"react/no-string-refs": 2,
"react/require-render-return": 2,
"react/no-find-dom-node": 2,
"react/no-is-mounted": 2,
"react/jsx-no-comment-textnodes": 2,
"react/jsx-no-undef": 2,
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"no-restricted-syntax": [0, "ForOfStatement"],
"prettier/prettier": "error"
},
"plugins": ["react", "prettier"]
}

View File

@@ -1,12 +1,88 @@
{
"extends": "./.eslintrc-hound.json",
"plugins": ["react"],
"extends": [
"plugin:@typescript-eslint/recommended",
"airbnb-typescript/base",
"plugin:wc/recommended",
"plugin:lit/recommended",
"prettier",
"prettier/@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"ecmaFeatures": {
"modules": true
},
"sourceType": "module",
"project": "./tsconfig.json"
},
"settings": {
"import/resolver": {
"webpack": {
"config": "./webpack.config.js"
}
}
},
"globals": {
"__DEV__": false,
"__DEMO__": false,
"__BUILD__": false,
"__VERSION__": false,
"__STATIC_PATH__": false,
"Polymer": true,
"webkitSpeechRecognition": false,
"ResizeObserver": false
},
"env": {
"browser": true
"browser": true,
"es6": true
},
"rules": {
"import/no-unresolved": 2,
"linebreak-style": 0,
"implicit-arrow-linebreak": 0
}
"class-methods-use-this": 0,
"new-cap": 0,
"prefer-template": 0,
"object-shorthand": 0,
"func-names": 0,
"prefer-arrow-callback": 0,
"no-underscore-dangle": 0,
"no-var": 0,
"strict": 0,
"prefer-spread": 0,
"no-plusplus": 0,
"no-bitwise": 0,
"comma-dangle": 0,
"vars-on-top": 0,
"no-continue": 0,
"no-param-reassign": 0,
"no-multi-assign": 0,
"radix": 0,
"no-alert": 0,
"no-return-await": 0,
"no-nested-ternary": 0,
"prefer-destructuring": 0,
"no-restricted-globals": [2, "event"],
"prefer-promise-reject-errors": 0,
"import/order": 0,
"import/prefer-default-export": 0,
"import/no-unresolved": 0,
"import/no-cycle": 0,
"import/extensions": [
2,
"ignorePackages",
{ "ts": "never", "js": "never" }
],
"no-restricted-syntax": ["error", "LabeledStatement", "WithStatement"],
"object-curly-newline": 0,
"default-case": 0,
"wc/no-self-class": 0,
"@typescript-eslint/camelcase": 0,
"@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/no-use-before-define": 0,
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/explicit-function-return-type": 0
},
"plugins": ["disable", "import", "lit", "prettier", "@typescript-eslint"],
"processor": "disable/disable"
}

View File

@@ -62,6 +62,18 @@ DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed w
- Browser and browser version:
- Operating system:
## State of relevant entities
<!--
If your issue is about how an entity is shown in the UI, please add the state
and attributes for all situations with a screenshot of the UI.
You can find this information at `/developer-tools/state`
-->
```yaml
```
## Problem-relevant configuration
<!--

View File

@@ -3,23 +3,24 @@ name: Request a feature for the UI, Frontend or Lovelace
about: Request an new feature for the Home Assistant frontend.
labels: feature request
---
<!--
DO NOT DELETE ANY TEXT from this template!
Otherwise, your request may be closed without comment.
-->
## The request
<!--
<!--
Describe to our maintainers, the feature you would like to be added.
Please be clear and concise and, if possible, provide a screenshot or mockup.
-->
## The alternatives
<!--
Are you currently using, or have you considered alternatives?
If so, could you please describe those?
-->
## Additional information

View File

@@ -2,7 +2,9 @@
You are amazing! Thanks for contributing to our project!
Please, DO NOT DELETE ANY TEXT from this template! (unless instructed).
-->
## Breaking change
<!--
If your PR contains a breaking change for existing users, it is important
to tell them what breaks, how to make it work again and why we did this.
@@ -11,20 +13,20 @@
Note: Remove this section if this PR is NOT a breaking change.
-->
## Proposed change
<!--
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
## Type of change
<!--
What type of change does your PR introduce to the Home Assistant frontend?
NOTE: Please, check only 1! box!
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
@@ -36,6 +38,7 @@
- [ ] Code quality improvements to existing code or addition of tests
## Example configuration
<!--
Supplying a configuration snippet, makes it easier for a maintainer to test
your PR.
@@ -46,16 +49,18 @@
```
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request:
- This PR is related to issue:
- Link to documentation pull request:
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
@@ -74,4 +79,5 @@ If user exposed functionality or configuration variables are added/changed:
<!--
Thank you for contributing <3
-->
[docs-repository]: https://github.com/home-assistant/home-assistant.io

2
.github/lock.yml vendored
View File

@@ -24,4 +24,4 @@ only: pulls
# Optionally, specify configuration settings just for `issues` or `pulls`
issues:
daysUntilLock: 30
daysUntilLock: 30

View File

@@ -35,13 +35,11 @@ jobs:
env:
CI: true
- name: Build icons
run: ./node_modules/.bin/gulp gen-icons-hassio gen-icons-mdi gen-icons-app
run: ./node_modules/.bin/gulp gen-icons-json
- name: Build translations
run: ./node_modules/.bin/gulp build-translations
- name: Run eslint
run: ./node_modules/.bin/eslint src hassio/src gallery/src
- name: Run tslint
run: ./node_modules/.bin/tslint 'src/**/*.ts' 'hassio/src/**/*.ts' 'gallery/src/**/*.ts' 'cast/src/**/*.ts' 'test-mocha/**/*.ts'
run: ./node_modules/.bin/eslint '{**/src,src}/**/*.{js,ts,html}' --ignore-path .gitignore
- name: Run tsc
run: ./node_modules/.bin/tsc
test:
@@ -96,7 +94,7 @@ jobs:
- name: Build Application
run: ./node_modules/.bin/gulp build-app
env:
TRAVIS: "true"
IS_TEST: "true"
supervisor:
runs-on: ubuntu-latest
needs: [lint, test]
@@ -124,4 +122,4 @@ jobs:
- name: Build Application
run: ./node_modules/.bin/gulp build-hassio
env:
TRAVIS: "true"
IS_TEST: "true"

4
.gitignore vendored
View File

@@ -5,7 +5,6 @@ npm-debug.log
.DS_Store
hass_frontend/*
.reify-cache
demo/hademo-icons.html
# Python stuff
*.py[cod]
@@ -31,3 +30,6 @@ src/cast/dev_const.ts
# Secrets
.lokalise_token
yarn-error.log
#asdf
.tool-versions

10
.prettierignore Normal file
View File

@@ -0,0 +1,10 @@
build
build-translations/*
translations/*
node_modules/*
hass_frontend/*
pip-selfcheck.json
# vscode
.vscode/*
!.vscode/extensions.json

View File

@@ -1,7 +1,6 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"ms-vscode.vscode-typescript-tslint-plugin",
"esbenp.prettier-vscode",
"bierner.lit-html",
"runem.lit-plugin"

View File

@@ -6,12 +6,12 @@ This is the repository for the official [Home Assistant](https://home-assistant.
- [View demo of Home Assistant](https://demo.home-assistant.io/)
- [More information about Home Assistant](https://home-assistant.io)
- [Frontend development instructions](https://developers.home-assistant.io/docs/en/frontend_index.html)
- [Frontend development instructions](https://developers.home-assistant.io/docs/frontend/development/)
## Development
- Initial setup: `script/setup`
- Development: [Instructions](https://developers.home-assistant.io/docs/en/frontend_development.html)
- Development: [Instructions](https://developers.home-assistant.io/docs/frontend/development/)
- Production build: `script/build_frontend`
- Gallery: `cd gallery && script/develop_gallery`
- Hass.io: [Instructions](https://developers.home-assistant.io/docs/en/hassio_hass.html)

View File

@@ -8,7 +8,7 @@ schedules:
branches:
include:
- dev
always: false
always: true
variables:
- group: netlify
@@ -24,4 +24,7 @@ jobs:
# Demo
curl -X POST -d {} https://api.netlify.com/build_hooks/${NETLIFY_DEMO}
# Gallery
curl -X POST -d {} https://api.netlify.com/build_hooks/${NETLIFY_GALLERY}
displayName: 'Trigger netlify build preview'

View File

@@ -47,18 +47,13 @@ stages:
script/release
displayName: "Build and release package"
- stage: "Wheels"
jobs:
- template: templates/azp-job-wheels.yaml@azure
parameters:
builderVersion: '$(versionWheels)'
builderApk: 'build-base'
wheelsLocal: true
wheelsRequirement: 'requirement.txt'
preBuild:
- task: NodeTool@0
displayName: "Use Node $(versionNode)"
inputs:
versionSpec: "$(versionNode)"
- script: |
set -e
yarn install
script/build_frontend
sleep 240
echo "home-assistant-frontend==$(Build.SourceBranchName)" > requirement.txt

View File

@@ -1,50 +1,39 @@
const options = ({ latestBuild }) => ({
presets: [
!latestBuild && [require("@babel/preset-env").default, { modules: false }],
require("@babel/preset-typescript").default,
].filter(Boolean),
plugins: [
// Part of ES2018. Converts {...a, b: 2} to Object.assign({}, a, {b: 2})
[
"@babel/plugin-proposal-object-rest-spread",
{ loose: true, useBuiltIns: true },
],
// Only support the syntax, Webpack will handle it.
"@babel/syntax-dynamic-import",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator",
[
require("@babel/plugin-proposal-decorators").default,
{ decoratorsBeforeExport: true },
],
[
require("@babel/plugin-proposal-class-properties").default,
{ loose: true },
],
],
});
module.exports.babelLoaderConfig = ({ latestBuild }) => {
if (latestBuild === undefined) {
throw Error("latestBuild not defined for babel loader config");
}
return {
test: /\.m?js$|\.tsx?$/,
exclude: [require.resolve("@mdi/js/mdi.js"), require.resolve("hls.js")],
use: {
loader: "babel-loader",
options: {
presets: [
!latestBuild && [
require("@babel/preset-env").default,
{ modules: false },
],
[
require("@babel/preset-typescript").default,
{
jsxPragma: "h",
},
],
].filter(Boolean),
plugins: [
// Part of ES2018. Converts {...a, b: 2} to Object.assign({}, a, {b: 2})
[
"@babel/plugin-proposal-object-rest-spread",
{ loose: true, useBuiltIns: true },
],
// Only support the syntax, Webpack will handle it.
"@babel/syntax-dynamic-import",
[
"@babel/transform-react-jsx",
{
pragma: "h",
},
],
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator",
[
require("@babel/plugin-proposal-decorators").default,
{ decoratorsBeforeExport: true },
],
[
require("@babel/plugin-proposal-class-properties").default,
{ loose: true },
],
],
},
options: options({ latestBuild }),
},
};
};

View File

@@ -1,3 +1,7 @@
const fs = require("fs");
const path = require("path");
const paths = require("./paths.js");
module.exports = {
isProdBuild() {
return process.env.NODE_ENV === "production";
@@ -5,10 +9,19 @@ module.exports = {
isStatsBuild() {
return process.env.STATS === "1";
},
isTravis() {
return process.env.TRAVIS === "true";
isTest() {
return process.env.IS_TEST === "true";
},
isNetlify() {
return process.env.NETLIFY === "true";
},
version() {
const version = fs
.readFileSync(path.resolve(paths.polymer_dir, "setup.py"), "utf8")
.match(/\d{8}\.\d+/);
if (!version) {
throw Error("Version not found");
}
return version[0];
},
};

View File

@@ -5,7 +5,7 @@ const envVars = require("../env");
require("./clean.js");
require("./translations.js");
require("./gen-icons.js");
require("./gen-icons-json.js");
require("./gather-static.js");
require("./compress.js");
require("./webpack.js");
@@ -20,8 +20,8 @@ gulp.task(
},
"clean",
gulp.parallel(
"gen-service-worker-dev",
gulp.parallel("gen-icons-app", "gen-icons-mdi"),
"gen-service-worker-app-dev",
"gen-icons-json",
"gen-pages-dev",
"gen-index-app-dev",
"build-translations"
@@ -38,15 +38,15 @@ gulp.task(
process.env.NODE_ENV = "production";
},
"clean",
gulp.parallel("gen-icons-app", "gen-icons-mdi", "build-translations"),
gulp.parallel("gen-icons-json", "build-translations"),
"copy-static",
"webpack-prod-app",
...// Don't compress running tests
(envVars.isTravis() ? [] : ["compress-app"]),
(envVars.isTest() ? [] : ["compress-app"]),
gulp.parallel(
"gen-pages-prod",
"gen-index-app-prod",
"gen-service-worker-prod"
"gen-service-worker-app-prod"
)
)
);

View File

@@ -2,7 +2,6 @@ const gulp = require("gulp");
require("./clean.js");
require("./translations.js");
require("./gen-icons.js");
require("./gather-static.js");
require("./webpack.js");
require("./service-worker.js");
@@ -15,12 +14,8 @@ gulp.task(
process.env.NODE_ENV = "development";
},
"clean-cast",
gulp.parallel(
"gen-icons-app",
"gen-icons-mdi",
"gen-index-cast-dev",
"build-translations"
),
"translations-enable-merge-backend",
gulp.parallel("gen-icons-json", "build-translations"),
"copy-static-cast",
"webpack-dev-server-cast"
)
@@ -33,7 +28,8 @@ gulp.task(
process.env.NODE_ENV = "production";
},
"clean-cast",
gulp.parallel("gen-icons-app", "gen-icons-mdi", "build-translations"),
"translations-enable-merge-backend",
gulp.parallel("gen-icons-json", "build-translations"),
"copy-static-cast",
"webpack-prod-cast",
"gen-index-cast-prod"

View File

@@ -9,25 +9,30 @@ const paths = require("../paths");
gulp.task("compress-app", function compressApp() {
const jsLatest = gulp
.src(path.resolve(paths.output, "**/*.js"))
.pipe(zopfli())
.pipe(zopfli({ threshold: 150 }))
.pipe(gulp.dest(paths.output));
const jsEs5 = gulp
.src(path.resolve(paths.output_es5, "**/*.js"))
.pipe(zopfli())
.pipe(zopfli({ threshold: 150 }))
.pipe(gulp.dest(paths.output_es5));
const polyfills = gulp
.src(path.resolve(paths.static, "polyfills/*.js"))
.pipe(zopfli())
.pipe(zopfli({ threshold: 150 }))
.pipe(gulp.dest(path.resolve(paths.static, "polyfills")));
const translations = gulp
.src(path.resolve(paths.static, "translations/*.json"))
.pipe(zopfli())
.src(path.resolve(paths.static, "translations/**/*.json"))
.pipe(zopfli({ threshold: 150 }))
.pipe(gulp.dest(path.resolve(paths.static, "translations")));
return merge(jsLatest, jsEs5, polyfills, translations);
const icons = gulp
.src(path.resolve(paths.static, "mdi/*.json"))
.pipe(zopfli({ threshold: 150 }))
.pipe(gulp.dest(path.resolve(paths.static, "mdi")));
return merge(jsLatest, jsEs5, polyfills, translations, icons);
});
gulp.task("compress-hassio", function compressApp() {

View File

@@ -3,7 +3,7 @@ const gulp = require("gulp");
require("./clean.js");
require("./translations.js");
require("./gen-icons.js");
require("./gen-icons-json.js");
require("./gather-static.js");
require("./webpack.js");
require("./service-worker.js");
@@ -16,13 +16,8 @@ gulp.task(
process.env.NODE_ENV = "development";
},
"clean-demo",
gulp.parallel(
"gen-icons-app",
"gen-icons-mdi",
"gen-icons-demo",
"gen-index-demo-dev",
"build-translations"
),
"translations-enable-merge-backend",
gulp.parallel("gen-icons-json", "gen-index-demo-dev", "build-translations"),
"copy-static-demo",
"webpack-dev-server-demo"
)
@@ -35,12 +30,9 @@ gulp.task(
process.env.NODE_ENV = "production";
},
"clean-demo",
gulp.parallel(
"gen-icons-app",
"gen-icons-mdi",
"gen-icons-demo",
"build-translations"
),
// Cast needs to be backwards compatible and older HA has no translations
"translations-enable-merge-backend",
gulp.parallel("gen-icons-json", "build-translations"),
"copy-static-demo",
"webpack-prod-demo",
"gen-index-demo-prod"

View File

@@ -1,9 +1,14 @@
const del = require("del");
const gulp = require("gulp");
const fs = require("fs");
const mapStream = require("map-stream");
const inDir = "translations";
const downloadDir = inDir + "/downloads";
const inDirFrontend = "translations/frontend";
const inDirBackend = "translations/backend";
const downloadDir = "translations/downloads";
const srcMeta = "src/translations/translationMetadata.json";
const encoding = "utf8";
const tasks = [];
@@ -12,7 +17,7 @@ function hasHtml(data) {
}
function recursiveCheckHasHtml(file, data, errors, recKey) {
Object.keys(data).forEach(function(key) {
Object.keys(data).forEach(function (key) {
if (typeof data[key] === "object") {
const nextRecKey = recKey ? `${recKey}.${key}` : key;
recursiveCheckHasHtml(file, data[key], errors, nextRecKey);
@@ -25,7 +30,7 @@ function recursiveCheckHasHtml(file, data, errors, recKey) {
function checkHtml() {
const errors = [];
return mapStream(function(file, cb) {
return mapStream(function (file, cb) {
const content = file.contents;
let error;
if (content) {
@@ -42,20 +47,36 @@ function checkHtml() {
}
let taskName = "clean-downloaded-translations";
gulp.task(taskName, function() {
gulp.task(taskName, function () {
return del([`${downloadDir}/**`]);
});
tasks.push(taskName);
taskName = "check-translations-html";
gulp.task(taskName, function() {
gulp.task(taskName, function () {
return gulp.src(`${downloadDir}/*.json`).pipe(checkHtml());
});
tasks.push(taskName);
taskName = "check-all-files-exist";
gulp.task(taskName, function () {
const file = fs.readFileSync(srcMeta, { encoding });
const meta = JSON.parse(file);
Object.keys(meta).forEach((lang) => {
if (!fs.existsSync(`${inDirFrontend}/${lang}.json`)) {
fs.writeFileSync(`${inDirFrontend}/${lang}.json`, JSON.stringify({}));
}
if (!fs.existsSync(`${inDirBackend}/${lang}.json`)) {
fs.writeFileSync(`${inDirBackend}/${lang}.json`, JSON.stringify({}));
}
});
return Promise.resolve();
});
tasks.push(taskName);
taskName = "move-downloaded-translations";
gulp.task(taskName, function() {
return gulp.src(`${downloadDir}/*.json`).pipe(gulp.dest(inDir));
gulp.task(taskName, function () {
return gulp.src(`${downloadDir}/*.json`).pipe(gulp.dest(inDirFrontend));
});
tasks.push(taskName);
@@ -65,6 +86,7 @@ gulp.task(
gulp.series(
"check-translations-html",
"move-downloaded-translations",
"check-all-files-exist",
"clean-downloaded-translations"
)
);

View File

@@ -47,11 +47,9 @@ gulp.task("gen-pages-dev", (done) => {
for (const page of PAGES) {
const content = renderTemplate(page, {
latestPageJS: `/frontend_latest/${page}.js`,
latestHassIconsJS: "/frontend_latest/hass-icons.js",
es5Compatibility: "/frontend_es5/compatibility.js",
es5PageJS: `/frontend_es5/${page}.js`,
es5HassIconsJS: "/frontend_es5/hass-icons.js",
});
fs.outputFileSync(path.resolve(config.root, `${page}.html`), content);
@@ -66,11 +64,9 @@ gulp.task("gen-pages-prod", (done) => {
for (const page of PAGES) {
const content = renderTemplate(page, {
latestPageJS: latestManifest[`${page}.js`],
latestHassIconsJS: latestManifest["hass-icons.js"],
es5Compatibility: es5Manifest["compatibility.js"],
es5PageJS: es5Manifest[`${page}.js`],
es5HassIconsJS: es5Manifest["hass-icons.js"],
});
fs.outputFileSync(
@@ -88,13 +84,11 @@ gulp.task("gen-index-app-dev", (done) => {
latestAppJS: "/frontend_latest/app.js",
latestCoreJS: "/frontend_latest/core.js",
latestCustomPanelJS: "/frontend_latest/custom-panel.js",
latestHassIconsJS: "/frontend_latest/hass-icons.js",
es5Compatibility: "/frontend_es5/compatibility.js",
es5AppJS: "/frontend_es5/app.js",
es5CoreJS: "/frontend_es5/core.js",
es5CustomPanelJS: "/frontend_es5/custom-panel.js",
es5HassIconsJS: "/frontend_es5/hass-icons.js",
}).replace(/#THEMEC/g, "{{ theme_color }}");
fs.outputFileSync(path.resolve(config.root, "index.html"), content);
@@ -108,13 +102,11 @@ gulp.task("gen-index-app-prod", (done) => {
latestAppJS: latestManifest["app.js"],
latestCoreJS: latestManifest["core.js"],
latestCustomPanelJS: latestManifest["custom-panel.js"],
latestHassIconsJS: latestManifest["hass-icons.js"],
es5Compatibility: es5Manifest["compatibility.js"],
es5AppJS: es5Manifest["app.js"],
es5CoreJS: es5Manifest["core.js"],
es5CustomPanelJS: es5Manifest["custom-panel.js"],
es5HassIconsJS: es5Manifest["hass-icons.js"],
});
const minified = minifyHtml(content).replace(/#THEMEC/g, "{{ theme_color }}");
@@ -222,7 +214,7 @@ gulp.task("gen-index-gallery-dev", (done) => {
// In dev mode we don't mangle names, so we hardcode urls. That way we can
// run webpack as last in watch mode, which blocks output.
const content = renderGalleryTemplate("index", {
latestGalleryJS: "./entrypoint.js",
latestGalleryJS: "./frontend_latest/entrypoint.js",
});
fs.outputFileSync(path.resolve(config.gallery_root, "index.html"), content);

View File

@@ -3,7 +3,7 @@ const gulp = require("gulp");
require("./clean.js");
require("./translations.js");
require("./gen-icons.js");
require("./gen-icons-json.js");
require("./gather-static.js");
require("./webpack.js");
require("./service-worker.js");
@@ -16,7 +16,8 @@ gulp.task(
process.env.NODE_ENV = "development";
},
"clean-gallery",
gulp.parallel("gen-icons-app", "gen-icons-mdi", "build-translations"),
"translations-enable-merge-backend",
gulp.parallel("gen-icons-json", "build-translations"),
"copy-static-gallery",
"gen-index-gallery-dev",
"webpack-dev-server-gallery"
@@ -30,7 +31,8 @@ gulp.task(
process.env.NODE_ENV = "production";
},
"clean-gallery",
gulp.parallel("gen-icons-app", "gen-icons-mdi", "build-translations"),
"translations-enable-merge-backend",
gulp.parallel("gen-icons-json", "build-translations"),
"copy-static-gallery",
"webpack-prod-gallery",
"gen-index-gallery-prod"

View File

@@ -26,6 +26,13 @@ function copyTranslations(staticDir) {
);
}
function copyMdiIcons(staticDir) {
const staticPath = genStaticPath(staticDir);
// MDI icons output
fs.copySync(polyPath("build/mdi"), staticPath("mdi"));
}
function copyPolyfills(staticDir) {
const staticPath = genStaticPath(staticDir);
@@ -73,19 +80,15 @@ gulp.task("copy-translations", (done) => {
gulp.task("copy-static", (done) => {
const staticDir = paths.static;
const staticPath = genStaticPath(paths.static);
// Basic static files
fs.copySync(polyPath("public"), paths.root);
copyPolyfills(staticDir);
copyFonts(staticDir);
copyTranslations(staticDir);
copyMdiIcons(staticDir);
// Panel assets
copyFileDir(
npmPath("react-big-calendar/lib/css/react-big-calendar.css"),
staticPath("panels/calendar/")
);
copyMapPanel(staticDir);
done();
});
@@ -103,6 +106,7 @@ gulp.task("copy-static-demo", (done) => {
copyMapPanel(paths.demo_static);
copyFonts(paths.demo_static);
copyTranslations(paths.demo_static);
copyMdiIcons(paths.demo_static);
done();
});
@@ -115,6 +119,7 @@ gulp.task("copy-static-cast", (done) => {
copyMapPanel(paths.cast_static);
copyFonts(paths.cast_static);
copyTranslations(paths.cast_static);
copyMdiIcons(paths.cast_static);
done();
});
@@ -127,5 +132,6 @@ gulp.task("copy-static-gallery", (done) => {
copyMapPanel(paths.gallery_static);
copyFonts(paths.gallery_static);
copyTranslations(paths.gallery_static);
copyMdiIcons(paths.gallery_static);
done();
});

View File

@@ -0,0 +1,112 @@
const gulp = require("gulp");
const path = require("path");
const fs = require("fs");
const hash = require("object-hash");
const ICON_PACKAGE_PATH = path.resolve(
__dirname,
"../../node_modules/@mdi/svg/"
);
const META_PATH = path.resolve(ICON_PACKAGE_PATH, "meta.json");
const PACKAGE_PATH = path.resolve(ICON_PACKAGE_PATH, "package.json");
const ICON_PATH = path.resolve(ICON_PACKAGE_PATH, "svg");
const OUTPUT_DIR = path.resolve(__dirname, "../../build/mdi");
const encoding = "utf8";
const getMeta = () => {
const file = fs.readFileSync(META_PATH, { encoding });
const meta = JSON.parse(file);
return meta.map((icon) => {
const svg = fs.readFileSync(`${ICON_PATH}/${icon.name}.svg`, {
encoding,
});
return { path: svg.match(/ d="([^"]+)"/)[1], name: icon.name };
});
};
const splitBySize = (meta) => {
const chunks = [];
const CHUNK_SIZE = 50000;
let curSize = 0;
let startKey;
let icons = [];
Object.values(meta).forEach((icon) => {
if (startKey === undefined) {
startKey = icon.name;
}
curSize += icon.path.length;
icons.push(icon);
if (curSize > CHUNK_SIZE) {
chunks.push({
startKey,
endKey: icon.name,
icons,
});
curSize = 0;
startKey = undefined;
icons = [];
}
});
chunks.push({
startKey,
icons,
});
return chunks;
};
const findDifferentiator = (curString, prevString) => {
for (let i = 0; i < curString.length; i++) {
if (curString[i] !== prevString[i]) {
return curString.substring(0, i + 1);
}
}
throw new Error("Cannot find differentiator", curString, prevString);
};
gulp.task("gen-icons-json", (done) => {
const meta = getMeta();
const split = splitBySize(meta);
if (!fs.existsSync(OUTPUT_DIR)) {
fs.mkdirSync(OUTPUT_DIR, { recursive: true });
}
const parts = [];
let lastEnd;
split.forEach((chunk) => {
let startKey;
if (lastEnd === undefined) {
chunk.startKey = undefined;
startKey = undefined;
} else {
startKey = findDifferentiator(chunk.startKey, lastEnd);
}
lastEnd = chunk.endKey;
const output = {};
chunk.icons.forEach((icon) => {
output[icon.name] = icon.path;
});
const filename = hash(output);
parts.push({ start: startKey, file: filename });
fs.writeFileSync(
path.resolve(OUTPUT_DIR, `${filename}.json`),
JSON.stringify(output)
);
});
const file = fs.readFileSync(PACKAGE_PATH, { encoding });
const package = JSON.parse(file);
fs.writeFileSync(
path.resolve(OUTPUT_DIR, "iconMetadata.json"),
JSON.stringify({ version: package.version, parts })
);
done();
});

View File

@@ -1,127 +0,0 @@
const gulp = require("gulp");
const path = require("path");
const fs = require("fs");
const paths = require("../paths");
const { mapFiles } = require("../util");
const ICON_PACKAGE_PATH = path.resolve(
__dirname,
"../../node_modules/@mdi/svg/"
);
const META_PATH = path.resolve(ICON_PACKAGE_PATH, "meta.json");
const ICON_PATH = path.resolve(ICON_PACKAGE_PATH, "svg");
const OUTPUT_DIR = path.resolve(__dirname, "../../build");
const MDI_OUTPUT_PATH = path.resolve(OUTPUT_DIR, "mdi.html");
const HASS_OUTPUT_PATH = path.resolve(OUTPUT_DIR, "hass-icons.html");
const BUILT_IN_PANEL_ICONS = [
"calendar", // Calendar
"settings", // Config
"home-assistant", // Hass.io
"poll-box", // History panel
"format-list-bulleted-type", // Logbook
"mailbox", // Mailbox
"tooltip-account", // Map
"cart", // Shopping List
"hammer", // developer-tools
];
// Given an icon name, load the SVG file
function loadIcon(name) {
const iconPath = path.resolve(ICON_PATH, `${name}.svg`);
try {
return fs.readFileSync(iconPath, "utf-8");
} catch (err) {
return null;
}
}
// Given an SVG file, convert it to an iron-iconset-svg definition
function transformXMLtoPolymer(name, xml) {
const start = xml.indexOf("><path") + 1;
const end = xml.length - start - 6;
const pth = xml.substr(start, end);
return `<g id="${name}">${pth}</g>`;
}
// Given an iconset name and icon names, generate a polymer iconset
function generateIconset(iconsetName, iconNames) {
const iconDefs = Array.from(iconNames)
.map((name) => {
const iconDef = loadIcon(name);
if (!iconDef) {
throw new Error(`Unknown icon referenced: ${name}`);
}
return transformXMLtoPolymer(name, iconDef);
})
.join("");
return `<ha-iconset-svg name="${iconsetName}" size="24"><svg><defs>${iconDefs}</defs></svg></ha-iconset-svg>`;
}
// Find all icons used by the project.
function findIcons(searchPath, iconsetName) {
const iconRegex = new RegExp(`${iconsetName}:[\\w-]+`, "g");
const icons = new Set();
function processFile(filename) {
const content = fs.readFileSync(filename);
let match;
// eslint-disable-next-line
while ((match = iconRegex.exec(content))) {
// strip off "hass:" and add to set
icons.add(match[0].substr(iconsetName.length + 1));
}
}
mapFiles(searchPath, ".js", processFile);
mapFiles(searchPath, ".ts", processFile);
return icons;
}
gulp.task("gen-icons-mdi", (done) => {
const meta = JSON.parse(
fs.readFileSync(path.resolve(ICON_PACKAGE_PATH, META_PATH), "UTF-8")
);
const iconNames = meta.map((iconInfo) => iconInfo.name);
if (!fs.existsSync(OUTPUT_DIR)) {
fs.mkdirSync(OUTPUT_DIR);
}
fs.writeFileSync(MDI_OUTPUT_PATH, generateIconset("mdi", iconNames));
done();
});
gulp.task("gen-icons-app", (done) => {
const iconNames = findIcons("./src", "hass");
BUILT_IN_PANEL_ICONS.forEach((name) => iconNames.add(name));
if (!fs.existsSync(OUTPUT_DIR)) {
fs.mkdirSync(OUTPUT_DIR);
}
fs.writeFileSync(HASS_OUTPUT_PATH, generateIconset("hass", iconNames));
done();
});
gulp.task("gen-icons-demo", (done) => {
const iconNames = findIcons(path.resolve(paths.demo_dir, "./src"), "hademo");
fs.writeFileSync(
path.resolve(paths.demo_dir, "hademo-icons.html"),
generateIconset("hademo", iconNames)
);
done();
});
gulp.task("gen-icons-hassio", (done) => {
const iconNames = findIcons(
path.resolve(paths.hassio_dir, "./src"),
"hassio"
);
// Find hassio icons inside HA main repo.
for (const item of findIcons(
path.resolve(paths.polymer_dir, "./src"),
"hassio"
)) {
iconNames.add(item);
}
fs.writeFileSync(
path.resolve(paths.hassio_dir, "hassio-icons.html"),
generateIconset("hassio", iconNames)
);
done();
});

View File

@@ -3,7 +3,7 @@ const gulp = require("gulp");
const envVars = require("../env");
require("./clean.js");
require("./gen-icons.js");
require("./gen-icons-json.js");
require("./webpack.js");
require("./compress.js");
@@ -14,7 +14,7 @@ gulp.task(
process.env.NODE_ENV = "development";
},
"clean-hassio",
gulp.parallel("gen-icons-hassio", "gen-icons-mdi"),
"gen-icons-json",
"webpack-watch-hassio"
)
);
@@ -26,9 +26,9 @@ gulp.task(
process.env.NODE_ENV = "production";
},
"clean-hassio",
gulp.parallel("gen-icons-hassio", "gen-icons-mdi"),
"gen-icons-json",
"webpack-prod-hassio",
...// Don't compress running tests
(envVars.isTravis() ? [] : ["compress-hassio"])
(envVars.isTest() ? [] : ["compress-hassio"])
)
);

View File

@@ -5,18 +5,22 @@
const gulp = require("gulp");
const path = require("path");
const fs = require("fs-extra");
const config = require("../paths.js");
const workboxBuild = require("workbox-build");
const sourceMapUrl = require("source-map-url");
const paths = require("../paths.js");
const swPath = path.resolve(config.root, "service_worker.js");
const swDest = path.resolve(paths.root, "service_worker.js");
const writeSW = (content) => fs.outputFileSync(swPath, content.trim() + "\n");
const writeSW = (content) => fs.outputFileSync(swDest, content.trim() + "\n");
gulp.task("gen-service-worker-dev", (done) => {
gulp.task("gen-service-worker-app-dev", (done) => {
writeSW(
`
console.debug('Service worker disabled in development');
self.addEventListener('install', (event) => {
// This will activate the dev service worker,
// removing any prod service worker the dev might have running
self.skipWaiting();
});
`
@@ -24,10 +28,63 @@ self.addEventListener('install', (event) => {
done();
});
gulp.task("gen-service-worker-prod", (done) => {
fs.copySync(
path.resolve(config.output, "service_worker.js"),
path.resolve(config.root, "service_worker.js")
gulp.task("gen-service-worker-app-prod", async () => {
// Read bundled source file
const bundleManifestLatest = require(path.resolve(
paths.output,
"manifest.json"
));
let serviceWorkerContent = fs.readFileSync(
paths.root + bundleManifestLatest["service_worker.js"],
"utf-8"
);
done();
// Delete old file from frontend_latest so manifest won't pick it up
fs.removeSync(paths.root + bundleManifestLatest["service_worker.js"]);
fs.removeSync(paths.root + bundleManifestLatest["service_worker.js.map"]);
// Remove ES5
const bundleManifestES5 = require(path.resolve(
paths.output_es5,
"manifest.json"
));
fs.removeSync(paths.root + bundleManifestES5["service_worker.js"]);
fs.removeSync(paths.root + bundleManifestES5["service_worker.js.map"]);
const workboxManifest = await workboxBuild.getManifest({
// Files that mach this pattern will be considered unique and skip revision check
// ignore JS files + translation files
dontCacheBustURLsMatching: /(frontend_latest\/.+|static\/translations\/.+)/,
globDirectory: paths.root,
globPatterns: [
"frontend_latest/*.js",
// Cache all English translations because we catch them as fallback
// Using pattern to match hash instead of * to avoid caching en-GB
// 'v' added as valid hash letter because in dev we hash with 'dev'
"static/translations/**/en-+([a-fv0-9]).json",
// Icon shown on splash screen
"static/icons/favicon-192x192.png",
"static/icons/favicon.ico",
// Common fonts
"static/fonts/roboto/Roboto-Light.woff2",
"static/fonts/roboto/Roboto-Medium.woff2",
"static/fonts/roboto/Roboto-Regular.woff2",
"static/fonts/roboto/Roboto-Bold.woff2",
],
});
for (const warning of workboxManifest.warnings) {
console.warn(warning);
}
// remove source map and add WB manifest
serviceWorkerContent = sourceMapUrl.removeFrom(serviceWorkerContent);
serviceWorkerContent = serviceWorkerContent.replace(
"WB_MANIFEST",
JSON.stringify(workboxManifest.manifestEntries)
);
// Write new file to root
fs.writeFileSync(swDest, serviceWorkerContent);
});

View File

@@ -14,13 +14,20 @@ const { mapFiles } = require("../util");
const env = require("../env");
const paths = require("../paths");
const inDir = "translations";
const inFrontendDir = "translations/frontend";
const inBackendDir = "translations/backend";
const workDir = "build-translations";
const fullDir = workDir + "/full";
const coreDir = workDir + "/core";
const outDir = workDir + "/output";
let mergeBackend = false;
String.prototype.rsplit = function(sep, maxsplit) {
gulp.task("translations-enable-merge-backend", (done) => {
mergeBackend = true;
done();
});
String.prototype.rsplit = function (sep, maxsplit) {
var split = this.split(sep);
return maxsplit
? [split.slice(0, -maxsplit).join(sep)].concat(split.slice(-maxsplit))
@@ -45,7 +52,7 @@ const TRANSLATION_FRAGMENTS = [
function recursiveFlatten(prefix, data) {
let output = {};
Object.keys(data).forEach(function(key) {
Object.keys(data).forEach(function (key) {
if (typeof data[key] === "object") {
output = {
...output,
@@ -107,7 +114,12 @@ function lokaliseTransform(data, original, file) {
output[key] = lokaliseTransform(value, original, file);
} else {
output[key] = value.replace(re_key_reference, (match, key) => {
const replace = key.split("::").reduce((tr, k) => tr[k], original);
const replace = key.split("::").reduce((tr, k) => {
if (!tr) {
throw Error(`Invalid key placeholder ${key} in ${file.path}`);
}
return tr[k];
}, original);
if (typeof replace !== "string") {
throw Error(`Invalid key placeholder ${key} in ${file.path}`);
}
@@ -118,7 +130,7 @@ function lokaliseTransform(data, original, file) {
return output;
}
gulp.task("clean-translations", function() {
gulp.task("clean-translations", function () {
return del([workDir]);
});
@@ -129,7 +141,7 @@ gulp.task("ensure-translations-build-dir", (done) => {
done();
});
gulp.task("create-test-metadata", function(cb) {
gulp.task("create-test-metadata", function (cb) {
fs.writeFile(
workDir + "/testMetadata.json",
JSON.stringify({
@@ -147,7 +159,7 @@ gulp.task(
return gulp
.src(path.join(paths.translations_src, "en.json"))
.pipe(
transform(function(data, file) {
transform(function (data, file) {
return recursiveEmpty(data);
})
)
@@ -165,28 +177,40 @@ gulp.task(
* project is buildable immediately after merging new translation keys, since
* the Lokalise update to translations/en.json will not happen immediately.
*/
gulp.task("build-master-translation", function() {
gulp.task("build-master-translation", function () {
const src = [path.join(paths.translations_src, "en.json")];
if (mergeBackend) {
src.push(path.join(inBackendDir, "en.json"));
}
return gulp
.src(path.join(paths.translations_src, "en.json"))
.src(src)
.pipe(
transform(function(data, file) {
transform(function (data, file) {
return lokaliseTransform(data, data, file);
})
)
.pipe(rename("translationMaster.json"))
.pipe(
merge({
fileName: "translationMaster.json",
})
)
.pipe(gulp.dest(workDir));
});
gulp.task("build-merged-translations", function() {
gulp.task("build-merged-translations", function () {
return gulp
.src([inDir + "/*.json", workDir + "/test.json"], { allowEmpty: true })
.src([inFrontendDir + "/*.json", workDir + "/test.json"], {
allowEmpty: true,
})
.pipe(
transform(function(data, file) {
transform(function (data, file) {
return lokaliseTransform(data, data, file);
})
)
.pipe(
foreach(function(stream, file) {
foreach(function (stream, file) {
// For each language generate a merged json file. It begins with the master
// translation as a failsafe for untranslated strings, and merges all parent
// tags into one file for each specific subtag
@@ -202,7 +226,10 @@ gulp.task("build-merged-translations", function() {
if (lang === "test") {
src.push(workDir + "/test.json");
} else if (lang !== "en") {
src.push(inDir + "/" + lang + ".json");
src.push(inFrontendDir + "/" + lang + ".json");
if (mergeBackend) {
src.push(inBackendDir + "/" + lang + ".json");
}
}
}
return gulp
@@ -223,7 +250,7 @@ var taskName;
const splitTasks = [];
TRANSLATION_FRAGMENTS.forEach((fragment) => {
taskName = "build-translation-fragment-" + fragment;
gulp.task(taskName, function() {
gulp.task(taskName, function () {
// Return only the translations for this fragment.
return gulp
.src(fullDir + "/*.json")
@@ -242,12 +269,12 @@ TRANSLATION_FRAGMENTS.forEach((fragment) => {
});
taskName = "build-translation-core";
gulp.task(taskName, function() {
gulp.task(taskName, function () {
// Remove the fragment translations from the core translation.
return gulp
.src(fullDir + "/*.json")
.pipe(
transform((data) => {
transform((data, file) => {
TRANSLATION_FRAGMENTS.forEach((fragment) => {
delete data.ui.panel[fragment];
});
@@ -259,7 +286,7 @@ gulp.task(taskName, function() {
splitTasks.push(taskName);
gulp.task("build-flattened-translations", function() {
gulp.task("build-flattened-translations", function () {
// Flatten the split versions of our translations, and move them into outDir
return gulp
.src(
@@ -269,7 +296,7 @@ gulp.task("build-flattened-translations", function() {
{ base: workDir }
)
.pipe(
transform(function(data) {
transform(function (data) {
// Polymer.AppLocalizeBehavior requires flattened json
return flatten(data);
})
@@ -351,7 +378,7 @@ gulp.task(
)
.pipe(merge({}))
.pipe(
transform(function(data) {
transform(function (data) {
const newData = {};
Object.entries(data).forEach(([key, value]) => {
// Filter out translations without native name.

View File

@@ -28,7 +28,7 @@ const runDevServer = ({
open: true,
watchContentBase: true,
contentBase,
}).listen(port, listenHost, function(err) {
}).listen(port, listenHost, function (err) {
if (err) {
throw err;
}
@@ -150,9 +150,8 @@ gulp.task(
gulp.task("webpack-dev-server-gallery", () => {
runDevServer({
compiler: webpack(
createGalleryConfig({ latestBuild: true, isProdBuild: false })
),
// We don't use the es5 build, but the dev server will fuck up the publicPath if we don't
compiler: webpack(bothBuilds(createGalleryConfig, { isProdBuild: false })),
contentBase: paths.gallery_root,
port: 8100,
});

View File

@@ -1,20 +1,12 @@
const webpack = require("webpack");
const fs = require("fs");
const path = require("path");
const TerserPlugin = require("terser-webpack-plugin");
const WorkboxPlugin = require("workbox-webpack-plugin");
const ManifestPlugin = require("webpack-manifest-plugin");
const WorkerPlugin = require("worker-plugin");
const paths = require("./paths.js");
const env = require("./env.js");
const { babelLoaderConfig } = require("./babel.js");
let version = fs
.readFileSync(path.resolve(paths.polymer_dir, "setup.py"), "utf8")
.match(/\d{8}\.\d+/);
if (!version) {
throw Error("Version not found");
}
version = version[0];
const createWebpackConfig = ({
entry,
outputRoot,
@@ -29,7 +21,9 @@ const createWebpackConfig = ({
}
return {
mode: isProdBuild ? "production" : "development",
devtool: isProdBuild ? "source-map" : "inline-cheap-module-source-map",
devtool: isProdBuild
? "cheap-module-source-map"
: "eval-cheap-module-source-map",
entry,
module: {
rules: [
@@ -38,17 +32,11 @@ const createWebpackConfig = ({
test: /\.css$/,
use: "raw-loader",
},
{
test: /\.(html)$/,
use: {
loader: "html-loader",
options: {
exportAsEs6Default: true,
},
},
},
],
},
externals: {
esprima: "esprima",
},
optimization: {
minimizer: [
new TerserPlugin({
@@ -64,12 +52,14 @@ const createWebpackConfig = ({
],
},
plugins: [
new WorkerPlugin(),
new ManifestPlugin(),
new webpack.DefinePlugin({
__DEV__: !isProdBuild,
__BUILD__: JSON.stringify(latestBuild ? "latest" : "es5"),
__VERSION__: JSON.stringify(version),
__VERSION__: JSON.stringify(env.version()),
__DEMO__: false,
__BACKWARDS_COMPAT__: false,
__STATIC_PATH__: "/static/",
"process.env.NODE_ENV": JSON.stringify(
isProdBuild ? "production" : "development"
@@ -88,6 +78,10 @@ const createWebpackConfig = ({
/@polymer\/font-roboto\/roboto\.js$/,
path.resolve(paths.polymer_dir, "src/util/empty.js")
),
new webpack.NormalModuleReplacementPlugin(
/@vaadin\/vaadin-material-styles\/font-roboto\.js$/,
path.resolve(paths.polymer_dir, "src/util/empty.js")
),
// Ignore mwc icons pointing at CDN.
new webpack.NormalModuleReplacementPlugin(
/@material\/mwc-icon\/mwc-icon-font\.js$/,
@@ -96,14 +90,6 @@ const createWebpackConfig = ({
].filter(Boolean),
resolve: {
extensions: [".ts", ".js", ".json"],
alias: {
react: "preact-compat",
"react-dom": "preact-compat",
// Not necessary unless you consume a module using `createClass`
"create-react-class": "preact-compat/lib/create-react-class",
// Not necessary unless you consume a module requiring `react-dom-factories`
"react-dom-factories": "preact-compat/lib/react-dom-factories",
},
},
output: {
filename: ({ chunk }) => {
@@ -121,70 +107,28 @@ const createWebpackConfig = ({
latestBuild ? "frontend_latest" : "frontend_es5"
),
publicPath: latestBuild ? "/frontend_latest/" : "/frontend_es5/",
// For workerize loader
// To silence warning in worker plugin
globalObject: "self",
},
};
};
const createAppConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => {
const config = createWebpackConfig({
return createWebpackConfig({
entry: {
service_worker: "./src/entrypoints/service_worker.ts",
app: "./src/entrypoints/app.ts",
authorize: "./src/entrypoints/authorize.ts",
onboarding: "./src/entrypoints/onboarding.ts",
core: "./src/entrypoints/core.ts",
compatibility: "./src/entrypoints/compatibility.ts",
"custom-panel": "./src/entrypoints/custom-panel.ts",
"hass-icons": "./src/entrypoints/hass-icons.ts",
},
outputRoot: paths.root,
isProdBuild,
latestBuild,
isStatsBuild,
});
if (latestBuild) {
// Create an object mapping browser urls to their paths during build
const translationMetadata = require("../build-translations/translationMetadata.json");
const workBoxTranslationsTemplatedURLs = {};
const englishFilename = `en-${translationMetadata.translations.en.hash}.json`;
// core
workBoxTranslationsTemplatedURLs[
`/static/translations/${englishFilename}`
] = `build-translations/output/${englishFilename}`;
translationMetadata.fragments.forEach((fragment) => {
workBoxTranslationsTemplatedURLs[
`/static/translations/${fragment}/${englishFilename}`
] = `build-translations/output/${fragment}/${englishFilename}`;
});
config.plugins.push(
new WorkboxPlugin.InjectManifest({
swSrc: "./src/entrypoints/service-worker-hass.js",
swDest: "service_worker.js",
importWorkboxFrom: "local",
include: [/\.js$/],
templatedURLs: {
...workBoxTranslationsTemplatedURLs,
"/static/icons/favicon-192x192.png":
"public/icons/favicon-192x192.png",
"/static/fonts/roboto/Roboto-Light.woff2":
"node_modules/roboto-fontface/fonts/roboto/Roboto-Light.woff2",
"/static/fonts/roboto/Roboto-Medium.woff2":
"node_modules/roboto-fontface/fonts/roboto/Roboto-Medium.woff2",
"/static/fonts/roboto/Roboto-Regular.woff2":
"node_modules/roboto-fontface/fonts/roboto/Roboto-Regular.woff2",
"/static/fonts/roboto/Roboto-Bold.woff2":
"node_modules/roboto-fontface/fonts/roboto/Roboto-Bold.woff2",
},
})
);
}
return config;
};
const createDemoConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => {
@@ -198,7 +142,7 @@ const createDemoConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => {
},
outputRoot: paths.demo_root,
defineOverlay: {
__VERSION__: JSON.stringify(`DEMO-${version}`),
__VERSION__: JSON.stringify(`DEMO-${env.version()}`),
__DEMO__: true,
},
isProdBuild,
@@ -221,6 +165,9 @@ const createCastConfig = ({ isProdBuild, latestBuild }) => {
outputRoot: paths.cast_root,
isProdBuild,
latestBuild,
defineOverlay: {
__BACKWARDS_COMPAT__: true,
},
});
};
@@ -245,9 +192,6 @@ const createHassioConfig = ({ isProdBuild, latestBuild }) => {
};
const createGalleryConfig = ({ isProdBuild, latestBuild }) => {
if (!latestBuild) {
throw new Error("Gallery only supports latest build!");
}
const config = createWebpackConfig({
entry: {
entrypoint: path.resolve(paths.gallery_dir, "src/entrypoint.js"),

View File

@@ -1,5 +1,3 @@
import "../../../src/resources/ha-style";
import "../../../src/resources/roboto";
import "../../../src/components/ha-iconset-svg";
import "../../../src/resources/hass-icons";
import "./layout/hc-connect";

View File

@@ -1,51 +1,53 @@
import "@polymer/paper-item/paper-icon-item";
import "@polymer/paper-listbox/paper-listbox";
import { Auth, Connection } from "home-assistant-js-websocket";
import {
css,
CSSResult,
customElement,
html,
LitElement,
property,
TemplateResult,
html,
CSSResult,
css,
} from "lit-element";
import { Connection, Auth } from "home-assistant-js-websocket";
import "@polymer/iron-icon";
import "@polymer/paper-listbox/paper-listbox";
import "@polymer/paper-item/paper-icon-item";
import "../../../../src/components/ha-icon";
import {
enableWrite,
askWrite,
saveTokens,
} from "../../../../src/common/auth/token_storage";
import {
ensureConnectedCastSession,
castSendShowLovelaceView,
} from "../../../../src/cast/receiver_messages";
import "../../../../src/layouts/loading-screen";
import { CastManager } from "../../../../src/cast/cast_manager";
import {
LovelaceConfig,
getLovelaceCollection,
getLegacyLovelaceCollection,
} from "../../../../src/data/lovelace";
import "./hc-layout";
import { generateDefaultViewConfig } from "../../../../src/panels/lovelace/common/generate-lovelace-config";
import { toggleAttribute } from "../../../../src/common/dom/toggle_attribute";
castSendShowLovelaceView,
ensureConnectedCastSession,
} from "../../../../src/cast/receiver_messages";
import {
askWrite,
enableWrite,
saveTokens,
} from "../../../../src/common/auth/token_storage";
import { atLeastVersion } from "../../../../src/common/config/version";
import { toggleAttribute } from "../../../../src/common/dom/toggle_attribute";
import "../../../../src/components/ha-icon";
import {
getLegacyLovelaceCollection,
getLovelaceCollection,
LovelaceConfig,
} from "../../../../src/data/lovelace";
import "../../../../src/layouts/loading-screen";
import { generateDefaultViewConfig } from "../../../../src/panels/lovelace/common/generate-lovelace-config";
import "./hc-layout";
import "@material/mwc-button/mwc-button";
@customElement("hc-cast")
class HcCast extends LitElement {
@property() public auth!: Auth;
@property() public connection!: Connection;
@property() public castManager!: CastManager;
@property() private askWrite = false;
@property() private lovelaceConfig?: LovelaceConfig | null;
protected render(): TemplateResult {
if (this.lovelaceConfig === undefined) {
return html`
<loading-screen></loading-screen>>
`;
return html` <loading-screen></loading-screen>> `;
}
const error =
@@ -75,14 +77,12 @@ class HcCast extends LitElement {
`
: ""}
${error
? html`
<div class="card-content">${error}</div>
`
? html` <div class="card-content">${error}</div> `
: !this.castManager.status
? html`
<p class="center-item">
<mwc-button raised @click=${this._handleLaunch}>
<iron-icon icon="hass:cast"></iron-icon>
<ha-icon icon="hass:cast"></ha-icon>
Start Casting
</mwc-button>
</p>
@@ -120,7 +120,7 @@ class HcCast extends LitElement {
${this.castManager.status
? html`
<mwc-button @click=${this._handleLaunch}>
<iron-icon icon="hass:cast-connected"></iron-icon>
<ha-icon icon="hass:cast-connected"></ha-icon>
Manage
</mwc-button>
`
@@ -242,7 +242,7 @@ class HcCast extends LitElement {
color: var(--secondary-text-color);
}
mwc-button iron-icon {
mwc-button ha-icon {
margin-right: 8px;
height: 18px;
}

View File

@@ -1,35 +1,35 @@
import {
LitElement,
customElement,
property,
TemplateResult,
html,
CSSResult,
css,
} from "lit-element";
import {
getAuth,
createConnection,
Auth,
getAuthOptions,
ERR_HASS_HOST_REQUIRED,
ERR_INVALID_HTTPS_TO_HTTP,
Connection,
ERR_CANNOT_CONNECT,
ERR_INVALID_AUTH,
} from "home-assistant-js-websocket";
import "@polymer/iron-icon";
import "@material/mwc-button";
import "@polymer/paper-input/paper-input";
import {
Auth,
Connection,
createConnection,
ERR_CANNOT_CONNECT,
ERR_HASS_HOST_REQUIRED,
ERR_INVALID_AUTH,
ERR_INVALID_HTTPS_TO_HTTP,
getAuth,
getAuthOptions,
} from "home-assistant-js-websocket";
import {
css,
CSSResult,
customElement,
html,
LitElement,
property,
TemplateResult,
} from "lit-element";
import { CastManager, getCastManager } from "../../../../src/cast/cast_manager";
import { castSendShowDemo } from "../../../../src/cast/receiver_messages";
import {
loadTokens,
saveTokens,
} from "../../../../src/common/auth/token_storage";
import "../../../../src/components/ha-icon";
import "../../../../src/layouts/loading-screen";
import { CastManager, getCastManager } from "../../../../src/cast/cast_manager";
import "./hc-layout";
import { castSendShowDemo } from "../../../../src/cast/receiver_messages";
import { registerServiceWorker } from "../../../../src/util/register-service-worker";
import "./hc-layout";
const seeFAQ = (qid) => html`
See <a href="./faq.html${qid ? `#${qid}` : ""}">the FAQ</a> for more
@@ -61,13 +61,19 @@ const INTRO = html`
@customElement("hc-connect")
export class HcConnect extends LitElement {
@property() private loading = false;
// If we had stored credentials but we cannot connect,
// show a screen asking retry or logout.
@property() private cannotConnect = false;
@property() private error?: string | TemplateResult;
@property() private auth?: Auth;
@property() private connection?: Connection;
@property() private castManager?: CastManager | null;
private openDemo = false;
protected render(): TemplateResult {
@@ -92,9 +98,7 @@ export class HcConnect extends LitElement {
}
if (this.castManager === undefined || this.loading) {
return html`
<loading-screen></loading-screen>
`;
return html` <loading-screen></loading-screen> `;
}
if (this.castManager === null) {
@@ -127,20 +131,16 @@ export class HcConnect extends LitElement {
@keydown=${this._handleInputKeyDown}
></paper-input>
</p>
${this.error
? html`
<p class="error">${this.error}</p>
`
: ""}
${this.error ? html` <p class="error">${this.error}</p> ` : ""}
</div>
<div class="card-actions">
<mwc-button @click=${this._handleDemo}>
Show Demo
<iron-icon
<ha-icon
.icon=${this.castManager.castState === "CONNECTED"
? "hass:cast-connected"
: "hass:cast"}
></iron-icon>
></ha-icon>
</mwc-button>
<div class="spacer"></div>
<mwc-button @click=${this._handleConnect}>Authorize</mwc-button>
@@ -184,7 +184,7 @@ export class HcConnect extends LitElement {
this.castManager = null;
}
);
registerServiceWorker(false);
registerServiceWorker(this, false);
}
private async _handleDemo() {
@@ -211,7 +211,8 @@ export class HcConnect extends LitElement {
if (value === "") {
this.error = "Please enter a Home Assistant URL.";
return;
} else if (value.indexOf("://") === -1) {
}
if (value.indexOf("://") === -1) {
this.error =
"Please enter your full URL, including the protocol part (https://).";
return;
@@ -315,7 +316,7 @@ export class HcConnect extends LitElement {
color: darkred;
}
mwc-button iron-icon {
mwc-button ha-icon {
margin-left: 8px;
}

View File

@@ -1,25 +1,28 @@
import {
customElement,
LitElement,
TemplateResult,
html,
CSSResult,
css,
property,
} from "lit-element";
import {
Auth,
Connection,
HassUser,
getUser,
HassUser,
} from "home-assistant-js-websocket";
import {
css,
CSSResult,
customElement,
html,
LitElement,
property,
TemplateResult,
} from "lit-element";
import "../../../../src/components/ha-card";
@customElement("hc-layout")
class HcLayout extends LitElement {
@property() public subtitle?: string | undefined;
@property() public auth?: Auth;
@property() public connection?: Connection;
@property() public user?: HassUser;
protected render(): TemplateResult {
@@ -37,11 +40,7 @@ class HcLayout extends LitElement {
this.auth.data.hassUrl.indexOf("//") + 2
)}</a
>
${this.user
? html`
${this.user.name}
`
: ""}
${this.user ? html` ${this.user.name} ` : ""}
</div>
`
: ""}

View File

@@ -1 +1,2 @@
/* eslint-disable no-undef */
export const castContext = cast.framework.CastReceiverContext.getInstance();

View File

@@ -1,4 +1,4 @@
import { Entity, convertEntities } from "../../../../src/fake_data/entity";
import { convertEntities, Entity } from "../../../../src/fake_data/entity";
export const castDemoEntities: () => Entity[] = () =>
convertEntities({

View File

@@ -1,6 +1,6 @@
import {
LovelaceConfig,
LovelaceCardConfig,
LovelaceConfig,
} from "../../../../src/data/lovelace";
import { castContext } from "../cast_context";

View File

@@ -1,9 +1,10 @@
/* eslint-disable no-undef */
import { CAST_NS } from "../../../src/cast/const";
import { HassMessage } from "../../../src/cast/receiver_messages";
import "../../../src/resources/custom-card-support";
import { castContext } from "./cast_context";
import { ReceivedMessage } from "./types";
import { HassMessage } from "../../../src/cast/receiver_messages";
import { HcMain } from "./layout/hc-main";
import { CAST_NS } from "../../../src/cast/const";
import { ReceivedMessage } from "./types";
const controller = new HcMain();
document.body.append(controller);

View File

@@ -1,19 +1,20 @@
import { HassElement } from "../../../../src/state/hass-element";
import "./hc-lovelace";
import { customElement, TemplateResult, html, property } from "lit-element";
import { customElement, html, property, TemplateResult } from "lit-element";
import { mockHistory } from "../../../../demo/src/stubs/history";
import { LovelaceConfig } from "../../../../src/data/lovelace";
import {
MockHomeAssistant,
provideHass,
} from "../../../../src/fake_data/provide_hass";
import { HassElement } from "../../../../src/state/hass-element";
import { HomeAssistant } from "../../../../src/types";
import { LovelaceConfig } from "../../../../src/data/lovelace";
import { castDemoEntities } from "../demo/cast-demo-entities";
import { castDemoLovelace } from "../demo/cast-demo-lovelace";
import { mockHistory } from "../../../../demo/src/stubs/history";
import "./hc-lovelace";
@customElement("hc-demo")
class HcDemo extends HassElement {
@property() public lovelacePath!: string;
@property() private _lovelaceConfig?: LovelaceConfig;
protected render(): TemplateResult {
@@ -28,6 +29,7 @@ class HcDemo extends HassElement {
></hc-lovelace>
`;
}
protected firstUpdated(changedProps) {
super.firstUpdated(changedProps);
this._initialize();

View File

@@ -1,17 +1,18 @@
import {
LitElement,
TemplateResult,
html,
customElement,
CSSResult,
css,
CSSResult,
customElement,
html,
LitElement,
property,
TemplateResult,
} from "lit-element";
import { HomeAssistant } from "../../../../src/types";
@customElement("hc-launch-screen")
class HcLaunchScreen extends LitElement {
@property() public hass?: HomeAssistant;
@property() public error?: string;
protected render(): TemplateResult {
@@ -22,11 +23,7 @@ class HcLaunchScreen extends LitElement {
/>
<div class="status">
${this.hass ? "Connected" : "Not Connected"}
${this.error
? html`
<p>Error: ${this.error}</p>
`
: ""}
${this.error ? html` <p>Error: ${this.error}</p> ` : ""}
</div>
</div>
`;

View File

@@ -1,17 +1,17 @@
import {
LitElement,
TemplateResult,
html,
customElement,
CSSResult,
css,
CSSResult,
customElement,
html,
LitElement,
property,
TemplateResult,
} from "lit-element";
import { LovelaceConfig } from "../../../../src/data/lovelace";
import "../../../../src/panels/lovelace/views/hui-view";
import "../../../../src/panels/lovelace/views/hui-panel-view";
import { HomeAssistant } from "../../../../src/types";
import { Lovelace } from "../../../../src/panels/lovelace/types";
import "../../../../src/panels/lovelace/views/hui-panel-view";
import "../../../../src/panels/lovelace/views/hui-view";
import { HomeAssistant } from "../../../../src/types";
import "./hc-launch-screen";
@customElement("hc-lovelace")
@@ -46,6 +46,7 @@ class HcLovelace extends LitElement {
? html`
<hui-panel-view
.hass=${this.hass}
.lovelace=${lovelace}
.config=${this.lovelaceConfig.views[index]}
></hui-panel-view>
`

View File

@@ -1,31 +1,31 @@
import {
getAuth,
createConnection,
getAuth,
UnsubscribeFunc,
} from "home-assistant-js-websocket";
import { customElement, TemplateResult, html, property } from "lit-element";
import { HassElement } from "../../../../src/state/hass-element";
import {
HassMessage,
ConnectMessage,
ShowLovelaceViewMessage,
GetStatusMessage,
ShowDemoMessage,
} from "../../../../src/cast/receiver_messages";
import {
LovelaceConfig,
getLovelaceCollection,
fetchResources,
LegacyLovelaceConfig,
getLegacyLovelaceCollection,
} from "../../../../src/data/lovelace";
import "./hc-launch-screen";
import { castContext } from "../cast_context";
import { customElement, html, property, TemplateResult } from "lit-element";
import { CAST_NS } from "../../../../src/cast/const";
import {
ConnectMessage,
GetStatusMessage,
HassMessage,
ShowDemoMessage,
ShowLovelaceViewMessage,
} from "../../../../src/cast/receiver_messages";
import { ReceiverStatusMessage } from "../../../../src/cast/sender_messages";
import { loadLovelaceResources } from "../../../../src/panels/lovelace/common/load-resources";
import { isNavigationClick } from "../../../../src/common/dom/is-navigation-click";
import { atLeastVersion } from "../../../../src/common/config/version";
import { isNavigationClick } from "../../../../src/common/dom/is-navigation-click";
import {
fetchResources,
getLegacyLovelaceCollection,
getLovelaceCollection,
LegacyLovelaceConfig,
LovelaceConfig,
} from "../../../../src/data/lovelace";
import { loadLovelaceResources } from "../../../../src/panels/lovelace/common/load-resources";
import { HassElement } from "../../../../src/state/hass-element";
import { castContext } from "../cast_context";
import "./hc-launch-screen";
let resourcesLoaded = false;
@@ -40,6 +40,7 @@ export class HcMain extends HassElement {
@property() private _error?: string;
private _unsubLovelace?: UnsubscribeFunc;
private _urlPath?: string | null;
public processIncomingMessage(msg: HassMessage) {
@@ -52,16 +53,14 @@ export class HcMain extends HassElement {
} else if (msg.type === "show_demo") {
this._handleShowDemo(msg);
} else {
// tslint:disable-next-line: no-console
// eslint-disable-next-line no-console
console.warn("unknown msg type", msg);
}
}
protected render(): TemplateResult {
if (this._showDemo) {
return html`
<hc-demo .lovelacePath=${this._lovelacePath}></hc-demo>
`;
return html` <hc-demo .lovelacePath=${this._lovelacePath}></hc-demo> `;
}
if (
@@ -91,15 +90,17 @@ export class HcMain extends HassElement {
super.firstUpdated(changedProps);
import("../second-load");
window.addEventListener("location-changed", () => {
if (location.pathname.startsWith("/lovelace/")) {
this._lovelacePath = location.pathname.substr(10);
const panelPath = `/${this._urlPath || "lovelace"}/`;
if (location.pathname.startsWith(panelPath)) {
this._lovelacePath = location.pathname.substr(panelPath.length);
this._sendStatus();
}
});
document.body.addEventListener("click", (ev) => {
const panelPath = `/${this._urlPath || "lovelace"}/`;
const href = isNavigationClick(ev);
if (href && href.startsWith("/lovelace/")) {
this._lovelacePath = href.substr(10);
if (href && href.startsWith(panelPath)) {
this._lovelacePath = href.substr(panelPath.length);
this._sendStatus();
}
});
@@ -171,10 +172,10 @@ export class HcMain extends HassElement {
this._error = "Cannot show Lovelace because we're not connected.";
return;
}
if (msg.urlPath === "lovelace") {
msg.urlPath = null;
}
if (!this._unsubLovelace || this._urlPath !== msg.urlPath) {
if (msg.urlPath === "lovelace") {
msg.urlPath = null;
}
this._urlPath = msg.urlPath;
if (this._unsubLovelace) {
this._unsubLovelace();

View File

@@ -1,5 +1,3 @@
import "web-animations-js/web-animations-next-lite.min";
import "../../../src/resources/hass-icons";
import "../../../src/resources/roboto";
import "../../../src/components/ha-iconset-svg";
import "./layout/hc-lovelace";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 805 B

After

Width:  |  Height:  |  Size: 803 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -7,5 +7,5 @@ set -e
cd "$(dirname "$0")/.."
STATS=1 NODE_ENV=production ../node_modules/.bin/webpack --profile --json > compilation-stats.json
npx webpack-bundle-analyzer compilation-stats.json dist
npx webpack-bundle-analyzer compilation-stats.json dist/frontend_latest
rm compilation-stats.json

View File

@@ -1,6 +1,6 @@
import { DemoConfig } from "../types";
import { demoLovelaceArsaboo } from "./lovelace";
import { demoEntitiesArsaboo } from "./entities";
import { demoLovelaceArsaboo } from "./lovelace";
import { demoThemeArsaboo } from "./theme";
export const demoArsaboo: DemoConfig = {

View File

@@ -21,7 +21,9 @@ export const demoConfigs: Array<() => Promise<DemoConfig>> = [
),
];
export let selectedDemoConfigIndex: number = 0;
// eslint-disable-next-line import/no-mutable-exports
export let selectedDemoConfigIndex = 0;
// eslint-disable-next-line import/no-mutable-exports
export let selectedDemoConfig: Promise<DemoConfig> = demoConfigs[
selectedDemoConfigIndex
]();

View File

@@ -1,6 +1,6 @@
import { DemoConfig } from "../types";
import { demoLovelaceJimpower } from "./lovelace";
import { demoEntitiesJimpower } from "./entities";
import { demoLovelaceJimpower } from "./lovelace";
import { demoThemeJimpower } from "./theme";
export const demoJimpower: DemoConfig = {

View File

@@ -33,7 +33,7 @@ export const demoThemeJimpower = () => ({
"label-badge-border-color": "green",
"paper-listbox-color": "var(--primary-color)",
"paper-slider-disabled-secondary-color": "var(--disabled-text-color)",
"paper-card-background-color": "#434954",
"card-background-color": "#434954",
"label-badge-text-color": "var(--primary-text-color)",
"paper-slider-knob-start-color": "var(--accent-color)",
"switch-unchecked-track-color": "var(--disabled-text-color)",

View File

@@ -1,6 +1,6 @@
import { DemoConfig } from "../types";
import { demoLovelaceKernehed } from "./lovelace";
import { demoEntitiesKernehed } from "./entities";
import { demoLovelaceKernehed } from "./lovelace";
import { demoThemeKernehed } from "./theme";
export const demoKernehed: DemoConfig = {

View File

@@ -34,7 +34,7 @@ export const demoThemeKernehed = () => ({
"label-badge-border-color": "green",
"paper-listbox-color": "#777777",
"paper-slider-disabled-secondary-color": "var(--disabled-text-color)",
"paper-card-background-color": "#292929",
"card-background-color": "#292929",
"label-badge-text-color": "var(--primary-text-color)",
"paper-slider-knob-start-color": "var(--accent-color)",
"switch-unchecked-track-color": "var(--disabled-text-color)",

View File

@@ -1,6 +1,6 @@
import { DemoConfig } from "../types";
import { demoLovelaceTeachingbirds } from "./lovelace";
import { demoEntitiesTeachingbirds } from "./entities";
import { demoLovelaceTeachingbirds } from "./lovelace";
import { demoThemeTeachingbirds } from "./theme";
export const demoTeachingbirds: DemoConfig = {

View File

@@ -63,8 +63,7 @@ export const demoLovelaceTeachingbirds: DemoConfig["lovelace"] = () => ({
elements: [
{
style: {
"--iron-icon-width": "100px",
"--iron-icon-height": "100px",
"--mdc-icon-size": "100%",
top: "50%",
left: "50%",
},

View File

@@ -13,7 +13,7 @@ export const demoThemeTeachingbirds = () => ({
"paper-listbox-color": "#FFFFFF",
"paper-toggle-button-checked-bar-color": "var(--light-primary-color)",
"switch-unchecked-track-color": "var(--primary-text-color)",
"paper-card-background-color": "#4e4e4e",
"card-background-color": "#4e4e4e",
"label-badge-text-color": "var(--text-primary-color)",
"primary-background-color": "#303030",
"sidebar-icon-color": "var(--paper-item-icon-color)",

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