Compare commits

..

383 Commits

Author SHA1 Message Date
Paulus Schoutsen
f995d8d525 Add extensions to imports from inside packages;2C 2020-05-07 18:26:58 -07: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
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
Bram Kragten
3be4b9d79b Merge pull request #5369 from home-assistant/dev
20200330.0
2020-03-30 21:34:24 +02:00
Bram Kragten
5dcea51712 Fix default path for demo 2020-03-30 21:20:06 +02:00
Bram Kragten
6995968d50 Update ha-sidebar.ts 2020-03-30 20:59:12 +02:00
Bram Kragten
c4cb42f3c2 Merge branch 'master' into dev 2020-03-30 20:57:24 +02:00
Bram Kragten
0d4a7a2b3e Bumped version to 20200330.0 2020-03-30 20:53:19 +02:00
Bram Kragten
20cc9c9b42 Update user config pages (#5354)
* Update user config pages

* remove user-editor

* Update

* Update dialog-add-user.ts
2020-03-30 20:52:53 +02:00
Bram Kragten
8a6bd04543 Add default dashboard selection to profile page (#5360)
* Add default dashboard selection to profile page

* Comments

* Console.bye
2020-03-30 16:08:36 +02:00
Bram Kragten
263138a388 MIgrate scripts to data table (#5352)
* MIgrate scripts to data table

* Update imports

* Update

* Lint
2020-03-30 15:38:15 +02:00
Bram Kragten
e645342131 Allow to start with empty view on take control (#5357)
* Allow to start with empty view on take control

* Localize
2020-03-30 15:37:59 +02:00
Bram Kragten
6e4c707f9e Migrate scene config to data table (#5351)
* Migrate scene config to data table

* Remove unused styles

* Update ha-scene-dashboard.ts

* Lint + help

* Update ha-scene-dashboard.ts
2020-03-30 15:06:29 +02:00
Bram Kragten
fca286d6c0 Change automation picker to data table (#5344)
* Change automation picker to data-table

* Update ha-automation-picker.ts

* Update ha-automation-picker.ts

* Update ha-automation-picker.ts

* Add edit button + disabled tooltip

* Fix translation key

* Remove unused

* Comments and fixes

* Update ha-automation-picker.ts
2020-03-30 14:21:55 +02:00
Bram Kragten
5a2e08647f Add area config page (#5343)
* Add area config page

* Comments

* Update ha-config-area-page.ts

* Update ha-config-area-page.ts
2020-03-30 14:21:36 +02:00
Bram Kragten
f6dac98abd Update layout of device info page (#5342)
* Update layout of device info page

* Comments

* <a> and simplify layout

* Update ha-config-device-page.ts
2020-03-30 14:21:21 +02:00
Pascal Vizeli
ddb525f6cd Fix hass.io panel for older version (#5365)
* Fix hass.io panel for older version

* Fix lint
2020-03-30 11:38:54 +02:00
HomeAssistant Azure
f7ee712456 [ci skip] Translation update 2020-03-30 00:40:34 +00:00
Ian Richardson
ff873e2f71 add name option to buttons row (#5083)
* add name option to buttons row

* explicit show_name

* Update src/panels/lovelace/components/hui-buttons-base.ts

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

* Update src/panels/lovelace/components/hui-buttons-base.ts

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

* lint

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-03-29 13:49:27 +02:00
Ian Richardson
54b57e6222 add volume slider to media_player row (#4743)
*  add volume slider to media_player row

* add more controls

* flex slider

* override width

* volume buttons when narrow

* address comments

* Updates for rebase

* attempt to use debounce. not working

* remove log

* fix observer

* address some review comments

* unobserve

* address comments
2020-03-29 13:30:52 +02:00
HomeAssistant Azure
375abfb95e [ci skip] Translation update 2020-03-29 00:32:56 +00:00
HomeAssistant Azure
30a38fa6d1 [ci skip] Translation update 2020-03-28 00:34:07 +00:00
Pascal Vizeli
554c0b692d Fix supervisor panel (#5348)
* Fix supervisor panel

* Lint

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-03-27 11:55:55 -07:00
HomeAssistant Azure
61ac831882 [ci skip] Translation update 2020-03-27 00:33:27 +00:00
Bram Kragten
59e89a0daf Sandbox iframe 2020-03-26 11:39:01 +01:00
Zack Arnett
1e3950cd1d Add shopping list (#5339) 2020-03-26 11:32:40 +01:00
Zack Arnett
f514ea453c Delete Card: Add Card Preview to Dialog (#5325)
* Delete Card Dialog

* Update with to be the max for a column

* Comments

* remove open and wait for render to resize I think

* Review

* fire event from dialog
2020-03-26 11:13:13 +01:00
Paulus Schoutsen
cc046478e5 Catch LL config not found exception in preload (#5340) 2020-03-26 10:47:12 +01:00
HomeAssistant Azure
a17c1052cd [ci skip] Translation update 2020-03-26 00:32:45 +00:00
HomeAssistant Azure
2408f9b8fa [ci skip] Translation update 2020-03-25 00:32:35 +00:00
Aidan Timson
6aae1b3378 Fix Default Lovelace Panel Title (#5301)
* Fix lovelace panel title

* Fix types error

* Revert and workaround null type

* Update src/data/panel.ts

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

* Update panel.ts

* Update panel.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-03-24 15:08:51 +01:00
Pascal Vizeli
ed51223226 Update azure-pipelines-release.yml for Azure Pipelines 2020-03-24 14:16:21 +01:00
sdotter
013808b7f5 Fixed iframe panel unnecessary scrollbar (on 100vh -64px) (#5326)
* Fixed iframe panel unnecessary scrollbar (on 100vh -64px)

* Fixed iframe panel unnecessary scrollbar (removed margin-top)

No need for margin-top
2020-03-24 13:18:45 +01:00
HomeAssistant Azure
af584e1d12 [ci skip] Translation update 2020-03-24 00:57:08 +00:00
J. Nick Koston
3763d7a1d0 Use horizontal control icons for devices that commonly move horizontally (#5309)
* Use horizontal control icons for devices that
commonly move horizontally including:

awning
curtain
gate

* no need to check

* remove debug

* reduce - js is so permissive

* remove curtain
2020-03-23 20:33:45 +01:00
Zack Arnett
ce92add096 Footer/Header: Graph (#5273)
* Add Graph as a footerheader option

* Move get Coordinates to a new file

* await

* Comments
2020-03-23 09:46:56 -04:00
HomeAssistant Azure
40c94b6596 [ci skip] Translation update 2020-03-23 00:32:58 +00:00
Aidan Timson
c894bc2e40 Fix icon button padding (#5312) 2020-03-23 00:18:13 +01:00
HomeAssistant Azure
415a4fa1af [ci skip] Translation update 2020-03-22 00:32:46 +00:00
Bram Kragten
b9367a33a8 Invalidate theme cache when switching demo's (#5305)
* Invalidate theme cache when switching demo's

* Move to mock hass
2020-03-21 20:19:13 +01:00
Bram Kragten
7170f06c08 Add checks for arrays in compute unused entities (#5307) 2020-03-21 20:18:40 +01:00
J. Nick Koston
f2578a58b4 Add "gate" device class for DEVICE_CLASS_GATE (#5299)
* Add "gate" device class for DEVICE_CLASS_GATE

Gates are found outside of a structure and are typically part of a fence.

When opening or closing a garage door, it was impossible to tell
if you had hit the button or not even though the underlying state
was reported as "opening". This lead to confusion and multiple
clicks to open a garage door which can cause the door to stop
opening and result in frustration.

Add icons for gate and garage opening and closing states.

* Add "gate" device class for DEVICE_CLASS_GATE

Gates are found outside of a structure and are typically part of a fence.

When opening or closing a garage door, it was impossible to tell
if you had hit the button or not even though the underlying state
was reported as "opening". This lead to confusion and multiple
clicks to open a garage door which can cause the door to stop
opening and result in frustration.

Add icons for gate and garage opening and closing states.

* de-bold
2020-03-21 11:20:06 -07:00
Bram Kragten
1950656bd5 Add ability to edit panel view cards (#5257)
* Add ability to edit panel view cards

* Localize and fix some styling
2020-03-21 16:51:44 +01:00
Bram Kragten
eed3263c70 Optimize cards for horizontal stack (#5254) 2020-03-21 15:59:30 +01:00
Robert Resch
02e01626f5 fix #5300: always show attribute step (#5302) 2020-03-21 15:15:20 +01:00
HomeAssistant Azure
41a2d9604e [ci skip] Translation update 2020-03-21 00:32:47 +00:00
Bram Kragten
7d6f188bfc Change themes logic (#5232)
* Fix themes

* Update hui-view.ts

* Comments and bail out

* Update apply_themes_on_element.ts

* refactor, move meta to theme mixin, adapt lovelace theme picker

* console.bye

* Comments

* Optimizations

* Bail out early is no hex value

* Cache processed themes

* Remove hex-rgb cache
2020-03-20 21:30:20 +01:00
Bram Kragten
15a144f17a Add iframe panel mode and align aspect ratio option with map card (#5289)
* Add iframe panel mode and align aspect ratio option with map card

* lint
2020-03-20 17:53:30 +01:00
Erik Montnemery
c54f2b66da Add delete button to MQTT devices' config page (#5117)
* Add delete button to MQTT devices' config page

* Move delete button to its own card

* Fix review comments

* Fix review comments

* Fix review comments

* Use haStyle instead of haStyleDialog
2020-03-20 15:53:36 +01:00
Bram Kragten
685a0807d8 Fix alarm panel (#5291)
Fixes https://github.com/home-assistant/frontend/issues/5073
2020-03-20 15:21:25 +01:00
Zack Arnett
0d404e0e37 Stub Configs: Add Type (#5206)
* Add Type

* Add return type

* Lint

* Fix map

* map fix

* Comments
2020-03-20 12:41:28 +01:00
Zack Arnett
39bb859f57 Fix tooltip overflow (#5282) 2020-03-20 12:01:18 +01:00
Zack Arnett
90e32b7e45 Hui Unavailable: Fix Opacity (#5283)
* Fix unavailable

* opacity
2020-03-20 11:49:46 +01:00
Zack Arnett
63a2d9dd18 alphabet english (#5284) 2020-03-20 11:48:02 +01:00
HomeAssistant Azure
4982693883 [ci skip] Translation update 2020-03-20 00:32:48 +00:00
Zack Arnett
f4211e3fa3 Find Entites: Filter Unavailable - Used and unused entities required (#5208)
* Update Find Entities

* lint

* Filter until max - entitiesFill-> entitiesFallback

* Comment - Move unav - unk filter to picker

* lint

* Var name update

* remove unnessary check

* add it back and fix logic

* use typescript ? in condition

* comments

* lint

* Compute used once

* pass in hass

* Return set

* fix merge

* Optimize unused entities in find
2020-03-19 14:39:14 -04:00
Paulus Schoutsen
eacf58b5a5 Update color count in color extraction (#5270)
* Update color count in color extraction

* add the images
2020-03-18 23:12:27 -04:00
HomeAssistant Azure
f9349bc731 [ci skip] Translation update 2020-03-19 00:32:53 +00:00
Bram Kragten
3840671764 Remove app-route from hui-root (#5267)
* Remove app-route from hui-root

* Update hui-root.ts
2020-03-18 15:37:44 -07:00
Bram Kragten
fd62cf02d6 Fix button card not showing visual editor on add (#5256) 2020-03-18 23:32:03 +01:00
Bram Kragten
254744cd7d Bumped version to 20200318.1 2020-03-18 23:29:00 +01:00
Zack Arnett
595d04c922 Fix theme update (#5246) 2020-03-18 23:28:50 +01:00
Bram Kragten
a3969fe2c8 Fix stack editor in stack editor (#5255) 2020-03-18 23:28:42 +01:00
Paulus Schoutsen
220e4134b7 Fix calculating title if panels not loaded yet (#5262) 2020-03-18 23:28:35 +01:00
Bram Kragten
56e176a6f1 Fix stack editor in conditional card (#5265) 2020-03-18 23:28:30 +01:00
Bram Kragten
780c15d6b3 Fix stack editor in conditional card (#5265) 2020-03-18 21:29:09 +01:00
Bram Kragten
55ff848b78 Fix stack editor in stack editor (#5255) 2020-03-18 20:51:00 +01:00
Zack Arnett
dbe829bc7d Card Editor: Copy Card (#5249)
* Copy Card Feature

* dUplicate
2020-03-18 20:33:59 +01:00
Zack Arnett
8d0508f320 Unused Entities: Only Show Fab when selection is made (#5248)
* Only Show Fab when selection is made

* reviews
2020-03-18 20:33:36 +01:00
Paulus Schoutsen
2741bb8b38 Fix calculating title if panels not loaded yet (#5262) 2020-03-18 20:32:35 +01:00
Paulus Schoutsen
16cadd53cf Set data as property. (#5263) 2020-03-18 20:27:44 +01:00
Olivér Falvai
a8d21c6112 Add loading text for long-running integration install step (#4378)
* Added optional label for dialog-data-entry-flow

* Use correct loading element

* Update src/translations/en.json

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

* Minor template adjustment

* Revert accidental change of PR templates

* Revert accidental change of PR templates

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-03-18 17:00:08 +01:00
Bram Kragten
6b2e707653 Update en.json 2020-03-18 12:49:32 +01:00
Bram Kragten
205b7451fa Update hui-gauge-card.ts (#5241) 2020-03-18 12:48:16 +01:00
Zack Arnett
1d3aeec0de more info (#5247) 2020-03-18 12:47:59 +01:00
Zack Arnett
ac911dcd31 Fix theme update (#5246) 2020-03-18 12:47:20 +01:00
Bram Kragten
89a94b3efc Merge pull request #5252 from home-assistant/dev
20200318.0
2020-03-18 12:33:12 +01:00
Bram Kragten
71793dcfa5 Cast fix for urlPath === "lovelace" (#5242) 2020-03-18 12:19:01 +01:00
Bram Kragten
1e527a8350 Bumped version to 20200318.0 2020-03-18 12:18:24 +01:00
Bram Kragten
262b12eb93 Fix dialog conent color (#5251)
* Fix ha-dialog content color

* Fix
2020-03-18 12:17:01 +01:00
HomeAssistant Azure
7fb1e699ae [ci skip] Translation update 2020-03-18 00:32:39 +00:00
Aidan Timson
9ee647329b Fix Wrong Index for Filtered Tabs (#5221)
* Fix wrong index for filtered tabs

* Set active tab to actual tab and use path

* Update src/layouts/hass-tabs-subpage.ts

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Update src/layouts/hass-tabs-subpage.ts

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-03-17 20:44:07 +01:00
HomeAssistant Azure
cd6dcec644 [ci skip] Translation update 2020-03-17 00:32:43 +00:00
Bram Kragten
d8f248c60e Merge pull request #5234 from home-assistant/dev
20200316.1
2020-03-16 21:18:04 +01:00
Aidan Timson
2925b930ad Set Title to Current Panel (#5220)
* Set title to current panel

* Move to mixin

* Naming

* guard clause
2020-03-16 20:54:55 +01:00
Bram Kragten
127aaba47b Add UI for reload resources service (#5229)
* Add UI for reload resources service

* Update hui-root.ts

* Check for config of main panel
2020-03-16 20:52:21 +01:00
Bram Kragten
8bc8761af6 Bumped version to 20200316.1 2020-03-16 20:32:59 +01:00
Bram Kragten
a88321d243 Only show url path field in advanced mode (#5233) 2020-03-16 20:32:13 +01:00
Bram Kragten
4e19232960 Merge pull request #5230 from Tediore/patch-3
Minor corrections and cosmetic improvements
2020-03-16 14:51:14 +01:00
Jay
5b95bdb6b7 Minor corrections and cosmetic improvements
Updated the correct file this time...
2020-03-16 08:15:18 -05:00
Bram Kragten
0fc59ccb16 Merge pull request #5228 from home-assistant/dev
20200316.0
2020-03-16 12:38:28 +01:00
Bram Kragten
a9daf9835a Bumped version to 20200316.0 2020-03-16 12:24:39 +01:00
Zack Arnett
2110d9c3b9 Map Card: Fix Dark Mode Toggle (#5209)
* Fix Editor

* comment
2020-03-16 12:23:13 +01:00
Zack Arnett
b77e0b8125 Card Picker: Remove Scale (#5205)
* remove scalling

* add zoom back
2020-03-16 12:22:56 +01:00
Zack Arnett
5197f102ea Webpage Card: Fix Aspect Ratio in Editor (#5210)
* fix Ifram editor

* suffix
2020-03-16 12:22:41 +01:00
Bram Kragten
447d4604c6 Require hyphen in lovelace dashboard url path (#5214)
* Require hyphen in url path

* Update dialog-lovelace-dashboard-detail.ts
2020-03-16 12:22:21 +01:00
Jason Lachowsky
5a84e34f93 Corrected minor misspellings (#5225) 2020-03-16 11:56:04 +01:00
Jay
fb6d3cccdc Cosmetic improvements, minor corrections (#5199)
Made some minor corrections:
"it's" > "its" ("its" is the possessive form of "it")
"setup" > "set up" ("setup" is a noun, "set up" is a verb)

Cosmetic improvement:
"can not" > "cannot" (both are correct, but "cannot" is usually more common, at least in the US. Strictly a matter of opinion here so no worries if you want this reversed.)
2020-03-16 11:51:43 +01:00
HomeAssistant Azure
fad3cb185b [ci skip] Translation update 2020-03-16 00:32:44 +00:00
HomeAssistant Azure
f61ce395f5 [ci skip] Translation update 2020-03-15 00:32:49 +00:00
Franck Nijhof
17f3299152 Fix brightness_pct in light device turn_on action (#5201) 2020-03-13 21:58:34 -07:00
HomeAssistant Azure
17e04589d0 [ci skip] Translation update 2020-03-14 00:32:33 +00:00
Bram Kragten
4b2edde81b Merge pull request #5198 from home-assistant/dev
20200313.0
2020-03-13 20:39:21 +01:00
Bram Kragten
5d3d766f56 Bumped version to 20200313.0 2020-03-13 20:25:21 +01:00
Zack Arnett
94e2a0dea0 Media Card: Reset Marquee on Text change (#5184)
* Stop marquee on next and prev

* force stop

* clean

* This is much better

* Clean

* comments

* comment

* No more repaints
2020-03-13 20:22:49 +01:00
Paulus Schoutsen
21fe68add0 Stub config tweaks (#5197)
* Stub config tweaks

* Lint
2020-03-13 20:22:34 +01:00
Bram Kragten
af6ebea4a3 Fix translations in production builds (#5192)
* Fix translations in production builds

* Make env functions
2020-03-13 10:19:32 -07:00
Paulus Schoutsen
3c17ee03b6 Improve color extraction for media control card (#5189)
* Improve color extraction

* Lazy load media control

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

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

* Extract constant

* Fix media control demo

* Remove quality(1)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-03-13 10:01:36 -07:00
Bram Kragten
0c3c007faf Check if entities is an array (#5193) 2020-03-13 17:48:49 +01:00
Zack Arnett
330eb0957b Update Gauge CSS (#5182) 2020-03-13 14:52:12 +01:00
HomeAssistant Azure
02923475e6 [ci skip] Translation update 2020-03-13 01:16:04 +00:00
Zack Arnett
01ff97b366 Fix Marquee Ellipsis (#5183) 2020-03-12 19:08:51 -04:00
1048 changed files with 48613 additions and 26434 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": "ignorePackages", "js": "ignorePackages" }
],
"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

@@ -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

@@ -8,7 +8,7 @@ trigger:
pr: none
variables:
- name: versionWheels
value: '1.3-3.7-alpine3.10'
value: '1.10.1-3.7-alpine3.11'
- name: versionNode
value: '12.1'
- group: twine
@@ -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,40 @@
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.options = options;
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,6 +1,27 @@
const fs = require("fs");
const path = require("path");
const paths = require("./paths.js");
module.exports = {
isProdBuild: process.env.NODE_ENV === "production",
isStatsBuild: process.env.STATS === "1",
isTravis: process.env.TRAVIS === "true",
isNetlify: process.env.NETLIFY === "true",
isProdBuild() {
return process.env.NODE_ENV === "production";
},
isStatsBuild() {
return process.env.STATS === "1";
},
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");
@@ -21,7 +21,7 @@ gulp.task(
"clean",
gulp.parallel(
"gen-service-worker-dev",
gulp.parallel("gen-icons-app", "gen-icons-mdi"),
"gen-icons-json",
"gen-pages-dev",
"gen-index-app-dev",
"build-translations"
@@ -38,11 +38,11 @@ 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",

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

@@ -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

@@ -2,7 +2,7 @@ const del = require("del");
const gulp = require("gulp");
const mapStream = require("map-stream");
const inDir = "translations";
const inDir = "translations/frontend";
const downloadDir = inDir + "/downloads";
const tasks = [];
@@ -12,7 +12,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 +25,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,19 +42,19 @@ 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 = "move-downloaded-translations";
gulp.task(taskName, function() {
gulp.task(taskName, function () {
return gulp.src(`${downloadDir}/*.json`).pipe(gulp.dest(inDir));
});
tasks.push(taskName);

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

@@ -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);
})
@@ -292,10 +319,11 @@ gulp.task(
function fingerprintTranslationFiles() {
// Fingerprint full file of each language
const files = fs.readdirSync(fullDir);
for (let i = 0; i < files.length; i++) {
fingerprints[files[i].split(".")[0]] = {
// In dev we create fake hashes
hash: env.isProdBuild
hash: env.isProdBuild()
? crypto
.createHash("md5")
.update(fs.readFileSync(path.join(fullDir, files[i]), "utf-8"))
@@ -332,7 +360,7 @@ gulp.task(
gulp.series(
"clean-translations",
"ensure-translations-build-dir",
env.isProdBuild ? (done) => done() : "create-test-translation",
env.isProdBuild() ? (done) => done() : "create-test-translation",
"build-master-translation",
"build-merged-translations",
gulp.parallel(...splitTasks),
@@ -350,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 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,
@@ -38,17 +30,11 @@ const createWebpackConfig = ({
test: /\.css$/,
use: "raw-loader",
},
{
test: /\.(html)$/,
use: {
loader: "html-loader",
options: {
exportAsEs6Default: true,
},
},
},
],
},
externals: {
esprima: "esprima",
},
optimization: {
minimizer: [
new TerserPlugin({
@@ -68,8 +54,9 @@ const createWebpackConfig = ({
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"
@@ -96,14 +83,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 }) => {
@@ -136,7 +115,6 @@ const createAppConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => {
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,
@@ -155,7 +133,7 @@ const createAppConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => {
`/static/translations/${englishFilename}`
] = `build-translations/output/${englishFilename}`;
Object.keys(translationMetadata.fragments).forEach((fragment) => {
translationMetadata.fragments.forEach((fragment) => {
workBoxTranslationsTemplatedURLs[
`/static/translations/${fragment}/${englishFilename}`
] = `build-translations/output/${fragment}/${englishFilename}`;
@@ -198,7 +176,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 +199,9 @@ const createCastConfig = ({ isProdBuild, latestBuild }) => {
outputRoot: paths.cast_root,
isProdBuild,
latestBuild,
defineOverlay: {
__BACKWARDS_COMPAT__: true,
},
});
};
@@ -245,9 +226,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>
@@ -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,6 +172,9 @@ 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) {
this._urlPath = msg.urlPath;
if (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";

View File

@@ -6,6 +6,6 @@ const { isProdBuild } = require("../build-scripts/env.js");
const latestBuild = true;
module.exports = createCastConfig({
isProdBuild,
isProdBuild: isProdBuild(),
latestBuild,
});

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

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": "100px",
top: "50%",
left: "50%",
},

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