Compare commits

..

445 Commits

Author SHA1 Message Date
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
Bram Kragten
f0a4a99654 Merge pull request #5181 from home-assistant/dev
20200312.0
2020-03-12 21:43:28 +01:00
Bram Kragten
02d2368654 Bumped version to 20200312.0 2020-03-12 21:05:35 +01:00
Bram Kragten
e19d07e434 Typos (#5180)
Fixes #5179
Fixes #5178
2020-03-12 21:04:46 +01:00
Bram Kragten
669ed5cb28 Dont create new array on every render (#5177) 2020-03-12 21:02:05 +01:00
Bram Kragten
785ae4a83d Fix for views with url starting with a number (#5176) 2020-03-12 20:49:26 +01:00
Bram Kragten
d327045802 Update dialog-helper-detail.ts 2020-03-12 20:48:41 +01:00
Bram Kragten
785ef19cce Only update map if one of entities changed (#5175) 2020-03-12 20:37:54 +01:00
Bram Kragten
f5653d0da5 Show if helper can be edited (#5174)
Fixes #5173
Fixes #5171
2020-03-12 20:37:33 +01:00
Bram Kragten
e0a6d2efe5 Add on state to media control card (#5168) 2020-03-12 20:11:33 +01:00
Bram Kragten
9971e2e934 Fix scroll entity settings dialog (#5165)
Fixes #5144
2020-03-12 20:11:19 +01:00
Bram Kragten
558802c7dd Simplify action handler directive (#5157) 2020-03-12 20:11:05 +01:00
Bram Kragten
91edcf9b52 Fix stack size (#5155) 2020-03-12 20:10:45 +01:00
Sergey Avdeev
f401aa2897 Update icon_color_css.ts (#5163) 2020-03-12 20:10:30 +01:00
Bram Kragten
1d0389327f Fix helper UI (#5161)
Fixes #5146
Fixes #5145
Fixes #5142
2020-03-12 20:10:06 +01:00
Bram Kragten
06cd7556f3 Dashboard UI fixes (#5160)
Fixes #5152
Fixes #5150
Fixes #5148
2020-03-12 20:09:55 +01:00
Bram Kragten
3b1f9a5dab Fix secondary info (#5159) 2020-03-12 20:09:41 +01:00
Bram Kragten
f54cd18da4 Fix resize observer on error card (#5158)
* Fix resize observer on error card

* Update hui-media-control-card.ts
2020-03-12 20:09:27 +01:00
Zack Arnett
73e0fd614e updates transparent to be hex plus alpha of 0 (#5167) 2020-03-12 19:47:48 +01:00
Paulus Schoutsen
9b220cc6ce Extract media controls into method (#5141)
* Extract media controls into method

* address comments

* lint

* Moooorre fixes

* Fix margin

* Update demos

* Very narrow idle players show play button

* Lint

* More stuff

* Marquee on steroids
2020-03-12 10:40:03 +01:00
Zack Arnett
c7a5f63e33 Fix for safari (#5143) 2020-03-12 10:06:08 +01:00
HomeAssistant Azure
11192e6065 [ci skip] Translation update 2020-03-12 00:32:46 +00:00
Bram Kragten
d83b308100 Fix area dialog too wide (#5136)
* Fix area dialog to wide

* Update styles
2020-03-11 17:10:26 -07:00
Quentame
f67bf6908f Refactor Freebox : add config flow + temperature sensor + signal dispatch (#4448)
* Add config flow to Freebox

* Compress image with https://tinypng.com/
2020-03-11 22:12:40 +01:00
Bram Kragten
2784edc689 Merge pull request #5135 from home-assistant/dev
20200311.1
2020-03-11 19:07:22 +01:00
Bram Kragten
8f41e99464 Bumped version to 20200311.1 2020-03-11 18:52:20 +01:00
Paulus Schoutsen
7c2b37e8ca Demo paths (#5134)
* Update paths to images in demo

* Remove some unused attributes

* Fix camera paths
2020-03-11 10:37:23 -07:00
Bram Kragten
dbdbad2deb Fix closing hui-editor (#5132) 2020-03-11 15:23:31 +01:00
Bram Kragten
e5db86363c Only save non system generated users and tweak text (#5131)
* Only save non system generated users and tweak text

* Clean up
2020-03-11 15:23:19 +01:00
Bram Kragten
b2026c1cd7 Fix automation event trigger UI (#5130) 2020-03-11 13:47:23 +01:00
Bram Kragten
b12f29afad Merge pull request #5128 from home-assistant/dev
20200311.0
2020-03-11 10:09:46 +01:00
Bram Kragten
04b23388b5 Bumped version to 20200311.0 2020-03-11 09:49:43 +01:00
Bram Kragten
7309a937e8 Bump home-assistant-js-websocket (#5127) 2020-03-11 09:38:21 +01:00
Ian Richardson
5dbcd1f726 ability to show attribute instead of state in picture-glance (#4958) 2020-03-11 09:01:00 +01:00
guillempages
3338459139 Allow state-label-element to show attributes (#4953)
* Allow state-label-element to show attributes

Add an additional (optional) parameter to the state-label element,
so that instead of showing the state, an attribute can be shown instead.

Can be used to e.g. add a climate entity to the floorplan,
but show the current temperature instead of the desired one.

* Improve style

Put the most frequent case as default in the ternary

* Remove unneeded variables

Use the _config.attribute directly instead of having a local temporary
Also remove superfluous checks for "!stateObj" (was already checked before)
2020-03-11 09:00:43 +01:00
Bram Kragten
35f17fc1d4 Add no data row when data table empty (#5113) 2020-03-11 08:42:52 +01:00
Zack Arnett
e062940639 Media Card: Fix Style Maps (#5120)
* Fix style map

* Comments
2020-03-11 08:42:34 +01:00
HomeAssistant Azure
ff4d5265c5 [ci skip] Translation update 2020-03-11 00:32:44 +00:00
Paulus Schoutsen
906f417436 Lazy load our elements once again (#5124) 2020-03-10 15:18:13 -07:00
Bram Kragten
1c75fe3bb8 Change marquee to css animations (#5119)
* Update hui-marquee.ts

* Change to css animation

* Comments

* tweaks

* Prevent page repaint on animation start/end
2020-03-10 17:39:16 -04:00
Bram Kragten
283e858576 Helpers: remove init values, change date/time mode picker, dont… (#5118) 2020-03-10 09:37:44 -07:00
HomeAssistant Azure
2b4ab6320b [ci skip] Translation update 2020-03-10 00:32:45 +00:00
Bram Kragten
2085260ce7 Fixes media card (#5115)
* Fixes media card

* Update hui-media-control-card.ts

* Change update of progress bar
2020-03-09 21:22:17 +01:00
Erik Montnemery
1f143176ad Use fallback for device name on device page (#5116)
* Use fallback for device name on device page

* Update ha-config-device-page.ts

* Lint
2020-03-09 21:09:27 +01:00
Bram Kragten
dd2163a837 Update media_player.family_room_2 2020-03-09 19:27:58 +01:00
Zack Arnett
0e1eca8a3e Media Card: Add Marquee to Title (#5095)
* Marquee Addition

* Review Comments

* instance var name change

* fix merge

* Comments plus merge fix
2020-03-09 09:43:53 -07:00
Bram Kragten
9da32880ec Fix update of cached datatables on connect (#5114) 2020-03-09 08:19:23 -07:00
Bram Kragten
15aee6a66a Fix alignment of generic entity row (#5112) 2020-03-09 13:55:30 +01:00
Zack Arnett
aba74f074a Fix input number from overflowing (#5099) 2020-03-09 13:55:14 +01:00
Bram Kragten
75860508de Recalc content height on lovelace change (#5110)
Fixes https://github.com/home-assistant/frontend/issues/5108
2020-03-09 13:20:26 +01:00
Aidan Timson
52160a367a 🔧 Standardize Generic Dialogs (#4726)
* 🔧 Use confirmation dialog in area deletion

* Swap automation confirmation dialogs

* Add to disable webhook

* Add to person deletion

* Add to zone deletion

* Add dialogs in raw editor

* Add/fix try catch

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-03-09 13:16:02 +01:00
Zack Arnett
5651a61604 Media Card: Adds Cursor: Pointer to Progress Bar (#5091) 2020-03-08 20:59:40 -07:00
Zack Arnett
959d8c3181 Media Card: Colors more integrated with Art (#5105) 2020-03-08 20:55:03 -07:00
Paulus Schoutsen
64ee7456dc Style unavailable/unknown cards (#5104)
* Style unavailable/unknown cards

* Hide default image if unavailable

* Style map

Co-authored-by: Zack Arnett <arnett.zackary@gmail.com>
2020-03-08 14:19:58 -07:00
Paulus Schoutsen
814fcf63a8 Fix cardHeight (#5102)
* Fix cardHeight

* Opacity instead of changing DOM

* Better fix

* Remove guard we don't need
2020-03-08 09:42:59 -07:00
Zack Arnett
b72d8cf7d7 Media Card: Fix Progress update (#5096) 2020-03-07 22:00:52 -08:00
Zack Arnett
8e7ef58715 Card Picker: Firefox Fix (#5098) 2020-03-07 21:59:25 -08:00
Paulus Schoutsen
56bfa01c56 Fix demo name 2020-03-07 21:53:40 -08:00
Paulus Schoutsen
4a0fc3e087 Rename demo 2020-03-07 21:51:48 -08:00
Paulus Schoutsen
f3c371996f Add media player card gallery (#5101) 2020-03-07 21:47:53 -08:00
Paulus Schoutsen
e5467181cb Fix vibrant type (#5100) 2020-03-08 00:46:51 -05:00
HomeAssistant Azure
0b3d2ea4ad [ci skip] Translation update 2020-03-08 00:32:36 +00:00
HomeAssistant Azure
9648aa3588 [ci skip] Translation update 2020-03-07 00:32:40 +00:00
HomeAssistant Azure
1b92cbbf74 [ci skip] Translation update 2020-03-06 13:41:27 +00:00
Bram Kragten
9979c046b3 Update azure-pipelines-translation.yml for Azure Pipelines 2020-03-06 14:38:19 +01:00
Bram Kragten
9ad121f9e6 Merge pull request #5089 from home-assistant/dev
20200306.0
2020-03-06 14:19:28 +01:00
Bram Kragten
a0900afba3 Bumped version to 20200306.0 2020-03-06 14:00:36 +01:00
Bram Kragten
1cb614c8a8 Forgot border height (#5088) 2020-03-06 13:46:11 +01:00
David F. Mulcahey
e63723f39e fix click handlers on data tables (#5087) 2020-03-06 13:45:12 +01:00
Bram Kragten
720bd03173 Add image to demo media player (#5086) 2020-03-06 13:44:59 +01:00
Bram Kragten
9e07cf67a5 Fix navigation after deleting a view and allow deleting view with cards (#5085)
* Fix navigation after deleting a view

* Allow deleting views with cards
2020-03-06 13:14:43 +01:00
Thomas Lovén
503dec7345 GUI editor for conditional card (#5051)
* GUI editor for conditional card

* Typing

* Fix typos. Remove quotes

* Add lovelace to card picker

* Address review comments
2020-03-06 12:58:41 +01:00
Bram Kragten
5a2649a65b Virtualize data tabel (#5066)
* WIP

* Fixes and implement further

* Give more space to table on mobile

* Remove unused deps

* Update ha-config-lovelace-dashboards.ts

* Add auto-height

* Console.bye

hihi

* lint
2020-03-06 12:58:13 +01:00
Tomasz
1599dc9e16 Set view visibility form UI (#4978)
* wip

* move logic to hui-view-visibility-editor.ts

* users will be always set

* extra filter to remove deleted users

* added better UI.
I had to add &nbsp; to ha-switch to avoid scrollbar

* fix for comments

* setting default visibility in a better way

* simplified logic, addressed comments
2020-03-06 12:36:34 +01:00
Zack Arnett
84dc8188c4 New Media Player - Cloned from Android Spotify Notification (#5044)
* Media Player Spotify Clone

* Ellipsis fix

* Style for theme update

* Height now determined by player height

* comments - Also includes Testing with images

* Pushing to resolve balloobs comments ;)

* Add Node Vibrant type

* Update Styles

* Comments

* Reviews

* Lint

* undo readme

* Reviews && Clean up

* Clear Interval

* Animation updates + comments

* small style tweak and comment

* Last little fix

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-03-05 21:33:38 -05:00
Paulus Schoutsen
74657ae815 Make cast backwards compatible (#5081)
* Make cast backwards compatible

* Update hc-main.ts

* Update home-assistant-js-websocket
2020-03-05 13:36:13 -08:00
Paulus Schoutsen
1a3b747d17 Style fixes to lovelace config dashboard (#5055)
* Style fixes to lovelace config dashboard

* Add standard panel and show which is default

* Update dialog-lovelace-dashboard-detail.ts

* Updated lovelace icon

* Comments and adapt to backend changes
2020-03-05 11:52:16 -08:00
Bram Kragten
802db71400 Fix secondary info in generic entity row (#5072) 2020-03-05 20:42:15 +01:00
Paulus Schoutsen
4f98524258 Optimise config entities panel + clarify not being able to dele… (#5079) 2020-03-05 09:09:29 -08:00
Bram Kragten
b17ea09b8b Improve chips (#5070)
Follow mdc specs
2020-03-05 12:59:32 +01:00
Bram Kragten
8abbc71e91 Only rebuild when current panel changed (#5071)
* Only rebuild when current panel changed

* Oops

* Update yarn.lock

* copy dep to repo

* Update deep-equal.ts

* Comments
2020-03-05 12:59:18 +01:00
Paulus Schoutsen
1db31fb0f7 Show entity reg editor for helpers when not editable (#5056) 2020-03-04 17:20:16 -08:00
Bram Kragten
e9b5725d7b Update default icon Lovelace sidebar. (#5069) 2020-03-05 00:19:41 +01:00
Bram Kragten
d3105b6846 Add rel=noopener (#5046) 2020-03-04 22:34:48 +01:00
Bram Kragten
196540afc7 Allow card editors to use card picker again (#5067) 2020-03-04 22:04:04 +01:00
Paulus Schoutsen
2b8b9f8311 Remove unused camera command (#5068) 2020-03-04 12:39:56 -08:00
redbar0n
b4f0fce600 Changed login text to be less misleading (#5054)
* Changed login text to be less misleading

See https://github.com/home-assistant/frontend/issues/5053

* Update according to suggestion for improvement

The new text should be more user-friendly.
2020-03-04 15:31:40 +01:00
Zack Arnett
c6f101a487 Add Descriptions for cards - Card Picker (#5058)
* Add Descriptions for cards - this is for card pick

* oops

* Comments from Frenck

* few card capitalizations found

* Comments

* Comments on glance
2020-03-03 17:05:24 -05:00
Paulus Schoutsen
54739c7ccd Support grouped system log messages (#5030)
* Support grouped system log messages

* Format source
2020-03-03 13:55:26 -08:00
Zack Arnett
aa2e632df3 Card Picker with Previews of cards (#4975)
* Card Picker with Previews of cards

* Getting Preview Async - Using dialogs entities

* Create generic getElement - filter entities before

* lint

* Add entities back to Picker. Set Qualifier

* Style Updates

* Move setup of filtered cards to connected

* style updates

* Dont pull entities if noEntity config

* Move all config logic to getConfig

* Style Update - Remove Manual process

* lint

* Accounting for ll-rebuild for async cards

* Style Updates - Use GetStubConfig for most

* Lint

* Filter entities with function - style - no preview

* Iframe rename and description

* Move getstubconfig to helper - update spinner

* Style for themes

* Move entities to be calc once

* Should update

* oops

* TSC

* Comments
2020-03-03 14:53:55 -05:00
Paulus Schoutsen
f3445d99cf Sort ungrouped entities (#5047)
* Sort ungrouped entities

* Console.bye
2020-03-03 17:36:39 +01:00
Bram Kragten
7e48b21767 Remove states-ui and allow setting (local) default lovelace panel (#5043)
* Remove states-ui and allow setting (local) default lovelace panel

* Remove from demo

* Delete ha-cards.js

* Add default for yaml defined dashboards

* Update ha-config-lovelace-dashboards.ts
2020-03-03 16:27:35 +01:00
Bram Kragten
1d1688093a Update config.yml 2020-03-03 11:10:57 +01:00
Bram Kragten
d392695ab7 Recreate translations when changed on dev (#5042) 2020-03-02 07:55:16 -08:00
HomeAssistant Azure
5066560411 [ci skip] Translation update 2020-03-02 12:54:26 +00:00
Bram Kragten
7fa6686e8c Update README.md 2020-03-02 13:40:45 +01:00
Paulus Schoutsen
d74fe6ed52 Update translation hashing (#5025)
* Update translation hashing

* Move gulp-rename
2020-03-02 11:36:00 +01:00
HomeAssistant Azure
319a3b4943 [ci skip] Translation update 2020-03-02 00:36:43 +00:00
HomeAssistant Azure
226e6e9f59 [ci skip] Translation update 2020-03-01 00:32:29 +00:00
Erik Montnemery
42f311a457 Update whitelist (#5026) 2020-02-29 14:09:14 +01:00
HomeAssistant Azure
e50ec2e2e2 [ci skip] Translation update 2020-02-29 00:32:31 +00:00
Bram Kragten
b72a3361c0 Fixes for brightness automation action (#5003)
* Fixes for brightness

* Add checbox before optional range integer

* Console

* Comments
2020-02-28 23:01:45 +01:00
Bram Kragten
7b057eaa77 Merge pull request #5024 from home-assistant/dev
20200228.0
2020-02-28 22:59:33 +01:00
Paulus Schoutsen
d7aaed05b7 Clean up generic row (#5022) 2020-02-28 13:35:42 -08:00
Bram Kragten
c5fe5565bb Merge branch 'master' into dev 2020-02-28 22:21:45 +01:00
Bram Kragten
a1a1763897 Bumped version to 20200228.0 2020-02-28 22:20:44 +01:00
Bram Kragten
724357683c Add take control for yaml mode (#4992) 2020-02-28 22:00:01 +01:00
Bram Kragten
0d6de9fe73 Fix for unavailable input-select (#4991)
* Fix for unavailable select

* Update hui-thermostat-card.ts
2020-02-28 21:59:14 +01:00
Bram Kragten
5646045e9e Add UI to create and manage Lovelace dashboards and resources (#5012)
* Add UI to create and manage Lovelace dashboards and resources

* update, comments, fixes

* Align icons with seach icon and checkboxes

* Fix

* Remove js and html resource types

* Allow it for existing ones
2020-02-28 21:58:50 +01:00
Bram Kragten
17c7a3bbac Bumped version to 20200220.5 2020-02-28 15:35:08 +01:00
Ian Richardson
8d65eb1fdf Fix state_color for button (#4995) 2020-02-28 15:35:04 +01:00
Ian Richardson
2298a55b16 Fix action handling for buttons row (#5007) 2020-02-28 15:34:45 +01:00
HomeAssistant Azure
33d65bcefc [ci skip] Translation update 2020-02-28 00:32:34 +00:00
Thomas Lovén
3cc7deda04 GUI editors for stacks (#4999)
* GUI editors for stacks

* fix type checking

* lint

* Address review comments

* Cleanup. Removing inline functions, combining others

* Give the class a more fitting name

* Final tweak

* Update stack cards

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-02-27 14:07:55 +01:00
Bram Kragten
e2de660bec Only cache default lovelace and handle config updates (#5000)
* Only cache default lovelace and handle config updates

* Update partial-panel-resolver.ts
2020-02-27 14:01:37 +01:00
Bram Kragten
6b1e5a525f Fix update if no lastversion and change audio pickers to default (#5010) 2020-02-27 11:44:09 +01:00
Ian Richardson
93565f0ed9 Fix action handling for buttons row (#5007) 2020-02-27 09:20:20 +01:00
HomeAssistant Azure
143d1162b6 [ci skip] Translation update 2020-02-27 00:32:30 +00:00
Ian Richardson
788d616fa2 Fix state_color for button (#4995) 2020-02-26 23:03:47 +01:00
Bram Kragten
0de9471a5d Revert "Static import all the LL cards etc" (#4989)
This reverts commit 52ded635ff.
2020-02-26 08:03:05 -08:00
Bram Kragten
b229071248 Add helper UI (#4940)
* Add helper UI

* Oops

* Update

* Update

* Update

* Lint

* Add all input forms

* Return extended entity registry entry from update

* Comments

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-02-26 12:53:03 +01:00
Bram Kragten
6d145730a5 Bumped version to 20200220.4 2020-02-26 09:42:10 +01:00
Paulus Schoutsen
f02bb67485 Static import all the LL cards etc (#4987) 2020-02-26 09:42:03 +01:00
Paulus Schoutsen
52ded635ff Static import all the LL cards etc (#4987) 2020-02-26 09:40:54 +01:00
HomeAssistant Azure
a6d73828b8 [ci skip] Translation update 2020-02-26 00:32:31 +00:00
Paulus Schoutsen
1d052fa5bb Add support for multiple Lovelace dashboards (#4967)
* Add support for multiple Lovelace dashboards

* Fix navigation, add to cast, revert resource loading

* Change resource logic

* Lint + cast fix

* Comments

* Fixes

* Console.bye

* Lint"

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-02-25 13:06:25 -08:00
Bram Kragten
38d758b52f Bumped version to 20200220.3 2020-02-25 21:56:52 +01:00
Bram Kragten
9162e9c318 Bumped version to 20200220.2 2020-02-25 21:55:36 +01:00
Bram Kragten
189ea00768 Fix for when the preview element was an error element (#4969)
* Fix for when the preview element was an error element

* Comments

* Update hui-dialog-edit-card.ts
2020-02-25 21:51:52 +01:00
Bram Kragten
25d6427aed Fix for when the preview element was an error element (#4969)
* Fix for when the preview element was an error element

* Comments

* Update hui-dialog-edit-card.ts
2020-02-25 21:51:07 +01:00
Franck Nijhof
8a61442cf2 Add dev demo builds GitHub Actions workflow (#4980) 2020-02-25 10:15:48 -08:00
Franck Nijhof
106d405699 Only trigger on PRs or pushes against the master and dev branch… (#4982) 2020-02-25 10:06:14 -08:00
Chris Talkington
1f23e9062f Fix typo in supervisor popup (#4966) 2020-02-24 20:45:08 -08:00
Franck Nijhof
231b498ea5 Remove Travis-CI (#4972) 2020-02-24 20:43:47 -08:00
HomeAssistant Azure
a256e5abfa [ci skip] Translation update 2020-02-25 00:33:05 +00:00
Ruslan Sayfutdinov
028b370ead [logbook] fix scrolling on iOS (#4950)
* [logbook] fix scrolling on iOS

* Update styling

* Update ha-logbook.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-02-24 13:50:22 +01:00
Sergey Avdeev
18abc6adf7 Update icon_color_css.ts (#4962) 2020-02-24 11:43:58 +01:00
Ruslan Sayfutdinov
95aa29d6ca Fix layout of history and logbook filters (#4963) 2020-02-24 11:38:05 +01:00
Paulus Schoutsen
5d2242dd16 Add a smarter default value for entity card show header toggle (#4964) 2020-02-24 11:29:40 +01:00
HomeAssistant Azure
de8bca6967 [ci skip] Translation update 2020-02-24 00:32:30 +00:00
HomeAssistant Azure
12234de20e [ci skip] Translation update 2020-02-23 00:32:34 +00:00
Tomasz
b41369a2ad Localize tabs names in view editor (#4954)
* Localize tabs

* remove Polish localization
2020-02-22 15:00:01 +01:00
HomeAssistant Azure
6e35c79c14 [ci skip] Translation update 2020-02-22 00:32:31 +00:00
Franck Nijhof
22e4c0512e Add GitHub Actions (#4952) 2020-02-21 13:59:09 +01:00
HomeAssistant Azure
3606b8077f [ci skip] Translation update 2020-02-21 00:34:40 +00:00
Paulus Schoutsen
3a90a65ba8 Merge pull request #4948 from home-assistant/dev
20200220.1
2020-02-20 14:49:22 -08:00
Paulus Schoutsen
e59987a8ed Bumped version to 20200220.1 2020-02-20 14:47:40 -08:00
Paulus Schoutsen
22d8ce0fd9 Fix creating card (#4947) 2020-02-20 14:47:28 -08:00
Zep Fietje
01eae3876b Make config list items appearance consistent for automations, scenes and scripts (#4945) 2020-02-20 21:10:40 +01:00
Paulus Schoutsen
2e43f390a4 Merge pull request #4942 from home-assistant/dev
20200220.0
2020-02-20 10:29:20 -08:00
Paulus Schoutsen
65421fa551 Bumped version to 20200220.0 2020-02-20 10:14:57 -08:00
Zack Arnett
fc88922ce3 Fix CPU and Browser Usuage (#4935) 2020-02-20 09:57:14 +01:00
Paulus Schoutsen
52609dded9 Add rebuild support to editor preview (#4932)
* Add rebuild support to editor preview

* getLovelaceCardClass function added

* Use error class

* Tiny cleanup

* Misplaced comment
2020-02-20 09:55:42 +01:00
HomeAssistant Azure
6d54496187 [ci skip] Translation update 2020-02-20 00:32:31 +00:00
Bram Kragten
2a6c38066d Merge pull request #4920 from home-assistant/dev
20200219.0
2020-02-19 10:49:19 +01:00
Bram Kragten
924c7804c9 Update hui-media-control-card.ts (#4919) 2020-02-19 10:44:42 +01:00
Bram Kragten
23f34fa7ae Bumped version to 20200219.0 2020-02-19 10:30:14 +01:00
Ian Richardson
7046cba1f7 Add buttons row (#4714)
*  Add buttons row

* refactor to composition

* Add action handler

* address review
2020-02-19 10:25:42 +01:00
Zack Arnett
4be1040a14 Convert History Graph Card to Typescript (#4882)
* Converting History Graph to Typescript

* Conversion to TS

* Reviews

* Review Updates
2020-02-19 10:20:37 +01:00
Zack Arnett
68baeb83cb Media Card Seek Functionality (#4907)
* Seek function

* Remove a testing section

* reviews
2020-02-19 10:19:57 +01:00
Zack Arnett
aa94e45582 Sensor Card - Top Margin 16px -> 8px (#4917) 2020-02-18 22:36:49 -08:00
Zack Arnett
2c58a9f802 Sensor Stroke Width Fix (#4916)
* Sensor width fix

* Const
2020-02-18 20:20:32 -08:00
HomeAssistant Azure
0a41a4f066 [ci skip] Translation update 2020-02-19 00:32:35 +00:00
Bram Kragten
e265d9581c Fix multiselect without data (#4906) 2020-02-18 22:17:52 +01:00
Paulus Schoutsen
4675579f79 Add safe mode support (#4908)
* Add safe mode support

* Lint

* Fix type in demo
2020-02-18 08:33:25 -08:00
Bram Kragten
52ae01ea74 Fix description and title of options flow (#4910) 2020-02-18 11:27:27 +01:00
HomeAssistant Azure
099430238c [ci skip] Translation update 2020-02-18 00:32:41 +00:00
Bram Kragten
af3626b215 Merge pull request #4850 from zsarnett/media-card-updates
Update Media Card to check for Supported Features
2020-02-17 21:16:06 +01:00
Bram Kragten
52ea3a5ce8 Merge pull request #4895 from scop/sort-available-events
Sort list of available events
2020-02-17 21:15:08 +01:00
Ville Skyttä
2ab2ade642 Import compare 2020-02-17 21:15:58 +02:00
Zack Arnett
1cc3936ec3 Typing functions 2020-02-17 13:36:21 -05:00
Paulus Schoutsen
322eef1c0f Add more info to system log (#4899)
* Add more info to system log

* Add util, oops

* Tweak UI
2020-02-17 10:20:24 -08:00
Zack Arnett
0964130782 rookie mistake 2020-02-17 12:09:17 -05:00
Zack Arnett
be9ec50e3a When no image occurs mark the image as undefined 2020-02-17 11:51:05 -05:00
Zack Arnett
da1dd45169 Update for playlist information if music isnt present 2020-02-17 11:31:27 -05:00
Zack Arnett
9a7f7f119d Review updates again because I am a fool 2020-02-17 10:28:13 -05:00
Bram Kragten
b1a414c840 Merge pull request #4903 from home-assistant/dev
20200217.0
2020-02-17 16:24:27 +01:00
Zack Arnett
2718ada9f9 Review updates 2020-02-17 10:01:01 -05:00
Bram Kragten
46a596ce34 Bumped version to 20200217.0 2020-02-17 15:58:06 +01:00
Bram Kragten
7036cefa72 Allow to change the location of home zone in zone editor (#4849)
* Allow to change the location of home zone in zone editor

* Update src/translations/en.json

Co-Authored-By: Paulus Schoutsen <balloob@gmail.com>

* Comment + mobile to general config

* Remove dupe import

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-02-17 15:27:31 +01:00
Ian Richardson
fb7fbf2dac add state_color option to glance, button and state-icon (#4854)
* add state_color option to glance, button and state-icon

* address comments

* address comments
2020-02-17 15:26:45 +01:00
Bram Kragten
49b0c8d549 include entities not in entity registry in config entities (#4867)
* include entities not in entity registry in config entities

* Update ha-data-table.ts

* Comments

* Update ha-device-entities-card.ts

* Comments
2020-02-17 15:02:23 +01:00
Bram Kragten
8f9a6bd544 Add multi select component to ha-form (#4247)
* Add multi select component

* Apply suggestions from code review

Co-Authored-By: Ian Richardson <iantrich@gmail.com>

* Comments

* update

* Fix

* Refactor to dropdown menu

Co-authored-by: Ian Richardson <iantrich@gmail.com>
2020-02-17 14:13:09 +01:00
Ruslan Sayfutdinov
24e4b0b772 [sidebar] set max-width for item-text (#4893) 2020-02-16 20:23:25 -08:00
HomeAssistant Azure
1c86bd2f8b [ci skip] Translation update 2020-02-17 00:32:55 +00:00
Zack Arnett
363f548f13 fix error (#4885) 2020-02-16 15:19:28 -08:00
Ville Skyttä
51ce481e77 Sort list of available events 2020-02-16 23:32:47 +02:00
Zack Arnett
30e5611812 Stupid mistake 2020-02-16 12:15:56 -05:00
Zack Arnett
67706a312d Support for requesting the image from the server 2020-02-16 12:11:18 -05:00
Paulus Schoutsen
f4eb3380b4 Less whitespace around icon (#4888) 2020-02-15 22:39:03 -08:00
Paulus Schoutsen
73934afc7d Sensor card hugging (#4887) 2020-02-16 00:57:56 -05:00
Paulus Schoutsen
9d2a0c0502 Reduce size of floorplan pic Arsaboo (#4886) 2020-02-15 21:40:28 -08:00
HomeAssistant Azure
9ec75531a8 [ci skip] Translation update 2020-02-16 00:32:37 +00:00
HomeAssistant Azure
91bdb8f742 [ci skip] Translation update 2020-02-15 00:32:38 +00:00
Thomas Lovén
d8ae3439de Make sure config is always frozen. Not just on error (#4871) 2020-02-14 16:11:25 -08:00
Bram Kragten
2d018fff6c Update babel en disable ES5 builds on dev (#4876) 2020-02-14 16:09:21 -08:00
Bram Kragten
7d37dc6cde Bump vaadin elements (#4878) 2020-02-14 16:08:44 -08:00
Bram Kragten
c60033027d Update material elements (#4877)
* Update material elements

* Update ha-checkbox.ts
2020-02-14 16:08:30 -08:00
Ian Richardson
3f7c29a6f6 ♻️ change entity-button to button card (#4581)
* ♻️ change entity-button to button card

* maintain separate entity-button class
2020-02-14 10:56:08 +01:00
Paulus Schoutsen
b2243f480c Add option to lazy load cards (#4857)
* Add option to lazy load cards

* Lazy load header/footer elements

* Lazy load rows

* Clean up params

* Rename last var
2020-02-13 21:13:48 -08:00
Ian Richardson
f5384e8bc8 add create helper functions for custom cards (#4853)
* add create helper functions for custom cards

* address comments
2020-02-13 21:13:29 -08:00
Robbie Trencheny
ecc6fcf862 Hide HTML5 push notification toggle if inside external app (#4860)
* Hide HTML5 push notification toggle if external bus is engaged

* Use isExternal instead

* Hide the whole row

* Black

* Fix import

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-02-13 17:47:08 -08:00
HomeAssistant Azure
46cc2aec94 [ci skip] Translation update 2020-02-14 00:32:50 +00:00
Thomas Lovén
c62a5a6dcd Freeze lovelace configuration on load (#4862)
* Freeze lovelace configuration on load

* Clone only when necessary

* Make cloning badges really work

* Freeze after checking

* Don't doublefreeze
2020-02-13 16:18:15 -08:00
Zack Arnett
f6b10232ec Disabled Style Updates 2020-02-13 16:35:16 -05:00
Zack Arnett
87559c0938 Review Updates 2020-02-13 16:30:34 -05:00
Bram Kragten
7903541689 Add toolbars and mobile headers + layout tweaks (#4803)
* Add toolbars and mobile headers + layout tweaks

* Comments
2020-02-13 19:53:48 +01:00
Bram Kragten
c93e1b0123 Add more info for Person (#4848)
* Add more info for Person

* Update src/dialogs/more-info/controls/more-info-vacuum.ts

Co-Authored-By: Paulus Schoutsen <balloob@gmail.com>

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-02-13 09:06:52 -08:00
Bram Kragten
e261fafdb3 Allow enabling/disabling automation from edit screen (#4846)
* Allow enabling/disabling automation from edit screen

* Comments
2020-02-13 09:06:14 -08:00
Bram Kragten
485e2fde25 Update hui-thermostat-card.ts (#4863) 2020-02-13 08:41:51 -08:00
Bram Kragten
6feaf64c90 Fix display of arrays/objects in attributes (#4836)
* Fix display of arrays/objects in attributes

* async import js-yaml
2020-02-13 08:22:41 -08:00
Bram Kragten
6b115bf06a Merge pull request #4859 from home-assistant/frenck-2020-0188
Spelling: Config(uration)
2020-02-13 10:29:46 +01:00
Bram Kragten
f45785fafe Change defaults of automations to device (#4843)
* Change defaults of automations to device

* Script too

* Update device_automation.ts

* Update device_automation.ts
2020-02-12 20:43:44 -08:00
Ruslan Sayfutdinov
ec046bc925 [history] fix dropdown animation (#4858) 2020-02-12 20:36:29 -08:00
HomeAssistant Azure
ab5733718b [ci skip] Translation update 2020-02-13 00:33:01 +00:00
Franck Nijhof
1077fb2945 Spelling: Config(uration) 2020-02-13 00:30:41 +01:00
Bram Kragten
b7a84cdd60 Merge pull request #4856 from home-assistant/dev
20200212.0
2020-02-12 22:41:36 +01:00
Bram Kragten
78102f5882 Merge branch 'master' into dev 2020-02-12 22:21:32 +01:00
Bram Kragten
4ea11bd928 Bumped version to 20200212.0 2020-02-12 22:18:01 +01:00
Bram Kragten
49422c3f63 Fix translations for update button config entry system options (#4837) 2020-02-12 13:49:20 +01:00
Bram Kragten
0b8700f725 Hide zone edit button for non admins (#4840) 2020-02-12 13:48:51 +01:00
Bram Kragten
c5aa000a97 Check for null target_temp (#4842)
Fixes #4359
2020-02-12 13:48:27 +01:00
Bram Kragten
4cdc4765f7 Fix tap firing twice on iOS (#4841) 2020-02-12 13:47:56 +01:00
Ruslan Sayfutdinov
a95290235d [logbook] fix margins for RTL languages (#4852) 2020-02-11 17:29:35 -08:00
HomeAssistant Azure
fb9d7ac2d8 [ci skip] Translation update 2020-02-12 00:32:46 +00:00
Ruslan Sayfutdinov
d48a4e0ac6 [logbook] implement shouldUpdate (#4832)
* [logbook] implement shouldUpdate

* Update src/panels/logbook/ha-logbook.ts

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

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-02-11 15:26:28 -08:00
Zack Arnett
d33e035db7 Update Media Card to check for supported features 2020-02-11 13:11:25 -05:00
Bram Kragten
1437b4c4b6 Fix media control card styling (#4845) 2020-02-11 09:43:46 -05:00
Robert Resch
9fce60065b Add lozalization to more-info-vacuum (#4793)
* Convert more-info-vacuum to Lit

* Introduce VacuumCommand to reduce render complexity and duplicate code

* Add localization for more-info-vacuum

* Inline supportFeature instead of creating a const.

* - Use interface instead of class for VacuumCommand
- Add different translation for start_pause and pause as they are not the same

* fix typo

* Use VACUUM_COMMANDS.some instead of writing duplicate code

* add @bramkragten suggestions
2020-02-11 09:15:38 +01:00
Paulus Schoutsen
d052b9ede8 Update en.json (#4835) 2020-02-11 09:05:18 +01:00
Ruslan Sayfutdinov
8cee5c729e [logbook] fix period dropdown animation (#4834) 2020-02-10 20:50:12 -08:00
HomeAssistant Azure
88bdf7c7ec [ci skip] Translation update 2020-02-11 00:32:36 +00:00
Bram Kragten
2c006e99f2 Use original id to remove entity (#4829) 2020-02-10 15:17:29 -08:00
Erik Montnemery
e7e8dff0ec Graceful fallback if translations for device automations are missing (#4824)
* Graceful fallback if translations for device automations are missing

* Update src/data/device_automation.ts

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

* Update src/data/device_automation.ts

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

* Update src/data/device_automation.ts

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

* tweak

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-02-10 20:17:24 +01:00
Ian Richardson
981c798e22 💄 match alarm panel icon coloring to card's (#4825) 2020-02-10 08:43:38 -08:00
Ruslan Sayfutdinov
4613d8b1f6 [logbook] configure flex container to display entries correctly on mobile devices (#4810) 2020-02-10 10:11:28 +01:00
Paulus Schoutsen
ba4e1949c4 Theme update refetch themes (#4812) 2020-02-10 10:10:39 +01:00
Iulian Onofrei
cc6686a790 Fix typo (#4779) 2020-02-10 10:03:42 +01:00
Nicholas Amadori
f791412f73 Spelling (#4806)
"Gerenal" corrected to "General"
2020-02-10 10:03:19 +01:00
HomeAssistant Azure
0c8ac17dcb [ci skip] Translation update 2020-02-10 00:32:29 +00:00
HomeAssistant Azure
9e11fe868e [ci skip] Translation update 2020-02-09 00:32:35 +00:00
Bram Kragten
7d91515bf5 Style tweaks (#4766)
* Style tweaks

* Update ha-style.ts

* Move derived styles
2020-02-08 14:49:29 -08:00
HomeAssistant Azure
e0565c35ab [ci skip] Translation update 2020-02-08 00:32:33 +00:00
Paulus Schoutsen
e5387e5806 Fall back to use handler if translations broken (#4777) 2020-02-07 18:46:16 +01:00
Paulus Schoutsen
8a4c52aeb7 Filter battery sensors from generated UI (#4799)
* Filter battery sensors from generated UI

* Use fancy TypeScript feature
2020-02-07 18:32:37 +01:00
Paulus Schoutsen
15e7b8117c Add integrations to dev info page (#4800)
* Add integrations to dev info page

* Fix annoying looking html tags

* What happened here
2020-02-07 18:30:38 +01:00
HomeAssistant Azure
d1703ba3e8 [ci skip] Translation update 2020-02-07 00:32:35 +00:00
Ruslan Sayfutdinov
c977f22047 Show seconds in the UI (#4765) 2020-02-06 10:38:38 -08:00
Zack Arnett
2e47aa1905 Update Edit Footer for Cards (#4752)
* Update CSS

* Radius Updates

* Updating to be a ha-card element
2020-02-05 23:05:49 -08:00
HomeAssistant Azure
c72105dca3 [ci skip] Translation update 2020-02-06 00:32:31 +00:00
Bram Kragten
e01f1cfcac More info scroll fix (#4774)
* Fix more info dialog scrolling

* Update ha-more-info-dialog.js
2020-02-05 14:03:16 -08:00
Zack Arnett
2e4c73c087 Convert Media Control Card to Typescript (#4761)
* Delete old JS file. Add new TS file. Add Type

* Updates

* Reviews

* Review Updates :)

* Updating State Localize

* Clean up

* Fixing Travis
2020-02-05 09:28:29 -08:00
Bram Kragten
c7f7ef28bf Fixes removing audio device (#4763)
(only the supervisor doesn't support it)
2020-02-05 09:21:43 -08:00
Michael Irigoyen
aac7dbab58 Update Material Design Icons to v4.9.95 (#4764) 2020-02-05 17:34:10 +01:00
Bram Kragten
8518f774d4 Rename hass.io panel to supervisor 2020-02-05 10:00:19 +01:00
HomeAssistant Azure
cb0d91d124 [ci skip] Translation update 2020-02-05 00:32:34 +00:00
Zack Arnett
107f428dd3 Sensor Card Fill feature (#4745) 2020-02-04 16:11:13 -08:00
Bram Kragten
7758ddba56 Fix theming with derived styles (#4758)
* Fix theming with derived styles

* Move
2020-02-04 15:40:35 -08:00
Paulus Schoutsen
e0376c803f Fix hassio audio 2020-02-04 10:28:43 -08:00
Paulus Schoutsen
788c490bbc Update update headers in hassio (#4751)
* Update update headers in hassio

* Other tabs too
2020-02-04 18:36:10 +01:00
Ian Richardson
cdf6e9eb75 🐛 properly format timestamps in glance card (#4602)
* 🐛 properly format timestamps in glance card

* address review comments
2020-02-04 16:18:42 +01:00
Bram Kragten
4aa49f66bc Remove unused classmap 2020-02-04 15:55:29 +01:00
Bram Kragten
1bf82f216a Tweak badge focus padding (#4750) 2020-02-04 15:15:15 +01:00
Bram Kragten
004ff58c21 Update hassio-style.ts 2020-02-04 13:34:14 +01:00
Joakim Sørensen
f1a1654371 Use icon image where available (#4721)
* Use iconimg where available

* Adjust margin for icon

* remove log

* Fix property casing

* Add blue topbar, and generalize properties

* Inline checks

* inline property functions

* Limit compute

* Linting

* lovercase const

* Review comments and move update dot to line

* Add roboto font to hassio

* Fix update and stopped styles colliding

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-02-04 12:36:09 +01:00
Bram Kragten
862044ca23 Hassio styling tweaks (#4749)
* Hassio styling tweaks

* Update hassio-style.ts

* Update hassio-pages-with-tabs.ts
2020-02-04 10:54:10 +01:00
Paulus Schoutsen
c54b474838 Hide automations from generated UI (#4748) 2020-02-04 09:27:26 +01:00
Bram Kragten
42cbe863bb Fix passive color radius and fix switch label clicks (#4703)
* Fix passive color radius and fix switch label clicks

* Colors vars
2020-02-03 22:32:22 -08:00
HomeAssistant Azure
ccc42dad79 [ci skip] Translation update 2020-02-04 00:33:02 +00:00
Paulus Schoutsen
82ff444cec Confirm when resetting hassio optoins (#4718) 2020-02-03 08:53:57 -08:00
Paulus Schoutsen
24c591fbf3 Convert Hass.io add-on options to YAML (#4717)
* Convert Hass.io options to YAML

* Fix yaml editors on other places

* Update ha-automation-action-service.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-02-03 11:06:47 +01:00
Joakim Sørensen
ad676d7fd3 Fix theme on sensor card (#4724) 2020-02-03 09:30:20 +01:00
David F. Mulcahey
cbe4782d78 fix loading groups (#4727) 2020-02-03 09:29:13 +01:00
HomeAssistant Azure
3fdcc1c0ea [ci skip] Translation update 2020-02-03 00:32:48 +00:00
HomeAssistant Azure
f9d64e51c4 [ci skip] Translation update 2020-02-02 00:32:38 +00:00
Paulus Schoutsen
b082828a75 Forward haptic events to parent window (#4719) 2020-02-01 08:11:57 -08:00
Paulus Schoutsen
25f5bf0042 Fix ingress add-on not started dialog showing twice (#4716)
* Fix ingress add-on not started dialog showing twice

* logging not allowed
2020-02-01 08:11:30 -08:00
Bram Kragten
f5dec3c6d5 Change map settings icon (#4701)
* Change map settings icon

Closes #4694

* hide for demo
2020-02-01 00:26:22 -08:00
Joakim Sørensen
3215437bb8 Fixes add-on audio selector (#4648)
* Fixes addon audio selector

* Set device as property

* Use getAttribute

* Keep device as attribute

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-31 23:03:30 -08:00
HomeAssistant Azure
33176d8f3d [ci skip] Translation update 2020-02-01 00:32:28 +00:00
Ian Richardson
f82b62f45c 🐛 fix tabindex for default entity more-info actions (#4697)
* 🐛 fix tabindex for default entity more-info actions

* Update hui-state-label-badge.ts
2020-01-31 17:19:08 +01:00
Bram Kragten
edfdd0da89 Styling zone menu (#4684)
* Styling zone menu

* Update ha-device-entities-card.ts
2020-01-31 12:14:21 +01:00
HomeAssistant Azure
33d9bf4660 [ci skip] Translation update 2020-01-31 00:32:34 +00:00
593 changed files with 32944 additions and 11835 deletions

1
.gitattributes vendored
View File

@@ -11,3 +11,4 @@
*.mp3 binary
demo/public/api/camera_proxy_stream/* binary
demo/public/api/media_player_proxy/* binary

View File

@@ -3,6 +3,7 @@ name: Report a bug with the UI, Frontend or Lovelace
about: Report an issue related to the Home Assistant frontend.
labels: bug
---
<!-- READ THIS FIRST:
- If you need additional help with this template please refer to https://www.home-assistant.io/help/reporting_issues/
- Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/home-assistant/releases
@@ -10,6 +11,7 @@ labels: bug
- Provide as many details as possible. Paste logs, configuration samples and code into the backticks.
DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed without comment.
-->
## Checklist
- [ ] I have updated to the latest available Home Assistant version.
@@ -17,21 +19,22 @@ DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed w
- [ ] I have tried a different browser to see if it is related to my browser.
## The problem
<!--
Describe the issue you are experiencing here to communicate to the
maintainers. Tell us about the current behavior.
If possible provide a screenshot with a description.
-->
## Expected behavior
<!--
<!--
Describe what you expected to happen or it should look/behave.
If possible provide a screenshot with a description.
-->
## Steps to reproduce
<!--
Provide steps for us, that helps reproducing your issue.
For example:
@@ -43,8 +46,8 @@ DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed w
6. Set the HVAC action to cool
-->
## Environment
<!--
Provide details about the versions you are using, which helps us reproducing
and finding the issue quicker. Version information is found in the
@@ -54,13 +57,13 @@ DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed w
your issue in a different browser and be sure to include your findings.
-->
- Home Assistant release with the issue:
- Last working Home Assistant release (if known):
- UI Type (States or Lovelace):
- Browser and browser version:
- Operating system:
- Home Assistant release with the issue:
- Last working Home Assistant release (if known):
- Browser and browser version:
- Operating system:
## Problem-relevant configuration
<!--
An example configuration that caused the problem for you. Fill this out even
if it seems unimportant to you. Please be sure to remove personal information
@@ -72,6 +75,7 @@ DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed w
```
## Javascript errors shown in your browser console/inspector
<!--
If you come across any javascript or other error logs, e.g., in your browser
console/inspector please provide them.
@@ -82,4 +86,3 @@ DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed w
```
## Additional information

View File

@@ -1,7 +1,7 @@
blank_issues_enabled: false
contact_links:
- name: Report a bug that is NOT related to the UI, Frontend or Lovelace
url: https://github.com/home-assistant/home-assistant/issues
url: https://github.com/home-assistant/core/issues
about: This is the issue tracker for our frontend. Please report other issues with the backend repository.
- name: Report incorrect or missing information on our website
url: https://github.com/home-assistant/home-assistant.io/issues

127
.github/workflows/ci.yaml vendored Normal file
View File

@@ -0,0 +1,127 @@
name: CI
on:
push:
branches:
- dev
- master
pull_request:
branches:
- dev
- master
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/checkout@v2
- name: Setting up Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Get yarn cache path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Fetching Yarn cache
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install
env:
CI: true
- name: Build icons
run: ./node_modules/.bin/gulp gen-icons-hassio gen-icons-mdi gen-icons-app
- 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'
- name: Run tsc
run: ./node_modules/.bin/tsc
test:
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/checkout@v2
- name: Setting up Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Get yarn cache path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Fetching Yarn cache
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install
env:
CI: true
- name: Run Mocha
run: npm run mocha
build:
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: Check out files from GitHub
uses: actions/checkout@v2
- name: Setting up Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Get yarn cache path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Fetching Yarn cache
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install
env:
CI: true
- name: Build Application
run: ./node_modules/.bin/gulp build-app
env:
TRAVIS: "true"
supervisor:
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: Check out files from GitHub
uses: actions/checkout@v2
- name: Setting up Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Get yarn cache path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Fetching Yarn cache
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install
env:
CI: true
- name: Build Application
run: ./node_modules/.bin/gulp build-hassio
env:
TRAVIS: "true"

39
.github/workflows/demo.yaml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: Demo
on:
push:
branches:
- dev
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/checkout@v2
- name: Setting up Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Get yarn cache path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Fetching Yarn cache
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install
env:
CI: true
- name: Build Demo
run: ./node_modules/.bin/gulp build-demo
- name: Deploy to Netlify
uses: netlify/actions/cli@master
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEMO_DEV_SITE_ID }}
with:
args: deploy --dir=demo/dist --prod

3
.gitignore vendored
View File

@@ -31,3 +31,6 @@ src/cast/dev_const.ts
# Secrets
.lokalise_token
yarn-error.log
#asdf
.tool-versions

View File

@@ -1,18 +0,0 @@
sudo: false
language: node_js
cache:
yarn: true
directories:
- bower_components
install: yarn install
script:
- npm run build
- hassio/script/build_hassio
# Because else eslint fails because hassio has cleaned that build
- ./node_modules/.bin/gulp gen-icons-app
- npm run test
# - xvfb-run wct --module-resolution=node --npm
# - 'if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct --module-resolution=node --npm --plugin sauce; fi'
dist: trusty
addons:
sauce_connect: true

View File

@@ -1,4 +1,4 @@
# Home Assistant Polymer [![Build Status](https://travis-ci.org/home-assistant/home-assistant-polymer.svg?branch=master)](https://travis-ci.org/home-assistant/home-assistant-polymer)
# Home Assistant Frontend
This is the repository for the official [Home Assistant](https://home-assistant.io) frontend.
@@ -19,12 +19,15 @@ This is the repository for the official [Home Assistant](https://home-assistant.
## Frontend development
### Classic environment
A complete guide can be found at the following [link](https://www.home-assistant.io/developers/frontend/). It describes a short guide for the build of project.
### Docker environment
It is possible to compile the project and/or run commands in the development environment having only the [Docker](https://www.docker.com) pre-installed in the system. On the root of project you can do:
* `sh ./script/docker_run.sh build` Build all the project with one command
* `sh ./script/docker_run.sh bash` Open an interactive shell (the same environment generated by the *classic environment*) where you can run commands. This bash work on your project directory and any change on your file is automatically present within your build bash.
- `sh ./script/docker_run.sh build` Build all the project with one command
- `sh ./script/docker_run.sh bash` Open an interactive shell (the same environment generated by the _classic environment_) where you can run commands. This bash work on your project directory and any change on your file is automatically present within your build bash.
**Note**: if you have installed `npm` in addition to the `docker`, you can use the commands `npm run docker_build` and `npm run bash` to get a full build or bash as explained above

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
@@ -50,15 +50,8 @@ stages:
- 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

@@ -11,7 +11,7 @@ trigger:
pr: none
schedules:
- cron: "30 0 * * *"
displayName: "translation update"
displayName: "frontend translation update"
branches:
include:
- dev

View File

@@ -34,6 +34,7 @@ module.exports.babelLoaderConfig = ({ latestBuild }) => {
},
],
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator",
[
require("@babel/plugin-proposal-decorators").default,
{ decoratorsBeforeExport: true },

View File

@@ -1,6 +1,14 @@
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";
},
isTravis() {
return process.env.TRAVIS === "true";
},
isNetlify() {
return process.env.NETLIFY === "true";
},
};

View File

@@ -24,7 +24,7 @@ gulp.task(
gulp.parallel("gen-icons-app", "gen-icons-mdi"),
"gen-pages-dev",
"gen-index-app-dev",
gulp.series("create-test-translation", "build-translations")
"build-translations"
),
"copy-static",
"webpack-watch-app"
@@ -42,7 +42,7 @@ gulp.task(
"copy-static",
"webpack-prod-app",
...// Don't compress running tests
(envVars.isTravis ? [] : ["compress-app"]),
(envVars.isTravis() ? [] : ["compress-app"]),
gulp.parallel(
"gen-pages-prod",
"gen-index-app-prod",

View File

@@ -16,7 +16,7 @@ gulp.task(
process.env.NODE_ENV = "development";
},
"clean-gallery",
gulp.parallel("gen-icons-app", "gen-icons-app", "build-translations"),
gulp.parallel("gen-icons-app", "gen-icons-mdi", "build-translations"),
"copy-static-gallery",
"gen-index-gallery-dev",
"webpack-dev-server-gallery"

View File

@@ -65,6 +65,12 @@ function copyMapPanel(staticDir) {
);
}
gulp.task("copy-translations", (done) => {
const staticDir = paths.static;
copyTranslations(staticDir);
done();
});
gulp.task("copy-static", (done) => {
const staticDir = paths.static;
const staticPath = genStaticPath(paths.static);

View File

@@ -2,6 +2,7 @@ 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,
@@ -57,20 +58,6 @@ function generateIconset(iconsetName, iconNames) {
return `<ha-iconset-svg name="${iconsetName}" size="24"><svg><defs>${iconDefs}</defs></svg></ha-iconset-svg>`;
}
// Helper function to map recursively over files in a folder and it's subfolders
function mapFiles(startPath, filter, mapFunc) {
const files = fs.readdirSync(startPath);
for (let i = 0; i < files.length; i++) {
const filename = path.join(startPath, files[i]);
const stat = fs.lstatSync(filename);
if (stat.isDirectory()) {
mapFiles(filename, filter, mapFunc);
} else if (filename.indexOf(filter) >= 0) {
mapFunc(filename);
}
}
}
// Find all icons used by the project.
function findIcons(searchPath, iconsetName) {
const iconRegex = new RegExp(`${iconsetName}:[\\w-]+`, "g");

View File

@@ -29,6 +29,6 @@ gulp.task(
gulp.parallel("gen-icons-hassio", "gen-icons-mdi"),
"webpack-prod-hassio",
...// Don't compress running tests
(envVars.isTravis ? [] : ["compress-hassio"])
(envVars.isTravis() ? [] : ["compress-hassio"])
)
);

View File

@@ -1,14 +1,18 @@
const crypto = require("crypto");
const del = require("del");
const path = require("path");
const source = require("vinyl-source-stream");
const vinylBuffer = require("vinyl-buffer");
const gulp = require("gulp");
const fs = require("fs");
const foreach = require("gulp-foreach");
const hash = require("gulp-hash");
const hashFilename = require("gulp-hash-filename");
const merge = require("gulp-merge-json");
const minify = require("gulp-jsonminify");
const rename = require("gulp-rename");
const transform = require("gulp-json-transform");
const { mapFiles } = require("../util");
const env = require("../env");
const paths = require("../paths");
const inDir = "translations";
const workDir = "build-translations";
@@ -39,8 +43,6 @@ const TRANSLATION_FRAGMENTS = [
"developer-tools",
];
const tasks = [];
function recursiveFlatten(prefix, data) {
let output = {};
Object.keys(data).forEach(function(key) {
@@ -116,11 +118,9 @@ function lokaliseTransform(data, original, file) {
return output;
}
let taskName = "clean-translations";
gulp.task(taskName, function() {
return del([`${outDir}/**/*.json`]);
gulp.task("clean-translations", function() {
return del([workDir]);
});
tasks.push(taskName);
gulp.task("ensure-translations-build-dir", (done) => {
if (!fs.existsSync(workDir)) {
@@ -129,29 +129,23 @@ gulp.task("ensure-translations-build-dir", (done) => {
done();
});
taskName = "create-test-metadata";
gulp.task(
taskName,
gulp.series("ensure-translations-build-dir", function writeTestMetaData(cb) {
fs.writeFile(
workDir + "/testMetadata.json",
JSON.stringify({
test: {
nativeName: "Test",
},
}),
cb
);
})
);
tasks.push(taskName);
gulp.task("create-test-metadata", function(cb) {
fs.writeFile(
workDir + "/testMetadata.json",
JSON.stringify({
test: {
nativeName: "Test",
},
}),
cb
);
});
taskName = "create-test-translation";
gulp.task(
taskName,
gulp.series("create-test-metadata", function() {
"create-test-translation",
gulp.series("create-test-metadata", function createTestTranslation() {
return gulp
.src("src/translations/en.json")
.src(path.join(paths.translations_src, "en.json"))
.pipe(
transform(function(data, file) {
return recursiveEmpty(data);
@@ -161,7 +155,6 @@ gulp.task(
.pipe(gulp.dest(workDir));
})
);
tasks.push(taskName);
/**
* This task will build a master translation file, to be used as the base for
@@ -172,235 +165,216 @@ tasks.push(taskName);
* project is buildable immediately after merging new translation keys, since
* the Lokalise update to translations/en.json will not happen immediately.
*/
taskName = "build-master-translation";
gulp.task(
taskName,
gulp.series("clean-translations", function() {
return gulp
.src("src/translations/en.json")
.pipe(
transform(function(data, file) {
return lokaliseTransform(data, data, file);
})
)
.pipe(rename("translationMaster.json"))
.pipe(gulp.dest(workDir));
})
);
tasks.push(taskName);
gulp.task("build-master-translation", function() {
return gulp
.src(path.join(paths.translations_src, "en.json"))
.pipe(
transform(function(data, file) {
return lokaliseTransform(data, data, file);
})
)
.pipe(rename("translationMaster.json"))
.pipe(gulp.dest(workDir));
});
taskName = "build-merged-translations";
gulp.task(
taskName,
gulp.series("build-master-translation", function() {
return gulp
.src([inDir + "/*.json", workDir + "/test.json"], { allowEmpty: true })
.pipe(
transform(function(data, file) {
return lokaliseTransform(data, data, file);
})
)
.pipe(
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
//
// TODO: This is a naive interpretation of BCP47 that should be improved.
// Will be OK for now as long as we don't have anything more complicated
// than a base translation + region.
const tr = path.basename(file.history[0], ".json");
const subtags = tr.split("-");
const src = [workDir + "/translationMaster.json"];
for (let i = 1; i <= subtags.length; i++) {
const lang = subtags.slice(0, i).join("-");
if (lang === "test") {
src.push(workDir + "/test.json");
} else if (lang !== "en") {
src.push(inDir + "/" + lang + ".json");
}
gulp.task("build-merged-translations", function() {
return gulp
.src([inDir + "/*.json", workDir + "/test.json"], { allowEmpty: true })
.pipe(
transform(function(data, file) {
return lokaliseTransform(data, data, file);
})
)
.pipe(
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
//
// TODO: This is a naive interpretation of BCP47 that should be improved.
// Will be OK for now as long as we don't have anything more complicated
// than a base translation + region.
const tr = path.basename(file.history[0], ".json");
const subtags = tr.split("-");
const src = [workDir + "/translationMaster.json"];
for (let i = 1; i <= subtags.length; i++) {
const lang = subtags.slice(0, i).join("-");
if (lang === "test") {
src.push(workDir + "/test.json");
} else if (lang !== "en") {
src.push(inDir + "/" + lang + ".json");
}
return gulp
.src(src, { allowEmpty: true })
.pipe(transform((data) => emptyFilter(data)))
.pipe(
merge({
fileName: tr + ".json",
})
)
.pipe(gulp.dest(fullDir));
})
);
})
);
tasks.push(taskName);
}
return gulp
.src(src, { allowEmpty: true })
.pipe(transform((data) => emptyFilter(data)))
.pipe(
merge({
fileName: tr + ".json",
})
)
.pipe(gulp.dest(fullDir));
})
);
});
var taskName;
const splitTasks = [];
TRANSLATION_FRAGMENTS.forEach((fragment) => {
taskName = "build-translation-fragment-" + fragment;
gulp.task(
taskName,
gulp.series("build-merged-translations", function() {
// Return only the translations for this fragment.
return gulp
.src(fullDir + "/*.json")
.pipe(
transform((data) => ({
ui: {
panel: {
[fragment]: data.ui.panel[fragment],
},
gulp.task(taskName, function() {
// Return only the translations for this fragment.
return gulp
.src(fullDir + "/*.json")
.pipe(
transform((data) => ({
ui: {
panel: {
[fragment]: data.ui.panel[fragment],
},
}))
)
.pipe(gulp.dest(workDir + "/" + fragment));
})
);
tasks.push(taskName);
},
}))
)
.pipe(gulp.dest(workDir + "/" + fragment));
});
splitTasks.push(taskName);
});
taskName = "build-translation-core";
gulp.task(
taskName,
gulp.series("build-merged-translations", function() {
// Remove the fragment translations from the core translation.
return gulp
.src(fullDir + "/*.json")
.pipe(
transform((data) => {
TRANSLATION_FRAGMENTS.forEach((fragment) => {
delete data.ui.panel[fragment];
});
return data;
})
)
.pipe(gulp.dest(coreDir));
})
);
tasks.push(taskName);
gulp.task(taskName, function() {
// Remove the fragment translations from the core translation.
return gulp
.src(fullDir + "/*.json")
.pipe(
transform((data) => {
TRANSLATION_FRAGMENTS.forEach((fragment) => {
delete data.ui.panel[fragment];
});
return data;
})
)
.pipe(gulp.dest(coreDir));
});
splitTasks.push(taskName);
taskName = "build-flattened-translations";
gulp.task(
taskName,
gulp.series(...splitTasks, function() {
// Flatten the split versions of our translations, and move them into outDir
return gulp
.src(
TRANSLATION_FRAGMENTS.map(
(fragment) => workDir + "/" + fragment + "/*.json"
).concat(coreDir + "/*.json"),
{ base: workDir }
)
.pipe(
transform(function(data) {
// Polymer.AppLocalizeBehavior requires flattened json
return flatten(data);
})
)
.pipe(minify())
.pipe(hashFilename())
.pipe(
rename((filePath) => {
if (filePath.dirname === "core") {
filePath.dirname = "";
}
})
)
.pipe(gulp.dest(outDir));
})
);
tasks.push(taskName);
gulp.task("build-flattened-translations", function() {
// Flatten the split versions of our translations, and move them into outDir
return gulp
.src(
TRANSLATION_FRAGMENTS.map(
(fragment) => workDir + "/" + fragment + "/*.json"
).concat(coreDir + "/*.json"),
{ base: workDir }
)
.pipe(
transform(function(data) {
// Polymer.AppLocalizeBehavior requires flattened json
return flatten(data);
})
)
.pipe(minify())
.pipe(
rename((filePath) => {
if (filePath.dirname === "core") {
filePath.dirname = "";
}
})
)
.pipe(gulp.dest(outDir));
});
taskName = "build-translation-fingerprints";
gulp.task(
taskName,
gulp.series("build-flattened-translations", function() {
return gulp
.src(outDir + "/**/*.json")
.pipe(
rename({
extname: "",
})
)
.pipe(
hash({
algorithm: "md5",
hashLength: 32,
template: "<%= name %>.json",
})
)
.pipe(hash.manifest("translationFingerprints.json"))
.pipe(
transform(function(data) {
// After generating fingerprints of our translation files, consolidate
// all translation fragment fingerprints under the translation name key
const newData = {};
Object.entries(data).forEach(([key, value]) => {
const [path, _md5] = key.rsplit("-", 1);
// let translation = key;
let translation = path;
const parts = translation.split("/");
if (parts.length === 2) {
translation = parts[1];
}
if (!(translation in newData)) {
newData[translation] = {
fingerprints: {},
};
}
newData[translation].fingerprints[path] = value;
});
return newData;
})
)
.pipe(gulp.dest(workDir));
})
);
tasks.push(taskName);
const fingerprints = {};
taskName = "build-translations";
gulp.task(
taskName,
gulp.series("build-translation-fingerprints", function() {
return gulp
.src(
[
"src/translations/translationMetadata.json",
workDir + "/testMetadata.json",
workDir + "/translationFingerprints.json",
],
{ allowEmpty: true }
)
.pipe(merge({}))
.pipe(
transform(function(data) {
const newData = {};
Object.entries(data).forEach(([key, value]) => {
// Filter out translations without native name.
if (data[key].nativeName) {
newData[key] = data[key];
} else {
console.warn(
`Skipping language ${key}. Native name was not translated.`
);
}
if (data[key]) newData[key] = value;
});
return newData;
})
)
.pipe(
transform((data) => ({
fragments: TRANSLATION_FRAGMENTS,
translations: data,
}))
)
.pipe(rename("translationMetadata.json"))
.pipe(gulp.dest(workDir));
})
);
tasks.push(taskName);
"build-translation-fingerprints",
function fingerprintTranslationFiles() {
// Fingerprint full file of each language
const files = fs.readdirSync(fullDir);
module.exports = tasks;
for (let i = 0; i < files.length; i++) {
fingerprints[files[i].split(".")[0]] = {
// In dev we create fake hashes
hash: env.isProdBuild()
? crypto
.createHash("md5")
.update(fs.readFileSync(path.join(fullDir, files[i]), "utf-8"))
.digest("hex")
: "dev",
};
}
mapFiles(outDir, ".json", (filename) => {
const parsed = path.parse(filename);
// nl.json -> nl-<hash>.json
if (!(parsed.name in fingerprints)) {
throw new Error(`Unable to find hash for ${filename}`);
}
fs.renameSync(
filename,
`${parsed.dir}/${parsed.name}-${fingerprints[parsed.name].hash}${
parsed.ext
}`
);
});
const stream = source("translationFingerprints.json");
stream.write(JSON.stringify(fingerprints));
process.nextTick(() => stream.end());
return stream.pipe(vinylBuffer()).pipe(gulp.dest(workDir));
}
);
gulp.task(
"build-translations",
gulp.series(
"clean-translations",
"ensure-translations-build-dir",
env.isProdBuild() ? (done) => done() : "create-test-translation",
"build-master-translation",
"build-merged-translations",
gulp.parallel(...splitTasks),
"build-flattened-translations",
"build-translation-fingerprints",
function writeMetadata() {
return gulp
.src(
[
path.join(paths.translations_src, "translationMetadata.json"),
workDir + "/testMetadata.json",
workDir + "/translationFingerprints.json",
],
{ allowEmpty: true }
)
.pipe(merge({}))
.pipe(
transform(function(data) {
const newData = {};
Object.entries(data).forEach(([key, value]) => {
// Filter out translations without native name.
if (data[key].nativeName) {
newData[key] = data[key];
} else {
console.warn(
`Skipping language ${key}. Native name was not translated.`
);
}
if (data[key]) newData[key] = value;
});
return newData;
})
)
.pipe(
transform((data) => ({
fragments: TRANSLATION_FRAGMENTS,
translations: data,
}))
)
.pipe(rename("translationMetadata.json"))
.pipe(gulp.dest(workDir));
}
)
);

View File

@@ -3,6 +3,7 @@ const gulp = require("gulp");
const webpack = require("webpack");
const WebpackDevServer = require("webpack-dev-server");
const log = require("fancy-log");
const path = require("path");
const paths = require("../paths");
const {
createAppConfig,
@@ -57,10 +58,14 @@ const handler = (done) => (err, stats) => {
gulp.task("webpack-watch-app", () => {
// we are not calling done, so this command will run forever
webpack(bothBuilds(createAppConfig, { isProdBuild: false })).watch(
{},
webpack(createAppConfig({ isProdBuild: false, latestBuild: true })).watch(
{ ignored: /build-translations/ },
handler()
);
gulp.watch(
path.join(paths.translations_src, "en.json"),
gulp.series("build-translations", "copy-translations")
);
});
gulp.task(

View File

@@ -29,4 +29,6 @@ module.exports = {
hassio_dir: path.resolve(__dirname, "../hassio"),
hassio_root: path.resolve(__dirname, "../hassio/build"),
hassio_publicPath: "/api/hassio/app/",
translations_src: path.resolve(__dirname, "../src/translations"),
};

16
build-scripts/util.js Normal file
View File

@@ -0,0 +1,16 @@
const path = require("path");
const fs = require("fs");
// Helper function to map recursively over files in a folder and it's subfolders
module.exports.mapFiles = function mapFiles(startPath, filter, mapFunc) {
const files = fs.readdirSync(startPath);
for (let i = 0; i < files.length; i++) {
const filename = path.join(startPath, files[i]);
const stat = fs.lstatSync(filename);
if (stat.isDirectory()) {
mapFiles(filename, filter, mapFunc);
} else if (filename.indexOf(filter) >= 0) {
mapFunc(filename);
}
}
};

View File

@@ -148,11 +148,17 @@ const createAppConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => {
// Create an object mapping browser urls to their paths during build
const translationMetadata = require("../build-translations/translationMetadata.json");
const workBoxTranslationsTemplatedURLs = {};
const englishFP = translationMetadata.translations.en.fingerprints;
Object.keys(englishFP).forEach((key) => {
const englishFilename = `en-${translationMetadata.translations.en.hash}.json`;
// core
workBoxTranslationsTemplatedURLs[
`/static/translations/${englishFilename}`
] = `build-translations/output/${englishFilename}`;
translationMetadata.fragments.forEach((fragment) => {
workBoxTranslationsTemplatedURLs[
`/static/translations/${englishFP[key]}`
] = `build-translations/output/${key}.json`;
`/static/translations/${fragment}/${englishFilename}`
] = `build-translations/output/${fragment}/${englishFilename}`;
});
config.plugins.push(

View File

@@ -26,10 +26,12 @@ 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";
import { atLeastVersion } from "../../../../src/common/config/version";
@customElement("hc-cast")
class HcCast extends LitElement {
@@ -133,7 +135,9 @@ class HcCast extends LitElement {
protected firstUpdated(changedProps) {
super.firstUpdated(changedProps);
const llColl = getLovelaceCollection(this.connection);
const llColl = atLeastVersion(this.connection.haVersion, 0, 107)
? getLovelaceCollection(this.connection)
: getLegacyLovelaceCollection(this.connection);
// We first do a single refresh because we need to check if there is LL
// configuration.
llColl.refresh().then(

View File

@@ -15,6 +15,9 @@ import {
import {
LovelaceConfig,
getLovelaceCollection,
fetchResources,
LegacyLovelaceConfig,
getLegacyLovelaceCollection,
} from "../../../../src/data/lovelace";
import "./hc-launch-screen";
import { castContext } from "../cast_context";
@@ -22,6 +25,9 @@ import { CAST_NS } from "../../../../src/cast/const";
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";
let resourcesLoaded = false;
@customElement("hc-main")
export class HcMain extends HassElement {
@@ -34,6 +40,7 @@ export class HcMain extends HassElement {
@property() private _error?: string;
private _unsubLovelace?: UnsubscribeFunc;
private _urlPath?: string | null;
public processIncomingMessage(msg: HassMessage) {
if (msg.type === "connect") {
@@ -108,6 +115,7 @@ export class HcMain extends HassElement {
if (this.hass) {
status.hassUrl = this.hass.auth.data.hassUrl;
status.lovelacePath = this._lovelacePath!;
status.urlPath = this._urlPath;
}
if (senderId) {
@@ -163,8 +171,17 @@ export class HcMain extends HassElement {
this._error = "Cannot show Lovelace because we're not connected.";
return;
}
if (!this._unsubLovelace) {
const llColl = getLovelaceCollection(this.hass!.connection);
if (!this._unsubLovelace || this._urlPath !== msg.urlPath) {
if (msg.urlPath === "lovelace") {
msg.urlPath = null;
}
this._urlPath = msg.urlPath;
if (this._unsubLovelace) {
this._unsubLovelace();
}
const llColl = atLeastVersion(this.hass.connection.haVersion, 0, 107)
? getLovelaceCollection(this.hass!.connection, msg.urlPath)
: getLegacyLovelaceCollection(this.hass!.connection);
// We first do a single refresh because we need to check if there is LL
// configuration.
try {
@@ -183,6 +200,15 @@ export class HcMain extends HassElement {
);
}
}
if (!resourcesLoaded) {
resourcesLoaded = true;
const resources = atLeastVersion(this.hass.connection.haVersion, 0, 107)
? await fetchResources(this.hass!.connection)
: (this._lovelaceConfig as LegacyLovelaceConfig).resources;
if (resources) {
loadLovelaceResources(resources, this.hass!.auth.data.hassUrl);
}
}
this._showDemo = false;
this._lovelacePath = msg.viewPath;
if (castContext.getDeviceCapabilities().touch_input_supported) {
@@ -194,12 +220,6 @@ export class HcMain extends HassElement {
private _handleNewLovelaceConfig(lovelaceConfig: LovelaceConfig) {
castContext.setApplicationState(lovelaceConfig.title!);
this._lovelaceConfig = lovelaceConfig;
if (lovelaceConfig.resources) {
loadLovelaceResources(
lovelaceConfig.resources,
this.hass!.auth.data.hassUrl
);
}
}
private _handleShowDemo(_msg: ShowDemoMessage) {

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: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 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: 68 KiB

After

Width:  |  Height:  |  Size: 20 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.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 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

@@ -291,16 +291,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
state: "13:21",
attributes: {
attribution: "Data provided by Ring.com",
device_id: "e04f434dca02",
firmware: "Up to Date",
kind: "lpd_v2",
timezone: "America/New_York",
type: "doorbots",
wifi_name: "RingOfSecurity-hUrGKNlhR",
created_at: "2019-01-22T13:21:03-05:00",
answered: false,
recording_status: "ready",
category: "motion",
friendly_name: "Front Door Last Motion",
icon: "hademo:history",
},
@@ -313,8 +304,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
"cbd8dfac9efb441f19168e271cb8629b0372d0c1f721353394b23ed0202013b0",
motion_detection: true,
friendly_name: "Patio",
entity_picture:
"/api/camera_proxy/camera.patio?token=cbd8dfac9efb441f19168e271cb8629b0372d0c1f721353394b23ed0202013b0",
entity_picture: "/assets/arsaboo/images/camera.patio.jpg",
supported_features: 0,
},
},
@@ -326,8 +316,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
"479b332e0a7cad4c58e0fb98a1ecb7942e3b225190adb93a1341edfa7daf45b0",
motion_detection: true,
friendly_name: "Porch",
entity_picture:
"/api/camera_proxy/camera.porch?token=479b332e0a7cad4c58e0fb98a1ecb7942e3b225190adb93a1341edfa7daf45b0",
entity_picture: "/assets/arsaboo/images/camera.porch.jpg",
supported_features: 0,
},
},
@@ -339,8 +328,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
"9381b2e4edd1bb21e868e2193f5d132a5fae153ce4f458451d979a02712b4642",
motion_detection: true,
friendly_name: "Backyard",
entity_picture:
"/api/camera_proxy/camera.backyard?token=9381b2e4edd1bb21e868e2193f5d132a5fae153ce4f458451d979a02712b4642",
entity_picture: "/assets/arsaboo/images/camera.backyard.jpg",
supported_features: 0,
},
},
@@ -352,8 +340,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
"ac38bf88c2c5896eed66ae15739a3e726677f92d79e0d57f83f726ac28bda746",
motion_detection: true,
friendly_name: "Driveway",
entity_picture:
"/api/camera_proxy/camera.driveway?token=ac38bf88c2c5896eed66ae15739a3e726677f92d79e0d57f83f726ac28bda746",
entity_picture: "/assets/arsaboo/images/camera.driveway.jpg",
supported_features: 0,
},
},
@@ -477,8 +464,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
friendly_name: localize(
"ui.panel.page-demo.config.arsaboo.names.family_room"
),
entity_picture:
"/api/media_player_proxy/media_player.family_room_2?token=be41a86e2a360761d67c36a010b09654b730deec092016ee92aafef79b1978ff&cache=e03d22fb103202e7",
entity_picture: "/assets/arsaboo/images/media_player_family_room.jpg",
supported_features: 64063,
},
},
@@ -487,16 +473,7 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
state: "06:44",
attributes: {
attribution: "Data provided by Ring.com",
device_id: "e04f434dca02",
firmware: "Up to Date",
kind: "lpd_v2",
timezone: "America/New_York",
type: "doorbots",
wifi_name: "RingOfSecurity-hUrGKNlhR",
created_at: "2019-01-22T06:44:31-05:00",
answered: false,
recording_status: "ready",
category: "ding",
friendly_name: "Front Door Last Ding",
icon: "hademo:history",
},

View File

@@ -395,7 +395,7 @@ export const demoLovelaceTeachingbirds: DemoConfig["lovelace"] = () => ({
cards: [
{
entity: "script.air_cleaner_quiet",
type: "entity-button",
type: "button",
name: "AC bed",
tap_action: {
action: "call-service",
@@ -408,7 +408,7 @@ export const demoLovelaceTeachingbirds: DemoConfig["lovelace"] = () => ({
},
{
entity: "script.air_cleaner_auto",
type: "entity-button",
type: "button",
name: "AC bed",
tap_action: {
action: "call-service",
@@ -421,7 +421,7 @@ export const demoLovelaceTeachingbirds: DemoConfig["lovelace"] = () => ({
},
{
entity: "script.air_cleaner_turbo",
type: "entity-button",
type: "button",
name: "AC bed",
tap_action: {
action: "call-service",
@@ -434,7 +434,7 @@ export const demoLovelaceTeachingbirds: DemoConfig["lovelace"] = () => ({
},
{
entity: "script.ac_off",
type: "entity-button",
type: "button",
name: "AC",
tap_action: {
action: "call-service",
@@ -447,7 +447,7 @@ export const demoLovelaceTeachingbirds: DemoConfig["lovelace"] = () => ({
},
{
entity: "script.ac_on",
type: "entity-button",
type: "button",
name: "AC",
tap_action: {
action: "call-service",
@@ -658,7 +658,7 @@ export const demoLovelaceTeachingbirds: DemoConfig["lovelace"] = () => ({
action: "call-service",
service: "script.goodnight",
},
type: "entity-button",
type: "button",
icon: "mdi:weather-night",
},
{
@@ -670,7 +670,7 @@ export const demoLovelaceTeachingbirds: DemoConfig["lovelace"] = () => ({
},
service: "scene.turn_on",
},
type: "entity-button",
type: "button",
icon: "mdi:coffee-outline",
},
{
@@ -682,7 +682,7 @@ export const demoLovelaceTeachingbirds: DemoConfig["lovelace"] = () => ({
},
service: "scene.turn_on",
},
type: "entity-button",
type: "button",
icon: "mdi:television-classic",
},
],
@@ -743,7 +743,7 @@ export const demoLovelaceTeachingbirds: DemoConfig["lovelace"] = () => ({
},
service: "light.toggle",
},
type: "entity-button",
type: "button",
icon: "mdi:page-layout-footer",
},
{
@@ -755,7 +755,7 @@ export const demoLovelaceTeachingbirds: DemoConfig["lovelace"] = () => ({
},
service: "light.toggle",
},
type: "entity-button",
type: "button",
icon: "mdi:page-layout-header",
},
],

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -16,7 +16,8 @@ class DemoCard extends PolymerElement {
color: var(--primary-color);
}
#card {
width: 400px;
max-width: 400px;
width: 100vw;
}
pre {
width: 400px;

View File

@@ -0,0 +1,84 @@
import { getEntity } from "../../../src/fake_data/entity";
export const createMediaPlayerEntities = () => [
getEntity("media_player", "music_paused", "paused", {
friendly_name: "Pausing The Music",
media_content_type: "music",
media_title: "I Wanna Be A Hippy (Flamman & Abraxas Radio Mix)",
media_artist: "Technohead",
supported_features: 64063,
entity_picture: "/images/album_cover_2.jpg",
media_duration: 300,
media_position: 50,
media_position_updated_at: new Date(
// 23 seconds in
new Date().getTime() - 23000
).toISOString(),
}),
getEntity("media_player", "music_playing", "playing", {
friendly_name: "Playing The Music",
media_content_type: "music",
media_title: "I Wanna Be A Hippy (Flamman & Abraxas Radio Mix)",
media_artist: "Technohead",
supported_features: 64063,
entity_picture: "/images/album_cover.jpg",
media_duration: 300,
media_position: 0,
media_position_updated_at: new Date(
// 23 seconds in
new Date().getTime() - 23000
).toISOString(),
}),
getEntity("media_player", "stream_playing", "playing", {
friendly_name: "Playing the Stream",
media_content_type: "movie",
media_title: "Epic sax guy 10 hours",
app_name: "YouTube",
entity_picture: "/images/frenck.jpg",
supported_features: 33,
}),
getEntity("media_player", "living_room", "playing", {
friendly_name: "Pause, No skip, tvshow",
media_content_type: "tvshow",
media_title: "Chapter 1",
media_series_title: "House of Cards",
app_name: "Netflix",
entity_picture: "/images/netflix.jpg",
supported_features: 1,
}),
getEntity("media_player", "sonos_idle", "idle", {
friendly_name: "Sonos Idle",
supported_features: 64063,
}),
getEntity("media_player", "theater", "off", {
friendly_name: "TV Off",
supported_features: 161,
}),
getEntity("media_player", "android_cast", "playing", {
friendly_name: "Casting App",
media_title: "Android Screen Casting",
app_name: "Screen Mirroring",
// supported_features: 21437,
}),
getEntity("media_player", "unavailable", "unavailable", {
friendly_name: "Player Unavailable",
supported_features: 21437,
}),
getEntity("media_player", "unknown", "unknown", {
friendly_name: "Player Unknown",
supported_features: 21437,
}),
getEntity("media_player", "receiver_on", "on", {
source_list: ["AirPlay", "Blu-Ray", "TV", "USB", "iPod (USB)"],
volume_level: 0.63,
is_volume_muted: false,
source: "TV",
friendly_name: "Receiver",
supported_features: 84364,
}),
getEntity("media_player", "receiver_off", "off", {
source_list: ["AirPlay", "Blu-Ray", "TV", "USB", "iPod (USB)"],
friendly_name: "Receiver",
supported_features: 84364,
}),
];

View File

@@ -15,14 +15,14 @@ const CONFIGS = [
{
heading: "Basic example",
config: `
- type: entity-button
- type: button
entity: light.bed_light
`,
},
{
heading: "With Name",
config: `
- type: entity-button
- type: button
name: Bedroom
entity: light.bed_light
`,
@@ -30,7 +30,7 @@ const CONFIGS = [
{
heading: "With Icon",
config: `
- type: entity-button
- type: button
entity: light.bed_light
icon: mdi:hotel
`,
@@ -38,7 +38,7 @@ const CONFIGS = [
{
heading: "Without State",
config: `
- type: entity-button
- type: button
entity: light.bed_light
show_state: false
`,
@@ -46,7 +46,7 @@ const CONFIGS = [
{
heading: "Custom Tap Action (toggle)",
config: `
- type: entity-button
- type: button
entity: light.bed_light
tap_action:
action: toggle
@@ -55,7 +55,7 @@ const CONFIGS = [
{
heading: "Running Service",
config: `
- type: entity-button
- type: button
entity: light.bed_light
service: light.toggle
`,
@@ -63,13 +63,13 @@ const CONFIGS = [
{
heading: "Invalid Entity",
config: `
- type: entity-button
- type: button
entity: sensor.invalid_entity
`,
},
];
class DemoEntityButtonEntity extends PolymerElement {
class DemoButtonEntity extends PolymerElement {
static get template() {
return html`
<demo-cards
@@ -97,4 +97,4 @@ class DemoEntityButtonEntity extends PolymerElement {
}
}
customElements.define("demo-hui-entity-button-card", DemoEntityButtonEntity);
customElements.define("demo-hui-button-card", DemoButtonEntity);

View File

@@ -0,0 +1,117 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import { provideHass } from "../../../src/fake_data/provide_hass";
import "../components/demo-cards";
import { createMediaPlayerEntities } from "../data/media_players";
import "../../../src/panels/lovelace/cards/hui-media-control-card";
const CONFIGS = [
{
heading: "Paused music",
config: `
- type: media-control
entity: media_player.music_paused
`,
},
{
heading: "Playing music",
config: `
- type: media-control
entity: media_player.music_playing
`,
},
{
heading: "Playing stream",
config: `
- type: media-control
entity: media_player.stream_playing
`,
},
{
heading: "Pause, No skip, tvshow",
config: `
- type: media-control
entity: media_player.living_room
`,
},
{
heading: "Screen casting",
config: `
- type: media-control
entity: media_player.android_cast
`,
},
{
heading: "Sonos Idle",
config: `
- type: media-control
entity: media_player.sonos_idle
`,
},
{
heading: "Player Off",
config: `
- type: media-control
entity: media_player.theater
`,
},
{
heading: "Player Unavailable",
config: `
- type: media-control
entity: media_player.unavailable
`,
},
{
heading: "Player Unknown",
config: `
- type: media-control
entity: media_player.unknown
`,
},
{
heading: "Receiver On",
config: `
- type: media-control
entity: media_player.receiver_on
`,
},
{
heading: "Receiver Off",
config: `
- type: media-control
entity: media_player.receiver_off
`,
},
];
class DemoHuiMediControlCard extends PolymerElement {
static get template() {
return html`
<demo-cards
id="demos"
hass="[[hass]]"
configs="[[_configs]]"
></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
hass: Object,
};
}
public ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(createMediaPlayerEntities());
}
}
customElements.define("demo-hui-media-control-card", DemoHuiMediControlCard);

View File

@@ -1,54 +1,9 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import { getEntity } from "../../../src/fake_data/entity";
import { provideHass } from "../../../src/fake_data/provide_hass";
import "../components/demo-cards";
const ENTITIES = [
getEntity("media_player", "bedroom", "playing", {
media_content_type: "movie",
media_title: "Epic sax guy 10 hours",
app_name: "YouTube",
supported_features: 32,
}),
getEntity("media_player", "family_room", "paused", {
media_content_type: "music",
media_title: "I Wanna Be A Hippy (Flamman & Abraxas Radio Mix)",
media_artist: "Technohead",
supported_features: 16417,
}),
getEntity("media_player", "family_room_no_play", "paused", {
media_content_type: "movie",
media_title: "Epic sax guy 10 hours",
app_name: "YouTube",
supported_features: 33,
}),
getEntity("media_player", "living_room", "playing", {
media_content_type: "tvshow",
media_title: "Chapter 1",
media_series_title: "House of Cards",
app_name: "Netflix",
supported_features: 1,
}),
getEntity("media_player", "lounge_room", "idle", {
media_content_type: "music",
media_title: "I Wanna Be A Hippy (Flamman & Abraxas Radio Mix)",
media_artist: "Technohead",
supported_features: 1,
}),
getEntity("media_player", "theater", "off", {
media_content_type: "movie",
media_title: "Epic sax guy 10 hours",
app_name: "YouTube",
supported_features: 33,
}),
getEntity("media_player", "android_cast", "playing", {
media_title: "Android Screen Casting",
app_name: "Screen Mirroring",
supported_features: 21437,
}),
];
import { createMediaPlayerEntities } from "../data/media_players";
const CONFIGS = [
{
@@ -56,20 +11,24 @@ const CONFIGS = [
config: `
- type: entities
entities:
- entity: media_player.bedroom
name: Skip, no pause
- entity: media_player.family_room
name: Paused, music
- entity: media_player.family_room_no_play
- entity: media_player.music_paused
name: Paused music
- entity: media_player.music_playing
name: Playing music
- entity: media_player.stream_playing
name: Paused, no play
- entity: media_player.living_room
name: Pause, No skip, tvshow
- entity: media_player.android_cast
name: Screen casting
- entity: media_player.lounge_room
- entity: media_player.sonos_idle
name: Chromcast Idle
- entity: media_player.theater
name: 'Player Off'
name: Player Off
- entity: media_player.unavailable
name: Player Unavailable
- entity: media_player.unknown
name: Player Unknown
`,
},
];
@@ -98,7 +57,7 @@ class DemoHuiMediaPlayerRows extends PolymerElement {
public ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
hass.addEntities(createMediaPlayerEntities());
}
}

View File

@@ -18,6 +18,7 @@ import {
} from "../../../src/data/hassio/addon";
import { navigate } from "../../../src/common/navigate";
import { filterAndSort } from "../components/hassio-filter-addons";
import { atLeastVersion } from "../../../src/common/config/version";
class HassioAddonRepositoryEl extends LitElement {
@property() public hass!: HomeAssistant;
@@ -42,75 +43,81 @@ class HassioAddonRepositoryEl extends LitElement {
if (this.filter && addons.length < 1) {
return html`
<div class="card-group">
<div class="title">
<div class="description">
No results found in "${repo.name}"
</div>
</div>
<div class="content">
<p class="description">
No results found in "${repo.name}"
</p>
</div>
`;
}
return html`
<div class="card-group">
<div class="title">
<div class="content">
<h1>
${repo.name}
<div class="description">
Maintained by ${repo.maintainer}<br />
<a class="repo" href=${repo.url} target="_blank">${repo.url}</a>
</div>
</h1>
<p class="description">
Maintained by ${repo.maintainer}<br />
<a class="repo" href=${repo.url} target="_blank" rel="noreferrer">
${repo.url}
</a>
</p>
<div class="card-group">
${addons.map(
(addon) => html`
<paper-card
.addon=${addon}
class=${addon.available ? "" : "not_available"}
@click=${this._addonTapped}
>
<div class="card-content">
<hassio-card-content
.hass=${this.hass}
.title=${addon.name}
.description=${addon.description}
.available=${addon.available}
.icon=${addon.installed && addon.installed !== addon.version
? "hassio:arrow-up-bold-circle"
: "hassio:puzzle"}
.iconTitle=${addon.installed
? addon.installed !== addon.version
? "New version available"
: "Add-on is installed"
: addon.available
? "Add-on is not installed"
: "Add-on is not available on your system"}
.iconClass=${addon.installed
? addon.installed !== addon.version
? "update"
: "installed"
: !addon.available
? "not_available"
: ""}
.iconImage=${atLeastVersion(
this.hass.config.version,
0,
105
) && addon.icon
? `/api/hassio/addons/${addon.slug}/icon`
: undefined}
.showTopbar=${addon.installed || !addon.available}
.topbarClass=${addon.installed
? addon.installed !== addon.version
? "update"
: "installed"
: !addon.available
? "unavailable"
: ""}
></hassio-card-content>
</div>
</paper-card>
`
)}
</div>
${addons.map(
(addon) => html`
<paper-card
.addon=${addon}
class=${addon.available ? "" : "not_available"}
@click=${this.addonTapped}
>
<div class="card-content">
<hassio-card-content
.hass=${this.hass}
.title=${addon.name}
.description=${addon.description}
.available=${addon.available}
.icon=${this.computeIcon(addon)}
.iconTitle=${this.computeIconTitle(addon)}
.iconClass=${this.computeIconClass(addon)}
></hassio-card-content>
</div>
</paper-card>
`
)}
</div>
`;
}
private computeIcon(addon) {
return addon.installed && addon.installed !== addon.version
? "hassio:arrow-up-bold-circle"
: "hassio:puzzle";
}
private computeIconTitle(addon) {
if (addon.installed) {
return addon.installed !== addon.version
? "New version available"
: "Add-on is installed";
}
return addon.available
? "Add-on is not installed"
: "Add-on is not available on your system";
}
private computeIconClass(addon) {
if (addon.installed) {
return addon.installed !== addon.version ? "update" : "installed";
}
return !addon.available ? "not_available" : "";
}
private addonTapped(ev) {
private _addonTapped(ev) {
navigate(this, `/hassio/addon/${ev.currentTarget.addon.slug}`);
}

View File

@@ -36,61 +36,63 @@ class HassioRepositoriesEditor extends LitElement {
protected render(): TemplateResult {
const repos = this._sortedRepos(this.repos);
return html`
<div class="card-group">
<div class="title">
<div class="content">
<h1>
Repositories
<div class="description">
Configure which add-on repositories to fetch data from:
</div>
</div>
${// Use repeat so that the fade-out from call-service-api-button
// stays with the correct repo after we add/delete one.
repeat(
repos,
(repo) => repo.slug,
(repo) => html`
<paper-card>
<div class="card-content">
<hassio-card-content
.hass=${this.hass}
.title=${repo.name}
.description=${repo.url}
icon="hassio:github-circle"
></hassio-card-content>
</div>
<div class="card-actions">
<ha-call-api-button
path="hassio/supervisor/options"
.hass=${this.hass}
.data=${this.computeRemoveRepoData(repos, repo.url)}
class="warning"
>
Remove
</ha-call-api-button>
</div>
</paper-card>
`
)}
</h1>
<p class="description">
Configure which add-on repositories to fetch data from:
</p>
<div class="card-group">
${// Use repeat so that the fade-out from call-service-api-button
// stays with the correct repo after we add/delete one.
repeat(
repos,
(repo) => repo.slug,
(repo) => html`
<paper-card>
<div class="card-content">
<hassio-card-content
.hass=${this.hass}
.title=${repo.name}
.description=${repo.url}
icon="hassio:github-circle"
></hassio-card-content>
</div>
<div class="card-actions">
<ha-call-api-button
path="hassio/supervisor/options"
.hass=${this.hass}
.data=${this.computeRemoveRepoData(repos, repo.url)}
class="warning"
>
Remove
</ha-call-api-button>
</div>
</paper-card>
`
)}
<paper-card>
<div class="card-content add">
<iron-icon icon="hassio:github-circle"></iron-icon>
<paper-input
label="Add new repository by URL"
.value=${this._repoUrl}
@value-changed=${this._urlChanged}
></paper-input>
</div>
<div class="card-actions">
<ha-call-api-button
path="hassio/supervisor/options"
.hass=${this.hass}
.data=${this.computeAddRepoData(repos, this._repoUrl)}
>
Add
</ha-call-api-button>
</div>
</paper-card>
<paper-card>
<div class="card-content add">
<iron-icon icon="hassio:github-circle"></iron-icon>
<paper-input
label="Add new repository by URL"
.value=${this._repoUrl}
@value-changed=${this._urlChanged}
></paper-input>
</div>
<div class="card-actions">
<ha-call-api-button
path="hassio/supervisor/options"
.hass=${this.hass}
.data=${this.computeAddRepoData(repos, this._repoUrl)}
>
Add
</ha-call-api-button>
</div>
</paper-card>
</div>
</div>
`;
}

View File

@@ -51,7 +51,7 @@ class HassioAddonAudio extends LitElement {
<paper-dropdown-menu
label="Input"
@selected-item-changed=${this._setInputDevice}
@iron-select=${this._setInputDevice}
>
<paper-listbox
slot="dropdown-content"
@@ -61,14 +61,16 @@ class HassioAddonAudio extends LitElement {
${this._inputDevices &&
this._inputDevices.map((item) => {
return html`
<paper-item device=${item.device}>${item.name}</paper-item>
<paper-item device=${item.device || ""}
>${item.name}</paper-item
>
`;
})}
</paper-listbox>
</paper-dropdown-menu>
<paper-dropdown-menu
label="Output"
@selected-item-changed=${this._setOutputDevice}
@iron-select=${this._setOutputDevice}
>
<paper-listbox
slot="dropdown-content"
@@ -78,7 +80,9 @@ class HassioAddonAudio extends LitElement {
${this._outputDevices &&
this._outputDevices.map((item) => {
return html`
<paper-item device=${item.device}>${item.name}</paper-item>
<paper-item device=${item.device || ""}
>${item.name}</paper-item
>
`;
})}
</paper-listbox>
@@ -123,33 +127,32 @@ class HassioAddonAudio extends LitElement {
}
private _setInputDevice(ev): void {
const device = ev.detail.device;
if (device) {
this._selectedInput = device;
}
const device = ev.detail.item.getAttribute("device");
this._selectedInput = device;
}
private _setOutputDevice(ev): void {
const device = ev.detail.device;
if (device) {
this._selectedOutput = device;
}
const device = ev.detail.item.getAttribute("device");
this._selectedOutput = device;
}
private async _addonChanged(): Promise<void> {
this._selectedInput = this.addon.audio_input;
this._selectedOutput = this.addon.audio_output;
this._selectedInput =
this.addon.audio_input === null ? "default" : this.addon.audio_input;
this._selectedOutput =
this.addon.audio_output === null ? "default" : this.addon.audio_output;
if (this._outputDevices) {
return;
}
const noDevice: HassioHardwareAudioDevice[] = [
{ device: undefined, name: "-" },
];
const noDevice: HassioHardwareAudioDevice = {
device: "default",
name: "Default",
};
try {
const { audio } = await fetchHassioHardwareAudio(this.hass);
const inupt = Object.keys(audio.input).map((key) => ({
const input = Object.keys(audio.input).map((key) => ({
device: key,
name: audio.input[key],
}));
@@ -158,20 +161,22 @@ class HassioAddonAudio extends LitElement {
name: audio.output[key],
}));
this._inputDevices = noDevice.concat(inupt);
this._outputDevices = noDevice.concat(output);
this._inputDevices = [noDevice, ...input];
this._outputDevices = [noDevice, ...output];
} catch {
this._error = "Failed to fetch audio hardware";
this._inputDevices = noDevice;
this._outputDevices = noDevice;
this._inputDevices = [noDevice];
this._outputDevices = [noDevice];
}
}
private async _saveSettings(): Promise<void> {
this._error = undefined;
const data: HassioAddonSetOptionParams = {
audio_input: this._selectedInput || null,
audio_output: this._selectedOutput || null,
audio_input:
this._selectedInput === "default" ? null : this._selectedInput,
audio_output:
this._selectedOutput === "default" ? null : this._selectedOutput,
};
try {
await setHassioAddonOption(this.hass, this.addon.slug, data);

View File

@@ -10,6 +10,7 @@ import {
property,
PropertyValues,
TemplateResult,
query,
} from "lit-element";
import { HomeAssistant } from "../../../src/types";
@@ -20,30 +21,42 @@ import {
} from "../../../src/data/hassio/addon";
import { hassioStyle } from "../resources/hassio-style";
import { haStyle } from "../../../src/resources/styles";
import { PolymerChangedEvent } from "../../../src/polymer-types";
import { fireEvent } from "../../../src/common/dom/fire_event";
import "../../../src/components/ha-yaml-editor";
// tslint:disable-next-line: no-duplicate-imports
import { HaYamlEditor } from "../../../src/components/ha-yaml-editor";
import { showConfirmationDialog } from "../../../src/dialogs/generic/show-dialog-box";
@customElement("hassio-addon-config")
class HassioAddonConfig extends LitElement {
@property() public hass!: HomeAssistant;
@property() public addon!: HassioAddonDetails;
@property() private _error?: string;
@property() private _config!: string;
@property({ type: Boolean }) private _configHasChanged = false;
@query("ha-yaml-editor") private _editor!: HaYamlEditor;
protected render(): TemplateResult {
const editor = this._editor;
// If editor not rendered, don't show the error.
const valid = editor ? editor.isValid : true;
return html`
<paper-card heading="Config">
<div class="card-content">
<ha-yaml-editor
@value-changed=${this._configChanged}
></ha-yaml-editor>
${this._error
? html`
<div class="errors">${this._error}</div>
`
: ""}
<iron-autogrow-textarea
@value-changed=${this._configChanged}
.value=${this._config}
></iron-autogrow-textarea>
${valid
? ""
: html`
<div class="errors">Invalid YAML</div>
`}
</div>
<div class="card-actions">
<mwc-button class="warning" @click=${this._resetTapped}>
@@ -51,7 +64,7 @@ class HassioAddonConfig extends LitElement {
</mwc-button>
<mwc-button
@click=${this._saveTapped}
.disabled=${!this._configHasChanged}
.disabled=${!this._configHasChanged || !valid}
>
Save
</mwc-button>
@@ -77,7 +90,7 @@ class HassioAddonConfig extends LitElement {
}
.errors {
color: var(--google-red-500);
margin-bottom: 16px;
margin-top: 16px;
}
iron-autogrow-textarea {
width: 100%;
@@ -93,18 +106,26 @@ class HassioAddonConfig extends LitElement {
protected updated(changedProperties: PropertyValues): void {
super.updated(changedProperties);
if (changedProperties.has("addon")) {
this._config = JSON.stringify(this.addon.options, null, 2);
this._editor.setValue(this.addon.options);
}
}
private _configChanged(ev: PolymerChangedEvent<string>): void {
this._config =
ev.detail.value || JSON.stringify(this.addon.options, null, 2);
this._configHasChanged =
this._config !== JSON.stringify(this.addon.options, null, 2);
private _configChanged(): void {
this._configHasChanged = true;
this.requestUpdate();
}
private async _resetTapped(): Promise<void> {
const confirmed = await showConfirmationDialog(this, {
title: this.addon.name,
text: "Are you sure you want to reset all your options?",
confirmText: "reset options",
});
if (!confirmed) {
return;
}
this._error = undefined;
const data: HassioAddonSetOptionParams = {
options: null,
@@ -129,7 +150,7 @@ class HassioAddonConfig extends LitElement {
this._error = undefined;
try {
data = {
options: JSON.parse(this._config),
options: this._editor.value,
};
} catch (err) {
this._error = err;

View File

@@ -36,6 +36,7 @@ import { haStyle } from "../../../src/resources/styles";
import { HomeAssistant } from "../../../src/types";
import { navigate } from "../../../src/common/navigate";
import { showHassioMarkdownDialog } from "../dialogs/markdown/show-dialog-hassio-markdown";
import { atLeastVersion } from "../../../src/common/config/version";
const PERMIS_DESC = {
rating: {
@@ -106,7 +107,7 @@ class HassioAddonInfo extends LitElement {
<hassio-card-content
.hass=${this.hass}
.title="${this.addon.name} ${this.addon
.last_version} is available"
.version_latest} is available"
.description="You are currently running version ${this.addon
.version}"
icon="hassio:arrow-up-bold-circle"
@@ -178,21 +179,26 @@ class HassioAddonInfo extends LitElement {
`}
`
: html`
${this.addon.last_version}
${this.addon.version_latest}
`}
</div>
</div>
<div class="description light-color">
${this.addon.description}.<br />
Visit
<a href="${this.addon.url}" target="_blank">
<a href="${this.addon.url}" target="_blank" rel="noreferrer">
${this.addon.name} page</a
>
for details.
</div>
${this.addon.logo
? html`
<a href="${this.addon.url}" target="_blank" class="logo">
<a
href="${this.addon.url}"
target="_blank"
class="logo"
rel="noreferrer"
>
<img src="/api/hassio/addons/${this.addon.slug}/logo" />
</a>
`
@@ -319,6 +325,7 @@ class HassioAddonInfo extends LitElement {
<ha-switch
@change=${this._startOnBootToggled}
.checked=${this.addon.boot === "auto"}
haptic
></ha-switch>
</div>
<div class="state">
@@ -326,6 +333,7 @@ class HassioAddonInfo extends LitElement {
<ha-switch
@change=${this._autoUpdateToggled}
.checked=${this.addon.auto_update}
haptic
></ha-switch>
</div>
${this.addon.ingress
@@ -336,6 +344,7 @@ class HassioAddonInfo extends LitElement {
@change=${this._panelToggled}
.checked=${this.addon.ingress_panel}
.disabled=${this._computeCannotIngressSidebar}
haptic
></ha-switch>
${this._computeCannotIngressSidebar
? html`
@@ -363,6 +372,7 @@ class HassioAddonInfo extends LitElement {
<ha-switch
@change=${this._protectionToggled}
.checked=${this.addon.protected}
haptic
></ha-switch>
</div>
`
@@ -424,6 +434,7 @@ class HassioAddonInfo extends LitElement {
tabindex="-1"
target="_blank"
class="right"
rel="noopener"
>
<mwc-button>
Open web UI
@@ -448,9 +459,8 @@ class HassioAddonInfo extends LitElement {
`
: ""}
<ha-progress-button
.disabled=${!this.addon.available}
.disabled=${!this.addon.available || this._installing}
.progress=${this._installing}
class="right"
@click=${this._installClicked}
>
Install
@@ -626,7 +636,7 @@ class HassioAddonInfo extends LitElement {
this.addon &&
!this.addon.detached &&
this.addon.version &&
this.addon.version !== this.addon.last_version
this.addon.version !== this.addon.version_latest
);
}
@@ -650,7 +660,9 @@ class HassioAddonInfo extends LitElement {
}
private get _computeCannotIngressSidebar(): boolean {
return !this.addon.ingress || !this._computeHA92plus;
return (
!this.addon.ingress || !atLeastVersion(this.hass.config.version, 0, 92)
);
}
private get _computeUsesProtectedOptions(): boolean {
@@ -659,11 +671,6 @@ class HassioAddonInfo extends LitElement {
);
}
private get _computeHA92plus(): boolean {
const [major, minor] = this.hass.config.version.split(".", 2);
return Number(major) > 0 || (major === "0" && Number(minor) >= 92);
}
private async _startOnBootToggled(): Promise<void> {
this._error = undefined;
const data: HassioAddonSetOptionParams = {

View File

@@ -17,21 +17,40 @@ class HassioCardContent extends LitElement {
@property() public hass!: HomeAssistant;
@property() public title!: string;
@property() public description?: string;
@property({ type: Boolean }) public available?: boolean;
@property({ type: Boolean }) public available: boolean = true;
@property({ type: Boolean }) public showTopbar: boolean = false;
@property() public topbarClass?: string;
@property() public datetime?: string;
@property() public iconTitle?: string;
@property() public iconClass?: string;
@property() public icon = "hass:help-circle";
@property() public iconImage?: string;
protected render(): TemplateResult {
return html`
<iron-icon
class=${this.iconClass}
.icon=${this.icon}
.title=${this.iconTitle}
></iron-icon>
${this.showTopbar
? html`
<div class="topbar ${this.topbarClass}"></div>
`
: ""}
${this.iconImage
? html`
<div class="icon_image ${this.iconClass}">
<img src="${this.iconImage}" title="${this.iconTitle}" />
<div></div>
</div>
`
: html`
<iron-icon
class=${this.iconClass}
.icon=${this.icon}
.title=${this.iconTitle}
></iron-icon>
`}
<div>
<div class="title">${this.title}</div>
<div class="title">
${this.title}
</div>
<div class="addition">
${this.description}
${/* treat as available when undefined */
@@ -53,8 +72,9 @@ class HassioCardContent extends LitElement {
static get styles(): CSSResult {
return css`
iron-icon {
margin-right: 16px;
margin-top: 16px;
margin-right: 24px;
margin-left: 8px;
margin-top: 12px;
float: left;
color: var(--secondary-text-color);
}
@@ -88,6 +108,44 @@ class HassioCardContent extends LitElement {
ha-relative-time {
display: block;
}
.icon_image img {
max-height: 40px;
max-width: 40px;
margin-top: 4px;
margin-right: 16px;
float: left;
}
.icon_image.stopped,
.icon_image.not_available {
filter: grayscale(1);
}
.dot {
position: absolute;
background-color: var(--paper-orange-400);
width: 12px;
height: 12px;
top: 8px;
right: 8px;
border-radius: 50%;
}
.topbar {
position: absolute;
width: 100%;
height: 2px;
top: 0;
left: 0;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}
.topbar.installed {
background-color: var(--primary-color);
}
.topbar.update {
background-color: var(--accent-color);
}
.topbar.unavailable {
background-color: var(--error-color);
}
`;
}
}

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