Compare commits

...

638 Commits

Author SHA1 Message Date
Bram Kragten c1eabeb29f Remove light card for generated mode 2020-01-17 21:53:38 +01:00
Paulus Schoutsen 5ff8fe68ba Alert user when add-on not started (#4485) 2020-01-17 17:02:56 +01:00
David F. Mulcahey a2a039ebc5 Add group binding to the ZHA config panel and misc. cleanup (#4466)
* clean up zha device card and usage

* group binding tile

* add cluster selection to group binding tile

* fix css class name

* fix filtering

* multiselect for clusters in group binding

* pass narrow to cluster table

* fix tables

* fix device page

* address remaing comments from previous PR

* fix bad cherry-pick

* css cleanup

* consistency

* use properties

* translations

* add confirmation dialog to remove button

* fix css

* review comments

* remove noise
2020-01-17 16:39:57 +01:00
Ian Richardson 1064aed1b0 📝 make some Lovelace UI text more clear (#4500) 2020-01-17 09:54:16 +01:00
Ian Richardson 7025592e8e 🐛 fix picture glance card's camera_view option in editor (#4495) 2020-01-17 09:44:57 +01:00
HomeAssistant Azure 4966354b62 [ci skip] Translation update 2020-01-17 00:32:37 +00:00
David F. Mulcahey 68d6faf4af fix selection check (#4488) 2020-01-16 18:19:01 +01:00
Paulus Schoutsen e3346483b9 Hide device trackers from generated lovelace (#4487) 2020-01-16 08:57:41 +01:00
HomeAssistant Azure e8fb79e5ce [ci skip] Translation update 2020-01-16 00:32:40 +00:00
Alexei Chetroi d612162ab1 Fix ZHA add device path. (#4486) 2020-01-15 20:05:05 +01:00
Bram Kragten 86f8ef3a70 Styling focus menus (#4483)
* Styling menus

* Update ha-config-navigation.ts
2020-01-15 19:41:56 +01:00
Bram Kragten 0e43435362 Don't ask to choose view when only 1 view (#4480) 2020-01-15 09:05:01 -08:00
Bram Kragten aaefe0b09f Handle unknown state (#4481) 2020-01-15 09:01:59 -08:00
Bram Kragten bc731a9dc3 Add edit btn to more info for scene, script and automation (#4476) 2020-01-15 09:50:16 +01:00
Bram Kragten da25701dca Disable adoptedStyleSheets in dev (#4474) 2020-01-15 09:25:17 +01:00
Bram Kragten 21ae483dc9 Styling fixes (#4475) 2020-01-15 09:25:04 +01:00
HomeAssistant Azure 38b6e9ca10 [ci skip] Translation update 2020-01-15 00:32:57 +00:00
Bram Kragten d31245866c Add DEPRECATED to states ui (#4463)
* Add DEPRECATED to states ui

* unelevated red

* target

* Add msg in info
2020-01-14 06:35:01 -08:00
Bram Kragten 4e08d8f3b3 Fix zha back btn (#4470) 2020-01-14 07:57:00 -05:00
Bram Kragten 1e717ab33e Catch undefined cloudstatus (#4465) 2020-01-14 13:52:23 +01:00
Bram Kragten 995fb4974e Fix translations (#4469) 2020-01-14 13:20:06 +01:00
HomeAssistant Azure ffb76132f8 [ci skip] Translation update 2020-01-14 00:32:29 +00:00
Bram Kragten acba3af54b Fix back btn for Polymer (#4467) 2020-01-13 18:21:43 +01:00
Paulus Schoutsen 40ac456937 Force refresh tokens if external app (#4461) 2020-01-13 05:47:08 -08:00
Bram Kragten 5c32413bf7 Onboarding core: Display error message when saving fails (#4462) 2020-01-13 05:31:53 -08:00
Bram Kragten 22792c70c5 Change config panel navigation (#4377)
* Change config panel navigation

* Show active + don't show toolbar?

* Update ha-panel-config.ts

* Change color of menu toolbar

* Update ha-config-router.ts

* Review comments
2020-01-12 17:57:38 +01:00
Krisjanis Lejejs a8ed87298a Improved map panel and map card to ignore zones when fitting map. (#4447)
* Improved map panel and map card to ignore zones when fitting map. [#1598](https://github.com/home-assistant/home-assistant-polymer/issues/1598)

* Improved map panel and map card to ignore zones when fitting map. [#1598](https://github.com/home-assistant/home-assistant-polymer/issues/1598)

* Improved map panel and map card to ignore zones when fitting map. [#1598](https://github.com/home-assistant/home-assistant-polymer/issues/1598)

* Changed approach and created a different array for zones

* Removed zone key option for markers
2020-01-12 17:56:55 +01:00
Joakim Sørensen b15270dfe2 Use correct suffix for elevation (#4454)
* Use correct suffix for elevation

* Use correct suffix for elevation
2020-01-12 07:31:59 -08:00
Bram Kragten 58ad949bc8 Virtualize logbook (#4450)
* Virtualize logbook

* Clean

* Update ha-logbook.ts
2020-01-12 13:00:26 +01:00
HomeAssistant Azure adce40de56 [ci skip] Translation update 2020-01-12 00:33:31 +00:00
Ian Richardson 0f487ae4bf Add tabindex to lovelace elements (#4160)
* tabindex

* use action handler

* circular focus test

* address comment

* add focus styling to other elements

* add focus styling to cards

* style glance card entities

* Add back light/thermo changes that were lost in rebase

* Remove unused import

* lint

* lint

* 💄 tweak focus style for glance entities

* 💄 apply styling to focused state-label-badges
2020-01-11 11:50:43 +01:00
Joakim Sørensen 2848e3a63b Adds CCS var usage to person dialog (#4449) 2020-01-11 11:49:57 +01:00
Bram Kragten 5a172a64c5 Make entry flow dialog modal (#4440)
* Make entry flow dialog modal

* Add close button

* Update dialog-data-entry-flow.ts

* Fix aria-label
2020-01-10 16:40:19 -08:00
HomeAssistant Azure 433aa16ea6 [ci skip] Translation update 2020-01-11 00:32:34 +00:00
HomeAssistant Azure 50cb8cf3cc [ci skip] Translation update 2020-01-10 00:32:38 +00:00
Sean Mooney 4e5406b27b Typo fix in issue template (#4445)
fixes small typo, necesarry = necessary
2020-01-09 09:29:42 -06:00
Franck Nijhof 80eb80619a Add configuration for Lock Threads on closed pull requests (#4443) 2020-01-09 11:40:25 +01:00
Ian Richardson bf71b3a869 ♻️ convert ha-attributes to lit-element (#4350)
* ♻️ convert ha-attributes to lit-element

* Address comments

* inline items

* 🐛 Fix attribution display logic
2020-01-09 10:22:23 +01:00
HomeAssistant Azure ff270c4b7d [ci skip] Translation update 2020-01-09 00:32:44 +00:00
David F. Mulcahey 5415068917 Rework the ZHA config panel (#4415)
* convert zha config panel to tabs

* add spacer to prevent combobox from hitting bottom

* break clusters out into their own section

* cleanup buttons

* remove header

* make devices default tab

* convert from tabs to a list view

* convert to table on dashboard

* fix anchor on mobile safari

* cleanup CSS to fix display on mobile

* cleanup card css

* more css cleanup

* fix group page

* remove translations changes

* Update src/panels/config/zha/zha-clusters.ts

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

* Update src/panels/config/zha/zha-config-dashboard.ts

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

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

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

* Update src/panels/config/zha/zha-groups-dashboard.ts

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

* review comments

* fix dangling quote after commit suggestion

* css cleanup

* remove flex rules

* remove flex rules

* css  cleanup

* remove dialog per review comments

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-01-08 18:35:21 +01:00
Bram Kragten 357a67c00d Bumped version to 20200108.0 2020-01-08 18:26:20 +01:00
HomeAssistant Azure cbe4269320 [ci skip] Translation update 2020-01-08 17:25:54 +00:00
Bram Kragten fbd5185ce2 Add ability to remove Lovelace config (#4430)
* Add ability to remove Lovelace config

* Update hc-lovelace.ts
2020-01-08 18:19:10 +01:00
Bram Kragten a33cf97e2c Fix moving actions with data (#4438) 2020-01-08 18:18:53 +01:00
Pascal Vizeli 7e7da26543 Update azure-pipelines-translation.yml for Azure Pipelines 2020-01-08 16:54:09 +01:00
Bram Kragten 79058e893b Add alert when Google sync failed (#4435) 2020-01-08 15:59:22 +01:00
Bram Kragten 2eb548bb74 Merge branch 'master' into dev 2020-01-07 20:53:23 +01:00
Bram Kragten 08baf8a757 Bumped version to 20200107.0 2020-01-07 20:50:51 +01:00
Bram Kragten f02fa6a94b Add multi select to entity registry (#4424)
* Add multi select to entity registry

* Fix filter and sort on status

* Remove unused prop platform

* Review

* Update ha-config-entity-registry.ts
2020-01-07 12:29:42 +01:00
Bram Kragten 2ed6d0e73c Make modal of Lovelace editor dialogs (#4426)
Fixes #4425
2020-01-06 22:25:17 +01:00
David F. Mulcahey 35d9b2ac3c Add the ability to create new Zigbee groups to the ZHA config panel (#4384)
* add group page

* Update src/panels/config/zha/zha-add-group-page.ts

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

* fix group name handling

* Update src/panels/config/zha/zha-add-group-page.ts

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

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-01-06 07:02:47 -05:00
Bram Kragten 18d09c6f04 Add UI for restored entities (#4414)
* Add UI for restored entities

* Add conformation for removal

* Apply suggestions

* Guard
2020-01-03 12:44:25 +01:00
Joakim Sørensen 70b81de49d Force rerender on update/save (#4396)
* Force rerender on update/save

* Fix linting issue

* Define properties by using @property() instead

* Add styles to disabled save button

* Change to use @customElement, and remove _generation as a property.
2020-01-02 21:15:26 +01:00
David Cramer f0808c1f54 Add ha-subppage toolbar css styles (#4409) 2020-01-02 20:55:43 +01:00
Jay e779f0747e Change TRIGGER to EXECUTE (#4413)
There's been some confusion among new users about what the `TRIGGER` button does in the automation info popup. `EXECUTE` better represents what pressing that button does since it bypasses conditions and simply runs the action like a script. The automation docs at <https://www.home-assistant.io/docs/automation/action/> also say "The action of an automation rule is what is being executed when a rule fires."
2020-01-02 20:16:39 +01:00
David F. Mulcahey bdd18775c3 Add group editing to the ZHA config panel (#4382)
* add group editing

* Update src/panels/config/zha/zha-devices-data-table.ts

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

* Update src/panels/config/zha/zha-group-page.ts

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

* Update src/panels/config/zha/zha-devices-data-table.ts

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

* Update src/panels/config/zha/zha-group-page.ts

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

* Update src/panels/config/zha/zha-group-page.ts

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

* Update src/panels/config/zha/zha-group-page.ts

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

* review comments

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-01-02 15:59:18 +01:00
David F. Mulcahey 711d51c022 Disable ZHA device binding buttons when a device to bind isn't selected (#4407)
* only enable buttons when a device is selected

* review comments
2020-01-02 07:24:40 -05:00
David F. Mulcahey 1b0d8bba29 fix area index on ZHA device card (#4406) 2020-01-02 10:50:19 +01:00
Colin Frei 2988cc512f Fix grammatical error (#4403) 2020-01-02 10:28:36 +01:00
Joakim Sørensen a2f8e5f3e7 Hide protection mode toggle if not usable (#4392) 2020-01-02 10:20:21 +01:00
David F. Mulcahey 680bf06a4b Add group detail view to the ZHA config panel (#4380)
* add group details

* review comments
2019-12-24 10:29:22 -05:00
David F. Mulcahey ff0b1881e2 Add Zigbee group removal to the ZHA config panel (#4376)
* add remove groups function

* add ability to remove groups

* translations

* review comments

* review comments

* review comments
2019-12-24 08:12:02 -05:00
David F. Mulcahey de653e1f7b Add Zigbee group viewing to ZHA config panel (#4365)
* add ability to view zigbee groups

* review comments

* remove selectable until used
2019-12-23 10:46:34 -05:00
Bram Kragten bb41170765 Add language Iban (#4375) 2019-12-23 16:27:41 +01:00
Bram Kragten 0ed2bc93aa Remove uploading translations from Travis (#4374) 2019-12-23 13:39:47 +01:00
Bram Kragten 04770f8ee2 Add language Esperanto (#4373) 2019-12-23 13:39:31 +01:00
Bram Kragten 15a2790b9f Add support to add all device entities to Lovelace (#4356)
* Add support to add all device entities to Lovelace

* Reload config when it was changed while Lovelace was not active

* Localize

* Update ha-panel-lovelace.ts

* Move to device entities card

* Move Lovelace logic to lovelace combine with unused entities

* Unused imports

* Added suggestions and support for YAML mode
2019-12-23 10:39:17 +01:00
Jc2k 83880791b1 Add 'unignore' to DISCOVERY_SOURCES that can be ignored. (#4370) 2019-12-21 17:10:20 +01:00
HomeAssistant Azure 4dca3289f6 [ci skip] Translation update 2019-12-19 16:07:21 +00:00
Pascal Vizeli 083a3ebfc4 Run translation on dev (#4368) 2019-12-19 17:03:05 +01:00
Pascal Vizeli 6117c4e989 Add Auto Translation handling (#4339)
* Add Auto Translation handling

* Cleanup
2019-12-18 16:38:36 +01:00
Bram Kragten 609763e658 Set focus to search when opening add integration dialog (#4357)
* Set focus to search when opening add integration dialog

* Also add to flow form
2019-12-18 16:35:20 +01:00
Bram Kragten 2c57ab60f1 Add ignore discovery button (#4354)
* Add ignore discovery button

* Add seperate list for ignored integrations

* Move translations

* Add zeroconf
2019-12-18 16:22:17 +01:00
Ian Richardson dd17a153d2 Fire custom LL event (#4361) 2019-12-18 07:40:26 +01:00
Bram Kragten c2d551bb7c Merge pull request #4341 from bonanitech/patch-2
Upgrade MDI icons to 4.7.95
2019-12-12 17:20:24 +01:00
Mauricio Bonani e0b1921108 Fix version number 2019-12-09 12:40:11 -05:00
Mauricio Bonani fcf39ceb96 Upgrade MDI icons to 4.7.95 2019-12-09 12:27:03 -05:00
Mauricio Bonani 3cc979a077 Upgrade MDI icons to 4.7.95 2019-12-09 12:24:36 -05:00
Bram Kragten 9972973774 Merge pull request #4338 from home-assistant/rc
20191204.1
2019-12-09 13:41:33 +01:00
Bram Kragten 20ae32bc26 Bumped version to 20191204.1 2019-12-09 13:03:17 +01:00
Bram Kragten a29892023b Revert "Add copy entity ID/state/attributes menu button in dev tools/states" (#4337)
* Revert "Add copy entity ID/state/attributes menu button in dev tools/states (#4259)"

This reverts commit 4b56db5255.

* Update package.json
2019-12-09 13:02:41 +01:00
Bram Kragten b283fec482 Update cloud-google-assistant.ts (#4329) 2019-12-09 13:02:17 +01:00
Bram Kragten e0116a8236 Fix thingtalk automations creation (#4328) 2019-12-09 13:01:56 +01:00
Bram Kragten d1990a4bac Revert "Add copy entity ID/state/attributes menu button in dev tools/states" (#4337)
* Revert "Add copy entity ID/state/attributes menu button in dev tools/states (#4259)"

This reverts commit 4b56db5255.

* Update package.json
2019-12-09 12:59:20 +01:00
Bram Kragten cbba1849e2 Convert script and automation editor to lit (#4327)
* Convert script and automation editor to lit

* Update yarn.lock
2019-12-09 10:59:52 +01:00
Bram Kragten 43393d1647 Update cloud-google-assistant.ts (#4329) 2019-12-09 08:34:36 +01:00
Bram Kragten b47ee1051c Fix thingtalk automations creation (#4328) 2019-12-07 20:46:04 +01:00
Bram Kragten 393adacc9e Convert automation actions/scripts to Lit (#4324)
* Convert automation actions/scripts to Lit

* Update ha-automation-action-row.ts

* Comments
2019-12-06 12:14:45 +01:00
Bram Kragten 073428849e Convert automation conditions to Lit (#4321)
* Convert automation conditions to Lit

* Split condition editor and row

* Comments

* Update automation.ts

* Update automation.ts
2019-12-05 19:48:06 +01:00
Bram Kragten e6ac0258e3 Use dynamicElement directive in ha-form (#4317)
* Use dynamicContentDirective

* Turn around

* Remove attributes

* Rename to dynamicElement
2019-12-04 22:58:35 +01:00
Bram Kragten d7e7798a55 Merge pull request #4318 from home-assistant/dev
20191204.0
2019-12-04 20:02:41 +01:00
Bram Kragten 2557414b11 Merge branch 'master' into dev 2019-12-04 19:30:47 +01:00
Bram Kragten f7065fbce9 Bumped version to 20191204.0 2019-12-04 19:28:47 +01:00
Bram Kragten 016564eee9 Update translations 2019-12-04 19:22:23 +01:00
Bram Kragten ff3087c39c Convert automation trigger to litelement (#4315)
* Convert automation trigger to Lit

* Update ha-automation-trigger-row.ts

* dynamicContentDirective

* update

* Lint

* Implement other types
2019-12-04 09:57:47 -08:00
Bram Kragten 239438ee5d Add entity picker to service call action (#4310)
* Add entity picker to service call action

* Use prop instead of attr
2019-12-03 12:30:51 +01:00
Florian Gareis 5458cda31f Add new confim dialog to automation editor (#4255) 2019-12-03 12:21:51 +01:00
Bram Kragten 36f49e66fd Remove empty defaults from time patern trigger automation (#4307) 2019-12-02 11:11:05 -08:00
Bram Kragten 2bafd38ea8 Allow automation actions/scripts to be moved up/down (#4308)
* Allow automation actions/scripts to be moved up/down

* Update index.tsx
2019-12-02 11:10:44 -08:00
Bram Kragten 73b3262491 Fix editing delay action (#4309) 2019-12-02 11:08:38 -08:00
Bram Kragten 808cde033f Update bug_report.md 2019-12-02 17:39:39 +01:00
Bram Kragten fa8f6b7b91 Add yaml editor to automation actions and scripts (#4306)
* Add yaml editor to automation actions and scripts

* Add types

* Update event.tsx
2019-12-02 14:08:19 +01:00
Bram Kragten 94c120cdb1 Add yaml editor to automation conditions (#4305) 2019-12-02 12:02:35 +01:00
Bram Kragten 7b2be54f8f YAML support for automation triggers (#4289)
* WIP: Add yaml editors to automation

* Fix form overwriting yaml on switching back

* Finish triggers

* prettier
2019-12-02 11:20:09 +01:00
nicop4 4b56db5255 Add copy entity ID/state/attributes menu button in dev tools/states (#4259)
* Added button and js method to copy with copy-to-clipboard library

* Copy entity id working, tooltip added

* copy ok, use ha toast to notify ok

* cleanup code

* add translation

* removed old useless code

* Replaced copy button with menu

* Fix comparison operator & removed commented code

	modifié :         src/panels/developer-tools/state/developer-tools-state.js

* Fix spaces

	modifié :         src/panels/developer-tools/state/developer-tools-state.js

* Improve copy attributes

* only one menu & update translation

* copy attributes in yml format
use paper-icon-item instead of paper-icon-button and add yarn.lock

* removed paper-item
2019-12-02 10:35:49 +01:00
Bram Kragten 93165c9111 Area/multiple devices and name support for thingtalk automations (#4272)
* WIP: Area/multiple devices and name support

* Fix removing devices

* Don't recalc entities for all devices every time

* Use guards

* Update ha-thingtalk-placeholders.ts
2019-12-02 10:30:30 +01:00
Bram Kragten caa604d5ca Add more aria labels (#4293)
* Add aria labels

* Fix polymer binding
2019-12-02 09:29:02 +01:00
Thomas Lovén e7e9e2cf85 Allow setting temperature to 0 degrees (#4300) 2019-12-02 09:23:20 +01:00
Bram Kragten daa04e9973 Fix jumping on iOS when toggle switch (#4275) 2019-11-29 12:41:37 +01:00
Bram Kragten 5355269f5d Check if external app by object (#4280)
* Check if external app by object

* Update core.ts

* Conditional chaining

* add babel optional chaining
2019-11-27 15:44:59 -08:00
Bram Kragten 2665a75250 Don't show hidden scenes (#4285)
* Don't show hidden scenes

* Comments

* computeStateDomain
2019-11-27 15:44:28 -08:00
Bram Kragten 8a39d18323 Bump TypeScript to 3.7 (#4282)
* Bump TypeScript to 3.7

* Update prettier to support ts 3.7

* Prettier

* More prettier

* Even more prettier
2019-11-27 13:51:03 -08:00
Bram Kragten b8a026397b Don't filter attributes when saving scene (#4278)
* Add cover attributes to scene editor

* Add more

* Remove filtering of attributes

* Update ha-scene-editor.ts
2019-11-27 13:43:46 -08:00
Bram Kragten bd5fe302eb Revert "Add specific maskable icons (#4283)" (#4284)
This reverts commit de0f1b2b65.
2019-11-27 20:23:58 +01:00
Bram Kragten de0f1b2b65 Add specific maskable icons (#4283) 2019-11-27 16:43:23 +01:00
Thomas Lovén defaa2b276 Fix missing semicolons in CSS (#4281)
Introduced in #4269
2019-11-27 13:06:02 +01:00
Bram Kragten 60efe00a1f Fix styling of vaadin elements (#4276) 2019-11-26 16:57:29 +01:00
Davide Varricchio fe93b993db Change to thermostat card to reflect step_temp on set-temperature (#4221)
* Minor change to thermostat card to reflect step_temp on set-temperature

* Corrected indentation

* Resolved eslint error
2019-11-25 17:42:38 +01:00
Joakim Sørensen f6afc92d3c Adds "air" at the bottom of the page (#4267)
* Adds "air" at the bottom of the page

* Update src/panels/config/dashboard/ha-config-dashboard.ts

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

* Add margin to promo
2019-11-25 17:38:08 +01:00
Carlos Gustavo Sarmiento e4c635c855 Added new CSS property for styling of the app-header component (#4269) 2019-11-25 17:37:33 +01:00
Bram Kragten a3e59e168f Bumped version to 20191119.6 2019-11-23 21:31:19 +01:00
Thomas Lovén e56355b406 Bump round-slider version. Fix #4265 (#4266) 2019-11-23 21:30:54 +01:00
Mauricio Bonani 8ef15c50b4 Upgrade MDI icons to 4.6.95 (#4270)
* Upgrade MDI icons to 4.6.95

* Upgrade MDI icons to 4.6.95
2019-11-23 21:26:32 +01:00
Marius 81588469b8 Add secondary-info: last-triggered (#4222)
* Add secondary-info: last-triggered

add last-triggered to the currently available options 'entity-id' and 'last-changed' see:https://www.home-assistant.io/lovelace/entities/#secondary_info

* corrected omission 'attributes'

* added test for attributes.last_triggered

* Update hui-generic-entity-row.ts

* Update hui-generic-entity-row.ts
2019-11-23 21:19:26 +01:00
Joakim Sørensen 70a920af3c Add initial bg color to panels (#4268) 2019-11-23 21:18:54 +01:00
Thomas Lovén 1329e60c89 Bump round-slider version. Fix #4265 (#4266) 2019-11-23 21:12:48 +01:00
Bram Kragten 9b7c095080 Bumped version to 20191119.5 2019-11-21 17:25:50 +01:00
Bram Kragten 654ff99cd1 Bumped version to 20191119.4 2019-11-21 17:04:43 +01:00
Bram Kragten 0511bc360e iOS 9 doesn't support append (#4260) 2019-11-21 17:04:36 +01:00
Bram Kragten ea9e8cc392 iOS 9 doesn't support append (#4260) 2019-11-21 17:03:35 +01:00
Bram Kragten 8433678371 Bumped version to 20191119.3 2019-11-21 15:22:07 +01:00
Bram Kragten 757bc00854 Fix thermostat card (#4258)
* Fix thermostat card

* Change styling

* Remove margin on mode buttons
2019-11-21 15:21:45 +01:00
Bram Kragten 2551393821 Fix light card (#4257)
* Fix light card

* Remove unused class

* Fix for when entity is not available

* Fix active state
2019-11-21 15:21:20 +01:00
Bram Kragten 0acd41b7f0 Fix thermostat card (#4258)
* Fix thermostat card

* Change styling

* Remove margin on mode buttons
2019-11-21 15:18:16 +01:00
Bram Kragten 85ca73db84 Fix light card (#4257)
* Fix light card

* Remove unused class

* Fix for when entity is not available

* Fix active state
2019-11-21 15:17:55 +01:00
Bram Kragten 444cbd00d9 Update README.md 2019-11-21 15:05:42 +01:00
Bram Kragten 15b500886c Bumped version to 20191119.2 2019-11-20 11:02:01 +01:00
Thomas Lovén 3aac834e72 Version bump round-slider. Fix bad rendering in IE/Edge (#4249) 2019-11-20 11:01:32 +01:00
Thomas Lovén 6edf23b91f Version bump round-slider. Fix bad rendering in IE/Edge (#4249) 2019-11-20 10:55:06 +01:00
Bram Kragten e445251b02 Bumped version to 20191119.1 2019-11-19 21:08:29 +01:00
Bram Kragten 693151b590 Fix ha-form on edge (#4248) 2019-11-19 21:08:15 +01:00
Bram Kragten 1249c0eea9 Fix ha-form on edge (#4248) 2019-11-19 21:06:52 +01:00
Bram Kragten 3133118870 Update vaadin components (#3571)
* Update vaadin components

* Remove resolution

* Migrate person detail dialog to mwc-dialog

* Fix imports

* Update dialog-person-detail.ts
2019-11-19 11:35:37 -06:00
Bram Kragten de5c1a0545 Merge pull request #4246 from home-assistant/dev
20191119.0
2019-11-19 13:37:07 +01:00
Bram Kragten c61e2fb459 Bumped version to 20191119.0 2019-11-19 13:19:33 +01:00
Bram Kragten 64a2a19da3 Update translations 2019-11-19 13:19:27 +01:00
Bram Kragten 74fe1f820c Fix error when no entities (#4244) 2019-11-19 13:16:55 +01:00
Bram Kragten 69929f5dc3 Fix thermostat unavailable (#4245) 2019-11-19 13:16:38 +01:00
Bram Kragten fcd793fc9e Fix device filtering on mobile (#4243) 2019-11-19 11:41:56 +01:00
Bram Kragten 8a3b1d76a1 Fix removing entity in scene editor (#4241)
Fixes https://github.com/home-assistant/home-assistant-polymer/issues/4237
2019-11-19 00:35:16 +01:00
Thomas Lovén 9f520d7628 Use new scaling features of round-slider (#4172)
* Refresh light card.

* Refresh thermostat card

* Fix paddings

* Fix #4175

* Use action handler

* Address review comments

* Lint

* Padding on percentage

* Remove typo
2019-11-19 00:32:23 +01:00
Bram Kragten 258cfddc3f Remove alias from scene action (#4240)
Fixes https://github.com/home-assistant/home-assistant-polymer/issues/4239
2019-11-19 00:28:35 +01:00
Bram Kragten 3697500402 Fix min value in editor (#4236) 2019-11-19 00:28:08 +01:00
springstan b4942ad27e Fixed two-part pin code input in Manual Alarm Control Panel (#4213)
* Consolidated code input via clicking GUI pads and using a physical keyboard

* Replaced the querySelector with the query decorator

* Run the query selector once, store its result and reuse it multiple times
2019-11-19 00:27:48 +01:00
Ville Skyttä 1e217e8d2f Support email and url form input types (#4186)
* Support email and url form input types

* Lint

* Lint

* Add types
2019-11-18 18:03:19 +01:00
Bram Kragten 0056237d85 Merge pull request #4233 from home-assistant/dev
20191118.0
2019-11-18 13:08:58 +01:00
Bram Kragten 920ee741f3 Bumped version to 20191118.0 2019-11-18 12:50:11 +01:00
Bram Kragten 6ecc60423f Fix actions not working on touch devices (#4231) 2019-11-18 11:27:44 +01:00
MatthewFlamm 09e7638c89 fix evaluating to false and remove ; (#4228) 2019-11-18 09:00:50 +01:00
Bram Kragten b82b4a639e Merge pull request #4227 from home-assistant/demo-manifest
Add maskable icon directive to demo manifest
2019-11-18 08:54:07 +01:00
Paulus Schoutsen d08aa51c16 Add maskable icon directive to demo manifest 2019-11-16 12:09:29 +01:00
Bram Kragten 385ffe6d8f Merge pull request #4226 from home-assistant/dev
20191115.0
2019-11-15 20:21:09 +01:00
Bram Kragten 564e6d4073 Bumped version to 20191115.0 2019-11-15 20:06:35 +01:00
Bram Kragten a4bd816eb5 Fix localise escaping issue (#4225) 2019-11-15 19:59:47 +01:00
Bram Kragten 13c18a9bb7 Merge pull request #4224 from iantrich/fix-filter-badge
Fix entity-filter-badge update
2019-11-15 19:59:25 +01:00
Ian Richardson 562d7a7cf4 use lastChild 2019-11-15 11:10:47 -06:00
Ian Richardson 89f33a1730 Fix entity-filter-badge update 2019-11-15 09:45:50 -06:00
Bram Kragten ff7309f5c4 Merge pull request #4218 from home-assistant/dev
20191114.0
2019-11-14 13:47:21 +01:00
Bram Kragten 1c614c855f Bumped version to 20191114.0 2019-11-14 13:28:28 +01:00
Bram Kragten 6a3238951d Updated translations 2019-11-14 13:28:06 +01:00
Bram Kragten 0dab5828fb Add Thingtalk automation generation (#4216)
* thingtalk

* works

* Add device_class support and get placeholders from api

* Update
2019-11-14 13:22:44 +01:00
Joakim Sørensen d0b9c09f8f Fix person dialog issues (#4210)
* Fix person dialog issues

* Remove repo (should not have been committed...)

* Trigger Travis
2019-11-12 20:30:11 +01:00
Josh McCarty 55f4629256 Wrap the dialog title when using Entity Registry (#4174)
* Wrap the dialog title when using Entity Registry

* Move updated styles to styles()
2019-11-12 14:52:56 +01:00
Joakim Sørensen 004565217e Restructure/reorder configuration dashboard (#4202)
* Reoreder config dashboard

* Changes base translation for config dashboard items to be pleural

* Convert to lit/ts

* remove unneded stuff

* fix child property passes

* Export page configuration

* Apply suggestion

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

* Change property to CloudStatus
2019-11-10 23:25:13 +01:00
Bram Kragten c07b39ebde Fix device and entity pickers clear (#4206)
* Fix device and entity pickers clear

* Prevent combobox to open on clear
2019-11-10 13:25:07 -08:00
Bram Kragten 8b17b6ed1c Add attribution and onboarding to voice (#4190)
* Add attribution and onboarding to voice

* Align with backend changes

* Layout + switch to ws for process

* Don't mutate window

* Move speechRecognition

* Add border

* Update ha-voice-command-dialog.ts
2019-11-10 11:30:41 -08:00
Paulus Schoutsen 1d16bdbe54 Merge pull request #4201 from home-assistant/lokalise
Update lokalise cli to version 2 + fix replacing localise vars
2019-11-10 11:30:08 -08:00
Joakim Sørensen 9e2a0c77d5 Adds clear value handler (#4205)
* Adds clear value handler

* Add the same to device picker
2019-11-10 19:23:27 +01:00
Joakim Sørensen 4f41508110 Adds timestamp device_class for sensor (#4204) 2019-11-10 18:41:33 +01:00
Joakim Sørensen eaedb2e5ae Checked button colors (#4203)
* split switch-checked-color into 2 vars like the unchecked variant

* Apply new css vars

* revert accidental delete

* revert demo changes

* revert property change
2019-11-10 18:40:36 +01:00
Bram Kragten 75ad1f51a9 Update translations_upload_base 2019-11-09 23:49:26 +01:00
Bram Kragten 142175c6ab Update lokalise cli to version 2 + fix replacing localise vars 2019-11-09 23:47:58 +01:00
Joakim Sørensen f1980d6bcf Fixes history graph card defaults (#4198) 2019-11-09 17:30:08 +01:00
Joakim Sørensen 5a7b5200fe Change correct localization string (#4197)
* Change correct localization string

* Update en.json
2019-11-09 17:29:14 +01:00
Joakim Sørensen d284d53b93 Reload buttons (#4194)
* Change base translation for ui.panel.config.server_control.section.reloading.core

* Give each btn a new card-action div
2019-11-08 14:39:21 -08:00
Bram Kragten bc01df42d8 Merge pull request #4193 from home-assistant/dev
20191108.0
2019-11-08 17:41:58 +01:00
Bram Kragten 901752bec3 Update translations (#4192) 2019-11-08 17:12:48 +01:00
Bram Kragten e3ef3cfae1 Bumped version to 20191108.0 2019-11-08 17:12:28 +01:00
Paulus Schoutsen ab476d2f1b Add conversation ID to voice dialog (#4189) 2019-11-07 12:21:37 -08:00
Bram Kragten 5ca82fd39c Fix mobile support for voice dialog (#4154)
* Fix mobile support for voice dialog

* Update ha-voice-command-dialog.ts

* typo

* Add extra data functions

* Start listening for choice

* Remove extra data logic
2019-11-04 12:34:59 -08:00
Bram Kragten da35c263d2 Add scene editor (#4164)
* Add scene editor

* Update ha-config-scene.ts

* Update en.json

* Update ha-scene-editor.ts

* Partial comments

* Types

* 1 more

* Comments

* Lint

* Update ha-device-picker.ts

* Update ha-device-card.ts
2019-11-04 12:07:09 -08:00
Bram Kragten 2a617a9639 Revert "Add Netatmo specific states" (#4171) 2019-11-01 20:35:35 +01:00
springstan c730aab28f Translated config flow form and steps (#4140)
* Translated config flow form and steps

* Moved translation from config_entry to config_flow

* Renamed translation key from not_all_fields_required to not_all_required_fields
2019-11-01 20:34:10 +01:00
Ian Richardson 274c2016c0 action-handler (#4115)
* action-handler

* comments

* address comments

* finish conversion

* move haptics

* address comments

* lint

* keyup

* double enter

* address comments

* keyup
2019-11-01 13:15:11 -05:00
Bram Kragten 9b3891f778 Fix state-label-badge override name (#4166) 2019-11-01 12:54:14 -05:00
Bram Kragten b705de956e Fix hassio build (#4167) 2019-11-01 17:42:36 +01:00
Ian Richardson e37201f84f enter is registering as double_tap (#4161)
* enter is registering as double_tap

* Update long-press-directive.ts

* Update long-press-directive.ts
2019-11-01 16:39:53 +01:00
springstan f53eea81c4 Translated a bunch of strings (#4137)
* Translated customization page
 - added translation key-value pairs to en.json
 - translated form-customize, customize-icon and its key-value

* Translated mutliple pages:
 - devices
 - entity-registry
 - config-entry
 - dashboard -> hint to advanced mode toggle

* Translated custom panel confirm message

* Added translation for no entries in logbook

* Updated translation keys, tested and removed ha-types file translations

* Removed setting an if to true for testing

* Use template literal instead of string concatenation
2019-11-01 16:12:49 +01:00
springstan 0fa8db1682 Translated unused entities, device registry page and domain toggler dialog (#4141)
* Translated device registry and domain toggler dialog

* Translated unused entities page

* Extracted unused_entities keys and created new section for domain_toggler

* Moved unknow_error and area_picker_label into devices section
2019-11-01 16:07:18 +01:00
Bram Kragten 46f5224e70 Migrate voice command dialog (#4150)
* Migrate voice command dialog

* Cleanup

* Correct types

* Added animation when listening and we should talk back right? :'-)

* Set recognition to english

* Comments

* Update on change of hass
2019-10-29 14:59:35 -07:00
Bram Kragten 12be2a9775 Merge branch 'master' into dev 2019-10-29 15:14:04 +01:00
springstan 6196bbdc5e Translated hui-editor and hui-root pages (#4142) 2019-10-29 13:15:47 +01:00
Marianne Hval b41f4777d4 More descriptive delete/move buttons + red delete (#4145) 2019-10-29 13:13:30 +01:00
springstan f2812bc706 Translated automation and script editor (#4146) 2019-10-29 13:12:35 +01:00
Bram Kragten 04500bc237 Merge pull request #4148 from springstan/addTitleAttributeConfigUIMode
Added title attributes and translated them in Configure UI Mode
2019-10-29 13:07:43 +01:00
Bram Kragten 2a6b877cf1 Bumped version to 20191025.1 2019-10-29 12:58:20 +01:00
Bram Kragten c3896a4613 Only do haptic on entity interactions 2019-10-29 12:56:52 +01:00
Bram Kragten c6fb896fe4 Merge pull request #4152 from home-assistant/haptics
Only do haptic on entity interactions
2019-10-29 12:53:44 +01:00
Bram Kragten 669fbb7e77 Only do haptic on entity interactions 2019-10-29 12:37:25 +01:00
springstan 971865e4f9 Added title attributes and translated them in Configure UI Mode 2019-10-28 20:13:24 +01:00
Paulus Schoutsen 9078e41855 Clarify tslint disable 2019-10-28 10:45:58 -07:00
Bram Kragten 466c48a7d0 Merge pull request #4128 from Twanislas/netatmo-states-translation
Add Netatmo specific states
2019-10-28 15:51:42 +01:00
Bram Kragten 31a047ce9e Merge pull request #4136 from home-assistant/dev
20191025.0
2019-10-25 17:44:34 +02:00
Bram Kragten bd24ffa5d0 Bumped version to 20191025.0 2019-10-25 17:12:30 +02:00
Bram Kragten 99f4bd7398 Updated translations 2019-10-25 17:12:22 +02:00
Bram Kragten 417177b097 Merge pull request #4135 from home-assistant/entity-reg-1-col
Change entity reg table to full width
2019-10-25 17:08:43 +02:00
Bram Kragten c407cab501 Change entity reg table to full width 2019-10-25 16:54:42 +02:00
Bram Kragten 044cf22f47 Fix variable column widths (#4127) 2019-10-24 09:43:28 -07:00
Bram Kragten 75aa940d44 Merge pull request #4129 from home-assistant/delete-view-btn
Fix styling delete view btn
2019-10-24 17:32:04 +02:00
Bram Kragten 7be8080726 Fix styling delete view btn 2019-10-24 12:32:59 +02:00
Antoine Rahier 13fbc813cd Add Netatmo thermostat states 2019-10-24 11:20:06 +02:00
Antoine Rahier 44d1458229 Revert "Add Netatmo specific states"
Wrong file !

This reverts commit f06f3ee2e5.
2019-10-24 11:16:41 +02:00
Antoine Rahier f06f3ee2e5 Add Netatmo specific states 2019-10-24 11:09:42 +02:00
Bram Kragten a889a02e15 Merge pull request #4123 from iantrich/aria-ts-translations
translated most aria-labels in ts files
2019-10-24 10:34:46 +02:00
Ian Richardson 6bf3d6a689 lint 2019-10-23 23:20:54 -05:00
Ian Richardson 1d7dcca495 translated most aria-labels in ts files 2019-10-23 23:02:58 -05:00
Bram Kragten ad8f049570 Merge pull request #4117 from home-assistant/dev
20191023.0
2019-10-23 21:36:21 +02:00
Bram Kragten 73c56a68b6 Bumped version to 20191023.0 2019-10-23 21:16:25 +02:00
Bram Kragten b34b52f305 Update translations 2019-10-23 21:16:03 +02:00
Ian Richardson 39d052273d support actions on rows (#4023)
* support actions on rows

* address comments

* add type

* pointer events

* move action area to row name to avoid handler competition

* add action to state-badge as well

* correct type

* address comments

* handle 'enter' in long-press and make entities state-badge selecatable
2019-10-23 10:30:09 -07:00
Bram Kragten e435b9153b Clean up device card (#4108) 2019-10-22 16:11:56 -07:00
Bram Kragten 0792278927 Fix more integrations message (#4106)
* Fix more integrations message

* Period outside link
2019-10-22 16:10:42 -07:00
Josh McCarty 06d59b3cde Adds a white background to the QR code for MFA (#4107) 2019-10-23 00:04:09 +02:00
Josh McCarty 1e7497ad33 Revise hassio update card design (#4041)
* Revise hassio update card design

See https://github.com/home-assistant/home-assistant-polymer/issues/3916

* Remove available text; use secondary text color instead of yellow/orange

* Less bold text for update header
2019-10-22 23:06:18 +02:00
Ian Richardson 49d0f2359b add sensor card to first demo (#4035)
* add sensor card to first demo

* Change to temperature sensor
2019-10-22 14:43:34 -05:00
Timmo bb73039205 Confirmation Dialog (#4053)
*  Add confirmation dialog

*  Add confirmation dialog to service calls

* 🔨 Change returned value

*  Add confirmation dialog to integration remove

*  Add to entity registry

*  Add to delete card and add translation

*  Add to views deletion

* 🔨 Remove async

* 🔨 Fix min-width for smaller screens

* 🔨 Remove async

* Fix wrong merge

* Update ha-config-entry-page.ts
2019-10-22 21:20:41 +02:00
Bram Kragten d4d6b7e2ce Fix delete button styling in hui-edit-view (#4102) 2019-10-22 21:17:55 +02:00
Drake Loud 7b5201599d added title to view configuation (#4037)
* added title to view configuation

* replacing let with const

* added localization change

* updated view config title

* linter updates

* Prettier updates
2019-10-22 10:27:36 +02:00
springstan 11c08e9a69 Added view title to heading of Lovelace Add Card picker (#4083)
* Added view title to heading of Lovelace Add Card picker

* Fixed building error, cleaned up code

* Changed _view to _viewConfig and added check for undefined _cardConfig

* Added else if for undefined _cardConfig, added else for manual cards

* Used template literal instead of string concatenation
2019-10-22 10:24:25 +02:00
aquarium 731bb176f7 Fix link to translation documentation (#4098) 2019-10-22 08:43:14 +02:00
Phi Dong b0fce93de8 Fix issue where long states do not wrap (#4101) 2019-10-22 08:39:37 +02:00
Paulus Schoutsen fdbe89e87e Fix develop build 2019-10-21 16:51:54 -07:00
Ian Richardson a8d0a2293f revert lovelace selectable text (#4095) 2019-10-21 16:45:15 -07:00
Paulus Schoutsen 8ac278bc59 Remove unused deps 2019-10-21 16:33:03 -07:00
Paulus Schoutsen 70d6c6b902 Refactor Webpack build scripts (#4093)
* Refactor Webpack build scripts

* Add Gallery too

* Fix icons

* Update travis
2019-10-21 15:02:54 -07:00
Drake Loud 0621218e16 Changed button to text (#4067)
* Changed button to text

* Moved styles to hui-edit-view

* prettier updates
2019-10-21 23:32:15 +02:00
Bram Kragten 2424376fba Change ha-device-picker to combo box + improve name handling + show area (#4089)
* Change ha-device-picker to combo box + improve name handling + show area

* unused import
2019-10-21 12:40:16 -07:00
Bram Kragten 3973374f3f Add positive_time_period_dict to ha-form (#4090)
* Add positive_time_period_dict to ha-form

* select input on focus

* Update ha-form-positive_time_period_dict.ts
2019-10-21 12:36:26 -07:00
Ian Richardson c25a38b82f add actions to state-badge element and state-label-badge (default Lovelace badge type) (#4028)
* add actions to state-badge element

* address comments

state-label-badge no longer handles clicks
added actions to hui-state-label-badge
moved ha-badges-card to Lit
2019-10-21 14:03:01 -05:00
Ian Richardson 3c0ba1d7eb Convert more-info-sun to Lit (#4075)
* Convert more-info-sun to Lit

* address comments
2019-10-21 13:04:22 -05:00
Ian Richardson be678b02c5 Convert more-info-weather to LitElement (#4073)
* Convert more-info-weather to LitElement

* address comments

* add shouldUpdate
2019-10-21 13:04:08 -05:00
Ian Richardson 0078b48e3c card level themes (#4057)
* card level themes

weather-forecast
shopping-list
plant-status
markdown
alarm-panel

* fix markdown

* address comments

also added picture cards

* update updated

* address comments

* address comments
2019-10-21 12:38:06 -05:00
springstan 540f1d9bce Fix for Zone icon visibility on Map panel and Lovelace Map card (#4085)
* Set icon color to black in ha-panel-map.js

* Changed icon color depending on dark mode in lovelace map card

* Fixed build error by swapping var for let and const

* Replaced hardcoded style with the light and dark classes
2019-10-21 17:45:40 +02:00
Bram Kragten 5e3cb812ec Fix yaml name collision in card editor (#4079)
* Fix `yaml` name collision

* Add types for js-yaml change to named imports
2019-10-21 17:36:09 +02:00
aquarium 6d10a5dd4c Split data table background color into separate theme variable (#4031)
* Split data table background color into separate theme variable

* Remove reference to MDC in data table theme variable name
2019-10-21 09:27:06 +02:00
Sean Mooney 96d14b7ab7 Changed outdated "GUI editor" reference to "visual editor" (#4068)
Changed warning text from "GUI editor" to "visual editor" to match the updated naming being used in card editors.
2019-10-20 15:10:07 +02:00
Phi Dong b96b026905 Add hovers (title attrs) to buttons on integrations config entry (#4059)
* Add integration specific titles to config buttons

* Rename tranlation var to integration, move button labels inline
2019-10-20 15:02:11 +02:00
Paulus Schoutsen c25f2d3941 Move compression from Webpack to Gulp (#4074) 2019-10-20 14:42:20 +02:00
Paulus Schoutsen 785453aa79 Clean up mixins (#4076)
* Clean up mixins

* Lint
2019-10-20 14:31:58 +02:00
Phi Dong 4dbf5327bd Update snapshot actions to be a list (#4045)
* Update snapshot actions to be a list

* Update text of delete button to warning color
2019-10-19 18:03:22 +02:00
springstan 603240c467 Translated developer tools info page (#4054)
* Translated developer tools info page

* Added set or remove as a variable in translation of key default_ui
2019-10-19 17:59:57 +02:00
Paulus Schoutsen bbc3e7d93f Make updateHass not async (#4060) 2019-10-19 17:18:56 +02:00
Ian Richardson fbee4937a0 add icon option to entities card name (#4024)
* add icon option to entities card name

* account for only icon

* address comments
2019-10-19 14:25:14 +02:00
Phi Dong 0a77728652 Move Home Assistant and version on info page into h2 (#4061) 2019-10-19 14:24:28 +02:00
Phi Dong e3ed0cf436 Hide save on card configuration if no card is picked (#4062) 2019-10-19 14:18:59 +02:00
Bram Kragten d05dc2e4dc Bring back babel (#3974)
* Bring back babel

* bump preset env

* Remove empty TS properties in mixins
2019-10-19 14:06:04 +02:00
Paulus Schoutsen c437cd3865 Use only decorators (#4058)
* Use only decorators

* Remove unused imports
2019-10-18 22:50:27 -07:00
springstan 442171169b Translated developer tools template page (#4050) 2019-10-18 23:05:07 +02:00
springstan cc12dbb6ee Translated developer tools services page (#4049)
* Translated developer tools services page

* Changed translation parameter from error to data
2019-10-18 23:04:43 +02:00
springstan 60b3a960ae Translated developer tools mqtt page (#4052) 2019-10-18 23:04:26 +02:00
shbatm 5a957c3c9e Add width property to light card to fix #3964 (#3972)
* Add width property to light card to fix #3964

* Update Light Card Name CSS

* Update css per review
2019-10-18 22:58:25 +02:00
Ian Richardson be4d431dc3 more-info dialog for counter (#4038)
* more-info dialog for counter

* address comments
2019-10-18 14:55:53 -05:00
Ian Richardson 0005c75091 fix double tap on glance entity (#4051) 2019-10-18 21:08:12 +02:00
springstan 880b382a16 Translated developer tools logs page (#4046)
* Translated developer tools logs page

* Changed translation key from load_log to load_full_log
2019-10-18 17:43:04 +02:00
Ian Richardson d012512a79 add feature request template (#4026) 2019-10-18 17:01:41 +02:00
springstan e2ac842690 Translated developer tools state page (#4039)
* Translated developer tools state page

* Fixed merge error by updating used icon in developer-tools-state.js
2019-10-18 16:33:11 +02:00
Ian Richardson 67d8d48855 translate view editor and explain panel mode (#4043) 2019-10-18 16:28:31 +02:00
Bram Kragten 00f2d36cb5 Migrate ha-form to lit (#4000)
* Migrate ha-form to lit

* Fix import path

* Update

* add default, change suffix, fix import

* Fix select
2019-10-18 16:08:34 +02:00
springstan 035057b185 Made thermostat history graph localizable (#4004)
* Made thermostat history graph localizable

* Changed string concatenation with white spaces from .join() to template literal

* Used variables in translations instead of template literals

* Update src/translations/en.json

Removed unnecessary space in heating value

Co-Authored-By: Bram Kragten <mail@bramkragten.nl>
2019-10-17 23:28:12 +02:00
springstan 982966c8d9 Translated developer tools events page (#4033)
* Translated developer tools events page

* Implemented translations (alert on empty event type, notification on firing an event), Removed unnecessary translation key-value pairs

* Added falsely removed key-value pairs
2019-10-17 23:17:39 +02:00
Ian Richardson f5e3a9ad40 Convert thermostat to round-slider (#3734)
* Convert to round-slider

Closes https://github.com/home-assistant/home-assistant-polymer/issues/3622
Closes https://github.com/home-assistant/home-assistant-polymer/issues/2756

* scaling

* address review comments

* css tweaks

* remove jquery

* address comments

* simplify set-temperature

* handle long name

* remove increased handleSize

* address comments

* address comments

* address comments

* address comment

* need coffee
2019-10-17 21:00:39 +02:00
Ian Richardson 141c3f1ea4 add confirmation option to actions (#4006)
* add confirmation option to actions

* address comments
2019-10-16 11:03:36 -05:00
Ian Richardson 4ea483e3de Switch theme (#4017)
* introduce ha-switch theming

* fix typo

* remove comment
2019-10-16 17:08:28 +02:00
Josh McCarty 8eca956cd1 Uses information-outline icon for entity more info link (#4016) 2019-10-16 16:53:25 +02:00
Ian Richardson c9242a5075 Custom badges (#3867)
* custom badges

* incremental

* functional

* cleanup

* cleanup

* address review comments

* address more comments

* address review comments

* address review comments

* cleanup

* address review comments

* address comments

* address comments

* fix entity-filter

* set hass once

* hass
2019-10-16 16:09:13 +02:00
Ian Richardson df29a5becb Add double tap action (#3879)
* add dbltap_action

* apply to picture-glance

* types and boolean

* fix typo

* simplify double tap logic

* extract hasDoubleClick functionality

* address comments

* address comments

* double_tap_action
2019-10-16 08:57:05 -05:00
Ian Richardson fb589337f8 display card errors with yaml config (#4018) 2019-10-16 09:22:57 +02:00
Ian Richardson ea5ee6189d filter system users from Person editor (#3958)
* filter system users from Person editor

* address review comments

* address comments

* address comments
2019-10-15 19:19:46 -05:00
Josh McCarty a39e47cced Updates alarm more-info dialog button styles to match lovelace card (#3955)
* Updates alarm more-info dialog button styles to match lovelace card

* Use flex for controlling button size

* Limit max-width of alarm buttons

This matches the width of the code input field
2019-10-15 21:04:29 +02:00
Ian Richardson 49d69f65ad add show_state option for picture-glance entities (#3937)
* add states option below picture-glance entities

* address review comments
2019-10-15 09:49:03 +02:00
Marcus Fredlund 424d677bcb Alarm Panel card: number buttons outline and adjusted padding and font-size fixing #2812 (#3991)
* outline on alarm panel buttons

* Fix for font-size before mwc-button is working.

* suggested edits from review

* changed to just outline

* Remove base-unit
2019-10-14 21:29:37 +02:00
springstan 59e4cdc62a Added integration name to System Options dialog (#3996)
* Added integration name to System Options dialog

* Passed integration name into translation string

* Translated integration name

* Added option for no translation
2019-10-14 21:28:44 +02:00
Bram Kragten 9d3dfad98c Update integration-badge.ts (#4001) 2019-10-14 21:28:13 +02:00
Erik Montnemery 555b746f4b Allow device actions to specify extra fields (#4002)
* Allow device actions to specify extra fields

* Typing etc.

* Use deviceAutomationsEqual to compare automations
2019-10-14 21:27:51 +02:00
Bram Kragten ce6a97d065 Merge pull request #3995 from scop/customize-yaml-message
Improve customize.yaml non-inclusion warning message
2019-10-14 21:27:07 +02:00
Ville Skyttä 88567df36d Prettier 2019-10-14 22:03:28 +03:00
Bram Kragten f55cbd9e9a Merge pull request #3999 from home-assistant/dev
20191014.0
2019-10-14 11:01:07 +02:00
Bram Kragten 7d00cc1eff Merge branch 'master' into dev 2019-10-14 10:28:17 +02:00
Bram Kragten 29301ddee7 Bumped version to 20191014.0 2019-10-14 10:22:13 +02:00
Bram Kragten 978b773968 Update translations 2019-10-14 10:21:56 +02:00
springstan 4f30cae6aa Translated Advanced mode toggle (#3997) 2019-10-13 22:39:08 +02:00
Ville Skyttä 5f29b66a8d Further tweak the message 2019-10-13 21:15:06 +03:00
springstan b94da1bd19 Added note about more integrations to bottom of Set up new integration dialog (#3992)
* Added note about more integrations to bottom of Set up new integration dialog

* Fixed note about more integration by encapsulating it in one paragraph
2019-10-13 15:57:24 +02:00
Franck Nijhof f9b0a0fc13 Fixes documentation URL for HTML5 push notifications (#3993) 2019-10-13 13:34:34 +02:00
Sven 300ffdae04 Add no devices available hint to person editor (#3906)
* Add no devices available hint to person editor (#3731)

* Fix device_tracker check and adjust messages

* fix lint

* Add location, fix memoize usage, hide entity picker and update text

* Move links to a list
2019-10-13 13:22:37 +02:00
Tom Raithel 476525e0d4 Remove 'Pick script to edit' headline from script editor (#3873)
Fixes #3829
2019-10-13 13:18:43 +02:00
Ville Skyttä edecf9d58f Improve customize.yaml non-inclusion warning message
Link to relevant docs, note that changes won't be applied after a
restart if the include isn't in place (changes _do_ actually affect the
current runtime configuration and are persisted in customize.yaml).
2019-10-13 14:07:02 +03:00
Sean Mooney 38bf2e116b Update ISSUE_TEMPLATE.md (#3987)
Now that ui-schema repo is merged here and there's a feature request label, I think this line is no longer necessary.

 `- This is for bugs only. Feature and enhancement requests should go in our community forum: https://community.home-assistant.io/c/feature-requests`
2019-10-12 23:14:51 -07:00
Paulus Schoutsen 0719c4d1ae Add cache headers to demo and cast (#3982)
* Add cache headers to demo and cast

* Demo only to copy static from frontend public folder

* Update headers

* Update demo headers

* Update cast headers

* Update _headers

* Update _headers
2019-10-12 23:12:01 -07:00
Bram Kragten 12840231be Add code mirror editors to the dev-tools data fields (#3981)
* Add yaml code mirror editor to the dev-tools yaml fields

* Add jinja2 editor on dev template

* Migrate to UpdatingElement, review comments

* update cm, add types

* types

* dev tools mqtt
2019-10-12 12:33:51 -07:00
Bram Kragten 4728c12225 Update google cloud card (#3978)
* Update google cloud card

* Oops
2019-10-11 08:48:56 -07:00
Bram Kragten 90526ac563 Migrate entity registry to data-table (#3965)
* Migrate entity registry to data-table

* icons

* Styling

* Review comments

* fix not selector

* typos + move columns out of class

* Localize + comments

* Fucked up the rebase
2019-10-11 14:55:45 +02:00
Hayley McIldoon 6f7ea03e35 Remove redundant text in Cloud panel #3824 (#3967) 2019-10-11 14:55:12 +02:00
Erik Montnemery 78900e05ad Allow device conditions to specify extra fields (#3973) 2019-10-11 13:16:54 +02:00
Ian Richardson 495f4aa19c ability to hide tabs (#3811)
* ability to hide tabs

* address review comments

* address review comments

* address review comments

* review comments
2019-10-11 13:14:34 +02:00
Bram Kragten 88c480759f Convert YAMLTextArea to code mirror editor (#3980)
* Convert YAMLTextArea to code mirror editor

* Review comments

* Clean up
2019-10-10 21:58:21 +02:00
Josh McCarty ab75365636 Move alexa state reporting switch position for consistency (#3953) 2019-10-10 10:51:58 +02:00
Tom Raithel 0266617c71 Remove overflow attribute from view column (#3971)
Fixes #3253
2019-10-10 10:50:46 +02:00
Mauricio Bonani aef45c5043 Upgrade MDI icons to 4.5.95 (#3977)
* Upgrade MDI icons to 4.5.95

* Upgrade MDI icons to 4.5.95
2019-10-10 09:44:10 +02:00
Hayley McIldoon deeb0146c7 Renamed Toggle Editor button #3617 (#3968) 2019-10-09 23:03:46 +02:00
Bram Kragten 5dea674f20 Merge pull request #3975 from home-assistant/rc
20191002.2
2019-10-09 22:19:34 +02:00
Bram Kragten 646fe34d09 Bumped version to 20191002.2 2019-10-09 21:57:58 +02:00
Ian Richardson c67907aa58 simplify 2019-10-09 21:54:58 +02:00
Ian Richardson e78f4c5ace picture-glance: check for entity state change 2019-10-09 21:54:34 +02:00
Bram Kragten e891fdc3eb Save orig value + some cleanup 2019-10-09 21:53:48 +02:00
Erik 95a258c2a5 Allow device triggers to specify extra fields 2019-10-09 21:53:30 +02:00
Bram Kragten f1fabd09a6 Merge pull request #3970 from emontnemery/automation_device_action_form
Allow device triggers to specify extra fields
2019-10-09 21:48:57 +02:00
Bram Kragten 0d77bdaf32 Merge pull request #3949 from iantrich/fix-glance-state_image
picture-glance: check for entity state change
2019-10-09 21:48:05 +02:00
Bram Kragten 320be2e5d9 Convert integration entry page to data table (#3963)
* Convert integration entry page to data table

* Simplify device-card

In a future PR this has to be changed further

* Center no devices text

* Review comments
2019-10-09 08:48:41 -07:00
Bram Kragten 6a098ad0b5 Save orig value + some cleanup 2019-10-09 13:34:34 +02:00
Erik e895e91a11 Allow device triggers to specify extra fields 2019-10-09 07:41:25 +02:00
Paulus Schoutsen fc3f7ca4b2 Mark Persian as right to left. 2019-10-08 10:24:21 -07:00
Bram Kragten 1f09d848c5 Merge pull request #3961 from home-assistant/rc
20191002.1
2019-10-08 17:55:43 +02:00
Bram Kragten 4d794f6088 Hide empty blocks on device page (#3950)
* Hide empty blocks on device page

* lint

* Rename entities on device rename

* check if entity_id is valid

* clarify var name

* Review comments

* Use regex to replace not allowed chars

* Align with backend
2019-10-08 17:54:17 +02:00
Bram Kragten 9ad7f0dbac Hide empty blocks on device page (#3950)
* Hide empty blocks on device page

* lint

* Rename entities on device rename

* check if entity_id is valid

* clarify var name

* Review comments

* Use regex to replace not allowed chars

* Align with backend
2019-10-08 08:53:31 -07:00
Bram Kragten 9f39610153 Update translations 2019-10-08 16:13:52 +02:00
Bram Kragten 12d8a04c15 Update translations 2019-10-08 16:13:06 +02:00
Bram Kragten 73b0f5949e Fix updating entity id in entity-registry-dialog (#3962) 2019-10-08 12:28:49 +02:00
Bram Kragten 0f7a3887a7 Fix updating entity id in entity-registry-dialog (#3962) 2019-10-08 12:27:29 +02:00
Bram Kragten ac75ce038a Bumped version to 20191002.1 2019-10-08 10:33:16 +02:00
Bram Kragten 8de9a73741 Add report state toggle for Google (#3855) 2019-10-08 10:28:37 +02:00
Bram Kragten ef51f29e28 Add report state toggle for Google (#3855) 2019-10-08 10:25:57 +02:00
Ian Richardson b61bbee35a fix media row secondary info (#3957) 2019-10-08 10:10:37 +02:00
Markus Nigbur 64dd8c463d Changed the states-ui toggle button to unobstrusive text link. (#3959) 2019-10-08 10:01:51 +02:00
akargl d2a95e9f06 Add default text to Markdown card editor (#3960) 2019-10-08 09:58:37 +02:00
Timmo 0cb0525516 Add localized names to card editor (#3941)
* 🔨 Add localized names to card editor

* ✏️ Rename alarm_panel to alarm-panel

* ✏️ Proper case

* 🔨 Move to else

* 🔨 Remove name and object from card picker
2019-10-07 20:17:12 +02:00
Ian Richardson dcaf4fdfe2 add title option to stack cards (#3839) 2019-10-07 10:17:52 +02:00
ottersen 0c13757910 Correct usage of Zigbee vs ZigBee #1 (#3938)
ref clarification by Zigbee Alliance of correct usage of "Zigbee" vs "ZigBee"

https://twitter.com/Frenck/status/1178239254713061377
2019-10-07 09:55:31 +02:00
ottersen 0cdcd74c9d Correct usage of Zigbee vs ZigBee #2 (#3939)
ref clarification by Zigbee Alliance of correct usage of "Zigbee" vs "ZigBee"

https://twitter.com/Frenck/status/1178239254713061377
2019-10-07 09:55:18 +02:00
Phi Dong db3968399f Add intro to OZW log z-wave config section (#3935) 2019-10-07 09:53:37 +02:00
Malte Franken 7494a49238 Normalize longitude to the range between -180 to +180 degrees (#3872)
* normalize longitude to the range between -180 to +180 degrees

* only normalize longitude if out of valid range
2019-10-07 09:49:00 +02:00
Ian Richardson 55d2a3c8b1 simplify 2019-10-06 23:16:14 -05:00
Ian Richardson be4e45c22c picture-glance: check for entity state change 2019-10-06 23:08:14 -05:00
Matthew Donoughe efb28d337a editor support for scene script action (#3942)
Script support added in home-assistant/home-assistant#27223
2019-10-05 15:14:37 -07:00
Phi Dong edd77e1f32 Exclude persistent_notifications domain when computing unused entities (#3936) 2019-10-05 14:01:00 +02:00
Bram Kragten 848dd7e071 Fixes to script localization (#3930)
* Fixes

* fix toast
2019-10-04 21:46:32 +02:00
Bram Kragten 59d4a4247a Fix whitespace error in services (#3880) 2019-10-04 17:21:43 +02:00
Jens Vanhooydonck ba79633758 HA Cloud overflow wrap (#3905)
* Overflow of Remote Control URL

* Overflow wrap of certificate information

Closes #2982

* Changed styling to class break-word

* Changed break-work to class

* Update src/panels/config/cloud/account/cloud-remote-pref.ts

Co-Authored-By: Bram Kragten <mail@bramkragten.nl>
2019-10-04 16:46:01 +02:00
Charles Garwood 860973bdbd Add localization to ZHA panel (#3881)
* Add localization for ZHA config panel

* Additional ZHA panel localization
2019-10-04 14:07:49 +02:00
Sven d4d897e79e Make cloud account panel translatable (#3875)
* Add localization to cloud login & register (#3844)

* Add localization to cloud account (#3844)

* Add localization to cloud forgot password (#3844)

* fix lint errors

* Update src/panels/config/cloud/account/cloud-account.js

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

* Update src/panels/config/cloud/register/cloud-register.js

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

* fix issues pointed out in review

* fix code style issue

* Add localization for dialogs, alexa and google

* fix exposed entities name
2019-10-04 13:14:53 +02:00
Bram Kragten 4850f3d588 Fix whitespace error in services (#3880) 2019-10-04 12:35:49 +02:00
Bram Kragten 8bc53c235f Fix styling system options (#3877) 2019-10-04 12:04:27 +02:00
Charles Garwood c74793b1d5 Add link to Z-Wave panel docs (#3874) 2019-10-03 20:51:37 +02:00
Marcel Brückner 56bac8a8c1 Make script editor translatable (#3866)
* Make script editor's script picker translatable (home-assistant/home-assistant-polymer#3848)

* Make script editor translatable (home-assistant/home-assistant-polymer#3848)

* Fix linting errors (home-assistant/home-assistant-polymer#3866)

* Fix linting errors (home-assistant/home-assistant-polymer#3866)

* Move unsaved_confirm translation key to common section (home-assistant/home-assistant-polymer#3866)

Instead of adding the same text multiple times for every section, add a common section to indicate reusable translations.

* Add variable to localization text

* Use JavaScript instead of Polymer data binding
2019-10-03 20:31:53 +02:00
Sven 184575fd54 Add localization to persons config page (#3846) (#3871) 2019-10-03 14:38:34 +02:00
Sven e148559d3e Add localization to user config page (#3845) (#3869) 2019-10-03 12:22:45 +02:00
Phi Dong 95b76dbb85 Fix issue where help icon overlapped with header text on mobile devices (#3868) 2019-10-03 11:50:36 +02:00
Bram Kragten 496bb9dc39 Merge pull request #3864 from home-assistant/dev
20191002.0
2019-10-02 22:46:27 +02:00
Bram Kragten 351ba3e701 Merge branch 'master' into dev 2019-10-02 22:31:00 +02:00
Bram Kragten 260f428bc6 Bumped version to 20191002.0 2019-10-02 22:25:49 +02:00
Bram Kragten 3622514131 Fix dark switch for map card editor (#3856) 2019-10-02 21:26:48 +02:00
Bram Kragten 391b2dcf6a Align background with tiles (#3858) 2019-10-02 21:25:59 +02:00
Bram Kragten a02bf1fd48 Allow yaml in dev states (#3859)
* Allow yaml in dev states

* remove json
2019-10-02 21:25:38 +02:00
Bram Kragten 4cf9472bf4 Allow yaml in dev services (#3860)
* Allow yaml in dev services

* remove json
2019-10-02 21:23:37 +02:00
Bram Kragten 74d1de7313 Allow yaml in dev events (#3861)
* Allow yaml in dev events

* remove json
2019-10-02 21:22:06 +02:00
Bram Kragten cd6fd6a46c Allow yaml in script and automation (#3862)
* Allow yaml in script and automation

* Restore defaults

* Rename class

* Catch errors in constructor

* Update yaml_textarea.tsx
2019-10-02 21:21:13 +02:00
Bram Kragten a6dda90b13 Default hide disabled entities from entity registry (#3863)
* Default hide disabled entities from entity registry

* localize

* Use memoize
2019-10-02 21:20:47 +02:00
Bram Kragten 7add8a2ea0 Guard for null badges (#3841)
* Guard for null badges

* Check for null badges on load and save
2019-10-02 09:29:36 -07:00
Bram Kragten b927a3ef29 Add entity registry functions to device page (#3843)
* Add entity registry functions to device page

* Move update/remove logic to dialog

* Hide disabled entities by default
2019-10-02 09:23:42 -07:00
Ian Richardson 76d3218130 Allow user selection of text in Lovelace (#3605)
* Allow user selection of text in Lovelace

Closes https://github.com/home-assistant/home-assistant-polymer/issues/2110

* set negative tabindex

This appears to work locally, but pushing it up to try on the demo to be sure

* toggle class for android

* apply suggestions
2019-10-02 13:33:16 +02:00
Franck Nijhof 8b6d8f9086 Update documentation link URL for integrations (#3857) 2019-10-02 13:23:41 +02:00
Bram Kragten ffaecb29b7 Update translations 2019-10-02 12:58:11 +02:00
Ian Richardson fa74295c0b add actions to picture-glance entities (#3807)
* add actions to picture-glance

* remove unnecessary entity property

* Update hui-picture-glance-card.ts
2019-10-02 11:22:33 +02:00
Bram Kragten ea50d486da Fix some styling of ha-switch (#3842)
If content is slotted it will get some margin to the toggle like the old switch.
2019-10-01 11:17:10 -07:00
Bram Kragten 3cf4b890b6 Remove local mdc-datatable (#3840)
With version 3.2.0 of mdc-datatable they removed the ts files from the published package, so we can now use it again.
2019-10-01 11:34:25 +02:00
Sean Mooney 313b984a53 Add missing domain icons (#3836)
`persistent_notification` and `zone` were both missing domain icons.
2019-10-01 10:11:44 +02:00
Bram Kragten 7d09e29d60 Use filter worker in data-table (#3808)
* Filter worker

Doesn't work

* Remove template for worker

* Move files

* Sort to worker + debounce filter

* Improve performance

* Update ha-data-table.ts
2019-09-30 15:53:48 -07:00
Ian Richardson 7e979f0cf1 add image option to entities card (#3832) 2019-09-30 22:25:09 +02:00
Ian Richardson 64366dc99a fix alignment of switches positioned absolutely (#3812)
* fix alignment of switches positioned absolutely

* wrap switches

* remove !important
2019-09-30 21:27:19 +02:00
Ian Richardson c69585db98 add state_filter to picture cards (#3791) 2019-09-30 09:49:11 +02:00
Bram Kragten 2dd5cd586b Add a setting for vibration (#3813)
* Add a setting for vibration

* Update en.json
2019-09-27 10:23:30 +02:00
Bram Kragten 05a258c886 Add hassio supervisor and os update notice (#3798)
* Add hassio supervisor and os update notice

* Cleanup

* Update hassio-dashboard.ts

* Fix styling

* Check if system has HassOs

* Remove unused import
2019-09-26 13:47:34 +02:00
Bram Kragten f4bd42dfd4 Add name to picture entity struct (#3809) 2019-09-25 23:37:54 +02:00
Bram Kragten 41e5e7c1ae Update yarn.lock 2019-09-25 22:41:17 +02:00
Ian Richardson 95dfcafce3 UI Editor for picture-glance card (#3709)
* UI Editor for picture-glance card

Closes https://github.com/home-assistant/home-assistant-polymer/issues/3700

* address review comments

* address review comments

* fallback to yaml if state image used

* push default changes

* default image for config

* Update hui-picture-glance-card-editor.ts
2019-09-25 15:38:26 -05:00
Bram Kragten 111d1afc21 Fix firefox overflow (#3806)
* Fix firefox overflow

MIght fix...

* Add comment

* Align
2019-09-25 21:52:21 +02:00
Ian Richardson 886c6dd88c Expand entity-filter options (#3692)
* Expand entity-filter options

Closes https://github.com/home-assistant/home-assistant-polymer/issues/3543

Adds the following to `state_filter`:
- `operator` option. Specify operator to use in comparison.
- `value` option. Specify value to compare against.
- `attribute` option.  Specify attribute to use instead of state in comparison.

e.g.
```yaml
type: entity-filter
state_filter:
  - "on"
  - operator: ">"
    value: 90
entities:
  - sensor.water_leak
  - sensor.outside_temp
  - entity: sensor.humidity_and_temp
    state_filter:
      operator: ">"
      value: 50
      attribute: humidity
```

* Update evaluate-filter.ts

* verify state_filter exists on card or each entity

* address review comments

* apply Bram's suggestion

* address review comments

* cleanup
2019-09-24 10:34:57 +02:00
On Freund 38b817bd67 Green shade in climate history for platforms that don't support hvac_action (#3787)
* Green shade in climate history for platforms that don't support HVAC_ACTION

* The presence of hvac_action can change over time

* Move static condition out of anon function
2019-09-24 10:34:13 +02:00
Ian Richardson c59b6626f2 UI editor for history-graph (#3782)
* UI editor for history-graph

* add translations
2019-09-24 10:00:52 +02:00
Ian Richardson 2cc196e3fb cleanup editors (#3786)
* cleanup editors

* address review comments
2019-09-23 17:11:45 -05:00
Erik Montnemery a08884fed6 Add support for and and or conditions to the automation editor. (#3724)
* Add support for `and` and `or` conditions in automations

* Remove debug prints, fix lint errors

* Fix

* Merge `and` and `or` conditions

* Add missing file
2019-09-23 14:07:57 -07:00
Bram Kragten 2fe4a02b6b Add support for panels to cast (#3796)
* Add panel support to cast

* Set background
2019-09-23 14:03:45 -07:00
Paulus Schoutsen 7c793c1cdb Bumped version to 20190919.1 2019-09-23 13:17:48 -07:00
Bram Kragten a0b848acc4 Bring back babel for ES5 builds (#3797)
* Bring back babel for ES5 builds

* Remove ts from babel
2019-09-23 13:17:44 -07:00
Bram Kragten a1b9a092d0 Bring back babel for ES5 builds (#3797)
* Bring back babel for ES5 builds

* Remove ts from babel
2019-09-23 13:15:12 -07:00
Bram Kragten 993d390ea5 Add device automation options to device page (#3776)
* Add device automation options to device page

* Update

* Fill automation editor with data

* Update ha-automation-editor.ts

* Remove dupe deps

* Fix imports
2019-09-23 14:13:44 +02:00
Ian Richardson 1f4d359050 Replace all default exports in common/ with named exports (#3790) 2019-09-23 10:57:47 +02:00
Ian Richardson f871387fa6 new action: url (#3773)
* new action: url

Takes a `url_path` option.
Closes https://github.com/home-assistant/ui-schema/issues/249
I'm experience the issue described here with my string values in the action-editor: https://github.com/home-assistant/home-assistant-polymer/issues/2645. Have not been able to track down where the issue is.

* Fix losing config on init

* fix action-editor
2019-09-22 21:56:29 +02:00
Ian Richardson 9a92ed31f6 picture entity editor fix (#3783)
* forgot to push commit

* resolve broken build
2019-09-21 22:42:46 -05:00
Ian Richardson 37129adfab UI Editor for picture-entity card (#3708)
* UI Editor for picture-entity card

Closes https://github.com/home-assistant/home-assistant-polymer/issues/3699

* address review comments

* translations
2019-09-21 22:15:30 -05:00
Paulus Schoutsen ec52e71c71 Upgrade some deps (#3780)
* Upgrade TS

* Remove unused uglifyjs webpack plugin

* Upgrade some webpack stuff
2019-09-21 11:59:51 +02:00
Ian Richardson 5e28e1b320 Switch paper-toggle-button to mwc-switch (#3683)
* Switch paper-toggle-button to mwc-switch

Closes https://github.com/home-assistant/home-assistant-polymer/issues/3352

* ha-switch

* apply not-checked theming

Thanks @bramkragten!

* address review comments
2019-09-21 11:59:27 +02:00
Ian Richardson 9a7eb3d406 light-card: icon option (#3771)
* light-card: icon option

closes https://github.com/home-assistant/home-assistant-polymer/issues/3768

* add theme select label property

* address review comments
2019-09-20 16:10:14 -05:00
Erik Montnemery eee0c2e53f Add support for automation description (#3723)
* Add support for automation annotation

* Update label and add placeholder

* Rename annotation to description

* Adress review comments, fix lint errors
2019-09-20 08:19:38 -07:00
Bram Kragten 145259e82f Add Language Urdu (#3750)
* Add Urdu

* Changed name to native name
2019-09-19 16:27:54 -07:00
Bram Kragten d0cc4c2715 Move views to own folder + use update vs updated in panel view (#3761)
* Move views to own folder + use update vs updated in panel view

* updated -> update
2019-09-19 09:10:02 -07:00
Paulus Schoutsen 4d97a47e08 Merge pull request #3770 from home-assistant/dev
20190919.0
2019-09-19 09:01:35 -07:00
Paulus Schoutsen 4ef5a8da70 Bumped version to 20190919.0 2019-09-19 08:59:57 -07:00
Paulus Schoutsen cdfd0afdf4 Update translations 2019-09-19 08:59:23 -07:00
Bram Kragten d250a931e6 fix continue integration flow (#3766)
* fix continue integration flow

* Remove test button
2019-09-19 08:57:17 -07:00
Bram Kragten cd2b92a449 Show toast on success save entity settings (#3763) 2019-09-19 08:53:16 -07:00
Bram Kragten c617cb5b12 Align behaviour state badge (#3767) 2019-09-19 08:53:00 -07:00
Paulus Schoutsen e7ac95e314 Merge pull request #3757 from home-assistant/dev
20190918.1
2019-09-18 13:02:58 -07:00
Paulus Schoutsen 7bab9cb464 Remove unused templates attributes from demo 2019-09-18 13:02:45 -07:00
Paulus Schoutsen bb5ab958c1 Bumped version to 20190918.1 2019-09-18 12:52:25 -07:00
Paulus Schoutsen 2d92ffaa4d Update translations 2019-09-18 12:52:20 -07:00
Mauricio Bonani 7a7a0f772a Upgrade MDI icons to 4.4.95 (#3755)
* Upgrade MDI icons to 4.4.95

* Upgrade MDI icons to 4.4.95
2019-09-18 12:38:45 -07:00
Paulus Schoutsen c898db5010 Fixes to device page (#3756)
* Fixes to device page

* Cache page with data page
2019-09-18 12:38:27 -07:00
Bram Kragten b6fbf4da3a Cast: Show error message instead of number (#3752)
* Cast: Show error message instead of number

* Update hc-main.ts
2019-09-18 09:33:58 -07:00
Bram Kragten 0bfc61629e Fix save button more info settings (#3751)
Would be blue on blue on mobile
2019-09-18 09:23:09 -07:00
Ian Richardson e594fcfc42 lower unavailable font-size (#3746)
Closes https://github.com/home-assistant/home-assistant-polymer/issues/3745
2019-09-18 17:19:42 +02:00
Bram Kragten 84ed6d8fb3 Merge pull request #3748 from home-assistant/dev
20190918.0
2019-09-18 14:22:53 +02:00
Bram Kragten 31ae115062 Fix set theme on panel (#3749) 2019-09-18 14:12:54 +02:00
Bram Kragten fca885a17a Bumped version to 20190918.0 2019-09-18 13:56:01 +02:00
Bram Kragten 29dff42de4 Make panel-view it's own component (#3747)
* Make panel-view it's own component

* Convert to updatingelement
2019-09-18 13:54:21 +02:00
Bram Kragten f5b3a82922 Merge pull request #3742 from home-assistant/dev
20190917.2
2019-09-17 21:13:48 +02:00
Bram Kragten 54beaad7e5 Bumped version to 20190917.2 2019-09-17 21:00:13 +02:00
Bram Kragten e30f9d4a66 Add device config page (#3695)
* Add device config page

* Remove unused imports

* Revert a lot

Make the PR smaller

* Change columns add battery level

* memoize

* don't bubble

* Add mobile view

* fix filter mobile

* Comments
2019-09-17 20:59:43 +02:00
Bram Kragten 27264b27a9 Fix (#3741) 2019-09-17 09:50:51 -07:00
Bram Kragten 2b1f9460a8 Fix styling mwc-button (#3740) 2019-09-17 09:06:53 -07:00
Bram Kragten 4641cd65ca Merge pull request #3739 from home-assistant/dev
20190917.1
2019-09-17 14:18:45 +02:00
Bram Kragten 1f6fe5dfcf Bumped version to 20190917.1 2019-09-17 14:12:46 +02:00
Bram Kragten 058b4ba658 Fix theme rgb creation (#3738) 2019-09-17 14:08:48 +02:00
Bram Kragten 24baa87b18 Merge pull request #3736 from home-assistant/dev
20190917.0
2019-09-17 08:00:51 +02:00
Bram Kragten fad2f1790f Update translations (#3735) 2019-09-17 07:50:38 +02:00
Bram Kragten 8fd8274d15 Bumped version to 20190917.0 2019-09-17 07:49:52 +02:00
Bram Kragten f4f1e24ad5 Generate rgb theme vars (#3728)
* Create rgb theme vars

* Check if key is rgb and revert paper

* Update apply_themes_on_element.ts

* paper-card > card
2019-09-17 07:46:53 +02:00
Paulus Schoutsen 42626ba2f8 Upgrade set-value (#3733) 2019-09-17 07:46:22 +02:00
Bram Kragten 29ab04fc7a Add subscribe mixin (#3710)
* Add subscribe mixin

* Update src/mixins/subscribe-mixin.ts

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

* Update src/mixins/subscribe-mixin.ts

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

* Update subscribe-mixin.ts

* Update subscribe-mixin.ts

* Add properties

* Fix
2019-09-17 07:45:56 +02:00
Bram Kragten 722e9bcda7 Hide columns in unused entities on mobile (#3719)
* Hide columns in unused entities on mobile

* Update hui-unused-entities.ts

* Fix

* Update hui-unused-entities.ts
2019-09-17 07:45:21 +02:00
Paulus Schoutsen 065e42c8fd Fix Cast race condition (#3732) 2019-09-17 07:42:25 +02:00
Bram Kragten bf343647d4 Fix background on panel (#3713)
* Fix background on panel

* Make themes work on panel

* fix for tabs-hidden

* and still not gone...
2019-09-16 15:03:16 -06:00
Bram Kragten 3b51e55f2d Update logs on activate tab (#3716)
* Update logs on activate tab

* Only update if we already loaded data
2019-09-16 13:56:22 -06:00
Bram Kragten 125616aa99 Merge pull request #3727 from PDekker/patch-1
Update cover_icon.ts
2019-09-16 20:50:16 +02:00
Bram Kragten 1341fe9ae9 Open more info in unused entities (#3714)
* Open more info in unused entities

* Only make entity column open more info
2019-09-16 11:09:07 -06:00
Bram Kragten b195df0bfa Merge pull request #3704 from iantrich/light-min
Set minimum brightness of slider to 1%
2019-09-16 15:53:11 +02:00
Bram Kragten 1109d18576 Merge pull request #3718 from DB-CL/dev
Update slider's min/max when thermostat gets updated
2019-09-16 15:45:17 +02:00
Bram Kragten b1a6580afb Merge pull request #3720 from SeanPM5/patch-1
Add documentation link on Events panel
2019-09-16 14:08:46 +02:00
PDekker 1d95b9d779 Update src/common/entity/cover_icon.ts
Co-Authored-By: Bram Kragten <mail@bramkragten.nl>
2019-09-16 14:01:47 +02:00
PDekker 202782e741 Update cover_icon.ts
Add new icons for existing device types
2019-09-16 11:39:09 +02:00
Sean Mooney a4663d438c prettier fix, hopefully third time's a charm? 2019-09-15 00:53:28 -04:00
Sean Mooney eab3e6091a Update developer-tools-event.js 2019-09-15 00:31:36 -04:00
Sean Mooney 6627a96a05 Add documentation link on Events panel
adds a link to events documentation which contains helpful information for using this tool.
2019-09-14 23:32:13 -04:00
Erik Montnemery 16ae52c321 Fix regression in device automation from #3643 (#3717) 2019-09-14 07:02:43 -06:00
Bram Kragten 9792572370 chnage order dev tools (#3715) 2019-09-14 07:00:44 -06:00
Bram Kragten 4bb65b8ae1 Make data table and checkbox themeable (#3712)
Added rgb vars, not sure we want to go that way, but otherwise we will get a lot of styles...
2019-09-14 06:56:16 -06:00
DBCL 2f3b399450 Please the linter 2019-09-13 23:27:28 +02:00
DBCL 3e98b8e4f1 Add min/max changes on thermostat update 2019-09-13 22:58:43 +02:00
Ian Richardson 493198f530 Set minimum brightness of slider to 1%
Closes #3693
2019-09-12 13:38:18 -05:00
Paulus Schoutsen ce9e3ae9e9 Merge pull request #3690 from home-assistant/dev
20190911.1
2019-09-11 13:04:39 -06:00
Paulus Schoutsen a2c2f6a1e2 Bumped version to 20190911.1 2019-09-11 13:00:59 -06:00
Bram Kragten b46c9406ff Add ha-data-table (#3647)
* Work in progress

* add sorting

implemented in unused entities to try it

* implement sorting

* fix

* Refactor

* Default sort, filterable, id

* Fix

* Add local mdc-data-table + comments + fixes

* Move mdc-data-tabel

So our linters won't complain...
2019-09-11 12:59:27 -06:00
Ian Richardson 9f213cf055 Don't display slider if light doesn't support brightness (#3684)
Closes https://github.com/home-assistant/home-assistant-polymer/issues/3542
2019-09-11 12:47:48 -06:00
Bram Kragten 3254478d05 Remove wct-browser-legacy (#3686) 2019-09-11 12:46:57 -06:00
Bram Kragten e78fb35593 Merge pull request #3688 from home-assistant/dev
20190911.0
2019-09-11 13:43:09 +02:00
Bram Kragten 321b852079 Bumped version to 20190911.0 2019-09-11 13:00:33 +02:00
Bram Kragten 8b44998e1f Update translations (#3687) 2019-09-11 12:59:53 +02:00
Paulus Schoutsen 4aeca70f49 Upgrade HAWS to 4.4.0 (#3682) 2019-09-10 21:27:44 -07:00
gregod 7912f0bf9e Set rel noopener and noreferrer on external links in markdown (#3666)
* Set rel noopener and noreferrer on external links in markdown

* Update ha-markdown.ts

* Update ha-markdown.ts
2019-09-10 13:44:02 -07:00
Paulus Schoutsen abc849f623 Remove Polymer CLI (#3681) 2019-09-10 13:08:21 -07:00
Bram Kragten e6671299fe Filter html from translations (#3665)
* Filter html from translations

* Error when html found
2019-09-10 20:18:57 +02:00
Bram Kragten 8c5beb0042 Replace paper-fab with ha-fab (#3678)
* Replace paper-fab with ha-fab

...which is based on mwc-fab

* comment
2019-09-10 20:17:11 +02:00
Thomas Lovén eba3c535bf Fix unclickable light in light-card. Fix #3679 (#3680) 2019-09-10 10:22:26 -07:00
Ian Richardson 34d50f0c90 Add image option to glance card entities (#3673)
* Add image option to glance card entities

Closes https://github.com/home-assistant/home-assistant-polymer/issues/3021

* properly order override
2019-09-09 22:14:12 -07:00
Ian Richardson 9eae637814 Only allow admin to edit UI config (#3674)
Closes https://github.com/home-assistant/home-assistant-polymer/issues/3084
2019-09-09 22:13:45 -07:00
Ian Richardson a29d598027 revert stop effect change (#3672)
Appears to be platform specific
2019-09-09 20:39:21 -07:00
Erik Montnemery 5448cbf1c5 Add device actions to automation editor. (#3637)
* Add device actions to automation editor.

* Copy automation on selection

* Fix types

* Remove device from device action schema
2019-09-09 12:01:58 -07:00
Ian Richardson f2999c30f3 Filter null badges (#3645)
* Convert weather-forecast to LitElement

Part of https://github.com/home-assistant/home-assistant-polymer/issues/2095

Not sure how RTL works and how to apply it.

Also, thinking I should update if the forecast changes and not just the state. Input?

* Revert "Convert weather-forecast to LitElement"

This reverts commit e1893b0a83.

* Filter out null badges

Closes https://github.com/home-assistant/home-assistant-polymer/issues/2974

* address review comments

* Update hui-view.ts
2019-09-09 11:31:20 -05:00
Ian Richardson 8a710202f1 Stop effect in more-info-light (#3636)
* Convert weather-forecast to LitElement

Part of https://github.com/home-assistant/home-assistant-polymer/issues/2095

Not sure how RTL works and how to apply it.

Also, thinking I should update if the forecast changes and not just the state. Input?

* Revert "Convert weather-forecast to LitElement"

This reverts commit e1893b0a83.

* Add stop effect button

Closes https://github.com/home-assistant/home-assistant-polymer/issues/3619

* address review comments

* cleanup
2019-09-09 14:10:20 +02:00
Bram Kragten 11f917d5f8 Add vibration (#3588)
* Add vibration

I don't have a device that supports vibrate, and can't find a list of patterns, maybe someone can make some nice patterns?

* listen event

* Mixin

* move logic to mixin
2019-09-09 14:08:52 +02:00
Bram Kragten 2d8d6119bd Merge pull request #3663 from home-assistant/remove-babel
Remove babel
2019-09-09 09:54:17 +02:00
Paulus Schoutsen 1a5ae99c42 Update ESLint 2019-09-08 23:51:30 -07:00
Paulus Schoutsen c4d888f060 Whitelist tags/attributes instead of allow-all (#3657) 2019-09-08 23:47:28 -07:00
Paulus Schoutsen 594ee7ce9b Update build scripts 2019-09-08 23:39:37 -07:00
Paulus Schoutsen 7f10bcbfd1 Drop Babel 2019-09-08 23:39:22 -07:00
Paulus Schoutsen fe31f532b6 Update ESLint (#3664) 2019-09-08 23:38:58 -07:00
Bram Kragten 7e7158b816 Pick unused entities for lovelace cards (#3614)
* Pick unused entities for lovelace cards

* Type

* Table layout for unused entities

* properties

* remove unused import

* mwc-button

Need to find a way to set the color

* add icons to pick view dialog

* Comments

* Lint

* Restore unused entities for yaml mode

* Remove _elements

* decorators, types, comments

* flexbox + comments

* remove unused import
2019-09-08 13:43:28 -07:00
dependabot[bot] e19c210af2 Bump jquery from 3.3.1 to 3.4.0 (#3652)
Bumps [jquery](https://github.com/jquery/jquery) from 3.3.1 to 3.4.0.
- [Release notes](https://github.com/jquery/jquery/releases)
- [Commits](https://github.com/jquery/jquery/compare/3.3.1...3.4.0)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-08 11:58:11 -07:00
dependabot[bot] a2f23c068b Bump lodash.mergewith from 4.6.1 to 4.6.2 (#3654)
Bumps [lodash.mergewith](https://github.com/lodash/lodash) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-08 11:55:12 -07:00
dependabot[bot] 205e12150f Bump lodash.template from 4.4.0 to 4.5.0 (#3653)
Bumps [lodash.template](https://github.com/lodash/lodash) from 4.4.0 to 4.5.0.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.4.0...4.5.0)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-08 11:55:03 -07:00
dependabot[bot] b7ea66c30f Bump eslint-utils from 1.3.1 to 1.4.2 (#3651)
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.2.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.3.1...v1.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-08 11:54:37 -07:00
Paulus Schoutsen 11ac8e4b08 Convert preact to tsx (#3643) 2019-09-08 11:54:17 -07:00
Bram Kragten d5f0ae8ae2 Merge pull request #3655 from home-assistant/dev
20190908.0
2019-09-08 20:53:20 +02:00
Bram Kragten 4c37c76a8f Merge branch 'dev' 2019-09-08 20:48:25 +02:00
Thomas Lovén cdfc3f8faf Use new round sliders for light card (#3634)
* Use new round sliders for light card

* Remove _roundSliderstyle
2019-09-08 11:47:36 -07:00
dependabot[bot] 44ca37c1dc Bump mixin-deep from 1.3.1 to 1.3.2 (#3650)
Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/jonschlinkert/mixin-deep/releases)
- [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-08 11:44:34 -07:00
dependabot[bot] 535308bf96 Bump js-yaml from 3.13.0 to 3.13.1 (#3649)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.13.0 to 3.13.1.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.13.0...3.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-08 11:44:27 -07:00
Bram Kragten 6328f15032 Bumped version to 20190908.0 2019-09-08 20:16:10 +02:00
Erik Montnemery 2f96a096f7 Device automations: Rename name to entity_name, introduce subtype (#3644) 2019-09-08 20:12:56 +02:00
Ian Richardson cbd01f2d68 Create more-for timer with action buttons (#3621)
* Create more-for timer with action buttons

Closes https://github.com/home-assistant/home-assistant-polymer/issues/3594

* center actions

* Address review comments

* address review comments
2019-09-06 22:13:05 -05:00
Paulus Schoutsen 2ff4d0fa4b Do not allow SVG by default (#3640) 2019-09-06 17:36:28 -07:00
Shahen Hovhannisyan 3aba2e3408 feat(translations): Added Armenian language (#3616)
* feat(translations): Added Armenian language

* fix(translations): Corrected nativeName

* fix(armenian/hy): Corrected language code

* chore(translationsMetadata): Sorted by alphabetic order
2019-09-06 14:11:27 -07:00
Mauricio Bonani b473c9c2aa Upgrade MDI icons to 4.3.95 (#3639)
* Upgrade MDI icons to 4.3.95

* Upgrade MDI icons to 4.3.95
2019-09-06 14:37:51 -05:00
Bram Kragten b97e24283c Clarify title of the dialog (#3629)
* Clarify title of the dialog

* translate
2019-09-06 16:36:58 +02:00
Ian Richardson c8d3293ae9 Throttle updates for entity-filter (#3551)
* Throttle updates for entity-filter

* throttle element config sets

* apply changes

* apply review changes
2019-09-06 11:48:39 +02:00
Ian Richardson 8e0c39e451 Convert weather-forecast to LitElement (#3623)
* Convert weather-forecast to LitElement

Part of https://github.com/home-assistant/home-assistant-polymer/issues/2095

Not sure how RTL works and how to apply it.

Also, thinking I should update if the forecast changes and not just the state. Input?

* Revert "Convert weather-forecast to LitElement"

This reverts commit e1893b0a83.

* Convert weather-forecast to LitElement

Part of https://github.com/home-assistant/home-assistant-polymer/issues/2095

Not sure how RTL works and how to apply it.

Also, thinking I should update if the forecast changes and not just the state. Input?

* address review comments and add types

* address review comments
2019-09-05 20:26:35 -07:00
Ian Richardson 46968bb565 Timestamp unavailable (#3635)
* Convert weather-forecast to LitElement

Part of https://github.com/home-assistant/home-assistant-polymer/issues/2095

Not sure how RTL works and how to apply it.

Also, thinking I should update if the forecast changes and not just the state. Input?

* Revert "Convert weather-forecast to LitElement"

This reverts commit e1893b0a83.

* Don't try to show unavailable timestamp

Closes https://github.com/home-assistant/home-assistant-polymer/issues/2956
2019-09-05 16:01:24 -07:00
Erik Montnemery 011219b727 Add device conditions to automation editor. (#3595)
* Add device conditions to automation editor.

* Fix inheritance shizzle

* Make device automation lists simple lists, not dicts

* Really make device automation lists simple lists

* Add few types

* Fix types
2019-09-05 15:43:14 -07:00
Bram Kragten 9205837b67 Create hui-views-list component (#3631)
And use for move card view
2019-09-05 11:17:19 -07:00
Bram Kragten 4eed3508ce Update cloud-google-pref.ts (#3628) 2019-09-05 09:47:39 -07:00
Bram Kragten 460a56aa0a Fill example data for services in dev tools (#3596)
* Fill example data

* Align indents

* Comments
2019-09-05 06:57:17 -07:00
Bram Kragten 3927eb53ac Fix translations (#3626) 2019-09-05 06:53:27 -07:00
Ian Richardson 2a596666c8 Move light brightness below icon (#3607)
* Move light brightness below icon

Closes https://github.com/home-assistant/home-assistant-polymer/issues/3606

* remove border and white text coloring
2019-09-04 12:57:06 -07:00
Bram Kragten 0008a100f4 Fill state details when entity selected (#3615) 2019-09-04 10:05:49 -07:00
David F. Mulcahey 164e433592 ZHA device info dialog (#3529)
* zha device info dialog

* cleanup

* quick hack to make this work

* remove hack

* add mixin for zha device info dialog

* fix potential exception

* cleanup

* review comments

* lint

* remove unused import

* lint

* review coments

* review comments

* translations and css
2019-09-04 09:40:47 -07:00
Bram Kragten abb9190c98 20190904.0 (#3613)
* Alarm codes (#3566)

* Handle alarm codes from keyboard input

Closes https://github.com/home-assistant/home-assistant-polymer/issues/2602

* remove friendly_name changes

* remove unnecessary TS check

* Update azure-pipelines-release.yml for Azure Pipelines

* Don't remove `hvac_action` from history attributes (#3570)

So it can be used to plot a fill when active in the graph.

* Update the map when making config changes (#3568)

* Add haptic feedback to handle click (#3569)

* Filter camera service entities (#3583)

Closes https://github.com/home-assistant/home-assistant-polymer/issues/3582

* Notification drawer RTL support (#3580)

* add exceptional icon (#3572)

* Add options to badges (#3552)

* Add options to badges

name
icon
entity_picture

* lint

* lint

* rename entityPicture to image

* Align styling cast buttons (#3579)

* Align styling cast buttons

* Split dev constants

* Ignore dev_const

* Update README.md

* Move lovelace background settings to theme (#3561)

* Move lovelace background settings to theme

While being backwards compatible

* Also update cast

* Don't allow overwrite of english lang (#3590)

* Update hui-card-options.ts (#3591)

* Fix display of no triggers text if no device is selected or device has no triggers (#3592)

* Fix timing issue in external auth (#3587)

* Fix timing issue in external auth

* add await 0

* Show toast on successfull save (#3576)

* Show toast on successfull save

We need to make a list of places where this could benefit the user experience.

* Helper method

* Rename

* handle unavailable lights (#3549)

* handle unavailable lights

* unavailable overlay

* extract unavailable overlay

* Option to display last changed in glance-card (#3584)

* Option to display last changed in glance-card

Closes https://github.com/home-assistant/ui-schema/issues/110

* move show_last_changed to entity-level

* address review comments

* Filter alerts in services (#3598)

Closes https://github.com/home-assistant/home-assistant-polymer/issues/3597

* Add exceptional in weather to translations (#3599)

* Add MQTT subscribe to dev tools (#3589)

* Add mqtt subscribe to dev tools

* Update mqtt-subscribe-card.ts

* Comments

* type

* Wrap long attributes in more-info-default (#3601)

Can likely be applied in many other places

Closes https://github.com/home-assistant/home-assistant-polymer/issues/2811

* Bumped version to 20190904.0 (#3612)
2019-09-04 14:21:03 +02:00
Bram Kragten c4fca84ded Bumped version to 20190904.0 (#3612) 2019-09-04 13:51:52 +02:00
Ian Richardson 48a010563e Wrap long attributes in more-info-default (#3601)
Can likely be applied in many other places

Closes https://github.com/home-assistant/home-assistant-polymer/issues/2811
2019-09-04 09:37:21 +02:00
Bram Kragten 4378904243 Add MQTT subscribe to dev tools (#3589)
* Add mqtt subscribe to dev tools

* Update mqtt-subscribe-card.ts

* Comments

* type
2019-09-03 15:57:54 -07:00
MatthewFlamm ba66bf88d3 Add exceptional in weather to translations (#3599) 2019-09-03 22:51:46 +02:00
Ian Richardson 5282a6504a Filter alerts in services (#3598)
Closes https://github.com/home-assistant/home-assistant-polymer/issues/3597
2019-09-03 22:23:10 +02:00
Ian Richardson 4f3abe1025 Option to display last changed in glance-card (#3584)
* Option to display last changed in glance-card

Closes https://github.com/home-assistant/ui-schema/issues/110

* move show_last_changed to entity-level

* address review comments
2019-09-03 22:12:21 +02:00
Ian Richardson 5bcba95c25 handle unavailable lights (#3549)
* handle unavailable lights

* unavailable overlay

* extract unavailable overlay
2019-09-03 14:35:37 -05:00
Bram Kragten a9c9d4ca51 Show toast on successfull save (#3576)
* Show toast on successfull save

We need to make a list of places where this could benefit the user experience.

* Helper method

* Rename
2019-09-03 20:33:10 +02:00
Bram Kragten f00ad84c16 Fix timing issue in external auth (#3587)
* Fix timing issue in external auth

* add await 0
2019-09-03 20:32:43 +02:00
Erik Montnemery 3b2e02562c Fix display of no triggers text if no device is selected or device has no triggers (#3592) 2019-09-03 10:55:42 -07:00
Bram Kragten 7bc947ffb0 Update hui-card-options.ts (#3591) 2019-09-03 10:26:26 -07:00
Bram Kragten 15564a1b26 Don't allow overwrite of english lang (#3590) 2019-09-03 10:26:04 -07:00
Bram Kragten 753e069323 Move lovelace background settings to theme (#3561)
* Move lovelace background settings to theme

While being backwards compatible

* Also update cast
2019-09-03 13:13:29 +02:00
Bram Kragten b37a0e2d43 Align styling cast buttons (#3579)
* Align styling cast buttons

* Split dev constants

* Ignore dev_const

* Update README.md
2019-09-03 12:56:11 +02:00
Ian Richardson 87b35010e0 Add options to badges (#3552)
* Add options to badges

name
icon
entity_picture

* lint

* lint

* rename entityPicture to image
2019-09-03 11:33:07 +02:00
MatthewFlamm 4e383e3e67 add exceptional icon (#3572) 2019-09-03 11:31:54 +02:00
Yosi Levy 0e82178973 Notification drawer RTL support (#3580) 2019-09-03 11:31:08 +02:00
Ian Richardson fe2046c6cd Filter camera service entities (#3583)
Closes https://github.com/home-assistant/home-assistant-polymer/issues/3582
2019-09-03 10:02:34 +02:00
Bram Kragten af0304bf78 Add haptic feedback to handle click (#3569) 2019-09-02 21:18:47 -07:00
Bram Kragten fcd206e94b Update the map when making config changes (#3568) 2019-09-02 21:17:03 -07:00
Bram Kragten cf7a300614 Don't remove hvac_action from history attributes (#3570)
So it can be used to plot a fill when active in the graph.
2019-09-02 09:10:48 -07:00
Pascal Vizeli a97ce49f0b Update azure-pipelines-release.yml for Azure Pipelines 2019-09-02 14:36:26 +02:00
Ian Richardson 5bfdc98217 Alarm codes (#3566)
* Handle alarm codes from keyboard input

Closes https://github.com/home-assistant/home-assistant-polymer/issues/2602

* remove friendly_name changes

* remove unnecessary TS check
2019-09-01 22:23:37 -07:00
Paulus Schoutsen b022128031 Merge pull request #3567 from home-assistant/dev
20190901.0
2019-09-01 22:18:43 -07:00
Bram Kragten 1bc2e6fc17 Use tslib and importHelpers (#3559) 2019-09-01 22:00:32 -07:00
Ian Richardson 6b5c9efb39 Break long strings in notifications (#3557) 2019-09-01 22:00:14 -07:00
Ian Richardson be0c035ba1 Don't open more-info from integrations dashboard (#3556) 2019-09-01 21:59:57 -07:00
Bram Kragten 12173388a0 Split Logs from info tab in dev tools (#3560)
* Split Logs from info tab in dev tools

* lint

* Remove border above logs
2019-09-01 21:53:12 -07:00
Ian Richardson ba0d7cb156 Present confirmation for server restarts/stops (#3564)
Closes https://github.com/home-assistant/home-assistant-polymer/issues/3233
2019-09-01 21:51:35 -07:00
Ian Richardson c3e29e359a Show alarm's friendly_name if set (#3565)
Closes https://github.com/home-assistant/home-assistant-polymer/issues/3459
2019-09-01 21:51:01 -07:00
Paulus Schoutsen 6259e45128 Bumped version to 20190901.0 2019-09-01 21:48:41 -07:00
Paulus Schoutsen 6998cce8eb Update translations 2019-09-01 21:48:37 -07:00
Erik Montnemery f43abb5a9d Support device triggers in automation editor (#3514)
* Support device trigger in automation editor

* Fix review comments, improve usability.

* Lint

* Lint

* Improve styling, address review comments

* Fix support for unknown stored automation

* Fix

* Lint

* Lint

* Index trigger by key, not by object

* Fix no trigger case

* Fix typing

* Move trigger translations to backend

* Rename WS command to device_automation/trigger/list

* Tweak

* Update src/data/device_automation.ts

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

* Address review comments

* Fix..

* Simplify ha-device-trigger-picker

* Fix changing device
2019-09-01 21:45:47 -07:00
Ian Richardson a7fdbc069b Update fan direction (#3547)
* Handle current_direction in more-info-fan

* remove current_direction changes

* add forward/reverse to translations
2019-08-30 17:29:17 -07:00
Paulus Schoutsen b154903691 Merge pull request #3537 from home-assistant/dev
20190828.0
2019-08-28 13:43:20 -07:00
Mauricio Bonani 15a88385c2 Upgrade MDI icons to 4.2.95 (#3533)
* Upgrade MDI icons to 4.2.95

* Upgrade MDI icons to 4.2.95
2019-08-28 13:42:18 -07:00
Paulus Schoutsen 6ddf364093 Bumped version to 20190828.0 2019-08-28 13:41:37 -07:00
Paulus Schoutsen fccb97ede8 Update translations 2019-08-28 13:41:34 -07:00
Sean Mooney cfc6bf4da9 Remove duplicate word from onboarding error (#3535)
Someone shared an error message in Discord and I noticed it mentioned the word "loading" twice in a row. This removes the duplicate word from the alert.
2019-08-28 13:37:58 -07:00
Thomas Lovén 02e250cd04 Fix for double taps in iOS 13 beta (#3523)
See home-assistant/home-assistant-polymer#3510 for more info.
2019-08-28 13:37:30 -07:00
Paulus Schoutsen d29eacb268 Merge pull request #3530 from home-assistant/dev
20190825.0
2019-08-25 22:24:24 -07:00
Paulus Schoutsen 62ae7df097 Bumped version to 20190825.0 2019-08-25 22:20:44 -07:00
Paulus Schoutsen 0d43bef600 Update translations 2019-08-25 22:20:35 -07:00
Paulus Schoutsen 3709c13975 Increase touch target of menu button with notifications (#3527) 2019-08-25 22:08:49 -07:00
Paulus Schoutsen b624b363bd Fix LL menu (#3528) 2019-08-25 21:51:47 -07:00
Paulus Schoutsen d841cc92ef Slightly simplify markdown API 2019-08-24 12:55:40 -07:00
Paulus Schoutsen cdcafe9e6f Run markdown in web worker (#3524)
* Run markdown in web worker

* Set global object
2019-08-24 12:48:57 -07:00
Paulus Schoutsen a66960fa00 Add context to comment 2019-08-24 12:42:38 -07:00
Paulus Schoutsen 38cc7b1090 Fix advanced mode not representing state correctly (#3519) 2019-08-24 09:55:49 -07:00
Paulus Schoutsen ac443c2fa0 Merge pull request #3515 from home-assistant/dev
20190822.0
2019-08-22 15:05:43 -07:00
Paulus Schoutsen ee0388708f Bumped version to 20190822.0 2019-08-22 15:04:09 -07:00
Paulus Schoutsen 0717a3dadd Update translations 2019-08-22 15:04:06 -07:00
Paulus Schoutsen 6b0b66af99 Fix text areas not working in Preact (#3513) 2019-08-22 12:24:42 -07:00
Paulus Schoutsen 7e5f28b3cc Fix required fields with default values (#3512) 2019-08-22 12:21:21 -07:00
Paulus Schoutsen c9307ab76a Merge pull request #3507 from home-assistant/dev
20190821.0
2019-08-21 14:14:38 -07:00
Paulus Schoutsen ecfbfbf56b Bumped version to 20190821.0 2019-08-21 14:13:32 -07:00
Paulus Schoutsen 9b321124bb Update translations 2019-08-21 14:13:27 -07:00
Paulus Schoutsen 512b76f450 Update MDI 2019-08-21 14:12:43 -07:00
Thomas Lovén 5de8c713c8 Lovelace markdown card - fix race condition, add variables to template (#3505)
* Fix connection race, add variables

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

* Lint
2019-08-21 14:03:40 -07:00
Paulus Schoutsen 7482059373 Merge pull request #3504 from home-assistant/dev
20190820.1
2019-08-20 16:19:52 -07:00
Paulus Schoutsen f64062d17b Bumped version to 20190820.1 2019-08-20 16:19:16 -07:00
Paulus Schoutsen afd6fddad7 Update translations 2019-08-20 16:19:03 -07:00
Paulus Schoutsen e8ad975212 Fix onboarding (#3503)
* Fix onboarding

* Lint
2019-08-20 16:18:26 -07:00
Paulus Schoutsen 831b23347e Merge pull request #3502 from home-assistant/dev
20190820.0
2019-08-20 00:14:18 -07:00
Paulus Schoutsen 5edee41c5b Add system options UI (#3501)
* Add system options UI

* Tweak translation
2019-08-20 00:09:33 -07:00
Paulus Schoutsen c04a091f59 Bumped version to 20190820.0 2019-08-20 00:07:25 -07:00
Paulus Schoutsen 3bbd45079c Update translations 2019-08-20 00:07:21 -07:00
Paulus Schoutsen 01da25d2d6 Allow disabling entity in entity registry (#3496)
* Allow disabling entitiy in entity registry

* Make strings translatable

* Update dialog-entity-registry-detail.ts

* Change to enabled
2019-08-19 23:59:32 -07:00
Paulus Schoutsen 355e3d7911 Migrate integrations page to TypeScript (#3500) 2019-08-19 15:12:57 -07:00
Thomas Lovén 6c109c15ef Add buttons to move entities (#3499) 2019-08-19 14:17:49 -07:00
Thomas Lovén c542b242fe Fix gui-editor resizing problem (#3498) 2019-08-19 13:19:56 -07:00
Yosi Levy bcb26bd960 Force ltr again in info panel (#3494) 2019-08-15 21:27:36 -07:00
Paulus Schoutsen 3a3c705343 Merge pull request #3492 from home-assistant/dev
20190815.0
2019-08-15 14:03:35 -07:00
Paulus Schoutsen 46f3a38b7c Bumped version to 20190815.0 2019-08-15 13:36:03 -07:00
Paulus Schoutsen 864175bde9 Update translations 2019-08-15 13:36:00 -07:00
Paulus Schoutsen f458bdffe0 Add support for options flows (#3491) 2019-08-15 13:34:26 -07:00
Paulus Schoutsen 200e099035 Refactor config flow dialog to make it reusable (#3488)
* Refactor config flow dialog to make it reusable

* More refactor

* forgot to save

* Render labels correcetly
2019-08-15 09:03:54 -07:00
Mauricio Bonani 07b8518162 Upgrade MDI icons to 4.0.96 (#3490)
* Upgrade MDI icons to 4.0.96

* Upgrade MDI icons to 4.0.96
2019-08-15 08:45:35 -07:00
Paulus Schoutsen b3525abf21 Upgrade lit-html (#3485) 2019-08-15 08:45:17 -07:00
Paulus Schoutsen f7bb85d332 Do not use toggleAttribute (#3484) 2019-08-12 12:52:59 -07:00
Paulus Schoutsen b8a18a27a4 Update release script 2019-08-12 12:48:34 -07:00
Yosi Levy 88bea10b26 Fix ha-sidebar for RTL (#3469)
* Fix menu alignments, icon, profile alignment in collapsed and expanded mode

* Refactor

* Lint exclude

* Refactor + lint ignore

* Fixed RTL calc location

* Refactored ifs
2019-08-12 10:44:51 -07:00
Yosi Levy 807dff99af RTL arrow problems (#3467)
* Updated style check since load sequence must have changed

* Refactored to timeout

* Added comment
2019-08-12 10:31:23 -07:00
Seb Ruiz 9fa8544972 Add relevant device_class icons for Cover entity (#3482)
* Add relevant cover icons for supported device classes

* Remove icon which doesn't have closed/open state

* Remove umbrella icon for awnings
2019-08-12 09:11:59 -07:00
Paulus Schoutsen 806e70b6c9 Merge pull request #3480 from home-assistant/dev
20190811.0
2019-08-11 21:17:04 -07:00
Paulus Schoutsen 204bd803bf Add reload scene button (#3476) 2019-08-11 20:52:58 -07:00
Paulus Schoutsen 52712f65c2 Bumped version to 20190811.0 2019-08-11 20:52:24 -07:00
Paulus Schoutsen 8c3f8656fe Update translations 2019-08-11 20:52:19 -07:00
Thomas Lovén 1f3a5b1396 Template markdown card (#3451)
* Render templates in markdown card

* Add manual entity_id option

* Linting

* Address review comments

* Address review comments

* Address review comments

* Address review comments

* Tweak disconnect function

* Remove cardSize instance variable

* Fix demo
2019-08-10 12:55:32 -07:00
Thomas Lovén c15629b81b Various changes to card editor. (#3265)
* Various changes to card editor.

* Avoid crashing on bad yaml when creating a new card

* Address review comments

* Revert interface change

* Avoid config loops. Nicer error behavior.
2019-08-10 12:14:35 -07:00
Paulus Schoutsen ef3892de92 Re-apply theme if backend theme changes (#3471) 2019-08-10 11:38:39 -07:00
Paulus Schoutsen 47d6bb69b0 Fix setting view background (#3470) 2019-08-09 16:26:33 -07:00
Paulus Schoutsen f10fab7e22 Fix hass.io icon order (#3462) 2019-08-09 15:53:46 -07:00
Bram Kragten e2dfac48d0 Cast View 0 + show active (#3466)
* View 0 + show active

* Fix view 0 receiver

* Type

select doesn't seem to be used?
2019-08-09 15:34:09 -07:00
Paulus Schoutsen 53f5a29151 Remove stale comment 2019-08-09 15:24:28 -07:00
Paulus Schoutsen a042cd2d48 Fix icon build 2019-08-09 13:15:58 -07:00
Paulus Schoutsen 8533f9372f Upgrade MDI icons to 3.9.97 2019-08-09 11:40:23 -07:00
Paulus Schoutsen a4e96a4f3f Update translations 2019-08-09 10:59:13 -07:00
Pascal Vizeli fa40135a27 Build wheels from release & Templates 2019-08-08 11:22:48 +02:00
Paulus Schoutsen d85f9f9021 Convert profile page to Lit/TS (#3449)
* Convert profile page to Lit/TS

* Lint
2019-08-07 14:35:31 -07:00
Thomas Lovén dc2ee2e63f Enable ha-icons in markdown card (#3458)
* Allow ha-icon in markdown

* Please the linter

* Remove allowSvg

* Remove lasts allow-svgs
2019-08-07 14:35:17 -07:00
Paulus Schoutsen f3729759b7 Update FAQ 2019-08-06 16:47:27 -07:00
Frederik Gladhorn f108e279cd Add script/setup (#3437)
script/setup did not exist, despite being mentioned in the readme.
Create it and let it call bootstrap.
2019-08-06 15:36:35 -07:00
Paulus Schoutsen 8dce24ddfc Tweak upload script 2019-08-06 09:56:07 -07:00
Paulus Schoutsen d2e780dda2 Better track pageview 2019-08-06 09:36:22 -07:00
Paulus Schoutsen c382768008 Update GA to always track / 2019-08-06 09:34:45 -07:00
Paulus Schoutsen f369045f35 Set correct GA code 2019-08-06 08:49:57 -07:00
Paulus Schoutsen 17921c18b6 Add GA to receiver 2019-08-06 08:44:47 -07:00
Paulus Schoutsen 42c6cecf89 Merge pull request #3461 from home-assistant/dev
20190805.0
2019-08-05 22:31:25 -07:00
Paulus Schoutsen 4799fdee9c Bumped version to 20190805.0 2019-08-05 22:22:35 -07:00
Paulus Schoutsen 2049687590 Update translations 2019-08-05 22:22:31 -07:00
Paulus Schoutsen aca5ae9f67 Fix Cast demo (#3460) 2019-08-05 22:21:54 -07:00
740 changed files with 110005 additions and 61909 deletions
+1
View File
@@ -1,6 +1,7 @@
{
"extends": ["airbnb-base", "prettier"],
"parserOptions": {
"ecmaVersion": "2020",
"ecmaFeatures": {
"jsx": true,
"modules": true
+1 -4
View File
@@ -1,12 +1,9 @@
{
"extends": "./.eslintrc-hound.json",
"plugins": [
"react"
],
"plugins": ["react"],
"env": {
"browser": true
},
"parser": "babel-eslint",
"rules": {
"import/no-unresolved": 2,
"linebreak-style": 0,
@@ -1,11 +1,24 @@
---
name: Bug report
about: Create a report to help us improve
title: ""
labels: bug
assignees: ""
---
<!-- 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
- This is for bugs only. Feature and enhancement requests should go in our community forum: https://community.home-assistant.io/c/feature-requests
- Provide as many details as possible. Do not delete any text from this template!
-->
**Checklist:**
- [ ] I updated to the latest version available
- [ ] I cleared the cache of my browser
**Home Assistant release with the issue:**
<!--
- Frontend -> Developer tools -> Info
- Or use this command: hass --version
@@ -14,22 +27,50 @@
**Last working Home Assistant release (if known):**
**UI (States or Lovelace UI?):**
<!--
- Frontend -> Developer tools -> Info
-->
**Browser and Operating System:**
<!--
Provide details about what browser (and version) you are seeing the issue in. And also which operating system this is on. If possible try to replicate the issue in other browsers and include your findings here.
-->
**Description of problem:**
<!--
Explain what the issue is, and how things should look/behave. If possible provide a screenshot with a description.
Explain what the issue is, and what is the current behaviour. If possible provide a screenshot with a description.
-->
**Expected behaviour:**
<!--
Explain how things should look/behave. If possible provide a screenshot with a description.
-->
**Relevant config:**
<!--
Give the config of both the integration that is used, the Lovelace config, scene, automation or otherwise relevant configuration.
-->
**Steps to reproduce this problem:**
<!--
Sum up all steps that are necessary to reproduce this bug.
For example:
1. Add a climate integration
2. Navigate to Lovelace
3. Click more info of the climate entity
4. Set the hvac action to heat
5. Set the temperature higher than the current temperature
6. Set the hvac action to cool
-->
**Javascript errors shown in the web inspector (if applicable):**
```
```
+19
View File
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: ""
labels: feature request
assignees: ""
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+27
View File
@@ -0,0 +1,27 @@
# Configuration for Lock Threads - https://github.com/dessant/lock-threads
# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 1
# Skip issues and pull requests created before a given timestamp. Timestamp must
# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
skipCreatedBefore: 2020-01-01
# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
exemptLabels: []
# Label to add before locking, such as `outdated`. Set to `false` to disable
lockLabel: false
# Comment to post before locking. Set to `false` to disable
lockComment: false
# Assign `resolved` as the reason for locking. Set to `false` to disable
setLockReason: false
# Limit to only `issues` or `pulls`
only: pulls
# Optionally, specify configuration settings just for `issues` or `pulls`
issues:
daysUntilLock: 30
+3
View File
@@ -25,6 +25,9 @@ dist
.vscode/*
!.vscode/extensions.json
# Cast dev settings
src/cast/dev_const.ts
# Secrets
.lokalise_token
yarn-error.log
+2 -10
View File
@@ -8,19 +8,11 @@ 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'
services:
- docker
before_deploy:
- 'docker pull lokalise/lokalise-cli@sha256:2198814ebddfda56ee041a4b427521757dd57f75415ea9693696a64c550cef21'
deploy:
provider: script
script: script/travis_deploy
'on':
branch: master
dist: trusty
addons:
sauce_connect: true
+4 -2
View File
@@ -2,9 +2,9 @@
This is the repository for the official [Home Assistant](https://home-assistant.io) frontend.
[![Screenshot of the frontend](https://raw.githubusercontent.com/home-assistant/home-assistant-polymer/master/docs/screenshot.png)](https://home-assistant.io/demo/)
[![Screenshot of the frontend](https://raw.githubusercontent.com/home-assistant/home-assistant-polymer/master/docs/screenshot.png)](https://demo.home-assistant.io/)
- [View demo of the Polymer frontend](https://home-assistant.io/demo/)
- [View demo of Home Assistant](https://demo.home-assistant.io/)
- [More information about Home Assistant](https://home-assistant.io)
- [Frontend development instructions](https://developers.home-assistant.io/docs/en/frontend_index.html)
@@ -31,3 +31,5 @@ It is possible to compile the project and/or run commands in the development env
## License
Home Assistant is open-source and Apache 2 licensed. Feel free to browse the repository, learn and reuse parts in your own projects.
We use [BrowserStack](https://www.browserstack.com) to test Home Assistant on a large variation of devices.
+29 -22
View File
@@ -7,31 +7,23 @@ trigger:
- "*"
pr: none
variables:
- name: versionBuilder
value: "5.2"
- group: github
- name: versionWheels
value: '1.3-3.7-alpine3.10'
- name: versionNode
value: '12.1'
- group: twine
resources:
repositories:
- repository: azure
type: github
name: 'home-assistant/ci-azure'
endpoint: 'home-assistant'
stages:
- stage: "Validate"
jobs:
- job: "VersionValidate"
pool:
vmImage: "ubuntu-latest"
steps:
- task: UsePythonVersion@0
displayName: "Use Python 3.7"
inputs:
versionSpec: "3.7"
- script: |
setup_version="$(python setup.py -V)"
branch_version="$(Build.SourceBranchName)"
if [ "${setup_version}" != "${branch_version}" ]; then
echo "Version of tag ${branch_version} don't match with ${setup_version}!"
exit 1
fi
displayName: "Check version of branch/tag"
- template: templates/azp-job-version.yaml@azure
- stage: "Build"
jobs:
@@ -44,9 +36,9 @@ stages:
inputs:
versionSpec: "3.7"
- task: NodeTool@0
displayName: "Use Node 12.1"
displayName: "Use Node $(versionNode)"
inputs:
versionSpec: "12.1"
versionSpec: "$(versionNode)"
- script: pip install twine wheel
displayName: "Install tools"
- script: |
@@ -55,3 +47,18 @@ stages:
script/release
displayName: "Build and release package"
- template: templates/azp-job-wheels.yaml@azure
parameters:
builderVersion: '$(versionWheels)'
builderApk: 'build-base'
wheelsLocal: true
preBuild:
- task: NodeTool@0
displayName: "Use Node $(versionNode)"
inputs:
versionSpec: "$(versionNode)"
- script: |
set -e
yarn install
script/build_frontend
+70
View File
@@ -0,0 +1,70 @@
# https://dev.azure.com/home-assistant
trigger:
batch: true
branches:
include:
- dev
paths:
include:
- translations/en.json
pr: none
schedules:
- cron: "30 0 * * *"
displayName: "translation update"
branches:
include:
- dev
always: true
variables:
- group: translation
resources:
repositories:
- repository: azure
type: github
name: 'home-assistant/ci-azure'
endpoint: 'home-assistant'
jobs:
- job: 'Upload'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
displayName: 'Use Node 12.x'
inputs:
versionSpec: '12.x'
- script: |
export LOKALISE_TOKEN="$(lokaliseToken)"
export AZURE_BRANCH="$(Build.SourceBranchName)"
./script/translations_upload_base
displayName: 'Upload Translation'
- job: 'Download'
dependsOn:
- 'Upload'
condition: or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Build.Reason'], 'Manual'))
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
displayName: 'Use Node 12.x'
inputs:
versionSpec: '12.x'
- template: templates/azp-step-git-init.yaml@azure
- script: |
export LOKALISE_TOKEN="$(lokaliseToken)"
export AZURE_BRANCH="$(Build.SourceBranchName)"
npm install
./script/translations_download
displayName: 'Download Translation'
- script: |
git checkout dev
git add translation
git commit -am "[ci skip] Translation update"
git push
displayName: 'Update translation'
+1
View File
@@ -33,6 +33,7 @@ module.exports.babelLoaderConfig = ({ latestBuild }) => {
pragma: "h",
},
],
"@babel/plugin-proposal-optional-chaining",
[
require("@babel/plugin-proposal-decorators").default,
{ decoratorsBeforeExport: true },
+6
View File
@@ -0,0 +1,6 @@
module.exports = {
isProdBuild: process.env.NODE_ENV === "production",
isStatsBuild: process.env.STATS === "1",
isTravis: process.env.TRAVIS === "true",
isNetlify: process.env.NETLIFY === "true",
};
+8 -7
View File
@@ -1,10 +1,13 @@
// Run HA develop mode
const gulp = require("gulp");
const envVars = require("../env");
require("./clean.js");
require("./translations.js");
require("./gen-icons.js");
require("./gather-static.js");
require("./compress.js");
require("./webpack.js");
require("./service-worker.js");
require("./entry-html.js");
@@ -18,7 +21,7 @@ gulp.task(
"clean",
gulp.parallel(
"gen-service-worker-dev",
"gen-icons",
gulp.parallel("gen-icons-app", "gen-icons-mdi"),
"gen-pages-dev",
"gen-index-app-dev",
gulp.series("create-test-translation", "build-translations")
@@ -35,13 +38,11 @@ gulp.task(
process.env.NODE_ENV = "production";
},
"clean",
gulp.parallel("gen-icons", "build-translations"),
gulp.parallel("gen-icons-app", "gen-icons-mdi", "build-translations"),
"copy-static",
gulp.parallel(
"webpack-prod-app",
// Do not compress static files in CI, it's SLOW.
...(process.env.CI === "true" ? [] : ["compress-static"])
),
"webpack-prod-app",
...// Don't compress running tests
(envVars.isTravis ? [] : ["compress-app"]),
gulp.parallel(
"gen-pages-prod",
"gen-index-app-prod",
+7 -3
View File
@@ -1,4 +1,3 @@
// Run cast develop mode
const gulp = require("gulp");
require("./clean.js");
@@ -16,7 +15,12 @@ gulp.task(
process.env.NODE_ENV = "development";
},
"clean-cast",
gulp.parallel("gen-icons", "gen-index-cast-dev", "build-translations"),
gulp.parallel(
"gen-icons-app",
"gen-icons-mdi",
"gen-index-cast-dev",
"build-translations"
),
"copy-static-cast",
"webpack-dev-server-cast"
)
@@ -29,7 +33,7 @@ gulp.task(
process.env.NODE_ENV = "production";
},
"clean-cast",
gulp.parallel("gen-icons", "build-translations"),
gulp.parallel("gen-icons-app", "gen-icons-mdi", "build-translations"),
"copy-static-cast",
"webpack-prod-cast",
"gen-index-cast-prod"
+16
View File
@@ -9,15 +9,31 @@ gulp.task(
return del([config.root, config.build_dir]);
})
);
gulp.task(
"clean-demo",
gulp.parallel("clean-translations", function cleanOutputAndBuildDir() {
return del([config.demo_root, config.build_dir]);
})
);
gulp.task(
"clean-cast",
gulp.parallel("clean-translations", function cleanOutputAndBuildDir() {
return del([config.cast_root, config.build_dir]);
})
);
gulp.task(
"clean-hassio",
gulp.parallel("clean-translations", function cleanOutputAndBuildDir() {
return del([config.hassio_root, config.build_dir]);
})
);
gulp.task(
"clean-gallery",
gulp.parallel("clean-translations", function cleanOutputAndBuildDir() {
return del([config.gallery_root, config.build_dir]);
})
);
+38
View File
@@ -0,0 +1,38 @@
// Tasks to compress
const gulp = require("gulp");
const zopfli = require("gulp-zopfli-green");
const merge = require("merge-stream");
const path = require("path");
const paths = require("../paths");
gulp.task("compress-app", function compressApp() {
const jsLatest = gulp
.src(path.resolve(paths.output, "**/*.js"))
.pipe(zopfli())
.pipe(gulp.dest(paths.output));
const jsEs5 = gulp
.src(path.resolve(paths.output_es5, "**/*.js"))
.pipe(zopfli())
.pipe(gulp.dest(paths.output_es5));
const polyfills = gulp
.src(path.resolve(paths.static, "polyfills/*.js"))
.pipe(zopfli())
.pipe(gulp.dest(path.resolve(paths.static, "polyfills")));
const translations = gulp
.src(path.resolve(paths.static, "translations/*.json"))
.pipe(zopfli())
.pipe(gulp.dest(path.resolve(paths.static, "translations")));
return merge(jsLatest, jsEs5, polyfills, translations);
});
gulp.task("compress-hassio", function compressApp() {
return gulp
.src(path.resolve(paths.hassio_root, "**/*.js"))
.pipe(zopfli())
.pipe(gulp.dest(paths.hassio_root));
});
+8 -2
View File
@@ -17,7 +17,8 @@ gulp.task(
},
"clean-demo",
gulp.parallel(
"gen-icons",
"gen-icons-app",
"gen-icons-mdi",
"gen-icons-demo",
"gen-index-demo-dev",
"build-translations"
@@ -34,7 +35,12 @@ gulp.task(
process.env.NODE_ENV = "production";
},
"clean-demo",
gulp.parallel("gen-icons", "gen-icons-demo", "build-translations"),
gulp.parallel(
"gen-icons-app",
"gen-icons-mdi",
"gen-icons-demo",
"build-translations"
),
"copy-static-demo",
"webpack-prod-demo",
"gen-index-demo-prod"
@@ -0,0 +1,73 @@
const del = require("del");
const gulp = require("gulp");
const mapStream = require("map-stream");
const inDir = "translations";
const downloadDir = inDir + "/downloads";
const tasks = [];
function hasHtml(data) {
return /<[a-z][\s\S]*>/i.test(data);
}
function recursiveCheckHasHtml(file, data, errors, recKey) {
Object.keys(data).forEach(function(key) {
if (typeof data[key] === "object") {
const nextRecKey = recKey ? `${recKey}.${key}` : key;
recursiveCheckHasHtml(file, data[key], errors, nextRecKey);
} else if (hasHtml(data[key])) {
errors.push(`HTML found in ${file.path} at key ${recKey}.${key}`);
}
});
}
function checkHtml() {
const errors = [];
return mapStream(function(file, cb) {
const content = file.contents;
let error;
if (content) {
if (hasHtml(String(content))) {
const data = JSON.parse(String(content));
recursiveCheckHasHtml(file, data, errors);
if (errors.length > 0) {
error = errors.join("\r\n");
}
}
}
cb(error, file);
});
}
let taskName = "clean-downloaded-translations";
gulp.task(taskName, function() {
return del([`${downloadDir}/**`]);
});
tasks.push(taskName);
taskName = "check-translations-html";
gulp.task(taskName, function() {
return gulp.src(`${downloadDir}/*.json`).pipe(checkHtml());
});
tasks.push(taskName);
taskName = "move-downloaded-translations";
gulp.task(taskName, function() {
return gulp.src(`${downloadDir}/*.json`).pipe(gulp.dest(inDir));
});
tasks.push(taskName);
taskName = "check-downloaded-translations";
gulp.task(
taskName,
gulp.series(
"check-translations-html",
"move-downloaded-translations",
"clean-downloaded-translations"
)
);
tasks.push(taskName);
module.exports = tasks;
+37 -9
View File
@@ -11,12 +11,6 @@ const config = require("../paths.js");
const templatePath = (tpl) =>
path.resolve(config.polymer_dir, "src/html/", `${tpl}.html.template`);
const demoTemplatePath = (tpl) =>
path.resolve(config.demo_dir, "src/html/", `${tpl}.html.template`);
const castTemplatePath = (tpl) =>
path.resolve(config.cast_dir, "src/html/", `${tpl}.html.template`);
const readFile = (pth) => fs.readFileSync(pth).toString();
const renderTemplate = (pth, data = {}, pathFunc = templatePath) => {
@@ -25,10 +19,19 @@ const renderTemplate = (pth, data = {}, pathFunc = templatePath) => {
};
const renderDemoTemplate = (pth, data = {}) =>
renderTemplate(pth, data, demoTemplatePath);
renderTemplate(pth, data, (tpl) =>
path.resolve(config.demo_dir, "src/html/", `${tpl}.html.template`)
);
const renderCastTemplate = (pth, data = {}) =>
renderTemplate(pth, data, castTemplatePath);
renderTemplate(pth, data, (tpl) =>
path.resolve(config.cast_dir, "src/html/", `${tpl}.html.template`)
);
const renderGalleryTemplate = (pth, data = {}) =>
renderTemplate(pth, data, (tpl) =>
path.resolve(config.gallery_dir, "src/html/", `${tpl}.html.template`)
);
const minifyHtml = (content) =>
minify(content, {
@@ -209,8 +212,33 @@ gulp.task("gen-index-demo-prod", (done) => {
es5Compatibility: es5Manifest["compatibility.js"],
es5DemoJS: es5Manifest["main.js"],
});
const minified = minifyHtml(content).replace(/#THEMEC/g, "{{ theme_color }}");
const minified = minifyHtml(content);
fs.outputFileSync(path.resolve(config.demo_root, "index.html"), minified);
done();
});
gulp.task("gen-index-gallery-dev", (done) => {
// In dev mode we don't mangle names, so we hardcode urls. That way we can
// run webpack as last in watch mode, which blocks output.
const content = renderGalleryTemplate("index", {
latestGalleryJS: "./entrypoint.js",
});
fs.outputFileSync(path.resolve(config.gallery_root, "index.html"), content);
done();
});
gulp.task("gen-index-gallery-prod", (done) => {
const latestManifest = require(path.resolve(
config.gallery_output,
"manifest.json"
));
const content = renderGalleryTemplate("index", {
latestGalleryJS: latestManifest["entrypoint.js"],
});
const minified = minifyHtml(content);
fs.outputFileSync(path.resolve(config.gallery_root, "index.html"), minified);
done();
});
+38
View File
@@ -0,0 +1,38 @@
// Run demo develop mode
const gulp = require("gulp");
require("./clean.js");
require("./translations.js");
require("./gen-icons.js");
require("./gather-static.js");
require("./webpack.js");
require("./service-worker.js");
require("./entry-html.js");
gulp.task(
"develop-gallery",
gulp.series(
async function setEnv() {
process.env.NODE_ENV = "development";
},
"clean-gallery",
gulp.parallel("gen-icons-app", "gen-icons-app", "build-translations"),
"copy-static-gallery",
"gen-index-gallery-dev",
"webpack-dev-server-gallery"
)
);
gulp.task(
"build-gallery",
gulp.series(
async function setEnv() {
process.env.NODE_ENV = "production";
},
"clean-gallery",
gulp.parallel("gen-icons-app", "gen-icons-mdi", "build-translations"),
"copy-static-gallery",
"webpack-prod-gallery",
"gen-index-gallery-prod"
)
);
+16 -19
View File
@@ -4,8 +4,6 @@ const gulp = require("gulp");
const path = require("path");
const cpx = require("cpx");
const fs = require("fs-extra");
const zopfli = require("gulp-zopfli-green");
const merge = require("merge-stream");
const paths = require("../paths");
const npmPath = (...parts) =>
@@ -67,20 +65,6 @@ function copyMapPanel(staticDir) {
);
}
function compressStatic(staticDir) {
const staticPath = genStaticPath(staticDir);
const polyfills = gulp
.src(staticPath("polyfills/*.js"))
.pipe(zopfli())
.pipe(gulp.dest(staticPath("polyfills")));
const translations = gulp
.src(staticPath("translations/*.json"))
.pipe(zopfli())
.pipe(gulp.dest(staticPath("translations")));
return merge(polyfills, translations);
}
gulp.task("copy-static", (done) => {
const staticDir = paths.static;
const staticPath = genStaticPath(paths.static);
@@ -100,11 +84,12 @@ gulp.task("copy-static", (done) => {
done();
});
gulp.task("compress-static", () => compressStatic(paths.static));
gulp.task("copy-static-demo", (done) => {
// Copy app static files
fs.copySync(polyPath("public"), paths.demo_root);
fs.copySync(
polyPath("public/static"),
path.resolve(paths.demo_root, "static")
);
// Copy demo static files
fs.copySync(path.resolve(paths.demo_dir, "public"), paths.demo_root);
@@ -126,3 +111,15 @@ gulp.task("copy-static-cast", (done) => {
copyTranslations(paths.cast_static);
done();
});
gulp.task("copy-static-gallery", (done) => {
// Copy app static files
fs.copySync(polyPath("public/static"), paths.gallery_static);
// Copy gallery static files
fs.copySync(path.resolve(paths.gallery_dir, "public"), paths.gallery_root);
copyMapPanel(paths.gallery_static);
copyFonts(paths.gallery_static);
copyTranslations(paths.gallery_static);
done();
});
+31 -27
View File
@@ -57,18 +57,6 @@ function generateIconset(iconsetName, iconNames) {
return `<ha-iconset-svg name="${iconsetName}" size="24"><svg><defs>${iconDefs}</defs></svg></ha-iconset-svg>`;
}
// Generate the full MDI iconset
function genMDIIcons() {
const meta = JSON.parse(
fs.readFileSync(path.resolve(ICON_PACKAGE_PATH, META_PATH), "UTF-8")
);
const iconNames = meta.map((iconInfo) => iconInfo.name);
if (!fs.existsSync(OUTPUT_DIR)) {
fs.mkdirSync(OUTPUT_DIR);
}
fs.writeFileSync(MDI_OUTPUT_PATH, generateIconset("mdi", iconNames));
}
// Helper function to map recursively over files in a folder and it's subfolders
function mapFiles(startPath, filter, mapFunc) {
const files = fs.readdirSync(startPath);
@@ -101,24 +89,27 @@ function findIcons(searchPath, iconsetName) {
return icons;
}
function genHassIcons() {
gulp.task("gen-icons-mdi", (done) => {
const meta = JSON.parse(
fs.readFileSync(path.resolve(ICON_PACKAGE_PATH, META_PATH), "UTF-8")
);
const iconNames = meta.map((iconInfo) => iconInfo.name);
if (!fs.existsSync(OUTPUT_DIR)) {
fs.mkdirSync(OUTPUT_DIR);
}
fs.writeFileSync(MDI_OUTPUT_PATH, generateIconset("mdi", iconNames));
done();
});
gulp.task("gen-icons-app", (done) => {
const iconNames = findIcons("./src", "hass");
BUILT_IN_PANEL_ICONS.forEach((name) => iconNames.add(name));
if (!fs.existsSync(OUTPUT_DIR)) {
fs.mkdirSync(OUTPUT_DIR);
}
fs.writeFileSync(HASS_OUTPUT_PATH, generateIconset("hass", iconNames));
}
gulp.task("gen-icons-mdi", (done) => {
genMDIIcons();
done();
});
gulp.task("gen-icons-hass", (done) => {
genHassIcons();
done();
});
gulp.task("gen-icons", gulp.series("gen-icons-hass", "gen-icons-mdi"));
gulp.task("gen-icons-demo", (done) => {
const iconNames = findIcons(path.resolve(paths.demo_dir, "./src"), "hademo");
@@ -129,8 +120,21 @@ gulp.task("gen-icons-demo", (done) => {
done();
});
module.exports = {
findIcons,
generateIconset,
genMDIIcons,
};
gulp.task("gen-icons-hassio", (done) => {
const iconNames = findIcons(
path.resolve(paths.hassio_dir, "./src"),
"hassio"
);
// Find hassio icons inside HA main repo.
for (const item of findIcons(
path.resolve(paths.polymer_dir, "./src"),
"hassio"
)) {
iconNames.add(item);
}
fs.writeFileSync(
path.resolve(paths.hassio_dir, "hassio-icons.html"),
generateIconset("hassio", iconNames)
);
done();
});
+34
View File
@@ -0,0 +1,34 @@
const gulp = require("gulp");
const envVars = require("../env");
require("./clean.js");
require("./gen-icons.js");
require("./webpack.js");
require("./compress.js");
gulp.task(
"develop-hassio",
gulp.series(
async function setEnv() {
process.env.NODE_ENV = "development";
},
"clean-hassio",
gulp.parallel("gen-icons-hassio", "gen-icons-mdi"),
"webpack-watch-hassio"
)
);
gulp.task(
"build-hassio",
gulp.series(
async function setEnv() {
process.env.NODE_ENV = "production";
},
"clean-hassio",
gulp.parallel("gen-icons-hassio", "gen-icons-mdi"),
"webpack-prod-hassio",
...// Don't compress running tests
(envVars.isTravis ? [] : ["compress-hassio"])
)
);
+14 -12
View File
@@ -45,11 +45,10 @@ function recursiveFlatten(prefix, data) {
let output = {};
Object.keys(data).forEach(function(key) {
if (typeof data[key] === "object") {
output = Object.assign(
{},
output,
recursiveFlatten(prefix + key + ".", data[key])
);
output = {
...output,
...recursiveFlatten(prefix + key + ".", data[key]),
};
} else {
output[prefix + key] = data[key];
}
@@ -99,18 +98,16 @@ function recursiveEmpty(data) {
* @link https://docs.lokalise.co/article/KO5SZWLLsy-key-referencing
*/
const re_key_reference = /\[%key:([^%]+)%\]/;
function lokalise_transform(data, original) {
function lokaliseTransform(data, original, file) {
const output = {};
Object.entries(data).forEach(([key, value]) => {
if (value instanceof Object) {
output[key] = lokalise_transform(value, original);
output[key] = lokaliseTransform(value, original, file);
} else {
output[key] = value.replace(re_key_reference, (match, key) => {
const replace = key.split("::").reduce((tr, k) => tr[k], original);
if (typeof replace !== "string") {
throw Error(
`Invalid key placeholder ${key} in src/translations/en.json`
);
throw Error(`Invalid key placeholder ${key} in ${file.path}`);
}
return replace;
});
@@ -183,7 +180,7 @@ gulp.task(
.src("src/translations/en.json")
.pipe(
transform(function(data, file) {
return lokalise_transform(data, data);
return lokaliseTransform(data, data, file);
})
)
.pipe(rename("translationMaster.json"))
@@ -198,6 +195,11 @@ gulp.task(
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
@@ -214,7 +216,7 @@ gulp.task(
const lang = subtags.slice(0, i).join("-");
if (lang === "test") {
src.push(workDir + "/test.json");
} else {
} else if (lang !== "en") {
src.push(inDir + "/" + lang + ".json");
}
}
+96 -97
View File
@@ -1,6 +1,5 @@
// Tasks to run webpack.
const gulp = require("gulp");
const path = require("path");
const webpack = require("webpack");
const WebpackDevServer = require("webpack-dev-server");
const log = require("fancy-log");
@@ -9,8 +8,33 @@ const {
createAppConfig,
createDemoConfig,
createCastConfig,
createHassioConfig,
createGalleryConfig,
} = require("../webpack");
const bothBuilds = (createConfigFunc, params) => [
createConfigFunc({ ...params, latestBuild: true }),
createConfigFunc({ ...params, latestBuild: false }),
];
const runDevServer = ({
compiler,
contentBase,
port,
listenHost = "localhost",
}) =>
new WebpackDevServer(compiler, {
open: true,
watchContentBase: true,
contentBase,
}).listen(port, listenHost, function(err) {
if (err) {
throw err;
}
// Server listening
log("[webpack-dev-server]", `http://localhost:${port}`);
});
const handler = (done) => (err, stats) => {
if (err) {
console.log(err.stack || err);
@@ -32,20 +56,11 @@ const handler = (done) => (err, stats) => {
};
gulp.task("webpack-watch-app", () => {
const compiler = webpack([
createAppConfig({
isProdBuild: false,
latestBuild: true,
isStatsBuild: false,
}),
createAppConfig({
isProdBuild: false,
latestBuild: false,
isStatsBuild: false,
}),
]);
compiler.watch({}, handler());
// we are not calling done, so this command will run forever
webpack(bothBuilds(createAppConfig, { isProdBuild: false })).watch(
{},
handler()
);
});
gulp.task(
@@ -53,47 +68,17 @@ gulp.task(
() =>
new Promise((resolve) =>
webpack(
[
createAppConfig({
isProdBuild: true,
latestBuild: true,
isStatsBuild: false,
}),
createAppConfig({
isProdBuild: true,
latestBuild: false,
isStatsBuild: false,
}),
],
bothBuilds(createAppConfig, { isProdBuild: true }),
handler(resolve)
)
)
);
gulp.task("webpack-dev-server-demo", () => {
const compiler = webpack([
createDemoConfig({
isProdBuild: false,
latestBuild: false,
isStatsBuild: false,
}),
createDemoConfig({
isProdBuild: false,
latestBuild: true,
isStatsBuild: false,
}),
]);
new WebpackDevServer(compiler, {
open: true,
watchContentBase: true,
contentBase: path.resolve(paths.demo_dir, "dist"),
}).listen(8090, "localhost", function(err) {
if (err) {
throw err;
}
// Server listening
log("[webpack-dev-server]", "http://localhost:8090");
runDevServer({
compiler: webpack(bothBuilds(createDemoConfig, { isProdBuild: false })),
contentBase: paths.demo_root,
port: 8090,
});
});
@@ -102,51 +87,22 @@ gulp.task(
() =>
new Promise((resolve) =>
webpack(
[
createDemoConfig({
isProdBuild: true,
latestBuild: false,
isStatsBuild: false,
}),
createDemoConfig({
isProdBuild: true,
latestBuild: true,
isStatsBuild: false,
}),
],
bothBuilds(createDemoConfig, {
isProdBuild: true,
}),
handler(resolve)
)
)
);
gulp.task("webpack-dev-server-cast", () => {
const compiler = webpack([
createCastConfig({
isProdBuild: false,
latestBuild: false,
}),
createCastConfig({
isProdBuild: false,
latestBuild: true,
}),
]);
new WebpackDevServer(compiler, {
open: true,
watchContentBase: true,
contentBase: path.resolve(paths.cast_dir, "dist"),
}).listen(
8080,
runDevServer({
compiler: webpack(bothBuilds(createCastConfig, { isProdBuild: false })),
contentBase: paths.cast_root,
port: 8080,
// Accessible from the network, because that's how Cast hits it.
"0.0.0.0",
function(err) {
if (err) {
throw err;
}
// Server listening
log("[webpack-dev-server]", "http://localhost:8080");
}
);
listenHost: "0.0.0.0",
});
});
gulp.task(
@@ -154,16 +110,59 @@ gulp.task(
() =>
new Promise((resolve) =>
webpack(
[
createCastConfig({
isProdBuild: true,
latestBuild: false,
}),
createCastConfig({
isProdBuild: true,
latestBuild: true,
}),
],
bothBuilds(createCastConfig, {
isProdBuild: true,
}),
handler(resolve)
)
)
);
gulp.task("webpack-watch-hassio", () => {
// we are not calling done, so this command will run forever
webpack(
createHassioConfig({
isProdBuild: false,
latestBuild: false,
})
).watch({}, handler());
});
gulp.task(
"webpack-prod-hassio",
() =>
new Promise((resolve) =>
webpack(
createHassioConfig({
isProdBuild: true,
latestBuild: false,
}),
handler(resolve)
)
)
);
gulp.task("webpack-dev-server-gallery", () => {
runDevServer({
compiler: webpack(
createGalleryConfig({ latestBuild: true, isProdBuild: false })
),
contentBase: paths.gallery_root,
port: 8100,
});
});
gulp.task(
"webpack-prod-gallery",
() =>
new Promise((resolve) =>
webpack(
createGalleryConfig({
isProdBuild: true,
latestBuild: true,
}),
handler(resolve)
)
)
+9
View File
@@ -20,4 +20,13 @@ module.exports = {
cast_static: path.resolve(__dirname, "../cast/dist/static"),
cast_output: path.resolve(__dirname, "../cast/dist/frontend_latest"),
cast_output_es5: path.resolve(__dirname, "../cast/dist/frontend_es5"),
gallery_dir: path.resolve(__dirname, "../gallery"),
gallery_root: path.resolve(__dirname, "../gallery/dist"),
gallery_output: path.resolve(__dirname, "../gallery/dist/frontend_latest"),
gallery_static: path.resolve(__dirname, "../gallery/dist/static"),
hassio_dir: path.resolve(__dirname, "../hassio"),
hassio_root: path.resolve(__dirname, "../hassio/build"),
hassio_publicPath: "/api/hassio/app/",
};
+201 -210
View File
@@ -3,8 +3,6 @@ const fs = require("fs");
const path = require("path");
const TerserPlugin = require("terser-webpack-plugin");
const WorkboxPlugin = require("workbox-webpack-plugin");
const CompressionPlugin = require("compression-webpack-plugin");
const zopfli = require("@gfx/zopfli");
const ManifestPlugin = require("webpack-manifest-plugin");
const paths = require("./paths.js");
const { babelLoaderConfig } = require("./babel.js");
@@ -17,253 +15,246 @@ if (!version) {
}
version = version[0];
const genMode = (isProdBuild) => (isProdBuild ? "production" : "development");
const genDevTool = (isProdBuild) =>
isProdBuild ? "source-map" : "inline-cheap-module-source-map";
const genFilename = (isProdBuild, dontHash = new Set()) => ({ chunk }) => {
if (!isProdBuild || dontHash.has(chunk.name)) {
return `${chunk.name}.js`;
}
return `${chunk.name}.${chunk.hash.substr(0, 8)}.js`;
};
const genChunkFilename = (isProdBuild, isStatsBuild) =>
isProdBuild && !isStatsBuild ? "chunk.[chunkhash].js" : "[name].chunk.js";
const resolve = {
extensions: [".ts", ".js", ".json", ".tsx"],
alias: {
react: "preact-compat",
"react-dom": "preact-compat",
// Not necessary unless you consume a module using `createClass`
"create-react-class": "preact-compat/lib/create-react-class",
// Not necessary unless you consume a module requiring `react-dom-factories`
"react-dom-factories": "preact-compat/lib/react-dom-factories",
},
};
const cssLoader = {
test: /\.css$/,
use: "raw-loader",
};
const htmlLoader = {
test: /\.(html)$/,
use: {
loader: "html-loader",
options: {
exportAsEs6Default: true,
},
},
};
const plugins = [
// Ignore moment.js locales
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
// Color.js is bloated, it contains all color definitions for all material color sets.
new webpack.NormalModuleReplacementPlugin(
/@polymer\/paper-styles\/color\.js$/,
path.resolve(paths.polymer_dir, "src/util/empty.js")
),
// Ignore roboto pointing at CDN. We use local font-roboto-local.
new webpack.NormalModuleReplacementPlugin(
/@polymer\/font-roboto\/roboto\.js$/,
path.resolve(paths.polymer_dir, "src/util/empty.js")
),
// Ignore mwc icons pointing at CDN.
new webpack.NormalModuleReplacementPlugin(
/@material\/mwc-icon\/mwc-icon-font\.js$/,
path.resolve(paths.polymer_dir, "src/util/empty.js")
),
];
const optimization = (latestBuild) => ({
minimizer: [
new TerserPlugin({
cache: true,
parallel: true,
extractComments: true,
sourceMap: true,
terserOptions: {
safari10: true,
ecma: latestBuild ? undefined : 5,
},
}),
],
});
const createAppConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => {
const isCI = process.env.CI === "true";
// 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) => {
workBoxTranslationsTemplatedURLs[
`/static/translations/${englishFP[key]}`
] = `build-translations/output/${key}.json`;
});
const entry = {
app: "./src/entrypoints/app.ts",
authorize: "./src/entrypoints/authorize.ts",
onboarding: "./src/entrypoints/onboarding.ts",
core: "./src/entrypoints/core.ts",
compatibility: "./src/entrypoints/compatibility.ts",
"custom-panel": "./src/entrypoints/custom-panel.ts",
"hass-icons": "./src/entrypoints/hass-icons.ts",
};
const createWebpackConfig = ({
entry,
outputRoot,
defineOverlay,
isProdBuild,
latestBuild,
isStatsBuild,
}) => {
return {
mode: genMode(isProdBuild),
devtool: genDevTool(isProdBuild),
mode: isProdBuild ? "production" : "development",
devtool: isProdBuild ? "source-map" : "inline-cheap-module-source-map",
entry,
module: {
rules: [babelLoaderConfig({ latestBuild }), cssLoader, htmlLoader],
rules: [
babelLoaderConfig({ latestBuild }),
{
test: /\.css$/,
use: "raw-loader",
},
{
test: /\.(html)$/,
use: {
loader: "html-loader",
options: {
exportAsEs6Default: true,
},
},
},
],
},
optimization: {
minimizer: [
new TerserPlugin({
cache: true,
parallel: true,
extractComments: true,
sourceMap: true,
terserOptions: {
safari10: true,
ecma: latestBuild ? undefined : 5,
},
}),
],
},
optimization: optimization(latestBuild),
plugins: [
new ManifestPlugin(),
new webpack.DefinePlugin({
__DEV__: JSON.stringify(!isProdBuild),
__DEMO__: false,
__DEV__: !isProdBuild,
__BUILD__: JSON.stringify(latestBuild ? "latest" : "es5"),
__VERSION__: JSON.stringify(version),
__DEMO__: false,
__STATIC_PATH__: "/static/",
"process.env.NODE_ENV": JSON.stringify(
isProdBuild ? "production" : "development"
),
...defineOverlay,
}),
...plugins,
isProdBuild &&
!isCI &&
!isStatsBuild &&
new CompressionPlugin({
cache: true,
exclude: [/\.js\.map$/, /\.LICENSE$/, /\.py$/, /\.txt$/],
algorithm(input, compressionOptions, callback) {
return zopfli.gzip(input, compressionOptions, callback);
},
}),
latestBuild &&
new WorkboxPlugin.InjectManifest({
swSrc: "./src/entrypoints/service-worker-hass.js",
swDest: "service_worker.js",
importWorkboxFrom: "local",
include: [/\.js$/],
templatedURLs: {
...workBoxTranslationsTemplatedURLs,
"/static/icons/favicon-192x192.png":
"public/icons/favicon-192x192.png",
"/static/fonts/roboto/Roboto-Light.woff2":
"node_modules/roboto-fontface/fonts/roboto/Roboto-Light.woff2",
"/static/fonts/roboto/Roboto-Medium.woff2":
"node_modules/roboto-fontface/fonts/roboto/Roboto-Medium.woff2",
"/static/fonts/roboto/Roboto-Regular.woff2":
"node_modules/roboto-fontface/fonts/roboto/Roboto-Regular.woff2",
"/static/fonts/roboto/Roboto-Bold.woff2":
"node_modules/roboto-fontface/fonts/roboto/Roboto-Bold.woff2",
},
}),
// Ignore moment.js locales
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
// Color.js is bloated, it contains all color definitions for all material color sets.
new webpack.NormalModuleReplacementPlugin(
/@polymer\/paper-styles\/color\.js$/,
path.resolve(paths.polymer_dir, "src/util/empty.js")
),
// Ignore roboto pointing at CDN. We use local font-roboto-local.
new webpack.NormalModuleReplacementPlugin(
/@polymer\/font-roboto\/roboto\.js$/,
path.resolve(paths.polymer_dir, "src/util/empty.js")
),
// Ignore mwc icons pointing at CDN.
new webpack.NormalModuleReplacementPlugin(
/@material\/mwc-icon\/mwc-icon-font\.js$/,
path.resolve(paths.polymer_dir, "src/util/empty.js")
),
].filter(Boolean),
output: {
filename: genFilename(isProdBuild),
chunkFilename: genChunkFilename(isProdBuild, isStatsBuild),
path: latestBuild ? paths.output : paths.output_es5,
publicPath: latestBuild ? "/frontend_latest/" : "/frontend_es5/",
resolve: {
extensions: [".ts", ".js", ".json"],
alias: {
react: "preact-compat",
"react-dom": "preact-compat",
// Not necessary unless you consume a module using `createClass`
"create-react-class": "preact-compat/lib/create-react-class",
// Not necessary unless you consume a module requiring `react-dom-factories`
"react-dom-factories": "preact-compat/lib/react-dom-factories",
},
},
output: {
filename: ({ chunk }) => {
const dontHash = new Set();
if (!isProdBuild || dontHash.has(chunk.name)) {
return `${chunk.name}.js`;
}
return `${chunk.name}.${chunk.hash.substr(0, 8)}.js`;
},
chunkFilename:
isProdBuild && !isStatsBuild
? "chunk.[chunkhash].js"
: "[name].chunk.js",
path: path.resolve(
outputRoot,
latestBuild ? "frontend_latest" : "frontend_es5"
),
publicPath: latestBuild ? "/frontend_latest/" : "/frontend_es5/",
// For workerize loader
globalObject: "self",
},
resolve,
};
};
const createAppConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => {
const config = createWebpackConfig({
entry: {
app: "./src/entrypoints/app.ts",
authorize: "./src/entrypoints/authorize.ts",
onboarding: "./src/entrypoints/onboarding.ts",
core: "./src/entrypoints/core.ts",
compatibility: "./src/entrypoints/compatibility.ts",
"custom-panel": "./src/entrypoints/custom-panel.ts",
"hass-icons": "./src/entrypoints/hass-icons.ts",
},
outputRoot: paths.root,
isProdBuild,
latestBuild,
isStatsBuild,
});
if (latestBuild) {
// Create an object mapping browser urls to their paths during build
const translationMetadata = require("../build-translations/translationMetadata.json");
const workBoxTranslationsTemplatedURLs = {};
const englishFP = translationMetadata.translations.en.fingerprints;
Object.keys(englishFP).forEach((key) => {
workBoxTranslationsTemplatedURLs[
`/static/translations/${englishFP[key]}`
] = `build-translations/output/${key}.json`;
});
config.plugins.push(
new WorkboxPlugin.InjectManifest({
swSrc: "./src/entrypoints/service-worker-hass.js",
swDest: "service_worker.js",
importWorkboxFrom: "local",
include: [/\.js$/],
templatedURLs: {
...workBoxTranslationsTemplatedURLs,
"/static/icons/favicon-192x192.png":
"public/icons/favicon-192x192.png",
"/static/fonts/roboto/Roboto-Light.woff2":
"node_modules/roboto-fontface/fonts/roboto/Roboto-Light.woff2",
"/static/fonts/roboto/Roboto-Medium.woff2":
"node_modules/roboto-fontface/fonts/roboto/Roboto-Medium.woff2",
"/static/fonts/roboto/Roboto-Regular.woff2":
"node_modules/roboto-fontface/fonts/roboto/Roboto-Regular.woff2",
"/static/fonts/roboto/Roboto-Bold.woff2":
"node_modules/roboto-fontface/fonts/roboto/Roboto-Bold.woff2",
},
})
);
}
return config;
};
const createDemoConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => {
return {
mode: genMode(isProdBuild),
devtool: genDevTool(isProdBuild),
return createWebpackConfig({
entry: {
main: "./demo/src/entrypoint.ts",
compatibility: "./src/entrypoints/compatibility.ts",
},
module: {
rules: [babelLoaderConfig({ latestBuild }), cssLoader, htmlLoader],
},
optimization: optimization(latestBuild),
plugins: [
new ManifestPlugin(),
new webpack.DefinePlugin({
__DEV__: !isProdBuild,
__BUILD__: JSON.stringify(latestBuild ? "latest" : "es5"),
__VERSION__: JSON.stringify(`DEMO-${version}`),
__DEMO__: true,
__STATIC_PATH__: "/static/",
"process.env.NODE_ENV": JSON.stringify(
isProdBuild ? "production" : "development"
),
}),
...plugins,
].filter(Boolean),
resolve,
output: {
filename: genFilename(isProdBuild),
chunkFilename: genChunkFilename(isProdBuild, isStatsBuild),
path: path.resolve(
paths.demo_root,
latestBuild ? "frontend_latest" : "frontend_es5"
main: path.resolve(paths.demo_dir, "src/entrypoint.ts"),
compatibility: path.resolve(
paths.polymer_dir,
"src/entrypoints/compatibility.ts"
),
publicPath: latestBuild ? "/frontend_latest/" : "/frontend_es5/",
},
};
outputRoot: paths.demo_root,
defineOverlay: {
__VERSION__: JSON.stringify(`DEMO-${version}`),
__DEMO__: true,
},
isProdBuild,
latestBuild,
isStatsBuild,
});
};
const createCastConfig = ({ isProdBuild, latestBuild }) => {
const isStatsBuild = false;
const entry = {
launcher: "./cast/src/launcher/entrypoint.ts",
launcher: path.resolve(paths.cast_dir, "src/launcher/entrypoint.ts"),
};
if (latestBuild) {
entry.receiver = "./cast/src/receiver/entrypoint.ts";
entry.receiver = path.resolve(paths.cast_dir, "src/receiver/entrypoint.ts");
}
return {
mode: genMode(isProdBuild),
devtool: genDevTool(isProdBuild),
return createWebpackConfig({
entry,
module: {
rules: [babelLoaderConfig({ latestBuild }), cssLoader, htmlLoader],
outputRoot: paths.cast_root,
isProdBuild,
latestBuild,
});
};
const createHassioConfig = ({ isProdBuild, latestBuild }) => {
if (latestBuild) {
throw new Error("Hass.io does not support latest build!");
}
const config = createWebpackConfig({
entry: {
entrypoint: path.resolve(paths.hassio_dir, "src/entrypoint.js"),
},
optimization: optimization(latestBuild),
plugins: [
new ManifestPlugin(),
new webpack.DefinePlugin({
__DEV__: !isProdBuild,
__BUILD__: JSON.stringify(latestBuild ? "latest" : "es5"),
__VERSION__: JSON.stringify(version),
__DEMO__: false,
__STATIC_PATH__: "/static/",
"process.env.NODE_ENV": JSON.stringify(
isProdBuild ? "production" : "development"
),
}),
...plugins,
].filter(Boolean),
resolve,
output: {
filename: genFilename(isProdBuild),
chunkFilename: genChunkFilename(isProdBuild, isStatsBuild),
path: path.resolve(
paths.cast_root,
latestBuild ? "frontend_latest" : "frontend_es5"
),
publicPath: latestBuild ? "/frontend_latest/" : "/frontend_es5/",
outputRoot: "",
isProdBuild,
latestBuild,
});
config.output.path = paths.hassio_root;
config.output.publicPath = paths.hassio_publicPath;
return config;
};
const createGalleryConfig = ({ isProdBuild, latestBuild }) => {
if (!latestBuild) {
throw new Error("Gallery only supports latest build!");
}
const config = createWebpackConfig({
entry: {
entrypoint: path.resolve(paths.gallery_dir, "src/entrypoint.js"),
},
};
outputRoot: paths.gallery_root,
isProdBuild,
latestBuild,
});
return config;
};
module.exports = {
resolve,
plugins,
optimization,
createAppConfig,
createDemoConfig,
createCastConfig,
createHassioConfig,
createGalleryConfig,
};
+1 -1
View File
@@ -25,7 +25,7 @@ Home Assistant Cast is made up of two separate applications:
### Setting dev variables
Open `src/cast/const.ts` and change `CAST_DEV` to `true` and `CAST_DEV_APP_ID` to the ID of the app you just created.
Open `src/cast/dev_const.ts` and change `CAST_DEV_APP_ID` to the ID of the app you just created. And set the `CAST_DEV_HASS_URL` to the url of you development machine.
### Changing configuration
+20
View File
@@ -0,0 +1,20 @@
/*
Cache-Control: public, max-age: 0, s-maxage=3600, must-revalidate
Content-Security-Policy: form-action https:
Feature-Policy: vibrate 'none'; geolocation 'none'; midi 'none'; microphone 'none'; camera 'none'; magnetometer 'none'; gyroscope 'none'; speaker 'none'; vibrate 'none'; payment 'none'
Referrer-Policy: no-referrer-when-downgrade
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
/images/*
Cache-Control: public, max-age: 604800, s-maxage=604800
/manifest.json
Cache-Control: public, max-age: 3600, s-maxage=3600
/frontend_es5/*
Cache-Control: public, max-age: 604800, s-maxage=604800
/frontend_latest/*
Cache-Control: public, max-age: 604800, s-maxage=604800
+3 -1
View File
@@ -1,3 +1,5 @@
# Run it twice, second time we just delete.
aws s3 sync dist s3://cast.home-assistant.io --acl public-read
aws s3 sync dist s3://cast.home-assistant.io --acl public-read --delete
# Don't delete as it might break open sites that need to load code splitted things.
# aws s3 sync dist s3://cast.home-assistant.io --acl public-read --delete
# Todo : update JS first, HTML last.
+36 -1
View File
@@ -118,7 +118,42 @@
</p>
</div>
<div class="section-header">How does Home Assistant Cast work?</div>
<div class="section-header" id="https">
Why does Home Assistant Cast require me to authorize my Home Assistant
instance?
</div>
<div class="card-content">
<p>
You're currently looking at the Home Assistant Cast launcher
application. This is a standalone application to launch Home Assistant
Cast on your Chromecast. Because Chromecasts do not allow us to log in
to Home Assistant, we need to supply authentication to it from the
launcher. This authentication is obtained when you authorize your
instance. Your authentication credentials will remain in your browser
and on your Cast device.
</p>
<p>
Your authentication credentials or Home Assistant url are never sent
to the Cloud. You can validate this behavior in
<a
href="https://github.com/home-assistant/home-assistant-polymer/tree/dev/cast"
target="_blank"
>the source code</a
>.
</p>
<p>
The launcher application exists to make it possible to use Home
Assistant Cast with older versions of Home Assistant.
</p>
<p>
Starting with Home Assistant 0.97, Home Assistant Cast is also built
into the Lovelace UI as a special entities card row. Since the
Lovelace UI already has authentication, you will be able to start
casting right away.
</p>
</div>
<div class="section-header">Wat does Home Assistant Cast do?</div>
<div class="card-content">
<p>
Home Assistant Cast is a receiver application for the Chromecast. When
+7 -4
View File
@@ -42,10 +42,13 @@
})();
</script>
<script>
var _gaq=[['_setAccount','UA-57927901-9'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-57927901-9', 'auto');
ga('send', 'pageview', location.pathname.includes("auth_callback") === -1 ? location.pathname : "/");
</script>
</body>
</html>
+6
View File
@@ -9,4 +9,10 @@
font-size: initial;
}
</style>
<script>
var _gaq=[['_setAccount','UA-57927901-10'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</html>
+3 -11
View File
@@ -29,6 +29,7 @@ import {
} 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";
@customElement("hc-cast")
class HcCast extends LitElement {
@@ -158,17 +159,8 @@ class HcCast extends LitElement {
protected updated(changedProps) {
super.updated(changedProps);
if (this.castManager && this.castManager.status) {
const selectEl = this.shadowRoot!.querySelector("select");
if (selectEl) {
this.shadowRoot!.querySelector("select")!.value =
this.castManager.castConnectedToOurHass &&
!this.castManager.status.showDemo
? this.castManager.status.lovelacePath || ""
: "";
}
}
this.toggleAttribute(
toggleAttribute(
this,
"hide-icons",
this.lovelaceConfig
? !this.lovelaceConfig.views.some((view) => view.icon)
+36 -17
View File
@@ -8,7 +8,8 @@ import {
property,
} from "lit-element";
import { LovelaceConfig } from "../../../../src/data/lovelace";
import "../../../../src/panels/lovelace/hui-view";
import "../../../../src/panels/lovelace/views/hui-view";
import "../../../../src/panels/lovelace/views/hui-panel-view";
import { HomeAssistant } from "../../../../src/types";
import { Lovelace } from "../../../../src/panels/lovelace/types";
import "./hc-launch-screen";
@@ -16,8 +17,10 @@ import "./hc-launch-screen";
@customElement("hc-lovelace")
class HcLovelace extends LitElement {
@property() public hass!: HomeAssistant;
@property() public lovelaceConfig!: LovelaceConfig;
@property() public viewPath?: string;
@property() public viewPath?: string | number;
protected render(): TemplateResult | void {
const index = this._viewIndex;
@@ -36,35 +39,52 @@ class HcLovelace extends LitElement {
mode: "storage",
language: "en",
saveConfig: async () => undefined,
deleteConfig: async () => undefined,
setEditMode: () => undefined,
};
return html`
<hui-view
.hass=${this.hass}
.lovelace=${lovelace}
.index=${index}
columns="2"
></hui-view>
`;
return this.lovelaceConfig.views[index].panel
? html`
<hui-panel-view
.hass=${this.hass}
.config=${this.lovelaceConfig.views[index]}
></hui-panel-view>
`
: html`
<hui-view
.hass=${this.hass}
.lovelace=${lovelace}
.index=${index}
columns="2"
></hui-view>
`;
}
protected updated(changedProps) {
super.updated(changedProps);
if (changedProps.has("viewPath") || changedProps.has("lovelaceConfig")) {
const index = this._viewIndex;
if (index) {
this.shadowRoot!.querySelector("hui-view")!.style.background =
if (index !== undefined) {
const configBackground =
this.lovelaceConfig.views[index].background ||
this.lovelaceConfig.background ||
"";
this.lovelaceConfig.background;
if (configBackground) {
(this.shadowRoot!.querySelector(
"hui-view, hui-panel-view"
) as HTMLElement)!.style.setProperty(
"--lovelace-background",
configBackground
);
}
}
}
}
private get _viewIndex() {
const selectedView = this.viewPath;
const selectedViewInt = parseInt(selectedView!, 10);
const selectedViewInt = parseInt(selectedView as string, 10);
for (let i = 0; i < this.lovelaceConfig.views.length; i++) {
if (
this.lovelaceConfig.views[i].path === selectedView ||
@@ -77,7 +97,6 @@ class HcLovelace extends LitElement {
}
static get styles(): CSSResult {
// We're applying a 10% transform so it all shows a little bigger.
return css`
:host {
min-height: 100vh;
@@ -86,7 +105,7 @@ class HcLovelace extends LitElement {
box-sizing: border-box;
background: var(--primary-background-color);
}
hui-view {
:host > * {
flex: 1;
}
`;
+41 -8
View File
@@ -1,10 +1,10 @@
import { HassElement } from "../../../../src/state/hass-element";
import {
getAuth,
createConnection,
UnsubscribeFunc,
} from "home-assistant-js-websocket";
import { customElement, TemplateResult, html, property } from "lit-element";
import { HassElement } from "../../../../src/state/hass-element";
import {
HassMessage,
ConnectMessage,
@@ -26,9 +26,13 @@ import { isNavigationClick } from "../../../../src/common/dom/is-navigation-clic
@customElement("hc-main")
export class HcMain extends HassElement {
@property() private _showDemo = false;
@property() private _lovelaceConfig?: LovelaceConfig;
@property() private _lovelacePath: string | null = null;
@property() private _lovelacePath: string | number | null = null;
@property() private _error?: string;
private _unsubLovelace?: UnsubscribeFunc;
public processIncomingMessage(msg: HassMessage) {
@@ -53,7 +57,13 @@ export class HcMain extends HassElement {
`;
}
if (!this._lovelaceConfig || !this._lovelacePath) {
if (
!this._lovelaceConfig ||
this._lovelacePath === null ||
// Guard against part of HA not being loaded yet.
(this.hass &&
(!this.hass.states || !this.hass.config || !this.hass.services))
) {
return html`
<hc-launch-screen
.hass=${this.hass}
@@ -127,10 +137,16 @@ export class HcMain extends HassElement {
}),
});
} catch (err) {
this._error = err;
this._error = this._getErrorMessage(err);
return;
}
let connection;
try {
connection = await createConnection({ auth });
} catch (err) {
this._error = this._getErrorMessage(err);
return;
}
const connection = await createConnection({ auth });
if (this.hass) {
this.hass.connection.close();
}
@@ -159,9 +175,9 @@ export class HcMain extends HassElement {
} catch (err) {
// Generate a Lovelace config.
this._unsubLovelace = () => undefined;
const {
generateLovelaceConfigFromHass,
} = await import("../../../../src/panels/lovelace/common/generate-lovelace-config");
const { generateLovelaceConfigFromHass } = await import(
"../../../../src/panels/lovelace/common/generate-lovelace-config"
);
this._handleNewLovelaceConfig(
await generateLovelaceConfigFromHass(this.hass!)
);
@@ -197,6 +213,23 @@ export class HcMain extends HassElement {
});
}
private _getErrorMessage(error: number): string {
switch (error) {
case 1:
return "Unable to connect to the Home Assistant websocket API.";
case 2:
return "The supplied authentication is invalid.";
case 3:
return "The connection to Home Assistant was lost.";
case 4:
return "Missing hassUrl. This is required.";
case 5:
return "Home Assistant needs to be served over https:// to use with Home Assistant Cast.";
default:
return "Unknown Error";
}
}
private _breakFree() {
const controls = document.body.querySelector("touch-controls");
if (controls) {
+11
View File
@@ -0,0 +1,11 @@
const { createCastConfig } = require("../build-scripts/webpack.js");
const { isProdBuild } = require("../build-scripts/env.js");
// File just used for stats builds
const latestBuild = true;
module.exports = createCastConfig({
isProdBuild,
latestBuild,
});
+18
View File
@@ -0,0 +1,18 @@
/*
Cache-Control: public, max-age: 0, s-maxage=3600, must-revalidate
Content-Security-Policy: form-action https:
Referrer-Policy: no-referrer-when-downgrade
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
/api/*
Cache-Control: public, max-age: 604800, s-maxage=604800
/assets/*
Cache-Control: public, max-age: 604800, s-maxage=604800
/frontend_es5/*
Cache-Control: public, max-age: 604800, s-maxage=604800
/frontend_latest/*
Cache-Control: public, max-age: 604800, s-maxage=604800
+8 -4
View File
@@ -7,22 +7,26 @@
{
"src": "/static/icons/favicon-192x192.png",
"sizes": "192x192",
"type": "image/png"
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "/static/icons/favicon-384x384.png",
"sizes": "384x384",
"type": "image/png"
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "/static/icons/favicon-512x512.png",
"sizes": "512x512",
"type": "image/png"
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "/static/icons/favicon-1024x1024.png",
"sizes": "1024x1024",
"type": "image/png"
"type": "image/png",
"purpose": "maskable any"
}
],
"lang": "en-US",
+12 -30
View File
@@ -115,10 +115,6 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
attributes: {
friendly_name: "Abode Updates",
icon: "hademo:security",
templates: {
icon_color:
"if (state === 'on') return 'rgb(251, 210, 41)'; return 'rgb(54, 95, 140)';\n",
},
},
},
"input_boolean.tv": {
@@ -127,10 +123,6 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
attributes: {
friendly_name: "TV",
icon: "hademo:television",
templates: {
icon_color:
"if (state === 'on') return 'rgb(251, 210, 41)'; return 'rgb(54, 95, 140)';\n",
},
},
},
"input_boolean.homeautomation": {
@@ -139,10 +131,6 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
attributes: {
friendly_name: "Home Automation",
icon: "hass:home-automation",
templates: {
icon_color:
"if (state === 'on') return 'rgb(251, 210, 41)'; return 'rgb(54, 95, 140)';\n",
},
},
},
"input_boolean.tvtime": {
@@ -151,12 +139,6 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
attributes: {
friendly_name: "TV Time",
icon: "hademo:television-guide",
templates: {
icon:
"if (state === 'on') return 'hademo:television-classic'; return 'hademo:television-classic-off';\n",
icon_color:
"if (state === 'on') return 'rgb(251, 210, 41)'; return 'rgb(54, 95, 140)';\n",
},
},
},
"input_select.livingroomharmony": {
@@ -235,6 +217,18 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
icon: "hademo:currency-usd",
},
},
"sensor.study_temp": {
entity_id: "sensor.study_temp",
state: "20.9",
attributes: {
unit_of_measurement: "°C",
device_class: "temperature",
friendly_name: localize(
"ui.panel.page-demo.config.arsaboo.names.temperature_study"
),
icon: "hademo:thermometer",
},
},
"cover.garagedoor": {
entity_id: "cover.garagedoor",
state: "closed",
@@ -560,12 +554,6 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
state: "off",
attributes: {
friendly_name: "Driveway Light",
templates: {
icon_color:
"if (state === 'on') return 'rgb(251, 210, 41)'; return 'rgb(54, 95, 140)';\n",
icon:
"if (state === 'on') return 'hademo:lightbulb-on'; return 'hademo:lightbulb';\n",
},
},
},
"switch.wemoporch": {
@@ -573,12 +561,6 @@ export const demoEntitiesArsaboo: DemoConfig["entities"] = (localize) =>
state: "off",
attributes: {
friendly_name: "Porch Lights",
templates: {
icon_color:
"if (state === 'on') return 'rgb(251, 210, 41)'; return 'rgb(54, 95, 140)';\n",
icon:
"if (state === 'on') return 'hademo:lightbulb-on'; return 'hademo:lightbulb';\n",
},
},
},
});
+5
View File
@@ -446,6 +446,11 @@ export const demoLovelaceArsaboo: DemoConfig["lovelace"] = (localize) => ({
"script.tv_off",
],
},
{
type: "sensor",
entity: "sensor.study_temp",
graph: "line",
},
{
type: "entities",
title: "Doorbell",
+3 -6
View File
@@ -23,27 +23,24 @@ export const demoThemeJimpower = () => ({
"paper-listbox-background-color": "#2E333A",
"table-row-background-color": "#353840",
"paper-grey-50": "var(--primary-text-color)",
"paper-toggle-button-checked-button-color": "var(--accent-color)",
"switch-checked-color": "var(--accent-color)",
"paper-dialog-background-color": "#434954",
"secondary-text-color": "#5294E2",
"google-red-500": "#E45E65",
"divider-color": "rgba(0, 0, 0, .12)",
"paper-toggle-button-unchecked-ink-color": "var(--disabled-text-color)",
"google-green-500": "#39E949",
"paper-toggle-button-unchecked-button-color": "var(--disabled-text-color)",
"switch-unchecked-button-color": "var(--disabled-text-color)",
"label-badge-border-color": "green",
"paper-listbox-color": "var(--primary-color)",
"paper-slider-disabled-secondary-color": "var(--disabled-text-color)",
"paper-toggle-button-checked-ink-color": "var(--accent-color)",
"paper-card-background-color": "#434954",
"label-badge-text-color": "var(--primary-text-color)",
"paper-slider-knob-start-color": "var(--accent-color)",
"paper-toggle-button-unchecked-bar-color": "var(--disabled-text-color)",
"switch-unchecked-track-color": "var(--disabled-text-color)",
"dark-primary-color": "var(--accent-color)",
"paper-slider-secondary-color": "var(--secondary-background-color)",
"paper-slider-pin-color": "var(--accent-color)",
"paper-item-icon-active-color": "#F9C536",
"accent-color": "#E45E65",
"paper-toggle-button-checked-bar-color": "var(--accent-color)",
"table-row-alternative-background-color": "#3E424B",
});
+3 -6
View File
@@ -24,27 +24,24 @@ export const demoThemeKernehed = () => ({
"paper-listbox-background-color": "#141414",
"table-row-background-color": "#292929",
"paper-grey-50": "var(--primary-text-color)",
"paper-toggle-button-checked-button-color": "var(--accent-color)",
"switch-checked-color": "var(--accent-color)",
"paper-dialog-background-color": "#292929",
"secondary-text-color": "#b58e31",
"google-red-500": "#b58e31",
"divider-color": "rgba(0, 0, 0, .12)",
"paper-toggle-button-unchecked-ink-color": "var(--disabled-text-color)",
"google-green-500": "#2980b9",
"paper-toggle-button-unchecked-button-color": "var(--disabled-text-color)",
"switch-unchecked-button-color": "var(--disabled-text-color)",
"label-badge-border-color": "green",
"paper-listbox-color": "#777777",
"paper-slider-disabled-secondary-color": "var(--disabled-text-color)",
"paper-toggle-button-checked-ink-color": "var(--accent-color)",
"paper-card-background-color": "#292929",
"label-badge-text-color": "var(--primary-text-color)",
"paper-slider-knob-start-color": "var(--accent-color)",
"paper-toggle-button-unchecked-bar-color": "var(--disabled-text-color)",
"switch-unchecked-track-color": "var(--disabled-text-color)",
"dark-primary-color": "var(--accent-color)",
"paper-slider-secondary-color": "var(--secondary-background-color)",
"paper-slider-pin-color": "var(--accent-color)",
"paper-item-icon-active-color": "#b58e31",
"accent-color": "#2980b9",
"paper-toggle-button-checked-bar-color": "var(--accent-color)",
"table-row-alternative-background-color": "#292929",
});
+2 -3
View File
@@ -12,8 +12,7 @@ export const demoThemeTeachingbirds = () => ({
"paper-slider-knob-color": "var(--primary-color)",
"paper-listbox-color": "#FFFFFF",
"paper-toggle-button-checked-bar-color": "var(--light-primary-color)",
"paper-toggle-button-checked-ink-color": "var(--dark-primary-color)",
"paper-toggle-button-unchecked-bar-color": "var(--primary-text-color)",
"switch-unchecked-track-color": "var(--primary-text-color)",
"paper-card-background-color": "#4e4e4e",
"label-badge-text-color": "var(--text-primary-color)",
"primary-background-color": "#303030",
@@ -22,7 +21,7 @@ export const demoThemeTeachingbirds = () => ({
"secondary-background-color": "#2b2b2b",
"paper-slider-knob-start-color": "var(--primary-color)",
"paper-item-icon-active-color": "#d8bf50",
"paper-toggle-button-checked-button-color": "var(--primary-color)",
"switch-checked-color": "var(--primary-color)",
"secondary-text-color": "#389638",
"disabled-text-color": "#545454",
"paper-item-icon_-_color": "var(--primary-text-color)",
+1 -1
View File
@@ -53,7 +53,7 @@ class CardModder extends LitElement {
for (var k in this._config.style) {
if (window.cardTools.hasTemplate(this._config.style[k]))
this.templated.push(k);
this.card.style.setProperty(k, '');
this.card.style.setProperty(k, "");
target.style.setProperty(
k,
window.cardTools.parseTemplate(this._config.style[k])
+2 -2
View File
@@ -161,8 +161,8 @@ if (!window.cardTools) {
};
cardTools.longpress = (element) => {
customElements.whenDefined("long-press").then(() => {
const longpress = document.body.querySelector("long-press");
customElements.whenDefined("action-handler").then(() => {
const longpress = document.body.querySelector("action-handler");
longpress.bind(element);
});
return element;
+6 -1
View File
@@ -54,7 +54,12 @@ class CastDemoRow extends LitElement implements EntityRow {
mgr.castContext.addEventListener(
cast.framework.CastContextEventType.SESSION_STATE_CHANGED,
(ev) => {
if (ev.sessionState === "SESSION_STARTED") {
// On Android, opening a new session always results in SESSION_RESUMED.
// So treat both as the same.
if (
ev.sessionState === "SESSION_STARTED" ||
ev.sessionState === "SESSION_RESUMED"
) {
castSendShowDemo(mgr);
}
}
+4 -18
View File
@@ -1,10 +1,4 @@
import {
LitElement,
html,
CSSResult,
css,
PropertyDeclarations,
} from "lit-element";
import { LitElement, html, CSSResult, css, property } from "lit-element";
import { until } from "lit-html/directives/until";
import "@material/mwc-button";
import "@polymer/paper-spinner/paper-spinner-lite";
@@ -20,19 +14,11 @@ import {
} from "../configs/demo-configs";
export class HADemoCard extends LitElement implements LovelaceCard {
public lovelace?: Lovelace;
public hass!: MockHomeAssistant;
private _switching?: boolean;
@property() public lovelace?: Lovelace;
@property() public hass!: MockHomeAssistant;
@property() private _switching?: boolean;
private _hidden = localStorage.hide_demo_card;
static get properties(): PropertyDeclarations {
return {
lovelace: {},
hass: {},
_switching: {},
};
}
public getCardSize() {
return this._hidden ? 0 : 2;
}
+3 -1
View File
@@ -12,5 +12,7 @@ import "./resources/hademo-icons";
/* polyfill for paper-dropdown */
setTimeout(() => {
import(/* webpackChunkName: "polyfill-web-animations-next" */ "web-animations-js/web-animations-next-lite.min");
import(
/* webpackChunkName: "polyfill-web-animations-next" */ "web-animations-js/web-animations-next-lite.min"
);
}, 1000);
+66 -61
View File
@@ -65,74 +65,79 @@ const generateHistory = (state, deltas) => {
const incrementalUnits = ["clients", "queries", "ads"];
export const mockHistory = (mockHass: MockHomeAssistant) => {
mockHass.mockAPI(new RegExp("history/period/.+"), (
hass,
// @ts-ignore
method,
path,
// @ts-ignore
parameters
) => {
const params = parseQuery<HistoryQueryParams>(path.split("?")[1]);
const entities = params.filter_entity_id.split(",");
mockHass.mockAPI(
new RegExp("history/period/.+"),
(
hass,
// @ts-ignore
method,
path,
// @ts-ignore
parameters
) => {
const params = parseQuery<HistoryQueryParams>(path.split("?")[1]);
const entities = params.filter_entity_id.split(",");
const results: HassEntity[][] = [];
const results: HassEntity[][] = [];
for (const entityId of entities) {
const state = hass.states[entityId];
for (const entityId of entities) {
const state = hass.states[entityId];
if (!state) {
continue;
}
if (!state) {
continue;
}
if (!state.attributes.unit_of_measurement) {
results.push(generateHistory(state, [state.state]));
continue;
}
if (!state.attributes.unit_of_measurement) {
results.push(generateHistory(state, [state.state]));
continue;
}
const numberState = Number(state.state);
const numberState = Number(state.state);
if (isNaN(numberState)) {
// tslint:disable-next-line
console.log(
"Ignoring state with unparsable state but with a unit",
entityId,
state
if (isNaN(numberState)) {
// tslint:disable-next-line
console.log(
"Ignoring state with unparsable state but with a unit",
entityId,
state
);
continue;
}
const statesToGenerate = 15;
let genFunc;
if (incrementalUnits.includes(state.attributes.unit_of_measurement)) {
let initial = Math.floor(
numberState * 0.4 + numberState * Math.random() * 0.2
);
const diff = Math.max(
1,
Math.floor((numberState - initial) / statesToGenerate)
);
genFunc = () => {
initial += diff;
return Math.min(numberState, initial);
};
} else {
const diff = Math.floor(
numberState * (numberState > 80 ? 0.05 : 0.5)
);
genFunc = () =>
numberState - diff + Math.floor(Math.random() * 2 * diff);
}
results.push(
generateHistory(
{
entity_id: state.entity_id,
attributes: state.attributes,
},
Array.from({ length: statesToGenerate }, genFunc)
)
);
continue;
}
const statesToGenerate = 15;
let genFunc;
if (incrementalUnits.includes(state.attributes.unit_of_measurement)) {
let initial = Math.floor(
numberState * 0.4 + numberState * Math.random() * 0.2
);
const diff = Math.max(
1,
Math.floor((numberState - initial) / statesToGenerate)
);
genFunc = () => {
initial += diff;
return Math.min(numberState, initial);
};
} else {
const diff = Math.floor(numberState * (numberState > 80 ? 0.05 : 0.5));
genFunc = () =>
numberState - diff + Math.floor(Math.random() * 2 * diff);
}
results.push(
generateHistory(
{
entity_id: state.entity_id,
attributes: state.attributes,
},
Array.from({ length: statesToGenerate }, genFunc)
)
);
return results;
}
return results;
});
);
};
+4 -3
View File
@@ -12,9 +12,10 @@ export const mockLovelace = (
localizePromise: Promise<LocalizeFunc>
) => {
hass.mockWS("lovelace/config", () =>
Promise.all([selectedDemoConfig, localizePromise]).then(
([config, localize]) => config.lovelace(localize)
)
Promise.all([
selectedDemoConfig,
localizePromise,
]).then(([config, localize]) => config.lovelace(localize))
);
hass.mockWS("lovelace/config/save", () => Promise.resolve());
+2 -2
View File
@@ -97,7 +97,7 @@ export const mockTranslations = (hass: MockHomeAssistant) => {
"component.nest.config.abort.authorize_url_timeout":
"Timeout generating authorize url.",
"component.nest.config.abort.no_flows":
"You need to configure Nest before being able to authenticate with it. [Please read the instructions](https://www.home-assistant.io/components/nest/).",
"You need to configure Nest before being able to authenticate with it. [Please read the instructions](https://www.home-assistant.io/integrations/nest/).",
"component.nest.config.error.internal_error":
"Internal error validating code",
"component.nest.config.error.invalid_code": "Invalid code",
@@ -199,7 +199,7 @@ export const mockTranslations = (hass: MockHomeAssistant) => {
"component.point.config.abort.external_setup":
"Point successfully configured from another flow.",
"component.point.config.abort.no_flows":
"You need to configure Point before being able to authenticate with it. [Please read the instructions](https://www.home-assistant.io/components/point/).",
"You need to configure Point before being able to authenticate with it. [Please read the instructions](https://www.home-assistant.io/integrations/point/).",
"component.point.config.create_entry.default":
"Successfully authenticated with Minut for your Point device(s)",
"component.point.config.error.follow_link":
+3 -4
View File
@@ -1,10 +1,9 @@
const { createDemoConfig } = require("../build-scripts/webpack.js");
const { isProdBuild, isStatsBuild } = require("../build-scripts/env.js");
// This file exists because we haven't migrated the stats script yet
// File just used for stats builds
const isProdBuild = process.env.NODE_ENV === "production";
const isStatsBuild = process.env.STATS === "1";
const latestBuild = false;
const latestBuild = true;
module.exports = createDemoConfig({
isProdBuild,
-18
View File
@@ -1,18 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#2157BC">
<title>HAGallery</title>
<script src='./main.js' async></script>
<style>
body {
font-family: Roboto, Noto, sans-serif;
margin: 0;
padding: 0;
}
</style>
</head>
<body></body>
</html>
+2 -10
View File
@@ -4,14 +4,6 @@
# Stop on errors
set -e
cd "$(dirname "$0")/.."
cd "$(dirname "$0")/../.."
OUTPUT_DIR=dist
rm -rf $OUTPUT_DIR
cd ..
./node_modules/.bin/gulp build-translations gen-icons
cd gallery
NODE_ENV=production ../node_modules/.bin/webpack -p --config webpack.config.js
./node_modules/.bin/gulp build-gallery
+2 -6
View File
@@ -4,10 +4,6 @@
# Stop on errors
set -e
cd "$(dirname "$0")/.."
cd "$(dirname "$0")/../.."
cd ..
./node_modules/.bin/gulp build-translations gen-icons
cd gallery
../node_modules/.bin/webpack-dev-server
./node_modules/.bin/gulp develop-gallery
+2 -2
View File
@@ -1,6 +1,6 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import JsYaml from "js-yaml";
import { safeLoad } from "js-yaml";
import { createCardElement } from "../../../src/panels/lovelace/common/create-card-element";
@@ -62,7 +62,7 @@ class DemoCard extends PolymerElement {
card.removeChild(card.lastChild);
}
const el = createCardElement(JsYaml.safeLoad(config.config)[0]);
const el = createCardElement(safeLoad(config.config)[0]);
el.hass = this.hass;
card.appendChild(el);
}
+8 -4
View File
@@ -1,9 +1,9 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "@polymer/app-layout/app-toolbar/app-toolbar";
import "@polymer/paper-toggle-button/paper-toggle-button";
import "./demo-card";
import "../../../src/components/ha-switch";
class DemoCards extends PolymerElement {
static get template() {
@@ -26,9 +26,9 @@ class DemoCards extends PolymerElement {
</style>
<app-toolbar>
<div class="filters">
<paper-toggle-button checked="{{_showConfig}}"
>Show config</paper-toggle-button
>
<ha-switch checked="[[_showConfig]]" on-change="_showConfigToggled">
Show config
</ha-switch>
</div>
</app-toolbar>
<div class="cards">
@@ -53,6 +53,10 @@ class DemoCards extends PolymerElement {
},
};
}
_showConfigToggled(ev) {
this._showConfig = ev.target.checked;
}
}
customElements.define("demo-cards", DemoCards);
+2 -4
View File
@@ -1,9 +1,9 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "@polymer/app-layout/app-toolbar/app-toolbar";
import "@polymer/paper-toggle-button/paper-toggle-button";
import "./demo-more-info";
import "../../../src/components/ha-switch";
class DemoMoreInfos extends PolymerElement {
static get template() {
@@ -26,9 +26,7 @@ class DemoMoreInfos extends PolymerElement {
</style>
<app-toolbar>
<div class="filters">
<paper-toggle-button checked="{{_showConfig}}"
>Show entity</paper-toggle-button
>
<ha-switch checked="{{_showConfig}}">Show entity</ha-switch>
</div>
</app-toolbar>
<div class="cards">
+1 -1
View File
@@ -36,7 +36,7 @@ export default {
attributes: {
title: "Welcome Home!",
message:
"Here are some resources to get started:\n\n - [Configuring Home Assistant](https://home-assistant.io/getting-started/configuration/)\n - [Available components](https://home-assistant.io/components/)\n - [Troubleshooting your configuration](https://home-assistant.io/docs/configuration/troubleshooting/)\n - [Getting help](https://home-assistant.io/help/)\n\nTo not see this card popup in the future, edit your config in\n`configuration.yaml` and disable the `introduction` component.",
"Here are some resources to get started:\n\n - [Configuring Home Assistant](https://home-assistant.io/getting-started/configuration/)\n - [Available integrations](https://home-assistant.io/integrations/)\n - [Troubleshooting your configuration](https://home-assistant.io/docs/configuration/troubleshooting/)\n - [Getting help](https://home-assistant.io/help/)\n\nTo not see this card popup in the future, edit your config in\n`configuration.yaml` and disable the `introduction` integration.",
},
last_changed: "2018-07-19T10:44:45.922241+00:00",
last_updated: "2018-07-19T10:44:45.922241+00:00",
+6 -10
View File
@@ -2,7 +2,8 @@ import { html, LitElement, TemplateResult } from "lit-element";
import "@material/mwc-button";
import "../../../src/components/ha-card";
import { longPress } from "../../../src/panels/lovelace/common/directives/long-press-directive";
import { actionHandler } from "../../../src/panels/lovelace/common/directives/action-handler-directive";
import { ActionHandlerEvent } from "../../../src/data/lovelace";
export class DemoUtilLongPress extends LitElement {
protected render(): TemplateResult | void {
@@ -12,9 +13,8 @@ export class DemoUtilLongPress extends LitElement {
() => html`
<ha-card>
<mwc-button
@ha-click="${this._handleTap}"
@ha-hold="${this._handleHold}"
.longPress="${longPress()}"
@action=${this._handleAction}
.actionHandler=${actionHandler({})}
>
(long) press me!
</mwc-button>
@@ -28,12 +28,8 @@ export class DemoUtilLongPress extends LitElement {
`;
}
private _handleTap(ev: Event) {
this._addValue(ev, "tap");
}
private _handleHold(ev: Event) {
this._addValue(ev, "hold");
private _handleAction(ev: ActionHandlerEvent) {
this._addValue(ev, ev.detail.action!);
}
private _addValue(ev: Event, value: string) {
+22
View File
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#2157BC" />
<title>HAGallery</title>
<script type="module" src="<%= latestGalleryJS %>"></script>
<style>
body {
font-family: Roboto, Noto, sans-serif;
margin: 0;
padding: 0;
}
</style>
</head>
<body></body>
</html>
+59 -53
View File
@@ -1,7 +1,7 @@
const path = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const { createGalleryConfig } = require("../build-scripts/webpack.js");
const { babelLoaderConfig } = require("../build-scripts/babel.js");
const webpackBase = require("../build-scripts/webpack.js");
const isProd = process.env.NODE_ENV === "production";
const chunkFilename = isProd ? "chunk.[chunkhash].js" : "[name].chunk.js";
@@ -9,58 +9,64 @@ const buildPath = path.resolve(__dirname, "dist");
const publicPath = isProd ? "./" : "http://localhost:8080/";
const latestBuild = true;
module.exports = {
mode: isProd ? "production" : "development",
// Disabled in prod while we make Home Assistant able to serve the right files.
// Was source-map
devtool: isProd ? "none" : "inline-source-map",
entry: "./src/entrypoint.js",
module: {
rules: [
babelLoaderConfig({ latestBuild }),
{
test: /\.css$/,
use: "raw-loader",
},
{
test: /\.(html)$/,
use: {
loader: "html-loader",
options: {
exportAsEs6Default: true,
module.exports = createGalleryConfig({
latestBuild: true,
});
const bla = () => {
const oldExports = {
mode: isProd ? "production" : "development",
// Disabled in prod while we make Home Assistant able to serve the right files.
// Was source-map
devtool: isProd ? "none" : "inline-source-map",
entry: "./src/entrypoint.js",
module: {
rules: [
babelLoaderConfig({ latestBuild }),
{
test: /\.css$/,
use: "raw-loader",
},
{
test: /\.(html)$/,
use: {
loader: "html-loader",
options: {
exportAsEs6Default: true,
},
},
},
},
],
},
optimization: webpackBase.optimization(latestBuild),
plugins: [
new CopyWebpackPlugin([
"public",
{ from: "../public", to: "static" },
{ from: "../build-translations/output", to: "static/translations" },
{
from: "../node_modules/leaflet/dist/leaflet.css",
to: "static/images/leaflet/",
},
{
from: "../node_modules/roboto-fontface/fonts/roboto/*.woff2",
to: "static/fonts/roboto/",
},
{
from: "../node_modules/leaflet/dist/images",
to: "static/images/leaflet/",
},
]),
].filter(Boolean),
resolve: webpackBase.resolve,
output: {
filename: "[name].js",
chunkFilename: chunkFilename,
path: buildPath,
publicPath,
},
devServer: {
contentBase: "./public",
},
],
},
optimization: webpackBase.optimization(latestBuild),
plugins: [
new CopyWebpackPlugin([
"public",
{ from: "../public", to: "static" },
{ from: "../build-translations/output", to: "static/translations" },
{
from: "../node_modules/leaflet/dist/leaflet.css",
to: "static/images/leaflet/",
},
{
from: "../node_modules/roboto-fontface/fonts/roboto/*.woff2",
to: "static/fonts/roboto/",
},
{
from: "../node_modules/leaflet/dist/images",
to: "static/images/leaflet/",
},
]),
].filter(Boolean),
resolve: webpackBase.resolve,
output: {
filename: "[name].js",
chunkFilename: chunkFilename,
path: buildPath,
publicPath,
},
devServer: {
contentBase: "./public",
},
};
};
+1
View File
@@ -3,6 +3,7 @@ const path = require("path");
module.exports = {
// Target directory for the build.
buildDir: path.resolve(__dirname, "build"),
nodeDir: path.resolve(__dirname, "../node_modules"),
// Path where the Hass.io frontend will be publicly available.
publicPath: "/api/hassio/app",
};
+2 -7
View File
@@ -4,11 +4,6 @@
# Stop on errors
set -e
cd "$(dirname "$0")/.."
cd "$(dirname "$0")/../.."
OUTPUT_DIR=build
rm -rf $OUTPUT_DIR
node script/gen-icons.js
NODE_ENV=production CI=false ../node_modules/.bin/webpack -p --config webpack.config.js
./node_modules/.bin/gulp build-hassio
+2 -7
View File
@@ -4,11 +4,6 @@
# Stop on errors
set -e
cd "$(dirname "$0")/.."
cd "$(dirname "$0")/../.."
OUTPUT_DIR=build
rm -rf $OUTPUT_DIR
mkdir $OUTPUT_DIR
node script/gen-icons.js
../node_modules/.bin/webpack --watch --progress
./node_modules/.bin/gulp develop-hassio
-20
View File
@@ -1,20 +0,0 @@
#!/usr/bin/env node
const fs = require("fs");
const {
findIcons,
generateIconset,
genMDIIcons,
} = require("../../build-scripts/gulp/gen-icons.js");
function genHassioIcons() {
const iconNames = findIcons("./src", "hassio");
for (const item of findIcons("../src", "hassio")) {
iconNames.add(item);
}
fs.writeFileSync("./hassio-icons.html", generateIconset("hassio", iconNames));
}
genMDIIcons();
genHassioIcons();
+2 -6
View File
@@ -44,9 +44,7 @@ class HassioAddonAudio extends EventsMixin(PolymerElement) {
selected="{{selectedInput}}"
>
<template is="dom-repeat" items="[[inputDevices]]">
<paper-item device\$="[[item.device]]"
>[[item.name]]</paper-item
>
<paper-item device$="[[item.device]]">[[item.name]]</paper-item>
</template>
</paper-listbox>
</paper-dropdown-menu>
@@ -57,9 +55,7 @@ class HassioAddonAudio extends EventsMixin(PolymerElement) {
selected="{{selectedOutput}}"
>
<template is="dom-repeat" items="[[outputDevices]]">
<paper-item device\$="[[item.device]]"
>[[item.name]]</paper-item
>
<paper-item device$="[[item.device]]">[[item.name]]</paper-item>
</template>
</paper-listbox>
</paper-dropdown-menu>
+32 -23
View File
@@ -2,19 +2,19 @@ import "@polymer/iron-icon/iron-icon";
import "@material/mwc-button";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-tooltip/paper-tooltip";
import "@polymer/paper-toggle-button/paper-toggle-button";
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../../../src/components/ha-label-badge";
import "../../../src/components/ha-markdown";
import "../../../src/components/buttons/ha-call-api-button";
import "../../../src/components/ha-switch";
import "../../../src/resources/ha-style";
import "../components/hassio-card-content";
import { EventsMixin } from "../../../src/mixins/events-mixin";
import { navigate } from "../../../src/common/navigate";
import { showHassioMarkdownDialog } from "../dialogs/markdown/show-dialog-hassio-markdown";
import "../components/hassio-card-content";
const PERMIS_DESC = {
rating: {
@@ -122,7 +122,7 @@ class HassioAddonInfo extends EventsMixin(PolymerElement) {
width: 16px;
color: var(--secondary-text-color);
}
paper-toggle-button {
ha-switch {
display: inline;
}
iron-icon.running {
@@ -348,44 +348,46 @@ class HassioAddonInfo extends EventsMixin(PolymerElement) {
<template is="dom-if" if="[[addon.version]]">
<div class="state">
<div>Start on boot</div>
<paper-toggle-button
<ha-switch
on-change="startOnBootToggled"
checked="[[computeStartOnBoot(addon.boot)]]"
></paper-toggle-button>
></ha-switch>
</div>
<div class="state">
<div>Auto update</div>
<paper-toggle-button
<ha-switch
on-change="autoUpdateToggled"
checked="[[addon.auto_update]]"
></paper-toggle-button>
></ha-switch>
</div>
<template is="dom-if" if="[[addon.ingress]]">
<div class="state">
<div>Show in sidebar</div>
<paper-toggle-button
<ha-switch
on-change="panelToggled"
checked="[[addon.ingress_panel]]"
disabled="[[_computeCannotIngressSidebar(hass, addon)]]"
></paper-toggle-button>
></ha-switch>
<template is="dom-if" if="[[_computeCannotIngressSidebar(hass, addon)]]">
<span>This option requires Home Assistant 0.92 or later.</span>
</template>
</div>
</template>
<div class="state">
<div>
Protection mode
<span>
<iron-icon icon="hassio:information"></iron-icon>
<paper-tooltip>Grant the add-on elevated system access.</paper-tooltip>
</span>
<template is="dom-if" if="[[_computeUsesProtectedOptions(addon)]]">
<div class="state">
<div>
Protection mode
<span>
<iron-icon icon="hassio:information"></iron-icon>
<paper-tooltip>Grant the add-on elevated system access.</paper-tooltip>
</span>
</div>
<ha-switch
on-change="protectionToggled"
checked="[[addon.protected]]"
></ha-switch>
</div>
<paper-toggle-button
on-change="protectionToggled"
checked="[[addon.protected]]"
></paper-toggle-button>
</div>
</template>
</template>
</div>
<div class="card-actions">
@@ -569,7 +571,10 @@ class HassioAddonInfo extends EventsMixin(PolymerElement) {
openChangelog() {
this.hass
.callApi("get", `hassio/addons/${this.addonSlug}/changelog`)
.then((resp) => resp, () => "Error getting changelog")
.then(
(resp) => resp,
() => "Error getting changelog"
)
.then((content) => {
showHassioMarkdownDialog(this, {
title: "Changelog",
@@ -607,6 +612,10 @@ class HassioAddonInfo extends EventsMixin(PolymerElement) {
return !addon.ingress || !this._computeHA92plus(hass);
}
_computeUsesProtectedOptions(addon) {
return addon.docker_api || addon.full_access || addon.host_pid;
}
_computeHA92plus(hass) {
const [major, minor] = hass.config.version.split(".", 2);
return Number(major) > 0 || (major === "0" && Number(minor) >= 92);
+2 -2
View File
@@ -102,7 +102,7 @@ export function parseTextToColoredPre(text) {
if (match[1] === undefined) continue;
for (const colorCode of match[1].split(";")) {
match[1].split(";").forEach((colorCode) => {
switch (parseInt(colorCode)) {
case 0:
// reset
@@ -195,7 +195,7 @@ export function parseTextToColoredPre(text) {
state.backgroundColor = null;
break;
}
}
});
}
addSpan(text.substring(i));
+8 -3
View File
@@ -8,26 +8,31 @@ import {
customElement,
} from "lit-element";
import "./hassio-addons";
import "./hassio-hass-update";
import "./hassio-update";
import { HomeAssistant } from "../../../src/types";
import {
HassioSupervisorInfo,
HassioHomeAssistantInfo,
HassioHassOSInfo,
} from "../../../src/data/hassio";
@customElement("hassio-dashboard")
class HassioDashboard extends LitElement {
@property() public hass!: HomeAssistant;
@property() public supervisorInfo!: HassioSupervisorInfo;
@property() public hassInfo!: HassioHomeAssistantInfo;
@property() public hassOsInfo!: HassioHassOSInfo;
protected render(): TemplateResult | void {
return html`
<div class="content">
<hassio-hass-update
<hassio-update
.hass=${this.hass}
.hassInfo=${this.hassInfo}
></hassio-hass-update>
.supervisorInfo=${this.supervisorInfo}
.hassOsInfo=${this.hassOsInfo}
></hassio-update>
<hassio-addons
.hass=${this.hass}
.addons=${this.supervisorInfo.addons}
@@ -1,96 +0,0 @@
import "@material/mwc-button";
import "@polymer/paper-card/paper-card";
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../../../src/components/buttons/ha-call-api-button";
import "../components/hassio-card-content";
import "../resources/hassio-style";
class HassioHassUpdate extends PolymerElement {
static get template() {
return html`
<style include="ha-style hassio-style">
paper-card {
display: block;
margin-bottom: 32px;
}
.errors {
color: var(--google-red-500);
margin-top: 16px;
}
a {
color: var(--primary-color);
}
</style>
<template is="dom-if" if="[[computeUpdateAvailable(hassInfo)]]">
<div class="content">
<div class="card-group">
<paper-card heading="Update available! 🎉">
<div class="card-content">
Home Assistant [[hassInfo.last_version]] is available and you
are currently running Home Assistant [[hassInfo.version]].
<template is="dom-if" if="[[error]]">
<div class="error">Error: [[error]]</div>
</template>
</div>
<div class="card-actions">
<ha-call-api-button
hass="[[hass]]"
path="hassio/homeassistant/update"
>Update</ha-call-api-button
>
<a
href="[[computeReleaseNotesUrl(hassInfo.version)]]"
target="_blank"
>
<mwc-button>Release notes</mwc-button>
</a>
</div>
</paper-card>
</div>
</div>
</template>
`;
}
static get properties() {
return {
hass: Object,
hassInfo: Object,
error: String,
};
}
ready() {
super.ready();
this.addEventListener("hass-api-called", (ev) => this.apiCalled(ev));
}
apiCalled(ev) {
if (ev.detail.success) {
this.errors = null;
return;
}
const response = ev.detail.response;
if (typeof response.body === "object") {
this.errors = response.body.message || "Unknown error";
} else {
this.errors = response.body;
}
}
computeUpdateAvailable(hassInfo) {
return hassInfo.version !== hassInfo.last_version;
}
computeReleaseNotesUrl(version) {
return `https://${
version.includes("b") ? "rc" : "www"
}.home-assistant.io/latest-release-notes/`;
}
}
customElements.define("hassio-hass-update", HassioHassUpdate);
+186
View File
@@ -0,0 +1,186 @@
import {
LitElement,
TemplateResult,
html,
CSSResult,
css,
property,
customElement,
} from "lit-element";
import "@polymer/iron-icon/iron-icon";
import { HomeAssistant } from "../../../src/types";
import {
HassioHomeAssistantInfo,
HassioHassOSInfo,
HassioSupervisorInfo,
} from "../../../src/data/hassio";
import { hassioStyle } from "../resources/hassio-style";
import "@material/mwc-button";
import "@polymer/paper-card/paper-card";
import "../../../src/components/buttons/ha-call-api-button";
import "../components/hassio-card-content";
@customElement("hassio-update")
export class HassioUpdate extends LitElement {
@property() public hass!: HomeAssistant;
@property() public hassInfo: HassioHomeAssistantInfo;
@property() public hassOsInfo?: HassioHassOSInfo;
@property() public supervisorInfo: HassioSupervisorInfo;
@property() public error?: string;
protected render(): TemplateResult | void {
const updatesAvailable: number = [
this.hassInfo,
this.supervisorInfo,
this.hassOsInfo,
].filter((value) => {
return !!value && value.version !== value.last_version;
}).length;
if (!updatesAvailable) {
return html``;
}
return html`
<div class="content">
${this.error
? html`
<div class="error">Error: ${this.error}</div>
`
: ""}
<div class="card-group">
<div class="title">
${updatesAvailable > 1
? "Updates Available 🎉"
: "Update Available 🎉"}
</div>
${this._renderUpdateCard(
"Home Assistant",
this.hassInfo.version,
this.hassInfo.last_version,
"hassio/homeassistant/update",
`https://${
this.hassInfo.last_version.includes("b") ? "rc" : "www"
}.home-assistant.io/latest-release-notes/`,
"hassio:home-assistant"
)}
${this._renderUpdateCard(
"Hass.io Supervisor",
this.supervisorInfo.version,
this.supervisorInfo.last_version,
"hassio/supervisor/update",
`https://github.com//home-assistant/hassio/releases/tag/${this.supervisorInfo.last_version}`
)}
${this.hassOsInfo
? this._renderUpdateCard(
"HassOS",
this.hassOsInfo.version,
this.hassOsInfo.version_latest,
"hassio/hassos/update",
`https://github.com//home-assistant/hassos/releases/tag/${this.hassOsInfo.version_latest}`
)
: ""}
</div>
</div>
`;
}
private _renderUpdateCard(
name: string,
curVersion: string,
lastVersion: string,
apiPath: string,
releaseNotesUrl: string,
icon?: string
): TemplateResult {
if (lastVersion === curVersion) {
return html``;
}
return html`
<paper-card>
<div class="card-content">
${icon
? html`
<div class="icon">
<iron-icon .icon="${icon}" />
</div>
`
: ""}
<div class="update-heading">${name} ${lastVersion}</div>
<div class="warning">
You are currently running version ${curVersion}
</div>
</div>
<div class="card-actions">
<a href="${releaseNotesUrl}" target="_blank">
<mwc-button>Release notes</mwc-button>
</a>
<ha-call-api-button
.hass=${this.hass}
.path=${apiPath}
@hass-api-called=${this._apiCalled}
>
Update
</ha-call-api-button>
</div>
</paper-card>
`;
}
private _apiCalled(ev) {
if (ev.detail.success) {
this.error = "";
return;
}
const response = ev.detail.response;
typeof response.body === "object"
? (this.error = response.body.message || "Unknown error")
: (this.error = response.body);
}
static get styles(): CSSResult[] {
return [
hassioStyle,
css`
:host {
width: 33%;
}
paper-card {
display: inline-block;
margin-bottom: 32px;
}
.icon {
--iron-icon-height: 48px;
--iron-icon-width: 48px;
float: right;
margin: 0 0 2px 10px;
}
.update-heading {
font-size: var(--paper-font-subhead_-_font-size);
font-weight: 500;
margin-bottom: 0.5em;
}
.warning {
color: var(--secondary-text-color);
}
.card-actions {
text-align: right;
}
.errors {
color: var(--google-red-500);
padding: 16px;
}
a {
text-decoration: none;
}
`,
];
}
}
@@ -12,7 +12,9 @@ export const showHassioMarkdownDialog = (
fireEvent(element, "show-dialog", {
dialogTag: "dialog-hassio-markdown",
dialogImport: () =>
import(/* webpackChunkName: "dialog-hassio-markdown" */ "./dialog-hassio-markdown"),
import(
/* webpackChunkName: "dialog-hassio-markdown" */ "./dialog-hassio-markdown"
),
dialogParams,
});
};
+42 -24
View File
@@ -3,6 +3,7 @@ import "@material/mwc-button";
import "@polymer/paper-checkbox/paper-checkbox";
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
import "@polymer/paper-icon-button/paper-icon-button";
import "@polymer/iron-icon/iron-icon";
import "@polymer/paper-input/paper-input";
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
@@ -94,13 +95,23 @@ class HassioSnapshotDialog extends PolymerElement {
.details {
color: var(--secondary-text-color);
}
.download {
color: var(--primary-color);
}
.warning,
.error {
color: var(--google-red-500);
}
.buttons {
display: flex;
flex-direction: column;
}
.buttons li {
list-style-type: none;
}
.buttons .icon {
margin-right: 16px;
}
.no-margin-top {
margin-top: 0;
}
</style>
<ha-paper-dialog
id="dialog"
@@ -132,7 +143,7 @@ class HassioSnapshotDialog extends PolymerElement {
</template>
<template is="dom-if" if="[[_addons.length]]">
<div>Add-ons:</div>
<paper-dialog-scrollable>
<paper-dialog-scrollable class="no-margin-top">
<template is="dom-repeat" items="[[_addons]]" sort="_sortAddons">
<paper-checkbox checked="{{item.checked}}">
[[item.name]] <span class="details">([[item.version]])</span>
@@ -151,28 +162,35 @@ class HassioSnapshotDialog extends PolymerElement {
<template is="dom-if" if="[[error]]">
<p class="error">Error: [[error]]</p>
</template>
<div class="buttons">
<paper-icon-button
icon="hassio:delete"
on-click="_deleteClicked"
class="warning"
title="Delete snapshot"
></paper-icon-button>
<paper-icon-button
on-click="_downloadClicked"
icon="hassio:download"
class="download"
title="Download snapshot"
></paper-icon-button>
<mwc-button on-click="_partialRestoreClicked"
>Restore selected</mwc-button
>
<div>Actions:</div>
<ul class="buttons">
<li>
<mwc-button on-click="_downloadClicked">
<iron-icon icon="hassio:download" class="icon"></iron-icon>
Download Snapshot
</mwc-button>
</li>
<li>
<mwc-button on-click="_partialRestoreClicked">
<iron-icon icon="hassio:history" class="icon"> </iron-icon>
Restore Selected
</mwc-button>
</li>
<template is="dom-if" if="[[_isFullSnapshot(snapshot.type)]]">
<mwc-button on-click="_fullRestoreClicked"
>Wipe &amp; restore</mwc-button
>
<li>
<mwc-button on-click="_fullRestoreClicked">
<iron-icon icon="hassio:history" class="icon"> </iron-icon>
Wipe &amp; restore
</mwc-button>
</li>
</template>
</div>
<li>
<mwc-button on-click="_deleteClicked">
<iron-icon icon="hassio:delete" class="icon warning"> </iron-icon>
<span class="warning">Delete Snapshot</span>
</mwc-button>
</li>
</ul>
</ha-paper-dialog>
`;
}
@@ -12,7 +12,9 @@ export const showHassioSnapshotDialog = (
fireEvent(element, "show-dialog", {
dialogTag: "dialog-hassio-snapshot",
dialogImport: () =>
import(/* webpackChunkName: "dialog-hassio-snapshot" */ "./dialog-hassio-snapshot"),
import(
/* webpackChunkName: "dialog-hassio-snapshot" */ "./dialog-hassio-snapshot"
),
dialogParams,
});
};
+2
View File
@@ -1,5 +1,7 @@
window.loadES5Adapter().then(() => {
// eslint-disable-next-line
import(/* webpackChunkName: "hassio-icons" */ "./resources/hassio-icons");
// eslint-disable-next-line
import(/* webpackChunkName: "hassio-main" */ "./hassio-main");
});
const styleEl = document.createElement("style");
+25 -5
View File
@@ -3,7 +3,7 @@ import { PolymerElement } from "@polymer/polymer";
import "@polymer/paper-icon-button";
import "../../src/resources/ha-style";
import applyThemesOnElement from "../../src/common/dom/apply_themes_on_element";
import { applyThemesOnElement } from "../../src/common/dom/apply_themes_on_element";
import { fireEvent } from "../../src/common/dom/fire_event";
import {
HassRouterPage,
@@ -13,9 +13,11 @@ import { HomeAssistant } from "../../src/types";
import {
fetchHassioSupervisorInfo,
fetchHassioHostInfo,
fetchHassioHassOsInfo,
fetchHassioHomeAssistantInfo,
HassioSupervisorInfo,
HassioHostInfo,
HassioHassOSInfo,
HassioHomeAssistantInfo,
fetchHassioAddonInfo,
createHassioSession,
@@ -25,6 +27,7 @@ import { makeDialogManager } from "../../src/dialogs/make-dialog-manager";
import { ProvideHassLitMixin } from "../../src/mixins/provide-hass-lit-mixin";
// Don't codesplit it, that way the dashboard always loads fast.
import "./hassio-pages-with-tabs";
import { navigate } from "../../src/common/navigate";
// The register callback of the IronA11yKeysBehavior inside paper-icon-button
// is not called, causing _keyBindings to be uninitiliazed for paper-icon-button,
@@ -54,18 +57,23 @@ class HassioMain extends ProvideHassLitMixin(HassRouterPage) {
addon: {
tag: "hassio-addon-view",
load: () =>
import(/* webpackChunkName: "hassio-addon-view" */ "./addon-view/hassio-addon-view"),
import(
/* webpackChunkName: "hassio-addon-view" */ "./addon-view/hassio-addon-view"
),
},
ingress: {
tag: "hassio-ingress-view",
load: () =>
import(/* webpackChunkName: "hassio-ingress-view" */ "./ingress-view/hassio-ingress-view"),
import(
/* webpackChunkName: "hassio-ingress-view" */ "./ingress-view/hassio-ingress-view"
),
},
},
};
@property() private _supervisorInfo: HassioSupervisorInfo;
@property() private _hostInfo: HassioHostInfo;
@property() private _hassOsInfo?: HassioHassOSInfo;
@property() private _hassInfo: HassioHomeAssistantInfo;
protected firstUpdated(changedProps: PropertyValues) {
@@ -113,6 +121,7 @@ class HassioMain extends ProvideHassLitMixin(HassRouterPage) {
supervisorInfo: this._supervisorInfo,
hostInfo: this._hostInfo,
hassInfo: this._hassInfo,
hassOsInfo: this._hassOsInfo,
route,
});
} else {
@@ -121,6 +130,7 @@ class HassioMain extends ProvideHassLitMixin(HassRouterPage) {
el.supervisorInfo = this._supervisorInfo;
el.hostInfo = this._hostInfo;
el.hassInfo = this._hassInfo;
el.hassOsInfo = this._hassOsInfo;
el.route = route;
}
}
@@ -139,6 +149,10 @@ class HassioMain extends ProvideHassLitMixin(HassRouterPage) {
this._supervisorInfo = supervisorInfo;
this._hostInfo = hostInfo;
this._hassInfo = hassInfo;
if (this._hostInfo.features && this._hostInfo.features.includes("hassos")) {
this._hassOsInfo = await fetchHassioHassOsInfo(this.hass);
}
}
private async _redirectIngress(addonSlug: string) {
@@ -152,14 +166,20 @@ class HassioMain extends ProvideHassLitMixin(HassRouterPage) {
}),
]);
if (!addon.ingress_url) {
throw new Error("Add-on does not support Ingress");
alert("Add-on does not support Ingress");
return;
}
if (addon.state !== "started") {
alert("Add-on is not running. Please start it first");
navigate(this, `/hassio/addon/${addon.slug}`, true);
return;
}
location.assign(addon.ingress_url);
// await a promise that doesn't resolve, so we show the loading screen
// while we load the next page.
await new Promise(() => undefined);
} catch (err) {
alert(`Unable to open ingress connection `);
alert("Unable to open ingress connection");
}
}
+3
View File
@@ -27,6 +27,7 @@ import {
HassioSupervisorInfo,
HassioHostInfo,
HassioHomeAssistantInfo,
HassioHassOSInfo,
} from "../../src/data/hassio";
const HAS_REFRESH_BUTTON = ["store", "snapshots"];
@@ -39,6 +40,7 @@ class HassioPagesWithTabs extends LitElement {
@property() public supervisorInfo!: HassioSupervisorInfo;
@property() public hostInfo!: HassioHostInfo;
@property() public hassInfo!: HassioHomeAssistantInfo;
@property() public hassOsInfo!: HassioHassOSInfo;
protected render(): TemplateResult | void {
const page = this._page;
@@ -79,6 +81,7 @@ class HassioPagesWithTabs extends LitElement {
.supervisorInfo=${this.supervisorInfo}
.hostInfo=${this.hostInfo}
.hassInfo=${this.hassInfo}
.hassOsInfo=${this.hassOsInfo}
></hassio-tabs-router>
</app-header-layout>
`;
+4
View File
@@ -15,6 +15,7 @@ import {
HassioSupervisorInfo,
HassioHostInfo,
HassioHomeAssistantInfo,
HassioHassOSInfo,
} from "../../src/data/hassio";
@customElement("hassio-tabs-router")
@@ -23,6 +24,7 @@ class HassioTabsRouter extends HassRouterPage {
@property() public supervisorInfo: HassioSupervisorInfo;
@property() public hostInfo: HassioHostInfo;
@property() public hassInfo: HassioHomeAssistantInfo;
@property() public hassOsInfo!: HassioHassOSInfo;
protected routerOptions: RouterOptions = {
routes: {
@@ -49,12 +51,14 @@ class HassioTabsRouter extends HassRouterPage {
supervisorInfo: this.supervisorInfo,
hostInfo: this.hostInfo,
hassInfo: this.hassInfo,
hassOsInfo: this.hassOsInfo,
});
} else {
el.hass = this.hass;
el.supervisorInfo = this.supervisorInfo;
el.hostInfo = this.hostInfo;
el.hassInfo = this.hassInfo;
el.hassOsInfo = this.hassOsInfo;
}
}
}
+3 -16
View File
@@ -107,7 +107,7 @@ class HassioHostInfo extends EventsMixin(PolymerElement) {
>Import from USB</ha-call-api-button
>
</template>
<template is="dom-if" if="[[_computeUpdateAvailable(_hassOs)]]">
<template is="dom-if" if="[[_computeUpdateAvailable(hassOsInfo)]]">
<ha-call-api-button hass="[[hass]]" path="hassio/hassos/update"
>Update</ha-call-api-button
>
@@ -120,12 +120,9 @@ class HassioHostInfo extends EventsMixin(PolymerElement) {
static get properties() {
return {
hass: Object,
data: {
type: Object,
observer: "_dataChanged",
},
data: Object,
hassOsInfo: Object,
errors: String,
_hassOs: Object,
};
}
@@ -149,16 +146,6 @@ class HassioHostInfo extends EventsMixin(PolymerElement) {
}
}
_dataChanged(data) {
if (data.features && data.features.includes("hassos")) {
this.hass.callApi("get", "hassio/hassos/info").then((resp) => {
this._hassOs = resp.data;
});
} else {
this._hassOs = {};
}
}
_computeUpdateAvailable(data) {
return data && data.version !== data.version_latest;
}
+2
View File
@@ -30,6 +30,7 @@ class HassioSystem extends PolymerElement {
<hassio-host-info
hass="[[hass]]"
data="[[hostInfo]]"
hass-os-info="[[hassOsInfo]]"
></hassio-host-info>
<div class="title">System log</div>
<hassio-supervisor-log hass="[[hass]]"></hassio-supervisor-log>
@@ -42,6 +43,7 @@ class HassioSystem extends PolymerElement {
hass: Object,
supervisorInfo: Object,
hostInfo: Object,
hassOsInfo: Object,
};
}
}
+7 -59
View File
@@ -1,63 +1,11 @@
const webpack = require("webpack");
const CompressionPlugin = require("compression-webpack-plugin");
const zopfli = require("@gfx/zopfli");
const { createHassioConfig } = require("../build-scripts/webpack.js");
const { isProdBuild } = require("../build-scripts/env.js");
const config = require("./config.js");
const { babelLoaderConfig } = require("../build-scripts/babel.js");
const webpackBase = require("../build-scripts/webpack.js");
// File just used for stats builds
const isProdBuild = process.env.NODE_ENV === "production";
const isCI = process.env.CI === "true";
const chunkFilename = isProdBuild ? "chunk.[chunkhash].js" : "[name].chunk.js";
const latestBuild = false;
module.exports = {
mode: isProdBuild ? "production" : "development",
devtool: isProdBuild ? "source-map" : "inline-source-map",
entry: {
entrypoint: "./src/entrypoint.js",
},
module: {
rules: [
babelLoaderConfig({ latestBuild }),
{
test: /\.(html)$/,
use: {
loader: "html-loader",
options: {
exportAsEs6Default: true,
},
},
},
],
},
optimization: webpackBase.optimization(latestBuild),
plugins: [
new webpack.DefinePlugin({
__DEV__: JSON.stringify(!isProdBuild),
__DEMO__: false,
__BUILD__: JSON.stringify(latestBuild ? "latest" : "es5"),
"process.env.NODE_ENV": JSON.stringify(
isProdBuild ? "production" : "development"
),
}),
isProdBuild &&
!isCI &&
new CompressionPlugin({
cache: true,
exclude: [/\.js\.map$/, /\.LICENSE$/, /\.py$/, /\.txt$/],
algorithm(input, compressionOptions, callback) {
return zopfli.gzip(input, compressionOptions, callback);
},
}),
].filter(Boolean),
resolve: {
extensions: [".ts", ".js", ".json"],
},
output: {
filename: "[name].js",
chunkFilename,
path: config.buildDir,
publicPath: `${config.publicPath}/`,
},
};
module.exports = createHassioConfig({
isProdBuild,
latestBuild,
});
+53 -47
View File
@@ -8,7 +8,7 @@
"version": "1.0.0",
"scripts": {
"build": "script/build_frontend",
"lint": "eslint src hassio/src gallery/src && tslint 'src/**/*.ts' 'hassio/src/**/*.ts' 'gallery/src/**/*.ts' 'cast/src/**/*.ts' 'test-mocha/**/*.ts' && polymer lint && tsc",
"lint": "eslint src hassio/src gallery/src && tslint 'src/**/*.ts' 'hassio/src/**/*.ts' 'gallery/src/**/*.ts' 'cast/src/**/*.ts' 'test-mocha/**/*.ts' && tsc",
"mocha": "node_modules/.bin/ts-mocha -p test-mocha/tsconfig.test.json --opts test-mocha/mocha.opts",
"test": "npm run lint && npm run mocha",
"docker_build": "sh ./script/docker_run.sh build $npm_package_version",
@@ -17,10 +17,16 @@
"author": "Paulus Schoutsen <Paulus@PaulusSchoutsen.nl> (http://paulusschoutsen.nl)",
"license": "Apache-2.0",
"dependencies": {
"@material/mwc-base": "^0.6.0",
"@material/mwc-button": "^0.6.0",
"@material/mwc-ripple": "^0.6.0",
"@mdi/svg": "3.7.95",
"@material/chips": "^3.2.0",
"@material/data-table": "^3.2.0",
"@material/mwc-base": "^0.10.0",
"@material/mwc-button": "^0.10.0",
"@material/mwc-checkbox": "^0.10.0",
"@material/mwc-dialog": "^0.10.0",
"@material/mwc-fab": "^0.10.0",
"@material/mwc-ripple": "^0.10.0",
"@material/mwc-switch": "^0.10.0",
"@mdi/svg": "4.7.95",
"@polymer/app-layout": "^3.0.2",
"@polymer/app-localize-behavior": "^3.0.1",
"@polymer/app-route": "^3.0.2",
@@ -45,7 +51,6 @@
"@polymer/paper-dialog-scrollable": "^3.0.1",
"@polymer/paper-drawer-panel": "^3.0.1",
"@polymer/paper-dropdown-menu": "^3.0.1",
"@polymer/paper-fab": "^3.0.1",
"@polymer/paper-icon-button": "^3.0.2",
"@polymer/paper-input": "^3.0.1",
"@polymer/paper-item": "^3.0.1",
@@ -61,16 +66,16 @@
"@polymer/paper-styles": "^3.0.1",
"@polymer/paper-tabs": "^3.0.1",
"@polymer/paper-toast": "^3.0.1",
"@polymer/paper-toggle-button": "^3.0.1",
"@polymer/paper-tooltip": "^3.0.1",
"@polymer/polymer": "3.1.0",
"@vaadin/vaadin-combo-box": "^4.2.8",
"@vaadin/vaadin-date-picker": "^3.3.3",
"@thomasloven/round-slider": "0.3.7",
"@vaadin/vaadin-combo-box": "^5.0.6",
"@vaadin/vaadin-date-picker": "^4.0.3",
"@webcomponents/shadycss": "^1.9.0",
"@webcomponents/webcomponentsjs": "^2.2.7",
"chart.js": "~2.8.0",
"chartjs-chart-timeline": "^0.3.0",
"codemirror": "^5.45.0",
"codemirror": "^5.49.0",
"cpx": "^1.5.0",
"deep-clone-simple": "^1.1.1",
"es6-object-assign": "^1.1.0",
@@ -78,13 +83,13 @@
"fuse.js": "^3.4.4",
"google-timezones-json": "^1.0.2",
"hls.js": "^0.12.4",
"home-assistant-js-websocket": "4.3.1",
"home-assistant-js-websocket": "^4.4.0",
"intl-messageformat": "^2.2.0",
"jquery": "^3.3.1",
"js-yaml": "^3.13.0",
"js-yaml": "^3.13.1",
"leaflet": "^1.4.0",
"lit-element": "^2.2.0",
"lit-element": "^2.2.1",
"lit-html": "^1.1.0",
"lit-virtualizer": "^0.4.2",
"marked": "^0.6.1",
"mdn-polyfills": "^5.16.0",
"memoize-one": "^5.0.2",
@@ -94,43 +99,44 @@
"react-big-calendar": "^0.20.4",
"regenerator-runtime": "^0.13.2",
"roboto-fontface": "^0.10.0",
"round-slider": "^1.3.3",
"superstruct": "^0.6.1",
"tslib": "^1.10.0",
"unfetch": "^4.1.0",
"web-animations-js": "^2.3.1",
"xss": "^1.0.6"
},
"devDependencies": {
"@babel/core": "^7.4.0",
"@babel/plugin-external-helpers": "^7.2.0",
"@babel/plugin-proposal-class-properties": "^7.4.0",
"@babel/plugin-proposal-decorators": "^7.4.0",
"@babel/plugin-proposal-object-rest-spread": "^7.4.0",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-transform-react-jsx": "^7.3.0",
"@babel/preset-env": "^7.4.2",
"@babel/preset-typescript": "^7.3.3",
"@gfx/zopfli": "^1.0.11",
"@babel/core": "^7.7.4",
"@babel/plugin-external-helpers": "^7.7.4",
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/plugin-proposal-decorators": "^7.7.4",
"@babel/plugin-proposal-object-rest-spread": "^7.7.4",
"@babel/plugin-proposal-optional-chaining": "^7.7.4",
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
"@babel/plugin-transform-react-jsx": "^7.7.4",
"@babel/preset-env": "^7.7.4",
"@babel/preset-typescript": "^7.7.4",
"@types/chai": "^4.1.7",
"@types/chromecast-caf-receiver": "^3.0.12",
"@types/chromecast-caf-sender": "^1.0.1",
"@types/codemirror": "^0.0.78",
"@types/hls.js": "^0.12.3",
"@types/js-yaml": "^3.12.1",
"@types/leaflet": "^1.4.3",
"@types/memoize-one": "4.1.0",
"@types/mocha": "^5.2.6",
"babel-eslint": "^10",
"@types/webspeechapi": "^0.0.29",
"babel-loader": "^8.0.5",
"chai": "^4.2.0",
"compression-webpack-plugin": "^2.0.0",
"copy-webpack-plugin": "^5.0.2",
"del": "^4.0.0",
"eslint": "^5.15.3",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-prettier": "^4.1.0",
"eslint-import-resolver-webpack": "^0.11.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.4",
"eslint": "^6.3.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.2.0",
"eslint-import-resolver-webpack": "^0.11.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.14.3",
"fs-extra": "^7.0.1",
"gulp": "^4.0.0",
"gulp-foreach": "^0.1.0",
@@ -146,37 +152,37 @@
"html-webpack-plugin": "^3.2.0",
"husky": "^1.3.1",
"lint-staged": "^8.1.5",
"lodash.template": "^4.4.0",
"lodash.template": "^4.5.0",
"map-stream": "^0.0.7",
"merge-stream": "^1.0.1",
"mocha": "^6.0.2",
"parse5": "^5.1.0",
"polymer-cli": "^1.9.7",
"prettier": "^1.16.4",
"prettier": "^1.19.1",
"raw-loader": "^2.0.0",
"reify": "^0.18.1",
"require-dir": "^1.2.0",
"sinon": "^7.3.1",
"terser-webpack-plugin": "^1.2.3",
"ts-mocha": "^6.0.0",
"tslint": "^5.14.0",
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0",
"tslint-eslint-rules": "^5.4.0",
"tslint-plugin-prettier": "^2.0.1",
"typescript": "^3.4.1",
"uglifyjs-webpack-plugin": "^2.1.2",
"wct-browser-legacy": "^1.0.2",
"typescript": "^3.7.2",
"web-component-tester": "^6.9.2",
"webpack": "^4.29.6",
"webpack-cli": "^3.3.0",
"webpack-dev-server": "^3.2.1",
"webpack": "^4.40.2",
"webpack-cli": "^3.3.9",
"webpack-dev-server": "^3.8.1",
"webpack-manifest-plugin": "^2.0.4",
"workbox-webpack-plugin": "^4.1.1"
"workbox-webpack-plugin": "^4.1.1",
"workerize-loader": "^1.1.0"
},
"_comment": "Polymer fixed to 3.1 because 3.2 throws on logbook page",
"_comment_2": "Fix in https://github.com/Polymer/polymer/pull/5569",
"resolutions": {
"@webcomponents/webcomponentsjs": "^2.2.10",
"@vaadin/vaadin-lumo-styles": "^1.4.2",
"@polymer/polymer": "3.1.0"
"@polymer/polymer": "3.1.0",
"lit-html": "^1.1.2"
},
"main": "src/home-assistant.js",
"husky": {
+1 -1
View File
@@ -13,4 +13,4 @@ script/build_frontend
rm -rf dist
python3 setup.py sdist
python3 -m twine upload dist/*
python3 -m twine upload dist/* --skip-existing
Executable
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
# Resolve all frontend dependencies that the application requires to develop.
# Stop on errors
set -e
cd "$(dirname "$0")/.."
script/bootstrap
+12 -6
View File
@@ -21,7 +21,7 @@ fi
[ -z "${LOKALISE_TOKEN-}" ] && LOKALISE_TOKEN="$(<.lokalise_token)"
PROJECT_ID="3420425759f6d6d241f598.13594006"
LOCAL_DIR="$(pwd)/translations"
LOCAL_DIR="$(pwd)/translations/downloads"
FILE_FORMAT=json
mkdir -p ${LOCAL_DIR}
@@ -29,9 +29,15 @@ mkdir -p ${LOCAL_DIR}
docker run \
-v ${LOCAL_DIR}:/opt/dest/locale \
--rm \
lokalise/lokalise-cli@sha256:b8329d20280263cad04f65b843e54b9e8e6909a348a678eac959550b5ef5c75f lokalise \
lokalise/lokalise-cli-2@sha256:f1860b26be22fa73b8c93bc5f8690f2afc867610a42de6fc27adc790e5d4425d lokalise2 \
--token ${LOKALISE_TOKEN} \
export ${PROJECT_ID} \
--export_empty skip \
--type json \
--unzip_to /opt/dest
--project-id ${PROJECT_ID} \
file download \
--export-empty-as skip \
--format json \
--json-unescaped-slashes=true \
--replace-breaks=false \
--original-filenames=false \
--unzip-to /opt/dest
./node_modules/.bin/gulp check-downloaded-translations
+8 -7
View File
@@ -26,17 +26,18 @@ LANG_ISO=en
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "${CURRENT_BRANCH-}" != "master" ] && [ "${TRAVIS_BRANCH-}" != "master" ] ; then
echo "Please only run the translations upload script from a clean checkout of master."
if [ "${CURRENT_BRANCH-}" != "dev" ] && [ "${AZURE_BRANCH-}" != "dev" ] ; then
echo "Please only run the translations upload script from a clean checkout of dev."
exit 1
fi
docker run \
-v ${LOCAL_FILE}:/opt/src/${LOCAL_FILE} \
lokalise/lokalise-cli@sha256:2198814ebddfda56ee041a4b427521757dd57f75415ea9693696a64c550cef21 lokalise \
lokalise/lokalise-cli-2@sha256:f1860b26be22fa73b8c93bc5f8690f2afc867610a42de6fc27adc790e5d4425d lokalise2 \
--token ${LOKALISE_TOKEN} \
import ${PROJECT_ID} \
--project-id ${PROJECT_ID} \
file upload \
--file /opt/src/${LOCAL_FILE} \
--lang_iso ${LANG_ISO} \
--convert_placeholders 0 \
--replace 1
--lang-iso ${LANG_ISO} \
--convert-placeholders=false \
--replace-modified=true
-11
View File
@@ -1,11 +0,0 @@
#!/usr/bin/env bash
# Safe bash settings
# -e Exit on command fail
# -u Exit on unset variable
# -o pipefail Exit if piped command has error code
set -eu -o pipefail
cd "$(dirname "$0")/.."
script/translations_upload_base
+1 -1
View File
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name="home-assistant-frontend",
version="20190804.0",
version="20200108.0",
description="The Home Assistant frontend",
url="https://github.com/home-assistant/home-assistant-polymer",
author="The Home Assistant Authors",
+21 -21
View File
@@ -7,11 +7,14 @@ import {
css,
} from "lit-element";
import "@material/mwc-button";
import "../components/ha-form";
import "../components/ha-form/ha-form";
import "../components/ha-markdown";
import { litLocalizeLiteMixin } from "../mixins/lit-localize-lite-mixin";
import { AuthProvider } from "../data/auth";
import { ConfigFlowStep, ConfigFlowStepForm } from "../data/config_entries";
import {
DataEntryFlowStep,
DataEntryFlowStepForm,
} from "../data/data_entry_flow";
type State = "loading" | "error" | "step";
@@ -22,7 +25,7 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
@property() public oauth2State?: string;
@property() private _state: State = "loading";
@property() private _stepData: any = {};
@property() private _step?: ConfigFlowStep;
@property() private _step?: DataEntryFlowStep;
@property() private _errorMessage?: string;
protected render() {
@@ -87,16 +90,15 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
}
}
private _renderStep(step: ConfigFlowStep) {
private _renderStep(step: DataEntryFlowStep) {
switch (step.type) {
case "abort":
return html`
${this.localize("ui.panel.page-authorize.abort_intro")}:
<ha-markdown
allowsvg
.content=${this.localize(
`ui.panel.page-authorize.form.providers.${
step.handler[0]
}.abort.${step.reason}`
`ui.panel.page-authorize.form.providers.${step.handler[0]}.abort.${step.reason}`
)}
></ha-markdown>
`;
@@ -106,7 +108,6 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
? html`
<ha-markdown
.content=${this._computeStepDescription(step)}
allow-svg
></ha-markdown>
`
: html``}
@@ -116,6 +117,7 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
.error=${step.errors}
.computeLabel=${this._computeLabelCallback(step)}
.computeError=${this._computeErrorCallback(step)}
@value-changed=${this._stepDataChanged}
></ha-form>
`;
default:
@@ -193,7 +195,7 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
document.location.assign(url);
}
private async _updateStep(step: ConfigFlowStep) {
private async _updateStep(step: DataEntryFlowStep) {
let stepData: any = null;
if (
this._step &&
@@ -220,10 +222,12 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
}, 100);
}
private _computeStepDescription(step: ConfigFlowStepForm) {
const resourceKey = `ui.panel.page-authorize.form.providers.${
step.handler[0]
}.step.${step.step_id}.description`;
private _stepDataChanged(ev: CustomEvent) {
this._stepData = ev.detail.value;
}
private _computeStepDescription(step: DataEntryFlowStepForm) {
const resourceKey = `ui.panel.page-authorize.form.providers.${step.handler[0]}.step.${step.step_id}.description`;
const args: string[] = [];
const placeholders = step.description_placeholders || {};
Object.keys(placeholders).forEach((key) => {
@@ -233,23 +237,19 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
return this.localize(resourceKey, ...args);
}
private _computeLabelCallback(step: ConfigFlowStepForm) {
private _computeLabelCallback(step: DataEntryFlowStepForm) {
// Returns a callback for ha-form to calculate labels per schema object
return (schema) =>
this.localize(
`ui.panel.page-authorize.form.providers.${step.handler[0]}.step.${
step.step_id
}.data.${schema.name}`
`ui.panel.page-authorize.form.providers.${step.handler[0]}.step.${step.step_id}.data.${schema.name}`
);
}
private _computeErrorCallback(step: ConfigFlowStepForm) {
private _computeErrorCallback(step: DataEntryFlowStepForm) {
// Returns a callback for ha-form to calculate error messages
return (error) =>
this.localize(
`ui.panel.page-authorize.form.providers.${
step.handler[0]
}.error.${error}`
`ui.panel.page-authorize.form.providers.${step.handler[0]}.error.${error}`
);
}
+9 -17
View File
@@ -2,16 +2,18 @@ import { litLocalizeLiteMixin } from "../mixins/lit-localize-lite-mixin";
import {
LitElement,
html,
PropertyDeclarations,
PropertyValues,
CSSResult,
css,
property,
} from "lit-element";
import "./ha-auth-flow";
import { AuthProvider, fetchAuthProviders } from "../data/auth";
import { registerServiceWorker } from "../util/register-service-worker";
import(/* webpackChunkName: "pick-auth-provider" */ "../auth/ha-pick-auth-provider");
import(
/* webpackChunkName: "pick-auth-provider" */ "../auth/ha-pick-auth-provider"
);
interface QueryParams {
client_id?: string;
@@ -20,11 +22,11 @@ interface QueryParams {
}
class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
public clientId?: string;
public redirectUri?: string;
public oauth2State?: string;
private _authProvider?: AuthProvider;
private _authProviders?: AuthProvider[];
@property() public clientId?: string;
@property() public redirectUri?: string;
@property() public oauth2State?: string;
@property() private _authProvider?: AuthProvider;
@property() private _authProviders?: AuthProvider[];
constructor() {
super();
@@ -48,16 +50,6 @@ class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
}
}
static get properties(): PropertyDeclarations {
return {
_authProvider: {},
_authProviders: {},
clientId: {},
redirectUri: {},
oauth2State: {},
};
}
protected render() {
if (!this._authProviders) {
return html`
-31
View File
@@ -1,31 +0,0 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../components/entity/ha-state-label-badge";
class HaBadgesCard extends PolymerElement {
static get template() {
return html`
<style>
ha-state-label-badge {
display: inline-block;
margin-bottom: var(--ha-state-label-badge-margin-bottom, 16px);
}
</style>
<template is="dom-repeat" items="[[states]]">
<ha-state-label-badge
hass="[[hass]]"
state="[[item]]"
></ha-state-label-badge>
</template>
`;
}
static get properties() {
return {
hass: Object,
states: Array,
};
}
}
customElements.define("ha-badges-card", HaBadgesCard);
+45
View File
@@ -0,0 +1,45 @@
import { TemplateResult, html } from "lit-html";
import { customElement, LitElement, property } from "lit-element";
import { HassEntity } from "home-assistant-js-websocket";
import "../components/entity/ha-state-label-badge";
import { HomeAssistant } from "../types";
import { fireEvent } from "../common/dom/fire_event";
@customElement("ha-badges-card")
class HaBadgesCard extends LitElement {
@property() public hass?: HomeAssistant;
@property() public states?: HassEntity[];
protected render(): TemplateResult | void {
if (!this.hass || !this.states) {
return html``;
}
return html`
${this.states.map(
(state) => html`
<ha-state-label-badge
.hass=${this.hass}
.state=${state}
@click=${this._handleClick}
></ha-state-label-badge>
`
)}
`;
}
private _handleClick(ev: Event) {
const entityId = ((ev.target as any).state as HassEntity).entity_id;
fireEvent(this, "hass-more-info", {
entityId,
});
}
}
declare global {
interface HTMLElementTagNameMap {
"ha-badges-card": HaBadgesCard;
}
}
+1 -1
View File
@@ -2,7 +2,7 @@ import "@polymer/paper-styles/element-styles/paper-material-styles";
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import computeStateName from "../common/entity/compute_state_name";
import { computeStateName } from "../common/entity/compute_state_name";
import { EventsMixin } from "../mixins/events-mixin";
import LocalizeMixin from "../mixins/localize-mixin";
import { fetchThumbnailUrlWithCache } from "../data/camera";
+4 -4
View File
@@ -6,10 +6,10 @@ import "../components/entity/ha-entity-toggle";
import "../components/ha-card";
import "../state-summary/state-card-content";
import computeStateDomain from "../common/entity/compute_state_domain";
import computeStateName from "../common/entity/compute_state_name";
import stateMoreInfoType from "../common/entity/state_more_info_type";
import canToggleState from "../common/entity/can_toggle_state";
import { computeStateDomain } from "../common/entity/compute_state_domain";
import { computeStateName } from "../common/entity/compute_state_name";
import { stateMoreInfoType } from "../common/entity/state_more_info_type";
import { canToggleState } from "../common/entity/can_toggle_state";
import { EventsMixin } from "../mixins/events-mixin";
import LocalizeMixin from "../mixins/localize-mixin";
+6 -9
View File
@@ -5,7 +5,7 @@ import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../components/state-history-charts";
import "../data/ha-state-history-data";
import computeStateName from "../common/entity/compute_state_name";
import { computeStateName } from "../common/entity/compute_state_name";
import { EventsMixin } from "../mixins/events-mixin";
/*
@@ -97,14 +97,11 @@ class HaHistoryGraphCard extends EventsMixin(PolymerElement) {
this.cacheConfig.refresh !== (stateObj.attributes.refresh || 0) ||
this.cacheConfig.hoursToShow !== (stateObj.attributes.hours_to_show || 24)
) {
this.cacheConfig = Object.assign(
{},
{
refresh: stateObj.attributes.refresh || 0,
cacheKey: stateObj.entity_id,
hoursToShow: stateObj.attributes.hours_to_show || 24,
}
);
this.cacheConfig = {
refresh: stateObj.attributes.refresh || 0,
cacheKey: stateObj.entity_id,
hoursToShow: stateObj.attributes.hours_to_show || 24,
};
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ import { PolymerElement } from "@polymer/polymer/polymer-element";
import HassMediaPlayerEntity from "../util/hass-media-player-model";
import { fetchMediaPlayerThumbnailWithCache } from "../data/media-player";
import computeStateName from "../common/entity/compute_state_name";
import { computeStateName } from "../common/entity/compute_state_name";
import { EventsMixin } from "../mixins/events-mixin";
import LocalizeMixin from "../mixins/localize-mixin";
+2 -2
View File
@@ -5,9 +5,9 @@ import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../components/ha-card";
import "../components/ha-markdown";
import computeStateName from "../common/entity/compute_state_name";
import { computeStateName } from "../common/entity/compute_state_name";
import LocalizeMixin from "../mixins/localize-mixin";
import computeObjectId from "../common/entity/compute_object_id";
import { computeObjectId } from "../common/entity/compute_object_id";
/*
* @appliesMixin LocalizeMixin
+1 -1
View File
@@ -4,7 +4,7 @@ import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../components/ha-card";
import "../components/ha-icon";
import computeStateName from "../common/entity/compute_state_name";
import { computeStateName } from "../common/entity/compute_state_name";
import { EventsMixin } from "../mixins/events-mixin";
class HaPlantCard extends EventsMixin(PolymerElement) {

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