Compare commits

..

1307 Commits

Author SHA1 Message Date
Paulus Schoutsen
b533e4d093 Bumped version to 20181112.0 2018-11-12 10:17:51 +01:00
Ian Richardson
239ec5fb53 Ability to add items to shopping-list-card (#2035)
* Ability to add items to shopping-list-card

* Address review comments
2018-11-12 10:17:19 +01:00
Thomas Lovén
d974d5dc52 Fix hold_action not working on chrome for android (#2011) 2018-11-12 10:17:18 +01:00
Zack Arnett
2076949289 Glance fix (#2040) 2018-11-12 08:05:05 +01:00
Paulus Schoutsen
65bd7fd64f Update translations 2018-11-11 22:54:04 +01:00
Paulus Schoutsen
1f0c7297ce Upgrade Lit (#2032) 2018-11-10 20:36:25 +01:00
Ian Richardson
efbd97f9a4 Add clearing of checked items to shopping-list-card (#2034) 2018-11-10 20:34:31 +01:00
Paulus Schoutsen
e580dbe7f2 Fix int in ha-form (#2033) 2018-11-09 15:38:30 +01:00
Nikolay Vasilchuk
9f55678cb3 Timezone support for displaying header with date in logbook (#2026)
* Fixed display header with date in logbook

* prettier fix
2018-11-09 10:59:03 +01:00
Ian Richardson
9c2b85dd6e Add checked item section to shopping-list-card (#2005)
* Add checked item section to shopping-list-card

* Not getting value back from `this.localize`? at line 109

* Alignment of label

* Address review comment

* Address review comments

* Address review comment and fix Travis errors

* Address review comments

* Hide checked label when empty

* Address review comment
2018-11-09 10:13:44 +01:00
Ian Richardson
cb640c2e71 Convert hui-picture-card to TypeScript/LitElement (#2030) 2018-11-09 10:10:17 +01:00
Paulus Schoutsen
56bdb6e352 Fix fetching sub 2018-11-08 19:32:58 +01:00
Paulus Schoutsen
81e1e5be8f Fix link color in persistent notification (#2023) 2018-11-08 10:31:49 -05:00
Ian Richardson
6c44a92e2c Convert hui-group-entity-row to TypeScript/LitElement (#2015)
* Convert hui-group-entity-row to TypeScript/LitElement

* Address review comment and Travis errors
2018-11-08 09:41:46 +01:00
Ian Richardson
9596f737e8 Convert hui-text-entity-row to TypeScript/LitElement (#2017)
* Convert hui-text-entity-row to TypeScript/LitElement

* Address review comments

* Fix Travis errors
2018-11-08 09:41:25 +01:00
Ian Richardson
ad5f815273 Convert hui-scene-entity-row to TypeScript/LitElement (#2021)
* Convert hui-scene-entity-row to TypeScript/LitElement

script-entity-row and this could probably extend a common base class. The only thing that differs them is the domain used in the callService and the button text.

* Stop more-info
2018-11-08 09:39:02 +01:00
Ian Richardson
4a893d96a0 Convert hui-script-entity-row to TypeScript/LitElement (#2020)
* Convert hui-script-entity-row to TypeScript/LitElement

* Stop more-info
2018-11-08 09:37:22 +01:00
Ian Richardson
59a681fcb7 Convert hui-lock-entity-row to TypeScript/LitElement (#2022) 2018-11-08 09:35:55 +01:00
Paulus Schoutsen
787ea885cc Add text color to error row (#2007)
Fixes #2002
2018-11-07 11:37:04 -05:00
Paulus Schoutsen
a26a37233b Use non-forked version of fecha 2018-11-07 10:48:49 +01:00
Paulus Schoutsen
c1e3259b08 Bumped version to 20181107.0 2018-11-07 10:31:22 +01:00
Paulus Schoutsen
9c735bb088 Merge branch 'master' into dev 2018-11-07 10:28:10 +01:00
Paulus Schoutsen
10092dcadf Bumped version to 2018117.0 2018-11-07 10:27:07 +01:00
Paulus Schoutsen
d31cea70bc Update translations 2018-11-07 10:26:19 +01:00
Paulus Schoutsen
b04ab6faa1 Bumped version to 20181103.2 2018-11-07 10:11:47 +01:00
Ian Richardson
23163b3095 Fix iframe aspect_ratio (#2004) 2018-11-07 10:11:35 +01:00
Thomas Lovén
849d7d2d95 Make conditional not take up space in stacks when hidden (#1999)
* Make conditional not take up space in stacks when hidden

* Update hui-conditional-card.ts
2018-11-07 10:11:35 +01:00
Paulus Schoutsen
a58a324073 Format html (#2006)
* Upgrade prettier

* Format files with prettier
2018-11-07 09:56:43 +01:00
Ian Richardson
7c2135f444 Fix iframe aspect_ratio (#2004) 2018-11-07 09:42:46 +01:00
Ian Richardson
f9719957b0 Convert call-service to TypeScript (#1985)
* Convert call-service to TypeScript

* Address Travis error

* Address review comments
2018-11-07 09:31:01 +01:00
Ian Richardson
9ce74e2da1 Convert hui-toggle-entity-row to TypeScript/LitElement (#1939)
* Convert hui-toggle-entity-row to TypeScript/LitElement

* Properly set generic-entity properties

* Addressed review comments

* Address review comments
2018-11-07 09:30:05 +01:00
Paulus Schoutsen
14b959b91b Fix cover showing error 2018-11-06 15:17:01 +01:00
Paulus Schoutsen
e2b9893b17 Expose entities for Google/Alexa (#680)
* Add entity filter

* Show exposed entities on cloud panel

* Fix tests

* Revert some testing changes

* Cursor: pointer

* Fix

* Update tests to TS
2018-11-06 14:22:59 +01:00
Thomas Lovén
54e43758d3 Make conditional not take up space in stacks when hidden (#1999)
* Make conditional not take up space in stacks when hidden

* Update hui-conditional-card.ts
2018-11-06 12:39:00 +01:00
Paulus Schoutsen
92af45d7fd Lint 2018-11-06 11:51:33 +01:00
Michael Scherer
5891a6ee7d Fix for thermostats without current temperature (#1979)
* fix for thermostats without current temperature

* make linter happy

* always render value, uom only when there is a value

* Update hui-thermostat-card.ts
2018-11-06 11:25:25 +01:00
Ian Richardson
c10e409634 Convert cover-row to TypeScript/LitElement (#1933)
* Convert cover-row to TypeScript/LitElement

* Extract `supports` methods from cover model

* Address review comments

* Revert line endings mixup

I suck at vs code apparently...

* Address review comments

* Address review comments: error-row not working
2018-11-06 11:07:15 +01:00
Ian Richardson
6432207bf1 New Card: Shopping List (#1970)
* New Card: Shopping List

Following features:
- Add item
- Edit item
- Complete item
- Clear items

* Address Travis complaint

* Addressed review comments

* Update translation variable name

* Line up input row text

* Taking MVP to heart

Addressed review comments and scaled this back to just get a simple shopping list card out there and we can discuss/debate how best to add the additional pieces with smaller PRs

* Remove calling connected in set hass
2018-11-06 10:47:24 +01:00
Zack Arnett
935639e5e0 Add getElementConfig to Glance + Add Form UI for updating YAML (#1944)
* Working version

* Working kind of

* Some more changes

* More review changes

* Progress

* Review updates

* Adding new changes

* Remove un-needed code

* Adding Types

* Updating UI Editor a bit

* Updating from missed reviews

* Updates from Reviews

* Yaml is not update each time. Instead stored as LovelaceConfig.

* Update to not pull config from preview but store it each time it changed

* Updating from Reviews

* Try catch fix

* Update hui-dialog-edit-card.ts
2018-11-06 10:09:28 +01:00
Paulus Schoutsen
cdb2093ea6 Ts all the tests (#1998)
* Convert tests to TypeScript

* Add types for tests

* Rename files to TS

* Fix up test imports

* Fix TSC errors

* Liiiint

* Add types to util method signatures

* Some more types
2018-11-06 10:09:09 +01:00
Karl Kihlström
856ef34964 <path> error fix & literals (#1993) 2018-11-05 19:46:41 +01:00
Karl Kihlström
cf19ceb193 Filter out non number states instead of assigning them 0 (#1987) 2018-11-05 16:28:36 +01:00
Paulus Schoutsen
e5fe2950af Split up cloud card (#1983)
* Split up cloud card

* Fix quotes
2018-11-05 09:59:19 +01:00
Paulus Schoutsen
1ca242405b Convert auth to TS (#1976)
* Convert auth to TS

* Lint

* Update HA-JS-WS to 3.2.0

* Migrate ws collections to TS

* Upgrade to latest HAWS

* Bump HAWS

* Lint

* Add types to WS calls
2018-11-04 10:01:33 +01:00
Michael Scherer
bcbf0ba75a add vscode extension recommondations (#1978) 2018-11-03 22:57:45 +01:00
Michael Scherer
4810042373 Hide state if its unknown e.g. the climate entity does not have one (#1977)
* Hide state if its unknown e.g. the climate entity does not have one

* state can not be null

* better comparsion

* use double quotes
2018-11-03 21:51:55 +01:00
Paulus Schoutsen
e1c90d74e3 Bumped version to 20181103.1 2018-11-03 19:17:48 +01:00
Zack Arnett
984570c55b Revert RTL PR (#1975)
* Revert RTL PR

* Missed this change
2018-11-03 19:16:55 +01:00
Zack Arnett
f489d88be4 Revert RTL PR (#1975)
* Revert RTL PR

* Missed this change
2018-11-03 19:15:51 +01:00
Paulus Schoutsen
6a84395303 Merge pull request #1974 from home-assistant/dev
20181103.0
2018-11-03 13:40:00 +01:00
Paulus Schoutsen
a3847ddd2a Merge remote-tracking branch 'origin/master' into dev 2018-11-03 13:26:48 +01:00
Paulus Schoutsen
dc0f023754 Version bump to 20181103.0 2018-11-03 13:24:36 +01:00
Paulus Schoutsen
89677577ef Update translations 2018-11-03 13:24:20 +01:00
Ronen Hayun
0922314134 POC for RTL support (#1966)
* POC for RTL support

* POC for RTL support

* POC for RTL support
2018-11-03 13:21:58 +01:00
Paulus Schoutsen
c68604d1fe Mark edit as alpha (#1973) 2018-11-03 13:19:44 +01:00
Zack Arnett
372cfdecf4 Light, Thermostat, and Gauge - Theme Addition (#1947)
* Update to have theme options

* Make ShouldUpdate into a help function

* Adding types to changed function
2018-11-02 20:59:14 +01:00
Paulus Schoutsen
ef40a0ceea Update frontend to 20181026.4 2018-11-02 20:08:01 +01:00
Paulus Schoutsen
343d18241b Update translations 2018-11-02 20:07:46 +01:00
Paulus Schoutsen
2ecb6e0f9e pic 2018-11-02 20:07:32 +01:00
Paulus Schoutsen
38b8e5e7b7 Update translations 2018-11-02 20:07:06 +01:00
Zack Arnett
058f8d178e Adding div arround each row to deal with spacing 2018-11-02 19:48:13 +01:00
Paulus Schoutsen
fbc1a722bd Normalize all line endings 2018-11-02 16:00:25 +01:00
Paulus Schoutsen
727cfe92e3 Force correct line endings 2018-11-02 15:59:48 +01:00
Paulus Schoutsen
4bcb13486e Version bump to 20181026.3 2018-11-02 14:06:02 +01:00
Paulus Schoutsen
4aa8603ebf Stop release if TypeScript throws 2018-11-02 14:05:49 +01:00
Paulus Schoutsen
ba33c8a456 Fix broken shit 2018-11-02 14:05:36 +01:00
Paulus Schoutsen
6f4cd88988 Merge branch 'master' into dev 2018-11-02 12:44:44 +01:00
Paulus Schoutsen
1f2deff6f0 Version bump to 20181026.2 2018-11-02 12:29:51 +01:00
Paulus Schoutsen
575882be5a Fix conditional card with undefined hass (#1927)
* Fix conditional card with undefined hass

* Conditional appendChild

* Allow updating card properly
2018-11-02 12:27:56 +01:00
Paulus Schoutsen
d591c45e4d Propagate hass correctly (#1918) 2018-11-02 12:27:55 +01:00
Paulus Schoutsen
f9b06adc9f Handle no operation mode (#1901)
* Handle no operation mode

* Upgrade HAWS so we can use correct types

* Lint
2018-11-02 12:27:55 +01:00
Ian Richardson
6cc67dc790 New warning row for non-existent entities (#1946)
* New warning row for non-existent entities

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

* Address my own comments
2018-11-02 12:26:20 +01:00
Ian Richardson
c0c7c0f41a Remove .js from imports (#1948)
* Remove .js from lovelace

Also cleaned up some trailing whitespace

* Go big or go home

* More removals

* Revert changes to gallery webpack

* Revert changes to webpack.config.js
2018-11-02 12:26:03 +01:00
Paulus Schoutsen
eb505d4bd7 don't compress for CI runs (#1949) 2018-11-02 12:15:45 +01:00
Zack Arnett
aebd1a1be1 Remove side effects of render and Add types - Button/Glance (#1919)
* Remove side effects of render and Add types

* Addressing changes

* Updating when to apply theme

* Review Updates

* Fixing last reviews

* Updates from travis
2018-11-02 10:13:49 +01:00
Bram Kragten
447c06d817 Fix overlapping device cards (#1940) 2018-11-01 09:18:12 +01:00
Ian Richardson
ce78131258 Remove unused mixin (#1934) 2018-10-31 09:49:11 +01:00
Ian Richardson
acab465c96 Move click and tooltip function to LL folder (#1935) 2018-10-31 09:45:38 +01:00
Zack Arnett
4ea83b8bd5 Fixes: #1902 - Thermostat/Light Background (#1931)
* Thermostat theme fixes

* Might as well put the light card in there
2018-10-31 09:38:56 +01:00
Zack Arnett
094eb632f2 Update Types for various cards (#1920)
* Update Types

* Travis fix

* Travis change

* Add HTMLElementTagNameMap for gauge

* Review Changes

* Formatting values as string to be accepted into format temp
2018-10-31 09:34:12 +01:00
Paulus Schoutsen
03b1e40593 Add preview to edit LL card (#1929) 2018-10-30 20:31:56 +01:00
Bram Kragten
2164b629cf catch translation errors (#1928) 2018-10-30 19:16:20 +01:00
Thomas Lovén
a081047008 Fix calculation of glance card size (#1930) 2018-10-30 15:57:08 +01:00
Paulus Schoutsen
2e395c1b0d Update version to 20181030.0 2018-10-30 11:33:37 +01:00
Paulus Schoutsen
520e03a612 Update translations 2018-10-30 11:33:20 +01:00
Paulus Schoutsen
a771a44557 Fix conditional card with undefined hass (#1927)
* Fix conditional card with undefined hass

* Conditional appendChild

* Allow updating card properly
2018-10-30 11:30:57 +01:00
Ian Richardson
38bfe8c8de Convert hui-call-service-row to TypeScript/LitElement (#1894)
* Convert hui-call-service-row to TypeScript/LitElement

* Update on _config change

* Addressed review comments

* Made `service_data` optional and verified that `callService` does use `entity` if it is available in the passed config.
* Removed check in `entities-card` for `service-data` and will remove the full config check once other PRs have been applied to avoid merge conflicts
* Will create a docs PR to update the docs

* Addressed review comments

* Removed entity config check in entities-card
* Made `icon` optional. Default now `remote`
* Made `action_name` optional. Default now 'Run'

* `.icon`
2018-10-30 11:15:12 +01:00
Zack Arnett
7ca2ef4c4c Addition to Edit Love Lace Cards (#1885)
* Initial Commit

* Removing old code

* Switching to litlement and ts

* remove .ts from extension

* Addressing a few reviews

* Added ShowDialog Still no whammy

* Fix some things

* Extract one more data method

* Add more types

* Clean up imports

* Call super

* Finishing touches

* Fix typescript check
2018-10-30 11:15:02 +01:00
Paulus Schoutsen
de5f02d706 Update TypeScript to latest (#1924) 2018-10-30 11:05:56 +01:00
Paulus Schoutsen
6f7ddef4a4 Update mdi icons (#1922) 2018-10-30 11:04:25 +01:00
Paulus Schoutsen
d78b5fac73 Update vaadin components (#1923) 2018-10-30 11:04:17 +01:00
Paulus Schoutsen
7cf65ba066 Update testing tools (#1925) 2018-10-30 11:04:06 +01:00
Paulus Schoutsen
91966f676a Update polymer (#1921) 2018-10-30 09:25:04 +01:00
Paulus Schoutsen
5a1ca3855b Propagate hass correctly (#1918) 2018-10-30 08:38:27 +01:00
Zack Arnett
226203143b Merge pull request #1874 from zsarnett/light-card
LoveLace Light Card
2018-10-29 23:39:12 -04:00
Zack Arnett
a5304115f0 UPdate Type for color 2018-10-29 22:24:23 -04:00
Zack Arnett
f7458b8d41 Add Hs_color to types 2018-10-29 20:12:20 -04:00
Zack Arnett
410b66d40f Adding more types 2018-10-29 18:15:35 -04:00
Zack Arnett
1fcf510278 Adding Type to Returns 2018-10-29 18:11:34 -04:00
Zack Arnett
bb4ce278b0 Fixing Gallery and updating timeout type 2018-10-29 18:07:57 -04:00
Zack Arnett
6dac48e5b8 Merge pull request #1913 from home-assistant/entities-padding-fix
Fixes #1910 - Entities Margin correction
2018-10-29 15:45:15 -04:00
Zack Arnett
7178d208d3 Light Card addition 2018-10-29 14:33:38 -04:00
Zack Arnett
00935c86d0 Add themes to entities (#1909) 2018-10-29 19:29:27 +01:00
Zack Arnett
3dde78cadf Adding div arround each row to deal with spacing 2018-10-29 13:54:10 -04:00
Zack Arnett
630214ddb9 Merge pull request #1911 from home-assistant/add-bypass
add arm_custom_bypass
2018-10-29 13:25:56 -04:00
Zack Arnett
b3f8781646 Merge pull request #1912 from home-assistant/prettier-fix
Fixes errors in PRs based on dev
2018-10-29 11:54:36 -04:00
Zack Arnett
b717402d26 Fixes errors in PRs based on dev 2018-10-29 11:37:23 -04:00
Zack Arnett
0d339e0cba add arm_custom_bypass 2018-10-29 11:33:01 -04:00
Ian Richardson
1d014bf6e3 Convert hui-section-row to TypeScript/LitElement (#1897)
* Convert hui-section-row to TypeScript/LitElement

* Address review comments
2018-10-29 10:53:17 +01:00
Zack Arnett
5ab15dc27f add arm night (#1908) 2018-10-29 08:59:33 +01:00
Timmo
c347be6f35 Lovelace - Weather Card: Adjust margins and move text (#1880)
* Thermostat fix (#1867)

* Thermostat fix

* Fix for unknown operation mode

* No title for you

* I suck at removing unnecessary things

* Fixing pointless Ternary operator

* Add version bump script

* Fix hass setting on stack (#1868)

* Fix hass setting on stack

* Don't set hass on pic elements if undefined

* Don't set hass on entity rows if undefined

* prefix config prop

* Pic elements set hass yoooo

* Remove interface

* Make stack config private

* Fix import

* Lint

* Bumped version to 20181026.1

* 🔨 move not text to header and name to secondary text

* 🔨 reduce some other margins
2018-10-29 08:30:56 +01:00
Paulus Schoutsen
d47c2a6fe0 Merge remote-tracking branch 'origin/master' into dev 2018-10-29 08:29:44 +01:00
Ian Richardson
82eb33a7d4 Convert hui-climate-entity-row to TypeScript/LitElement (#1899)
* Convert hui-climate-entity-row to TypeScript/LitElement

* Address review comments

* Address review comments
2018-10-28 21:09:41 +01:00
Ian Richardson
4f6bae193d Convert hui-weblink-row to TypeScript/LitElement (#1898)
* Convert hui-weblink-row to TypeScript/LitElement

* Addressed review comments

* Made name and icon fields optional. Will create a corresponding PR to the docs to update them as Optional
* Updated entities-card to not check weblink config as that is the job of the element (entities-card should be updated to not check service-call config either as that is the job of the row element as well)

* Addressed review comments

That's cool!
2018-10-28 21:08:58 +01:00
Ian Richardson
b8752c4158 Convert hui-divider-row to TypeScript/LitElement (#1896)
* Convert hui-divider-row to TypeScript/LitElement

* Add return types

* Fixed style issues

* Address review comments
2018-10-28 21:07:30 +01:00
Zack Arnett
b6d0d777bf Gauge convert and fix issues (#1886)
* Gauge convert and fix issues

* Fixing Unit_of_Measurement

* Addressing Reviews

* Updating typing
2018-10-28 20:47:21 +01:00
Ian Richardson
8c155d4d0e Convert hui-state-badge-element to TypeScript/LitElement (#1892)
* Convert hui-state-badge-element to TypeScript/LitElement

The state image is not updating. This is true with the image-element as well. There's probably something simple between them both that I'm missing in my syntax for defining them

* Added htmlmap interface

* Addressed review comments
2018-10-28 20:36:53 +01:00
Ian Richardson
bdf5d0f5c6 Convert hui-state-icon-element to TypeScript/LitElement (#1891)
* Convert hui-state-icon-element to TypeScript/LitElement

The icon is not currently dispalying and therefor cannot determine if changing as well. Everything else is working. Should probably create a base class for all these elements to extend for simple things like checking for the entity and setting hass correctly once I get that sorted out.

* Fixed setting of properties

* Remove ! on this._config

* Addressed review comments

* Moved event handlers to private functions to avoid arrow function creation on each render
* Check for `hass` before looking for state
* Movevd absolute import above relative imports
2018-10-28 20:35:48 +01:00
Ian Richardson
4959b861bd Convert hui-image-element to TypeScript/LitElement (#1890)
* Convert hui-image-element to TypeScript/LitElement

WIP
Some of the state portions passed down to ha-image are not updating the view.

* Fixed setting of properties

* Add tagnamemap interface

* Address review comments
2018-10-28 20:25:12 +01:00
Paulus Schoutsen
a4fa0ae64b Handle no operation mode (#1901)
* Handle no operation mode

* Upgrade HAWS so we can use correct types

* Lint
2018-10-28 20:07:05 +01:00
Ian Richardson
7cd5f36c7a Convert hui-service-button-element to TypeScript/LitElement (#1888)
* Convert hui-service-button-element to TypeScript/LitElement

Will need to rebase once hui-icon-element PR is merged

* Added return types

* Convert ha-call-service-button attributes to properties

* Re-order imports
2018-10-28 13:57:52 +01:00
Ian Richardson
ecfdb16957 Convert hui-state-label-element to TypeScript/LitElement (#1893) 2018-10-28 09:09:43 +01:00
Ian Richardson
d31195fc87 Add to HTML tag name map (#1900) 2018-10-28 09:00:37 +01:00
eyager1
f3ef4cef74 Change icon to set operation_mode to "off" (#1883)
The choice of the "fan-off" icon to set the climate operation_mode to off should be changed . Many HVAC thermostats have a manual fan control.   The use of the fan icon in this card would imply that it would change or toggle the fan_mode of a climate component, not the operation_mode.  If setting the fan_mode of a climate component via this card were to be implemented in the future the use of "fan" and "fan-off" icons would be the most logical choices for icons.   I propose changing the icon that would set the operation_mode to off to generic power icon such as "power", or "power-off" to avoid confusion and to reserve the "fan" and "fan-off" icons for future use to change the the state of fan_mode.
2018-10-28 08:57:54 +01:00
Ian Richardson
ec6db9c8ca Merge pull request #1895 from iantrich/row-types
Make hass optional within EntityRow as it may not be defined
2018-10-27 21:17:45 -05:00
Ian Richardson
bb483c9d72 Make hass optional within EntityRow as it may not be defined 2018-10-27 21:00:06 -05:00
Zack Arnett
414448137a Merge pull request #1871 from iantrich/typescript-icon-element
Convert hui-icon-element to TypeScript/LitElement
2018-10-27 21:50:09 -04:00
Ian Richardson
d0acef3ecb Add return types 2018-10-27 18:01:07 -05:00
Ian Richardson
5617416932 cleaned up elementconfig type order 2018-10-27 16:54:27 -05:00
Ian Richardson
bf0eb798d9 Implemented navigate function
Fix linting error
2018-10-27 16:51:44 -05:00
Ian Richardson
8afc3812b7 Remove element-click refactor
Was unable to get computeTooltip to work for non-converted elements. There are not many elements that use this so will just remove this mixin once conversion of all to TS has been completed.
2018-10-27 16:40:43 -05:00
Ian Richardson
5a7841e6bf Pass correct node to handleClick 2018-10-27 15:51:34 -05:00
Ian Richardson
2758e86fab Convert hui-icon-element to TypeScript/LitElement and extract ElementClick mixin functions 2018-10-27 15:51:34 -05:00
Paulus Schoutsen
d9935a714e Bumped version to 20181026.1 2018-10-27 12:05:14 +02:00
Paulus Schoutsen
d6a9d6829b Fix hass setting on stack (#1868)
* Fix hass setting on stack

* Don't set hass on pic elements if undefined

* Don't set hass on entity rows if undefined

* prefix config prop

* Pic elements set hass yoooo

* Remove interface

* Make stack config private

* Fix import

* Lint
2018-10-27 12:05:06 +02:00
Paulus Schoutsen
8b02371786 Fix hass setting on stack (#1868)
* Fix hass setting on stack

* Don't set hass on pic elements if undefined

* Don't set hass on entity rows if undefined

* prefix config prop

* Pic elements set hass yoooo

* Remove interface

* Make stack config private

* Fix import

* Lint
2018-10-27 12:00:40 +02:00
Paulus Schoutsen
9a5b692204 Add version bump script 2018-10-27 11:40:52 +02:00
Zack Arnett
0b504c7df2 Thermostat fix (#1867)
* Thermostat fix

* Fix for unknown operation mode

* No title for you

* I suck at removing unnecessary things

* Fixing pointless Ternary operator
2018-10-27 11:16:10 +02:00
Zack Arnett
6cab3bbc8e Thermostat fix (#1867)
* Thermostat fix

* Fix for unknown operation mode

* No title for you

* I suck at removing unnecessary things

* Fixing pointless Ternary operator
2018-10-27 10:59:33 +02:00
Paulus Schoutsen
35194cf345 Extract navigate mixin (#1865)
* Extract navigate to function

* Remove eventsmixin properly and side effects
2018-10-27 10:56:03 +02:00
Paulus Schoutsen
13c5724d7c Fix version extract (#1866) 2018-10-26 23:22:45 +02:00
Zack Arnett
156ea62ffa Merge pull request #1863 from home-assistant/states-sensor-badges
States Sensor badges Padding fix
2018-10-26 15:24:10 -04:00
Zack Arnett
22693bcbcc Updating to meet Material Design standards 2018-10-26 14:11:11 -04:00
Zack Arnett
ba70220659 Prettier fixes (#1864) 2018-10-26 19:40:53 +02:00
Gabriel Oliveira
fc96d33d6a 1813 - Improve Hass.io System cards UI (#1862)
* 1813 - Improve Hass.io System cards UI

* 1813 - Move margin to proper card file
2018-10-26 19:38:02 +02:00
Zack Arnett
685915e13c Fix States Badges Padding 2018-10-26 12:39:40 -04:00
Paulus Schoutsen
c39b17f12c Version bump to 20181026.0 2018-10-26 10:10:27 +02:00
Paulus Schoutsen
110d9a4cc1 update translations 2018-10-26 10:07:24 +02:00
Piotr Dobrowolski
8902328b30 Allow custom UI on "card" entities (#1824)
This will always render entities with `custom_ui_state_card` attribute
set in `entities` state card. Fixes custom UI on `media_player` objects.
2018-10-26 10:06:17 +02:00
Ian Richardson
7ff9211dfc Convert hui-picture-elements-card to TypeScript/LitElement (#1853)
* Convert hui-picture-elements-card to TypeScript/LitElement

Elements are not showing currently

* Address review comments

* Update demo
2018-10-26 10:04:04 +02:00
Paulus Schoutsen
17b4f873e7 Enforce prettier for TypeScript (#1860) 2018-10-26 09:37:47 +02:00
Zack Arnett
741c0c08b9 Thermostat Card LoveLace (#1814)
* POC/WIP: Thermostat Card

* Fix jQuery imports

* Cleaning out testing code and working on reviews

* Colors Dynamic + mode dynamic

* Minor changes

* adding html prefix

* Dynamic Text size and colors - getting somwhere slowly.

* Review Changes - Working version (i think)

* Updating Gallery Entry

* Travies Review

* Remove provide plugin, move CSS to JS

* Add provideHass to demo

* Demo fixes

* tweak margins

* Travis changes

* Style Tweaks

* Update to client Width range
2018-10-26 09:30:58 +02:00
Ian Richardson
c42d9385d1 Convert hui-horizontal-stack-card to TypeScript/LitElement (#1851)
* Convert horizontal-stack to TypeScript/LitElement

Base stack-card class for horizontal and vertical stack cards to extend as their code overlaps a lot. Not sure if it should be in `common` or not

* rename locale hass variable

* Address review comments

* Abstract getCardSize
2018-10-26 09:27:57 +02:00
Thomas Lovén
8cbd667286 Lovelace - Long Press for everything (#1848)
* Long-press controller and lit-directive

* Enable long-press for glance card

* Enable long-press for entity-button

* Use new long-press for picture-elements

* Enable long-press for picture-entity card
2018-10-26 09:27:39 +02:00
Paulus Schoutsen
8bf60d502a Allow mocking websocket commands in the gallery (#1859)
* Allow mocking rest/websocket commands in the gallery

* typo
2018-10-26 09:27:10 +02:00
Zack Arnett
9f60499a3f Fix for input slider on states ui (#1861) 2018-10-25 20:15:31 -04:00
Paulus Schoutsen
56a9ff2b35 Gallery: fix notifs, fake config/services, glance demo (#1857)
* Gallery: fix notifs, fake config/services, glance demo

* Fix missing glance states

* Fill in more missing entities

* Add controller to entity filter card
2018-10-25 14:05:22 +02:00
Paulus Schoutsen
8c7b62509b Fix stack card getSize (#1856) 2018-10-25 12:29:05 +02:00
Ian Richardson
5e61065b64 Convert hui-error-card to TypeScript/LitElement (#1852) 2018-10-25 09:28:15 +02:00
Zack Arnett
39dd0524f8 Merge pull request #1792 from zsarnett/entities-card-lit
Updating Entities Card to TS+lit
2018-10-24 21:12:08 -04:00
Zack Arnett
25c6a4d3a6 Switching to new version of localize 2018-10-24 16:34:20 -04:00
Zack Arnett
0b9a4c56a9 Review Update 2018-10-24 16:34:20 -04:00
Zack Arnett
faa08f9e1f Review Update 2018-10-24 16:34:20 -04:00
Zack Arnett
7fbe0937df Review updates 2018-10-24 16:34:20 -04:00
Zack Arnett
66f5e34d52 Removing log console 2018-10-24 16:34:19 -04:00
Zack Arnett
ddf59c8d5c Readding Homeasistant call in types 2018-10-24 16:34:19 -04:00
Zack Arnett
0856073e85 Changing element to unknown 2018-10-24 16:34:19 -04:00
Zack Arnett
06aef18d0c addressiing reviews 2018-10-24 16:34:19 -04:00
Zack Arnett
be63648238 Review Update 2018-10-24 16:34:19 -04:00
Zack Arnett
56e01e66fb Review fix 2018-10-24 16:34:18 -04:00
Zack Arnett
772153e58a Update entities 2018-10-24 16:34:18 -04:00
Zack Arnett
3882a5aa89 Fix for Click Event 2018-10-24 16:34:18 -04:00
Zack Arnett
edf8027bf4 Updating repeat array 2018-10-24 16:34:18 -04:00
Zack Arnett
2fd459381d Updating from Reviews 2018-10-24 16:34:17 -04:00
Zack Arnett
76e67d27e7 Update to Togglable entities 2018-10-24 16:34:17 -04:00
Zack Arnett
18be134ad8 Updating Entities Card to TS+lit 2018-10-24 16:34:17 -04:00
Paulus Schoutsen
1feb9f6a27 Bump version to 20181024.0 2018-10-24 22:14:06 +02:00
Paulus Schoutsen
337a760e73 Update translations 2018-10-24 22:13:49 +02:00
Thomas Lovén
54cd412107 Fix for some dev pages crashing on iOS. (#1850)
This should probably be reverted when the fixes in
https://bugs.webkit.org/show_bug.cgi?id=174629 has been rolled out.
2018-10-24 22:04:27 +02:00
Ian Richardson
cf2171ece1 Convert hui-vertical-stack-card to TypeScript/LitElement (#1846)
Failed to rebase previous branch and am taking my working changes and applying to a new branch based off of current master.

Updated tslint.json to allow for prefixed `_` to variable names
2018-10-24 12:11:09 +02:00
Paulus Schoutsen
47fb8a5513 Fix mixin names (#1849) 2018-10-24 12:10:58 +02:00
Ian Richardson
06bf134bd4 Remove extending of HassLocalizeMixin as it is not needed (#1847) 2018-10-24 11:42:09 +02:00
Timmo
cf8899fcbe ↕️ fix sorting of addons (#1845) 2018-10-24 09:58:44 +02:00
Charles Garwood
c05b77961e Reduces device registry card height to only show 4 entities before scrolling (#1844) 2018-10-23 17:40:31 +02:00
Paulus Schoutsen
19c365cd12 Update version to 20181023.0 2018-10-23 14:01:51 +02:00
Paulus Schoutsen
29f032087e Update translations 2018-10-23 14:01:22 +02:00
Paulus Schoutsen
d0cb7b9724 TS history data (#1839)
* Convert history data to TS

* Lint

* Extract cached history

* Move around
2018-10-23 13:54:52 +02:00
Thomas Lovén
ad162677a6 Introduce typescript to hui-conditional-card (#1831) 2018-10-23 12:11:06 +02:00
Thomas Lovén
fbbbe7d17d Add HomeAssistant object hass to LovelaceCard interface (#1843) 2018-10-23 10:53:42 +02:00
Ian Richardson
ef0d11c042 connection is being populated for HomeAssistant type, not conn (#1841) 2018-10-23 09:33:04 +02:00
Ian Richardson
fc2608980f Generate icons from `.ts. files (#1842) 2018-10-23 09:32:27 +02:00
Tom Raithel
cc97e82a78 Improve size of device cards and add max-width for entities (#1838)
fixes #1751
2018-10-23 00:12:39 +02:00
Paulus Schoutsen
54e3191de6 Reinstate first call true 2018-10-22 21:40:35 +02:00
Paulus Schoutsen
4f8c8762c7 Fix second visit to history panel (#1835) 2018-10-22 21:37:21 +02:00
Zack Arnett
c190f1986e Merge pull request #1834 from home-assistant/fix-chart-tooltip
Fix chart tooltip
2018-10-22 15:13:25 -04:00
Paulus Schoutsen
b418048bc9 Fix chart tooltip 2018-10-22 21:07:31 +02:00
Paulus Schoutsen
0fdd1c74f2 Always define localize func (#1830) 2018-10-22 20:31:43 +02:00
Thomas Lovén
3b1b2b95e7 Add option to pick number of columns for glance card (#1832) 2018-10-22 20:10:48 +02:00
Paulus Schoutsen
3bb5484b7f Bump version to 20181021.0 2018-10-21 20:32:05 +02:00
Paulus Schoutsen
d93c09b27b Fix reference to this.language (#1825) 2018-10-21 20:31:41 +02:00
Paulus Schoutsen
e7ec18d270 Fix lint 2018-10-21 20:31:24 +02:00
Paulus Schoutsen
3ebe21e135 Update translations 2018-10-21 20:16:09 +02:00
Ian Richardson
aca1ecf1ee Convert hui-markdown-card to TypeScript/LitElement (#1808)
* Convert hui-markdown-card to TypeScript/LitElement

* Addressed review comments

* Addressed review comments

* Addressed review comments
2018-10-21 20:09:11 +02:00
Charles Garwood
e8ef2fdc2c this.language -> this.hass.language (#1816) 2018-10-21 15:12:28 +02:00
Paulus Schoutsen
b129d5fb08 Refresh cloud status if paying sub info comes in (#1822) 2018-10-21 12:28:16 +02:00
Zack Arnett
11f4564465 Merge pull request #1807 from home-assistant/safer-icon-brightness
Safer brightness calculation for icons
2018-10-19 20:58:46 -04:00
Thomas Lovén
c9d140281b fix typo in variable name 2018-10-19 16:35:52 +02:00
PhracturedBlue
fa637a37d5 Fix mailbox issues with this.fire() and this.language undefined (#1809)
* Fix bug with this.fire and this.language

* Proper language variable
2018-10-19 16:15:31 +02:00
Thomas Lovén
1589c3fc51 Better error message 2018-10-19 15:29:05 +02:00
Thomas Lovén
bdc2b31202 Complain and ignore instead of fixing 2018-10-19 12:07:33 +02:00
Thomas Lovén
0970e1e33c Fix overflow of image elements. (#1811)
* Fix overflow of image elements.

* Positioning safeguards
2018-10-19 10:41:08 +02:00
Timmo
028003dffc Set attributes in input form controls (#1805)
* 🔨 add autocapitalize, autocomplete, autocorrect and spellcheck attributes

* 🔨 switch autocapitalize to none

* 🔨 add attributes to dev-state

* 🔨 add attributes to entity-picker
2018-10-19 09:13:45 +02:00
Thomas Lovén
1eb4ac7f34 Safer brightness calculation for icons 2018-10-19 00:01:23 +02:00
Zack Arnett
d97e356376 Merge pull request #1794 from zsarnett/glance-unavailable
Glance Card update to show when entity is unavailable
2018-10-18 11:21:08 -04:00
Zack Arnett
d36352af16 Removing Repeat 2018-10-18 10:26:42 -04:00
Zack Arnett
05ae92d5f8 Merge pull request #1786 from zsarnett/glance-column-change
Changing Glance Column Width default to fill card
2018-10-18 09:52:16 -04:00
Paulus Schoutsen
dce612f944 Trim whitespace 2018-10-18 15:40:37 +02:00
Ian Richardson
3a196203c3 Convert hui-iframe-card to LitElement/TypeScript (#1801)
* Convert hui-iframe-card to LitElement/TypeScript

* style cleanup

* Address review comments

* Addressed review comments
2018-10-18 15:37:01 +02:00
Zack Arnett
33578a6289 Updating from reviews 2018-10-18 09:28:49 -04:00
Zack Arnett
4c3db2119b Update to show when entity is unavailable 2018-10-18 09:14:32 -04:00
Zack Arnett
4a7ff3cd94 Removing Column width variable in interface 2018-10-18 09:06:29 -04:00
Paulus Schoutsen
5578580d78 Verison bump to 20181018.0 2018-10-18 13:39:45 +02:00
Paulus Schoutsen
dc1d8366a5 Fix automation editor (#1804) 2018-10-18 13:39:18 +02:00
Paulus Schoutsen
252f0692c8 Add hass on badge (#1802)
* Add hass on badge

* Add more hass everywhere
2018-10-18 13:21:06 +02:00
Thomas Lovén
9d13925280 Show currently selected language in profile settings. Resolves #1797 (#1800) 2018-10-18 09:55:28 +02:00
Thomas Lovén
5462a71f52 Use this.hass.language since this.language is removed from localize mixin. (#1799) 2018-10-18 09:54:01 +02:00
Josh McCarty
42953a0b62 Use title case for all configuration pages (#1793)
Localize translations will need to be updated separately.
2018-10-18 09:25:35 +02:00
Thomas Lovén
f146a1d80f Lovelace: Allow press-and-hold on picture-elements elements. (#1745)
* Allow press-and-hold on picture-elements elements.
2018-10-17 22:16:17 +02:00
Zack Arnett
a113c71de7 Merge branch 'master' into glance-column-change 2018-10-17 15:06:29 -04:00
Zack Arnett
1f642f436a Adding Theme option to Glance and Button Cards (#1783)
* Adding Theme option to Glance and Button Cards

* Updateing Theme default to `default`

* Prettier Update
2018-10-17 20:20:05 +02:00
Zack Arnett
62d27a17d5 Takes out column width variable 2018-10-17 13:06:57 -04:00
Zack Arnett
35941a58a5 Prettier Fixes 2018-10-17 11:11:29 -04:00
Paulus Schoutsen
2ace2165e0 version bump to 20181017.0 2018-10-17 14:06:59 +02:00
Paulus Schoutsen
1cfcacfa9a Update translations 2018-10-17 14:06:20 +02:00
Paulus Schoutsen
e020fd1154 👋 decorators (#1790) 2018-10-17 13:58:24 +02:00
Paulus Schoutsen
1dcc645fec Guard cloud info being null (#1788) 2018-10-17 13:48:31 +02:00
Thomas Lovén
87fba75860 Fix margins in vertical-stack (#1789) 2018-10-17 13:48:04 +02:00
Paulus Schoutsen
294360d35a Fix babel config 2018-10-17 09:20:41 +02:00
Paulus Schoutsen
a7684d7206 Add some decorators (#1784)
* Add some decorators

* Disable sort keys

* Add babel plugins

* Update typescript to 7.1
2018-10-16 23:30:13 +02:00
Paulus Schoutsen
af81ede100 Fix showing sub info (#1785) 2018-10-16 23:29:40 +02:00
Zack Arnett
698beedaa2 Changing Clance Column width default to fill card 2018-10-16 16:20:28 -04:00
Paulus Schoutsen
a6b4cce7f3 Upgrade MDI icons (#1781) 2018-10-16 20:02:09 +02:00
ehendrix23
ba66ff840f Added domain icon for homekit (#1782)
Added domain icon home-automation for domain homekit. With PR home-assistant/pull/17180 the homekit component will create entries within logbook. This PR is to set the icon displayed then for those logbook entries to be the home-automation icon.
2018-10-16 19:06:19 +02:00
Zack Arnett
c296f33ba1 Update Button Card to TS + Lit (#1778)
* Updating from Reviews - Reset commits and force pushing

* Removing Redundant check on config

* Checking Entity before setting config
2018-10-16 19:04:29 +02:00
Paulus Schoutsen
e7a49192bd Type check as part of lint (#1780)
* Type check as part of lint

* Lint

* Validate service exist for call-service action

* Fix for of
2018-10-16 17:21:05 +02:00
Thomas Lovén
5774d913af Lovelace: Add a label entity row (#1779)
* Add a label entity row

* Style fixes

* Allow blank label text

* Rename to section
2018-10-16 16:50:40 +02:00
Charles Garwood
b068db3f7a Hide Z-Wave "Remove/Replace Failed Node" Buttons unless nodes are failed (#1777)
* Hide failed node buttons if node isn't failed

* Cleanup
2018-10-16 09:05:15 +02:00
Paulus Schoutsen
8e49241e7c Add types to hass object (#1776) 2018-10-16 09:04:10 +02:00
Tom Raithel
b8cee5cc9c Fix Icon spacing in Logbook list (#1774) 2018-10-15 21:02:32 +02:00
Zack Arnett
794808d3a7 Button Card - Lovelace Addition (#1766)
* Initial Commit - Button Card

* Fixing Coloring Review

* Resolving Reviews

* Updating last Reviews
2018-10-15 20:07:13 +02:00
Zack Arnett
48f6d1dfec Adding Alarm Panel to Lovelace (#1758)
* Adding Alarm Panel

* Updating error in Lint

* Review Changes

* Using label-badge for upper right icon

* Resolving Reviews

* Prettier Fixes

* Updating style to fix overlapping state badge

* Adding Alarm Card back to create element

* Resolving reviews and reposition of Icon

* Updating to Localize Labels
2018-10-15 19:14:43 +02:00
Paulus Schoutsen
97e1aae9c0 Introduce TypeScript (#1773) 2018-10-15 19:07:08 +02:00
Paulus Schoutsen
e2511c5ed3 Remove default export fire event (#1772)
* Remove default export fire event

* Update provide_hass.js
2018-10-15 06:17:33 +02:00
Paulus Schoutsen
74bdfc8c2d Use style.setProperty instead of updateStyles 2018-10-14 22:53:33 +02:00
Paulus Schoutsen
fbccf23d36 Clean up localize mixin (#1771) 2018-10-14 22:40:43 +02:00
Paulus Schoutsen
906aaa15a3 20181014.0 2018-10-14 19:05:46 +02:00
Paulus Schoutsen
0ae1f9c754 Update Translations 2018-10-14 19:05:45 +02:00
Adam Mills
f1bd89fd02 Fix checking for syntax if for doesn't exist (#1769) 2018-10-14 19:04:51 +02:00
Paulus Schoutsen
3949b47e51 Introduce object rest spread (#1763) 2018-10-14 19:03:25 +02:00
Bram Kragten
2f6595bca7 add min-width to childeren of horizontal stack (#1761)
See https://css-tricks.com/flexbox-truncated-text/
2018-10-13 16:02:47 +02:00
Paulus Schoutsen
3bcd0ddc46 Migrate Babel 6 -> 7 (#1762)
* Migrate Babel 6 -> 7

* Update babel-eslint
2018-10-13 11:25:03 +02:00
Paulus Schoutsen
ca93c2cfcd Convert glance card to lit (#1760)
* Convert glance card to lit

* Guard for hass before config

* Lint

* better click listening

* Move config check

* Format HTML
2018-10-12 22:18:38 -07:00
Paulus Schoutsen
a633e3c553 version bump to 20181012.0 2018-10-12 14:49:33 +02:00
Paulus Schoutsen
bef2731207 Update translations 2018-10-12 14:49:15 +02:00
Paulus Schoutsen
ee53ee4077 Missing localize (#1757) 2018-10-12 12:50:58 +02:00
Paulus Schoutsen
34bfc12647 Prettier 💎 (#1737)
* Add prettier

* Apply Prettier
2018-10-11 12:22:11 +02:00
Nikolay Vasilchuk
3b425c3e14 Logbook: filter by entity and period (#1728)
* Filter logbook by entity_id

* Filter logbook by period

* Filter logbook styles

* CI Fix

* Review

* Review

* CI Fix
2018-10-11 11:46:16 +02:00
Zack Arnett
69eb007ea2 Adding Gauge Card to Lovelace (#1742)
* Commiting Only needed Files. Adds Gallery Entry

* Adding Attribute current_temperature to gallery entry config

* Fixing code from review and updating gallery

* Updating Gallery to show errors

* Resolving Reviews and updating gallery

* Deleting unused line

* Minor changes

* Address my own comments.
2018-10-11 10:30:56 +02:00
Jerad Meisner
90c3350d40 Fix error when only one state history entry. (#1750) 2018-10-09 11:12:04 +02:00
John Arild Berentsen
a7ddbd72b3 Fix non-working zwave log andriod PWA (#1714)
* Fix non-working andriod PWA

* Forgot clearing dialog setInterval

* Correctly identify pwa or browser interval clearing

* Move isPwa to common

* Stab at making imorted dialog

* Redone refresh

* Remove unused property
2018-10-09 11:10:32 +02:00
Paulus Schoutsen
5a2ee98ae2 Version bump to 20181007.0 2018-10-07 23:15:44 +02:00
Karl Kihlström
ea0b5d5e26 Add sensor-graph-card (#1744)
* Added sensor-graph-card

* Removed Object as type

* Removed unused attributes

* Fixed card config

* Changed svg rendering to lit html svg

* Fixed config conversion

* Changed to _config, _entity, _line as private

* Removed lit-element package

* Renamed to hui-sensor-card

* lit-html 0.6.2 changes

* Added logic for graph config option
2018-10-07 23:13:10 +02:00
Paulus Schoutsen
af2cb1be1a Update Lit to 0.6.2 (#1748) 2018-10-07 21:32:50 +02:00
Jerad Meisner
c30e7ac683 Add time created to persistent notifications. (#1733)
* Add time created to persistent notifications.

* Add tooltip to show actual date.

* Fix style rules.

* Fix duplicate ids.
2018-10-07 18:59:54 +02:00
Paulus Schoutsen
7fb5ac11fd Update translations 2018-10-07 18:52:30 +02:00
Paulus Schoutsen
b2dc0ac819 Proper fix for mjs to hassio too 2018-10-07 18:52:01 +02:00
Paulus Schoutsen
dbdf873ba4 transpile mjs (#1746) 2018-10-07 14:11:33 +02:00
Paulus Schoutsen
1b70b6e88c Introduce Lit Element (#1738) 2018-10-07 11:07:02 +02:00
Paulus Schoutsen
c90e13d35e Inline domain icon (#1739) 2018-10-05 21:29:50 +02:00
Paul Davis
442375f76e fix dockerfile for new setups (#1740) 2018-10-05 21:23:31 +02:00
Paulus Schoutsen
81d493e1d6 Version bump to 20181005.0 2018-10-05 17:46:49 +02:00
Paulus Schoutsen
151f16af47 Update translations 2018-10-05 17:46:34 +02:00
Adam Mills
606a220603 [WIP] Handle dict syntax in state trigger "for" (#1725)
* Handle dict syntax in state trigger "for"

* padStart polyfill
2018-10-05 11:33:27 +02:00
Thomas Lovén
362e758c40 Lovelace: Allow glance card to assume theme colors (#1732)
* Allow glance card to assume theme colors

* Better configuration options

* Added example to gallery

* Fixing problems from review
2018-10-05 10:26:31 +02:00
Paulus Schoutsen
2eb3a55f59 Remove last used from long lived access token list. (#1727) 2018-10-05 10:23:29 +02:00
Paulus Schoutsen
6720c03cbc Fix language reference (#1735) 2018-10-04 13:24:07 +02:00
Jerad Meisner
a76386b53b Fix console errors in LL when entities are unavailable. (#1734) 2018-10-04 09:44:01 +02:00
Thomas Lovén
0243632357 Remove margin from conditional if not shown (#1730) 2018-10-04 09:36:14 +02:00
Paulus Schoutsen
bb24b55a67 Update translations 2018-10-03 15:28:12 +02:00
Paulus Schoutsen
f47fd8eec4 Bump version to 20181002.0 2018-10-02 14:17:58 +02:00
Paulus Schoutsen
f1f9f13d82 Update translations 2018-10-02 14:17:44 +02:00
Paulus Schoutsen
d2dd82c0ec Use new LL command (#1702) 2018-10-02 14:16:52 +02:00
Paulus Schoutsen
e1738b625d Fix link color for Hass.io update panel (#1721) 2018-10-02 14:16:35 +02:00
William Scanlon
7aa37183b6 Convert climate water heaters to new water_heaters component (#1661)
* Water heater support

* Attempt to fix lint errors.

* Fixed another lint issue
2018-10-02 14:16:19 +02:00
Jason Hu
c91b28a850 L10N config-entries (#1718)
* L10N config-entries

* Lint

* Address review comment

* Add back parentheses
2018-10-02 13:27:18 +02:00
Adam Mills
70225c1a18 Expose state trigger For configuration in editor (#1723) 2018-10-02 13:26:56 +02:00
Jason Hu
3d9d7d899d Fix zero degree in weather card (#1720)
* Fix zero degree display in weather card

* Fix zero degree display in weather more-info dialog
2018-10-01 13:30:48 +02:00
Otto Winter
f0619c7d13 Add pressure sensor device class (#1713) 2018-10-01 12:32:03 +02:00
Jason Hu
305fa84d38 Apply user language preference on datetime formatting (#1719) 2018-10-01 12:08:21 +02:00
Jason Hu
edf0e2bedb Add l10n suppor for profile panel (#1717)
* L10N support for profile panel and mfa module

* L10N support for mfa setup flow

* Lint

* Lint

* Lint
2018-10-01 12:02:41 +02:00
Anders Melchiorsen
8be5561d19 Remove turn_off from brightness slider (#1715) 2018-10-01 10:56:08 +02:00
Paulus Schoutsen
f11ca53282 Version bump to 20180927.0 2018-09-27 23:03:17 +02:00
Paulus Schoutsen
2c25d6cc0a Update translations 2018-09-27 23:03:02 +02:00
Paulus Schoutsen
db6ab4d8ec Update Z-Wave icon (#1711) 2018-09-27 23:02:22 +02:00
Jerad Meisner
3961eff372 Extend paper-slider to fix rounding issue. (#1709) 2018-09-27 10:06:56 +02:00
Charles Garwood
458a7827f9 Fix for content appearing behind header in hassio and config panels (#1708)
* Call iron-resize on route change

* Add EventsMixin to hassio-main
2018-09-26 20:37:03 +02:00
Paulus Schoutsen
68d1c77a79 Bump version to 20180926.0 2018-09-26 11:10:46 +02:00
Paulus Schoutsen
aa97e30d51 Add card for entities without devices (#1706)
* Add card for entities without devices

* Better empty check
2018-09-26 11:09:33 +02:00
Paulus Schoutsen
9027d7d391 Update translations 2018-09-26 10:57:56 +02:00
Paulus Schoutsen
974fd5de0f Allow description when creating entry (#1704)
* Allow description when creating entry

* Lint
2018-09-25 16:32:45 +02:00
Paulus Schoutsen
f9d28fbf83 Add alert icon" (#1703) 2018-09-25 14:42:23 +02:00
Paulus Schoutsen
b944089087 Version bump 20180924.0 2018-09-24 11:46:26 +02:00
Paulus Schoutsen
7b6cf28459 Update translations 2018-09-24 11:46:10 +02:00
Paulus Schoutsen
be91688efb Add link to release notes (#1694) 2018-09-24 11:05:23 +02:00
Paulus Schoutsen
a5d47231aa Fix text color for system panel (#1695) 2018-09-24 11:05:16 +02:00
Paulus Schoutsen
01e833a399 Fix ha-paper-slider (#1700) 2018-09-24 11:05:03 +02:00
Charles Garwood
c363ba8056 Fix more-info graph when expanded (#1696) 2018-09-24 10:01:40 +02:00
schumpeter2
7cec39ba6c Fix more-info dialog call for groups of entities having a common domain (#1698) 2018-09-24 09:58:25 +02:00
PhracturedBlue
3f15cbd2bd Add support for multiple separate mailboxes (#1660) 2018-09-21 11:56:30 +02:00
Paulus Schoutsen
3235d33463 Add firmware 2018-09-21 10:41:25 +02:00
Paulus Schoutsen
140597c7f8 Minor CSS Fixes 2018-09-21 10:00:03 +02:00
Paulus Schoutsen
e1407a7d73 Use human readable description if possible (#1688)
* Use human readable description if possible

* lint
2018-09-21 09:20:07 +02:00
Paulus Schoutsen
03525c010f Allow toggling cloud integrations (#1690) 2018-09-21 09:02:24 +02:00
Paulus Schoutsen
8dc202af92 Version bump to 20180920.0 2018-09-20 10:53:41 +02:00
Paulus Schoutsen
369977f8f3 Update translations 2018-09-20 10:52:56 +02:00
randellhodges
7f8c092dfc Normalize more-info bottom padding (#1682) 2018-09-20 10:20:12 +02:00
randellhodges
d517cad6e6 fixed weather-lightning icon (#1684) 2018-09-20 10:19:04 +02:00
Paulus Schoutsen
62a68890d3 Show sub info (#1685)
* Show sub info

* Fix observer
2018-09-20 10:18:39 +02:00
Paulus Schoutsen
3d8a8cc77b Fix minifier (#1683) 2018-09-20 00:08:25 +02:00
Paulus Schoutsen
55dc35a8fc Update version to 20180919.0 2018-09-19 15:16:35 +02:00
Paulus Schoutsen
82e49a5e44 Update translations 2018-09-19 15:16:14 +02:00
Paulus Schoutsen
17ac6f96a0 Update deps (#1678)
* Update deps

* Lint

* Fix lint
2018-09-19 15:15:16 +02:00
Pascal Vizeli
085db3e0a6 Fix URL for nabucasa page (#1677) 2018-09-19 14:59:59 +02:00
Paulus Schoutsen
348bebc417 Update material design sidebar (#1676) 2018-09-19 14:59:48 +02:00
Paulus Schoutsen
15d21cc673 Fix miniy fail (#1674) 2018-09-19 11:32:24 +02:00
Paulus Schoutsen
7e0ff14f28 Merge overview into integrations (#1672)
* Merge overview into integrations

* Lint
2018-09-19 11:11:00 +02:00
Charles Garwood
67d09e8b3d Add loaded components popup to dev-info (#1666)
* Add loaded components popup to dev-info

* Change dialog handling
2018-09-18 14:54:37 +02:00
randellhodges
ce3b53a920 Image aspect ratio (#1665)
* Allow user to specify an aspect ratio for various images

* added a comment on what is supported

* fixed typo

* Fixed lint and test errors
2018-09-17 21:16:00 +02:00
Paulus Schoutsen
a32809e14b Update padding checkbox 2018-09-17 17:23:56 +02:00
Paulus Schoutsen
1d8c515da2 Bump to 20180917.0 2018-09-17 14:17:08 +02:00
Paulus Schoutsen
81e0f1a025 Update translations 2018-09-17 14:16:47 +02:00
Paulus Schoutsen
c593e2789c Add basic overview page (#1668)
* Add basic overview page

* Add empty state

* Show hub devices

* Add more info to config entries page

* Lint
2018-09-17 14:11:07 +02:00
cdce8p
650d2d7a47 Lovelace Custom ui fallback (#1670)
* Custom ui elements fallback to default instead of error

* Lint

* Changed fallback to timeout
2018-09-17 14:06:17 +02:00
Paulus Schoutsen
2665c86683 Show entities under configured integrations (#1663) 2018-09-17 10:00:21 +02:00
Jerad Meisner
8b262f3424 Added entity row for media players. (#1495)
* Added entity row for media players.

* Use artist:track/series:episode for music/tvshow.

* Add controls

* Comments

* Fixes

* Fixes for off states. Added gallery demo.

* Resolve conflicts. Change to use template extension points.

* Fixes
2018-09-17 09:58:43 +02:00
Jerad Meisner
5187f3b84f Get persistent_notifications for lovelace from websocket. (#1649)
* Get persistent_notifications for lovelace from websocket.

* Only fetch notifications on event.

* Use collection for notifications.
2018-09-17 09:53:14 +02:00
Charles Garwood
443e083a79 Add Z-Wave Entity Information/more-info button (#1664)
* Add Entity Info button

* Cleanup
2018-09-17 09:43:13 +02:00
Paulus Schoutsen
6c262c20ce Handle defaults, required and optional fields (#1662)
* Handle defaults, required and optional fields

* Lint
2018-09-17 09:42:43 +02:00
Paulus Schoutsen
cfbf2903c1 Version bump to 20180916.0 2018-09-16 21:20:49 +02:00
Paulus Schoutsen
19b8ff7d9f Update translations 2018-09-16 21:20:24 +02:00
Paulus Schoutsen
ec6ffd2115 Update text 2018-09-16 21:19:58 +02:00
Paulus Schoutsen
433b1e2979 Fix translation 2018-09-12 15:30:33 +02:00
Paulus Schoutsen
bd3d079dfb Version bump to 20180912.0 2018-09-12 13:13:49 +02:00
Paulus Schoutsen
fe776191b7 Update translations 2018-09-12 13:13:30 +02:00
Paulus Schoutsen
c546d8787d Add last used to token on profile page (#1659) 2018-09-12 13:12:26 +02:00
Jason Hu
a672b84b88 Disable delete icon if token is current used one (#1658) 2018-09-12 09:50:12 +02:00
Paulus Schoutsen
e3a137c675 Version bump to 20180911.0 2018-09-11 21:35:28 +02:00
Paulus Schoutsen
10aa99abdc Update translations 2018-09-11 21:35:08 +02:00
Paulus Schoutsen
34567d451f Add UI for tokens (#1656)
* Add UI for tokens

* Update strings

* Update text

* Update text
2018-09-11 21:29:40 +02:00
PhracturedBlue
494e3dc62c Fix authorization and display issues in mailbox view (#1610)
* Mailbox: Fix authorization issues.  Remove backdrop

* Fix linting issues

* Use HA Dialog system.  Fix authorization

* Add back missing backdrop

* Linting errors

* Use callApi.  Add error checking and spinner

* linting error

* more linting errors

* minor requested fixes

* Use let/const.  Fix lint issues

* Remove blob test that can never fail

* More let vs var fixes

* More minor requested fixes

* Rework code to use fetchWithAuth

* Async tweaks

* Lint

* Fix onboarding

* Add credentials for onboarding

* Lint
2018-09-11 11:33:57 +02:00
Paulus Schoutsen
0997274f29 Update external auth (#1655)
* Update external auth

* Lint
2018-09-11 10:24:01 +02:00
cdce8p
76161329b6 Add lovelace template extension points (#1653) 2018-09-10 23:15:29 +02:00
John Arild Berentsen
8505750958 Load ozw-log in new window, and add tail-like button. (#1652)
* Load log in new window, and add tail

* avoid duplicate code
2018-09-10 21:53:16 +02:00
Paulus Schoutsen
4077105db1 Version bump to 20180910.0 2018-09-10 13:28:51 +02:00
Paulus Schoutsen
3f31d83a55 Update translations 2018-09-10 13:28:33 +02:00
Paulus Schoutsen
d729e3c567 Update HAWS to 3.1.2 2018-09-10 13:25:50 +02:00
Paulus Schoutsen
9af75f9a43 Prevent changing domain entity ID (#1650) 2018-09-10 13:14:21 +02:00
Alessandro Staniscia
d32d334a2e Review Docker management (#1113)
* Review Docker management ( linked with #934 )

*  fix comment by @balloob

* Explicit remove of  package-lock.json

* moved on feature branch, merge docker scripts, added documetation

* Used alphine as requested by @balloob on https://github.com/home-assistant/home-assistant-polymer/pull/947 and followed the @mcspr comment https://github.com/home-assistant/home-assistant-polymer/issues/934

* Remove package-lock from gitignore, we don't use npm

* Update for new build instructions
2018-09-10 11:58:18 +02:00
Charles Garwood
94006a843c ZWave Panel Updates (#1647)
* Add padding to zwave log text

* Replace entity dropdown with actual entity_id

* Add Node Information button for more-info popup, and remove less-functional Node Info card.

* Fix indentation

* Address review comments

* Fix lint/mixin

* Update comment
2018-09-10 10:16:10 +02:00
Jason Hu
4790590327 Try to resolve workbox warning (#1648) 2018-09-10 10:15:20 +02:00
Charles Garwood
7cf7763e21 Fix body stream already read error (#1646) 2018-09-08 21:06:07 +02:00
Paulus Schoutsen
0d7979a72f Add revoke token to (external) auth (#1639)
* Add revoke token to external auth

* Lint

* Update to HAWS 3.1.1

* Fix constant
2018-09-07 20:37:06 +02:00
Paulus Schoutsen
300425e698 Redirect to onboarding from auth page (#1640)
* Redirect to onboarding from auth page

* Remove left over trial code
2018-09-07 20:13:00 +02:00
Stephen Vanterpool
59010baf89 Fix the way calls are made over the javascript bridge (#1644)
* Fix the way calls are made over the javascript bridge

* Update external_auth.js
2018-09-07 20:12:52 +02:00
Paulus Schoutsen
47fcb122a2 Don't delete system generated user (#1638) 2018-09-07 19:41:06 +02:00
Paulus Schoutsen
bbb50b1397 Better handle auth (#1637)
* Better handle auth

* Lint
2018-09-07 19:40:56 +02:00
Paulus Schoutsen
ae8724d699 Compress using zopfli (#1636) 2018-09-05 11:41:03 +02:00
Paulus Schoutsen
2169f6979d Remove link to alexa web 2018-09-04 15:02:35 +02:00
Paulus Schoutsen
9cc577e9c7 Add external auth (#1621)
* Add external auth

* Lint

* Warn when external auth not present
2018-09-03 09:00:39 -07:00
Paulus Schoutsen
6ead58f62f Version bump to 20180903.0 2018-09-03 13:17:04 +02:00
Paulus Schoutsen
ec3118227c Update translations 2018-09-03 13:16:45 +02:00
Paulus Schoutsen
0d3d9bc78a Upgrade MDI icons (#1630) 2018-09-03 13:07:58 +02:00
Jason Hu
e16b3db0d4 Ask "save to login" after hassConnected (#1631) 2018-09-03 13:07:34 +02:00
Timmo
cdab874b5b Autocapitalization of username field (#1627)
* 🔨 fix capitalization of username field

* 🔨 change words to on
2018-09-03 13:06:15 +02:00
Paulus Schoutsen
bf40995b16 Show an error when invalid client id or redirect uri (#1620) 2018-09-02 10:29:38 -07:00
Paulus Schoutsen
68b3a4fbb7 Version bump to 20180831.0 2018-08-31 12:45:59 +02:00
Paulus Schoutsen
c38bfa1101 Update translations 2018-08-31 12:45:42 +02:00
Jerad Meisner
af7a85eeb7 Force line chart for climate state history. (#1617)
* Force line chart for climate state history.

* Simplify climate check
2018-08-31 12:44:07 +02:00
Paulus Schoutsen
2bd5dc21a8 Fix refresh user (#1618)
* Fix refresh user

* Lint
2018-08-31 12:28:32 +02:00
Paulus Schoutsen
18a151c8e8 Fix Safari Profile page (#1619) 2018-08-31 11:17:57 +02:00
Paulus Schoutsen
da19a1a9c6 Fix header for glance cards 2018-08-31 11:15:06 +02:00
Paulus Schoutsen
45cdb5a3e4 Use new version of HAWS (#1612)
* Use new version of HAWS

* Fix init page

* Lint

* Fix tests

* Update gitignore

* Clear old tokens, use new key to store
2018-08-31 09:45:58 +02:00
Paulus Schoutsen
ab19dbc35e Version bump to 20180829.1 2018-08-29 22:49:34 +02:00
Paulus Schoutsen
6a443734a1 Update translations 2018-08-29 22:49:21 +02:00
Jason Hu
f0251d3056 Fix for login flow switch (#1609)
* Fix for login flow switch

* Switch flow shall clear step data
2018-08-29 22:48:32 +02:00
Paulus Schoutsen
31127ccf29 Version bump to 20180829.0 2018-08-29 10:23:27 +02:00
Paulus Schoutsen
b97e055b39 Update translations 2018-08-29 10:22:57 +02:00
Jason Hu
f4ce1ee0fa Add some translation for login flow (#1608)
* Add some translation for login flow

* Fix typo
2018-08-29 10:18:55 +02:00
PhracturedBlue
2a29311ca5 Lovelace: Don't show badge entities in unused list (#1607) 2018-08-28 20:34:12 +02:00
Paulus Schoutsen
8cfd7ee170 Version bump to 20180827.0 2018-08-27 22:20:31 +02:00
Paulus Schoutsen
59a8354a7f Update translations 2018-08-27 22:20:17 +02:00
Paulus Schoutsen
f443942e03 Authorize onboarding (#1603)
* Tweak onboarding + authorize

* Authorize/Onboarding pimp

* More tweaks

* Comments
2018-08-27 22:10:15 +02:00
Alok Saboo
772208ba22 Fixed typo (#1604) 2018-08-27 21:50:14 +02:00
Paulus Schoutsen
e46a1be5d7 Center svg in markdown 2018-08-26 22:00:57 +02:00
Paulus Schoutsen
d295a9d0e4 Version bump to 20180826.0 2018-08-26 21:24:03 +02:00
Paulus Schoutsen
f0bf34073b Update translations 2018-08-26 21:23:25 +02:00
Jason Hu
73098d106d disableXssFilter ==> allowSvg (#1600)
* disableXssFilter ==> allowSvg

* Move allowSvg patch to _render()

* Add comment
2018-08-26 11:50:37 -07:00
Jason Hu
c8ea4cd85e Disable XSS filter in flow step desc markdown (#1599) 2018-08-26 12:44:50 +02:00
Paulus Schoutsen
f64ddf46e2 Update frontend to 20180825.0 2018-08-25 11:13:29 +02:00
Paulus Schoutsen
5e6e3dd793 Update translations 2018-08-25 11:13:14 +02:00
Paulus Schoutsen
13ff59ec89 Fix hass icons 2018-08-24 21:59:53 +02:00
Jason Hu
7cc3fc728b Add ha-mfa-modules-card and setup flow (#1590)
* Add ha-mfa-modules-card and setup flow

* Add hass-refresh-current-user event

* Address code review comment
2018-08-24 19:35:33 +02:00
Glenn Waters
ec79e12bf3 Fix for missing 'Disarm' button (#1549)
* Fix for missing 'Disarm' button

Disarm button does not show when in `arming` and `disarming` state.

* Update more-info-alarm_control_panel.js

Disarm button visible on arming state.
2018-08-24 16:57:04 +02:00
Paulus Schoutsen
d38b989c02 Version bump to 20180824.0 2018-08-24 15:50:17 +02:00
Paulus Schoutsen
f9a629bf8d Update translations 2018-08-24 15:49:58 +02:00
Jerad Meisner
02edbce460 Notification drawer (#1536)
* Notification drawer MVP concept

* Localization

* Don't use events.
2018-08-24 15:46:58 +02:00
Jerad Meisner
b9f84d012f Add default_zoom option to map card. (#1592) 2018-08-24 10:27:36 +02:00
Jerad Meisner
421478bb49 Hide toolbar on scroll. (#1595) 2018-08-24 10:25:58 +02:00
Jerad Meisner
cde106bd77 Fix custom icon colors in entities and glance cards. (#1587)
* Fix custom icon colors in entities and glance cards.

* Use ha-icon directly in state-badge.
2018-08-23 22:24:21 +02:00
John Arild Berentsen
144f00e2cc reset entity properties on 404 (#1591) 2018-08-23 22:23:00 +02:00
squidwardy
74185f0beb Add support for JS modules in custom panels. (#1588)
* Added support for JS modules in custom panels.

* Update load-custom-panel.js

* Corrected syntax

* Force push

* Fixed EOL

* Delete index.html

* Fixed tempA href missing module_url name
2018-08-23 11:14:47 +02:00
Paulus Schoutsen
09f238162e Cleanup (#1575) 2018-08-21 08:59:54 +02:00
Jerad Meisner
13ece650bc Fix input_number flexbox. (#1586) 2018-08-21 08:59:39 +02:00
Paulus Schoutsen
cbef262805 Version bump to 20180820.0 2018-08-20 11:50:51 +02:00
Paulus Schoutsen
cbdd641d5f Update translations 2018-08-20 11:50:33 +02:00
Paulus Schoutsen
f435c38aa5 Upgrade websocket lib to 2.1 (#1583) 2018-08-20 11:49:24 +02:00
Paulus Schoutsen
4e135681bc Fix push notifications (#1585) 2018-08-20 11:49:13 +02:00
Paulus Schoutsen
8da969455b Add period to push notif toggle description 2018-08-19 18:51:24 +02:00
Paulus Schoutsen
f4ebf77b36 bump frontend to 20180818.0 2018-08-18 11:11:58 +02:00
Paulus Schoutsen
bb3af18e46 Only ask to save login with new auth (#1581) 2018-08-18 11:11:17 +02:00
Jerad Meisner
c025df2974 Use core temperature units for climate entities. (#1580) 2018-08-17 09:29:42 +02:00
Paulus Schoutsen
5cf5e6ec6c Version bump to 20180816.1 2018-08-16 22:14:26 +02:00
Paulus Schoutsen
6236252a90 Fix editor 2018-08-16 22:14:06 +02:00
Paulus Schoutsen
9f71d9331c Fix automation editor safari (#1576)
* Use ha-textarea

* Lower Safari requirement to 10.3

* Lint
2018-08-16 21:49:35 +02:00
John Arild Berentsen
488e6d09ca Fix Ascii not updating properly and code length limited to current code length (#1577) 2018-08-16 20:49:19 +02:00
Paulus Schoutsen
00b1fbe091 Version bump to 20180816.0 2018-08-16 14:21:06 +02:00
Paulus Schoutsen
c1ea1bb54f Update translations 2018-08-16 14:20:54 +02:00
John Arild Berentsen
49a5d922fc Zwcp small fixes, style, refactor etc. (#1570)
* Fix promise errors

* Style, fixes and refactors

* Missed some files

* Short key
2018-08-16 14:18:50 +02:00
Paulus Schoutsen
a960084438 Include ES5 version of hass-icons (#1574) 2018-08-16 13:39:43 +02:00
Jason Hu
8ae44e6f7f Fix stateObj.attributes.entity_id null issue (#1572) 2018-08-16 10:16:34 +02:00
Paulus Schoutsen
95ea220936 Fix build 2018-08-15 12:30:45 +02:00
Paulus Schoutsen
7ffdb3ddc7 Use ha toast for frontend notification 2018-08-15 10:48:23 +02:00
Jason Hunter
decbbc9acd Media Player: Standardize computePlaybackControlIcon (#1571)
* standardize computePlaybackControlIcon and add play/pause icon for UNKNOWN state

* fix linting errors
2018-08-15 10:45:36 +02:00
Paulus Schoutsen
496e05651e Version bump to 20180813.0 2018-08-13 21:24:42 +02:00
Paulus Schoutsen
efd36bf207 Update translations 2018-08-13 21:24:42 +02:00
Paulus Schoutsen
283668ef18 Fix disconnected notification (#1569) 2018-08-13 21:22:23 +02:00
Paulus Schoutsen
310299367b Ask to store auth (#1568)
* Ask to store auth

* Reorg auth
2018-08-13 21:10:39 +02:00
Paulus Schoutsen
63c7c55843 Cleanups (#1566)
* Cleanup core.js

* Add ha-toast

* Lint

* Remove unused import
2018-08-13 15:48:54 +02:00
Jerad Meisner
4bc83b01d3 Remove _hiddenState method. (#1557)
* Remove _hiddenState method since it always has the same result.

* Hide state when row element is narrow. Add input_number row to gallery.
2018-08-13 09:42:09 +02:00
Paulus Schoutsen
743c3ab784 update version to 20180811.0 2018-08-11 08:55:10 +02:00
Paulus Schoutsen
98d2b0b889 Update translations 2018-08-11 08:54:55 +02:00
Paulus Schoutsen
c39417c93d Move user settings to profile page (#1560) 2018-08-11 08:46:16 +02:00
Paulus Schoutsen
1b2b62f04c Reorg root (#1559)
* Extract element from entrypoint

* Reorg root

* Extract more

* Lint

* Extract connection

* Extract notification

* Lint

* Also split out more info dialog

* Consolidate dynamic element creation
2018-08-11 08:45:11 +02:00
Jerad Meisner
1a31855fc8 Right-align climate row state display. (#1558) 2018-08-10 08:22:58 +02:00
Paulus Schoutsen
f4e92dedff Fix links to dev tools
Fixes #1556
2018-08-09 23:13:33 +02:00
John Arild Berentsen
85d6be64cc Remove zwave rename functions (#1553) 2018-08-09 11:47:38 +02:00
Jason Hu
033e058745 Fix access token expires issue (#1554) 2018-08-09 11:17:40 +02:00
Paulus Schoutsen
1cbe0b7b9f Don't put components in entrypoint (#1548)
* Don't put components in entrypoint

* Remove extra deps
2018-08-07 23:11:57 +02:00
Paulus Schoutsen
22433d1a39 Update translations 2018-08-07 09:40:53 +02:00
John Arild Berentsen
e048060c72 Fix wrong targetnode and nonupdating othergroupnodes (#1541) 2018-08-06 10:40:31 +02:00
Paulus Schoutsen
60d04b5c58 Bump version to 20180804.0 2018-08-04 15:16:42 +02:00
Paulus Schoutsen
0a991ecdf8 Update translations" 2018-08-04 15:16:28 +02:00
Paulus Schoutsen
a9f29a3151 Fix custom panel include (#1539) 2018-08-04 15:15:44 +02:00
Jason Hu
50f417a7e2 Fix dropdown in new login form (#1538) 2018-08-04 15:05:44 +02:00
Paulus Schoutsen
d69492988a Version bump to 20180803.0 2018-08-03 13:37:05 +02:00
Paulus Schoutsen
286fa14a30 Update translations 2018-08-03 13:36:52 +02:00
Paulus Schoutsen
8fa9b15fbe Fix margin gallery 2018-08-03 13:31:11 +02:00
Marius
b432324159 Fixed conditional card state on 1st render (#1537)
* Fixed conditional card state on 1st render

* Moved method to correct location
2018-08-03 13:03:28 +02:00
Conrad Juhl Andersen
255ea41648 Update state-card and more-info card to support new methods. (#1532)
* Update state-card and more-info card to support new start and pause methods

* Revert some changes

* fixed checking the same thing twice
2018-08-03 11:23:28 +02:00
Jason Hu
6bcfdfaaf8 Support for voluptuous-serialize 2.0.0 (#1529) 2018-08-02 17:03:26 +01:00
Paulus Schoutsen
2dada41791 Version bump to 20180802.0 2018-08-02 14:18:11 +02:00
Paulus Schoutsen
4b5152a348 Update translations 2018-08-02 14:17:55 +02:00
Paulus Schoutsen
c537a8d389 Use correct keys for localization. (#1533) 2018-08-02 13:17:41 +01:00
Jerad Meisner
716e505c88 Fixed passing service_data to call-service-button. (#1531) 2018-08-02 13:12:24 +01:00
Alexei Chetroi
cc652a9476 allow 'same-origin' credentials for fetch() (#1530) 2018-08-02 13:11:53 +01:00
Conrad Juhl Andersen
db310646b7 Vacuum: Added support for STATES (#1497)
* Changed vacuum state-card

* Stupid copy/paste error

* Added support for vacuum in lovelace

* Implement backwards compat.

* Remove lovelace changes

* Added new lovelace

* Updated lovelace code to reflect changes in entity

* Hopefully fix me being bad at git?

* even more fixes

* remove lovelace for now

* Fixed styling errors

* fix styling

* Fallback to toggle

* Fixed errors

* 🐫

* Updated ui

* fix lint error

* Added error to translation

* Added translations

* Removed a comma

* Added the last translations

* Support translation for actions

* Styling

* abcd, removed states from ui.card.vacuum, and moved actions to ui.card.vacuum.actions

* abcd and use this._interceptable

* Removed unused import

* _computeLabel(state, interceptable)
2018-07-27 16:03:27 +02:00
Paulus Schoutsen
a8ce5e3e25 Add profile badge to sidebar header (#1525)
* Add profile badge to sidebar header

* Lint

* Update ha-sidebar.js

* Address comments
2018-07-27 09:12:14 +02:00
c727
7ca7d3e12c Add conditional card for Lovelace (#1524)
* Add conditional card for Lovelace

* Make it work

* Fix cardSize

* Lint

* Check if visible in cardSize

* Fix

* Add demo, remove visible in cardSize

* Check if undefined
2018-07-27 08:37:09 +02:00
Jerad Meisner
be7fb50f8c Hide change password card for non-homeassistant auth_providers. (#1526) 2018-07-27 08:27:59 +02:00
c727
fdbaa3908a Try to fix history graph for lovelace (#1523)
* Try to fix history graph for lovelace

* Reset interval

* Sort

* Lint
2018-07-26 20:16:23 +02:00
Paulus Schoutsen
ec9a259fc0 Version bump to 20180726.0 2018-07-26 09:31:52 +02:00
Paulus Schoutsen
1287f98357 Update translations 2018-07-26 09:31:38 +02:00
Paulus Schoutsen
6cbca6d88a Use webpack plugin to generate HTML (#1521)
* Use webpack plugin to generate HTML

* Generate index.html

* Remove unused packages
2018-07-26 09:30:03 +02:00
quthla
e458cf1388 Fix name styling (#1522)
* Fix name styling

* Update hui-glance-card.js

* Demo

* Update demo-hui-glance-card.js

* Update hui-glance-card.js
2018-07-26 00:56:25 +02:00
c727
36ba37c59c Fix margin for row action buttons (#1520)
* Fix margin for row action buttons

* Also cover controls
2018-07-25 21:13:37 +02:00
c727
1b18315e96 Add icon support for picture glance (#1518)
* Add icon support for picture glance

* Add gallery demo

* Replace icon-button with ha-icon
2018-07-25 11:02:25 +02:00
Jerad Meisner
690252a6ba Added row entity for climate entities. (#1494)
* Added row entity for climate entities.

* Revert to old climate state style.

* Added climate entity to entities-card in gallery.
2018-07-25 10:40:21 +02:00
c727
72390aaadc Add support for CSS imports (#1517)
* Add support for CSS imports

* Abc
2018-07-24 20:31:15 +02:00
c727
7b579c8e7a Fix header toggle for entity objects (#1514)
* Fix header toggle for entity objects

* Finish

* Lint
2018-07-24 16:02:52 +02:00
quthla
b32a6d58f3 Allow empty names (#1515) 2018-07-24 16:01:41 +02:00
Paulus Schoutsen
7953d960b6 Version bump to 20180724.0 2018-07-24 14:13:30 +02:00
Paulus Schoutsen
e9e7a3cdf3 Update translations 2018-07-24 14:13:08 +02:00
Paulus Schoutsen
f7d9aecf47 Allow changing entity id (#1508)
* Allow changing entity id

* _entityId

* Use set properties
2018-07-24 14:07:40 +02:00
c727
201959841c Hide name or state in picture entity (#1511)
* Hide name or state in picture entity

* Lint
2018-07-24 13:54:54 +02:00
c727
5e91fbc54f Glance: replace turn-on with call-service (#1510)
* Glance: replace turn-on with call-service

* Fix demo

* Lint
2018-07-24 13:50:01 +02:00
c727
d1d248ab87 Add call-service row element (#1513) 2018-07-24 13:49:12 +02:00
c727
00bee73bf1 Fix toggle if state = unavailable (#1512) 2018-07-24 10:06:54 +02:00
c727
c375e5900b Fix toggle-able for group row elements (#1507) 2018-07-24 08:42:33 +02:00
c727
dcc47b6b83 Add prefix and suffix for state-label (#1509)
* Add prefix and suffix for state-label

* Feedback
2018-07-24 08:36:09 +02:00
Paulus Schoutsen
b589412fdd More info (#1500)
* Add more info

* Lint

* Minor cleanup

* Address comments
2018-07-23 22:40:42 +02:00
c727
a899fb1df8 Use local and optimized images in gallery (#1506) 2018-07-23 15:40:58 +02:00
John Arild Berentsen
0aee48cb2c Add ability to set Zwave protection commandclass (#1433)
* Add protection selector

* Review changes

* Naming

* forgot one literal

* Further reveiw changes
2018-07-23 15:31:44 +02:00
Paulus Schoutsen
d30bf6d566 Tweak divider example (#1505) 2018-07-23 14:46:57 +02:00
c727
22ed241286 Add row divider for entities card (#1503)
* Add row divider for entities card

* Add gallery demo

* Change hr to div, less attributes needed
2018-07-23 10:02:33 +02:00
c727
44ab96d590 Entities card: special row types, weblink (#1493)
* Add special row-cards: weblink

* Fix binding

* Fix yaml

* Lint

* Feedback

* Fix build

* Lint

* Lint
2018-07-23 03:57:42 +02:00
Alok Saboo
af4df647cc Updated picture-elements demo card (#1501)
* Update floorplan image

* Add image elements

* Updated card to use different elements

* Change light name

* Light name

* Updated path
2018-07-22 20:31:05 +02:00
Paulus Schoutsen
bdf26bbccd Tweaks (#1489)
* Tweaks

* Lint

* No need for copy plugin

* Allow handling more complex service calls

* Missed a state

* Add locks

* Lint

* Add cover entity

* Make generic entity constructor

* Light to handle homeassistant.X services

* Lint

* Fix translations

* final tweaks
2018-07-22 11:41:56 +02:00
Paulus Schoutsen
3b2d4de313 Add example to show single entity conditionally (#1498) 2018-07-22 10:55:13 +02:00
Alok Saboo
aaea698a6c Added basic picture-elements demo card (#1496)
* Added basic picture-elements card

* Cleanup

* Added title

* Remoted comment
2018-07-22 09:53:51 +02:00
c727
97f548a9f1 Custom icons for row cards and glance (#1492)
* Custom icons for row cards

* Remove var fallback

* Add icon support to glance

* Fix glance
2018-07-21 09:04:45 +02:00
c727
6b1d04584e Improve CSS for entity rows (#1491) 2018-07-21 03:10:42 +02:00
Jerad Meisner
5d7e4322eb Automation and vacuum rows toggleable. (#1490) 2018-07-21 01:42:24 +02:00
Nathan Knotts
bc71019573 ha-cover-controls: handle opening/closing states (#1485)
* ha-cover-controls: handle opening/closing states

* added missing semi-colons

* fixed entityObj reference
2018-07-20 23:00:38 +02:00
c727
f42bddd447 Add more hass data to gallery (#1487)
* Add more hass data to gallery

* Fix media player images
2018-07-20 22:13:34 +02:00
Paulus Schoutsen
93b1e29876 Bump version to 20180720.0 2018-07-20 12:27:06 +02:00
Paulus Schoutsen
388c2c5db4 Update translations 2018-07-20 12:26:51 +02:00
Paulus Schoutsen
3e60083633 Add js-yaml to yarn 2018-07-20 12:24:16 +02:00
Jerad Meisner
06532def08 Add custom elements to picture-elements. (#1482) 2018-07-20 12:04:11 +02:00
Jason Hu
abf85ae19b Only send auth/current_user if new auth is enabled (#1483) 2018-07-20 12:02:30 +02:00
Paulus Schoutsen
9634a13dc2 Fix static assets (#1484) 2018-07-20 11:42:07 +02:00
c727
a78aba5f50 Add more gallery cards (#1481)
* Add more gallery cards

* Lint
2018-07-20 03:22:16 +02:00
Paulus Schoutsen
1b039aee50 tweak demo cards layout (#1479)
* tweak demo cards layout

* Lint
2018-07-19 23:44:12 +02:00
c727
54860d7762 Add more features to gallery (#1477)
* Add more features to gallery

* Feedback

* Fix margin

* Use array-style config

* Split into DemoCards and DemoCard

* Move padding

* Use min-height
2018-07-19 22:57:51 +02:00
Paulus Schoutsen
5c74e31629 Add some styling to the gallery (#1478) 2018-07-19 22:19:10 +02:00
Paulus Schoutsen
61d3d446f4 picture glance: better handle if no title (#1474)
* Better handle if no title

* Simplify code

* Arrays in ifs

* Remove unused method

* Always render the middle div

* Always show both entity divs
2018-07-19 21:18:24 +02:00
Paulus Schoutsen
ec54036f1e Tweak readme 2018-07-19 21:12:59 +02:00
Paulus Schoutsen
a5befbe153 Add more demos (#1476) 2018-07-19 17:00:18 +02:00
Paulus Schoutsen
f952d9c307 Fix build scripts for first run 2018-07-19 15:45:44 +02:00
Paulus Schoutsen
68b94cd7c7 Remove bower.json 2018-07-19 15:27:56 +02:00
Paulus Schoutsen
56907fb922 Add gallery (#1475)
* Add gallery

* Add build script

* Lint

* Remove cache
2018-07-19 15:24:30 +02:00
Paulus Schoutsen
5cc6d20674 Version bump to 20180719.0 2018-07-19 10:51:56 +02:00
Paulus Schoutsen
da78dacca9 Update translations 2018-07-19 10:51:40 +02:00
Paulus Schoutsen
964c028c72 Tweaks to user flow (#1473)
* Tweaks to user flow

* Mobile layout

* Final tweaks
2018-07-19 10:51:00 +02:00
Jerad Meisner
708447b6f1 Added change password card to profile panel. (#1464)
* Added change password dialog to profile panel.

* Switch change password from dialog to card

* Restore current password verification.
2018-07-19 09:39:56 +02:00
Jason Hu
7e257f6ee9 Display Unnamed User if no name found in user object (#1469)
* Display Unnamed User if no name found in user object

* address review comment
2018-07-19 09:11:21 +02:00
c727
10d44db8e6 Allow views with badges and no cards (#1471) 2018-07-19 08:45:59 +02:00
c727
e84f5c683c Fix Lovelace docs URL #2 (#1470)
last PR was to false branch xD
2018-07-19 02:16:13 +02:00
Paulus Schoutsen
bfdde116e2 Version bump to 20180718.0 2018-07-18 17:28:45 +02:00
Paulus Schoutsen
51020d7e68 Update translations 2018-07-18 17:28:39 +02:00
c727
8c44e243e1 Separate row entity elements for Lovelace (#1461)
* Separate row entity elements for Lovelace

* Update

* Update

* Add fan

* Add support for last changed

* Feedback

* Feedback2

* Update

* Update

* Fix timer

* Update

* Lint
2018-07-18 17:25:13 +02:00
Paulus Schoutsen
9ab4158e0a Use callWS helper (#1465) 2018-07-18 17:13:53 +02:00
c727
4c3e039423 Use separate duration for relative time (#1463) 2018-07-18 09:50:31 +02:00
c727
7c5c5ea9b6 Use custom off states in picture glance (#1462) 2018-07-18 09:49:11 +02:00
Jerad Meisner
6db76c8ab4 Refactored element creation out of picture-elements class. (#1446)
* Refactored element creation out of picture-element class.

* Fix navigation element listener.

* Cleanup. Change service-icon -> icon.

* Fixes.

* More fixes.

* More fixes.

* Feedback

* More fixes.
2018-07-18 09:48:27 +02:00
Paulus Schoutsen
3f0824bd39 Version bump to 20180717.0 2018-07-17 10:56:18 +02:00
Paulus Schoutsen
e2c4695613 Add compat layer 2018-07-17 10:55:23 +02:00
Paulus Schoutsen
37678d99af Update translations 2018-07-17 10:06:19 +02:00
Paulus Schoutsen
90328cfc33 Add an onboarding flow (#1452)
* Add an onboarding flow

* Address comments
2018-07-17 10:05:27 +02:00
Paulus Schoutsen
84b0542fb6 Fix spacing picture glance (#1460) 2018-07-17 10:04:48 +02:00
Paulus Schoutsen
229d167f89 Add current user to hass object (#1451)
* Add current user to hass object

* Add enter key support to login form
2018-07-17 09:25:46 +02:00
c727
5c5a7e50da Remove capitalize from card heading (#1455)
fix: https://github.com/home-assistant/ui-schema/issues/107
2018-07-17 08:45:52 +02:00
c727
bac1c8f630 Make Glance column width configurable (#1456) 2018-07-17 08:44:01 +02:00
Marius
9c66d47afa Fixes picture-glance no longer compatible with entity-filter (#1448)
* fixes https://github.com/home-assistant/ui-schema/issues/101

* Updates based on feedback

* More updates from feedback

* Cleanup
2018-07-17 08:43:20 +02:00
Jason Hu
1f80769d9e Submit form when Enter pressed in new login form (#1459) 2018-07-17 08:38:40 +02:00
c727
8dcda2dae9 Fix translation for weather states (#1454)
we should rename the keys on lokalise before we merge this

fix: #1414
2018-07-17 00:34:46 +02:00
Jason Hu
348b284ba6 Check access token expires before we use it. (#1444)
* Check access token expires before we use it.If we found access token expires, we proactive call refresh token.So that we can avoid uncessary invalid auth error in backend.

* Move expires  calc to fetchToken() and refresToken()

* Address code review comment
2018-07-16 23:11:05 +02:00
Paulus Schoutsen
b5ff52febf Version bump to 20180716.0 2018-07-16 08:47:24 +02:00
Marius
832f4ba6cd Make custom cards work as panel (#1447)
* Make custom cards work as panel

* Fixed some errors and implemented suggestion from comments
2018-07-15 14:05:32 +02:00
Paulus Schoutsen
89f9589084 Version bump to 20180713.0 2018-07-13 15:33:00 +02:00
Paulus Schoutsen
ed0d0ab944 Update translations 2018-07-13 15:32:37 +02:00
Paulus Schoutsen
ed9c73429f Allow managing users (#1436)
* Allow managing users

* Address comments

* table -> card-content

* Don't close dialog on error
2018-07-13 15:31:22 +02:00
c727
c11cf53f96 Lovelace: add basic support for badges (#1443)
* Lovelace: add basic support for badges

* Lint

* Check in entityId exists in states

* Hide badges container if no badges

* setProperties

* lint
2018-07-13 13:42:34 +02:00
quthla
834528506a Override history names (#1405) 2018-07-13 12:12:50 +02:00
c727
f2c56a624b Glance card: hide name or state (#1442) 2018-07-12 13:56:25 +02:00
c727
6a35fc9eb5 Picture elements: add service-icon (#1439)
* Picture elements: add service-icon

* Default for servie_data

* Lint

* Remove file
2018-07-12 12:34:05 +02:00
c727
1b262f7cea Picture glance: introduce DOMAINS_TOGGLE (#1440)
* Picture glance: introduce DOMAINS_TOGGLE

* Use set instead of array
2018-07-12 11:58:11 +02:00
c727
c5fd32afac Glance: add toggle and turn_on as action (#1438)
* Glance: add toggle and turn_on as action

* Lint
2018-07-12 09:08:54 +02:00
Jerad Meisner
19e58c775e Add image type for picture-elements card. (#1428)
* Add image type for picture-elements.

* Rebased master. Move overflow rule to parent.

* Cleaned up click handler.
2018-07-12 08:56:53 +02:00
Paulus Schoutsen
c90a3dcdfd Version bump to 20180710.0 2018-07-10 11:58:39 +02:00
Jerad Meisner
5df758c0b2 Add configurable filter and state_filter to hui-image. (#1423)
* Add configurable filter and state_filter to hui-image.

* Rename state -> stateObj.

* Cleanup

* Remove unnecessary CSS

* Use placeholder for broken images.

* Update broken image
2018-07-10 11:37:46 +02:00
Jason Hu
77c65d43ae Add password field support to ha-form (#1418)
* Add password field support to ha-form

* Lint

* Load ha-iconset-svg
2018-07-10 11:20:11 +02:00
Paulus Schoutsen
dbb6a8e6d4 Fix when not using oauth (#1434) 2018-07-10 10:49:51 +02:00
Paulus Schoutsen
89ab6a7d5d Add release drafter 2018-07-10 10:21:24 +02:00
Paulus Schoutsen
c378eda17b Version bump to 20180709.0 2018-07-09 18:26:24 +02:00
Paulus Schoutsen
133d198e7c Make Lovelace filter card more robust (#1431)
* Make Lovelace filter card more robust

* Update hui-entity-filter-card.js
2018-07-09 18:25:00 +02:00
Paulus Schoutsen
2e4ddebcda Use IndieAuth for client ID (#1427)
* Use IndieAuth for client ID

* Lint
2018-07-09 18:24:49 +02:00
Jerad Meisner
13819937a7 Show more-info for media_players in picture-glance. (#1429)
* Show more-info for media-players in picture-glance.

* Cleanup
2018-07-09 18:21:47 +02:00
c727
b89ad9b217 Fix language detection for country codes (#1426)
* Fix language detection for country codes

navigator.languages = ["de-DE"],  navigator.languages = "de-DE" was detected as en before

* Use for each

* Use for of
2018-07-09 14:43:36 +02:00
Jerad Meisner
e51177b3c2 Fix picture-glance crash when state unavailable. (#1425)
* Fix picture-glance crash when state unavailable.

* Replace this.hass with hass, available check also for dialog-entities

* Lint
2018-07-08 23:59:16 +02:00
Jerad Meisner
bb7dc76996 Open more info for camera in picture-glance card. (#1424) 2018-07-08 19:30:11 +02:00
Paulus Schoutsen
274f8e1b64 Version bump to 20180708.0 2018-07-08 17:24:53 +02:00
Paulus Schoutsen
d1d3ff9013 Update translations 2018-07-08 17:24:36 +02:00
quthla
c39b6bb665 Fix Lovelace (#1420) 2018-07-08 17:19:55 +02:00
Paulus Schoutsen
52f2c29726 Cleanup the webpack config (#1417)
* Cleanup the webpack config

* Typo
2018-07-08 17:16:19 +02:00
c727
b0f29744bf Lovelace map: hide overflow, reset focus button (#1421)
* Lovelace map: hide overflow, reset focus button

* Increase margin for better clicking
2018-07-08 15:03:56 +02:00
c727
c17f390f58 State card lock (#1419)
* Add state-card-lock

* Cleanup

* Feedback

* Lovelace: Exclude covers and locks from header toggle
2018-07-08 03:24:22 +02:00
quthla
f58c612018 Lovelace custom ui (#1404)
* Lovelace custom ui

* Allow ForOf

* Move code
2018-07-07 21:04:11 +02:00
c727
d96c5f6bde Don't modify stateObj (#1410)
* Don't modify stateObj

* Lint
2018-07-07 13:25:06 +02:00
Jerad Meisner
e649d37c05 Love: Added map card (#1412)
* Added map card

* Prefer arrow functions.

* Fix lint errors.

* Extract Leaflet setup. Debounce events. Cleanup.

* Cleanup.

* Add disconnectedCallback. More cleanup.
2018-07-07 05:36:01 -04:00
Jerad Meisner
594c1d6615 Don't show more info for weblinks. (#1416) 2018-07-07 05:35:03 -04:00
c727
10009eea2e Lovelace: Style view backgroud (#1408)
* Lovelace: Style view backgroud

based on: #1403

fix: https://github.com/home-assistant/ui-schema/issues/30

```yaml
background: center / cover no-repeat url("https://images.pexels.com/photos/977736/pexels-photo-977736.jpeg?auto=compress&cs=tinysrgb&h=750&w=1260")

background: radial-gradient(crimson, skyblue)

background: orange
```

* Reset background if not defined

* Simplify

* Lint

* Add global backround

* Fix backround in unused entities

* Lint
2018-07-06 15:12:43 -04:00
Hmmbob
cb60904912 Replace Fitbit Config Screenshot (#1411)
Fixes https://github.com/home-assistant/home-assistant/issues/15235
2018-07-06 15:10:01 -04:00
c727
ddd37f63a0 Remove line-height 0 from ifram card (#1413) 2018-07-06 02:25:17 +02:00
Jerad Meisner
d71a80c4f8 Love: Rework layout to use static sized view area (#1403)
* Rework view layout.

* Don't edit ha-app-layout

This reverts commit 7b32161

* User classList.toggle instead of attribute binding.

* Change view to a div.
2018-07-05 11:27:28 -04:00
c727
6b10eeb1e9 Hassio: Add button to change hostname (#1406)
* Hassio: Add button to change hostname

* Lint

* Lint
2018-07-04 22:49:29 -04:00
Paulus Schoutsen
e3d82f9e37 version bump to 20180704.0 2018-07-04 11:57:58 -04:00
c727
6739c88428 Add a button to show new entities (#1390)
* Add a button to show new entities

* Fix copy paste

* Test

* Update

* To-do: Menu CSS

* Set _curView to -1

* Lint

* Feedback

* Fix menu

* Feedback
2018-07-04 04:44:13 +02:00
Paulus Schoutsen
5b0ca026d5 version bump to 20180703.1 2018-07-03 14:51:34 -04:00
c727
42525ae1df Fix navigation path title (#1401) 2018-07-03 14:51:10 -04:00
Paulus Schoutsen
c201a9073f Fix opening menu triggers column change (#1400) 2018-07-03 14:47:36 -04:00
Paulus Schoutsen
ad4814dfad Use ha-icon when user can set icon (#1399) 2018-07-03 14:33:43 -04:00
Paulus Schoutsen
e5c900aec1 Use navigation_path for picture-elements navigation element 2018-07-03 11:13:51 -04:00
Paulus Schoutsen
6f8385afa7 20180703.0 2018-07-03 10:59:08 -04:00
Paulus Schoutsen
5cccf4836f Add navigation_path to picture-glance (#1397)
* Add navigation_path to picture-glance

* Lint
2018-07-03 10:57:26 -04:00
sbYm
d299166f2a Fix json detect (#1391)
* Fix json detect

Content-type is not always "application/json" when using nginx.    
eg: application/json; charset=utf-8

* Update hass-call-api.js

* Lint

* Lint 2
2018-07-03 10:17:15 -04:00
Jerad Meisner
c0ae7d50ad Replace camera-preview card with picture-entity card. (#1393) 2018-07-03 09:28:54 -04:00
c727
dc034038c0 P-Elements: Add title to navigation icon (#1395)
* P-Elements: Add title to navigation icon

...and removed computeDomain()

* Improve code
2018-07-03 05:51:37 +02:00
c727
536b1e7b73 Fix scrollbar issues in vertical stack card (#1394)
* Fix scrollbar issues in vertical stack card

* Update vstack
2018-07-03 05:51:13 +02:00
Paulus Schoutsen
20d6f6d530 Don't allow toggle if can't toggle. Allow hiding info (#1389)
* Don't allow toggle if can't toggle. Allow hiding info

* Allow tap_action: toggle

* cleanup

* Lint
2018-07-03 01:55:46 +02:00
Paulus Schoutsen
173cd8126c Picture Entity to use name instead of titles (#1388)
Entities have names, states have titles.
2018-07-02 22:39:23 +02:00
Paulus Schoutsen
e452384ecd Bump version to 20180702.1 2018-07-02 14:20:48 -04:00
Jerad Meisner
918c2ce29e Love: Update hui-image to use entity instead of state. (#1386)
* Update hui-image to use entity instead of state.

* Removed old function.
2018-07-02 14:20:16 -04:00
Paulus Schoutsen
66803cd4eb Add panel mode (#1383) 2018-07-02 14:17:48 -04:00
Paulus Schoutsen
66ae61374d Add navigation element (#1384)
* Add navigation element

* Lint

* Add missing import
2018-07-02 14:17:23 -04:00
Paulus Schoutsen
cf5460bf58 Add simple picture card (#1385)
* Add simple picture card

* navigate_path -> navigation_path
2018-07-02 14:16:29 -04:00
Paulus Schoutsen
c868df2718 Only allow state filter for filter card (#1387)
* Only allow state filter for filter card

* Lint

* Address comments
2018-07-02 14:03:59 -04:00
Paulus Schoutsen
25fddad446 Version bump to 20180702.0 2018-07-02 08:54:05 -04:00
Paulus Schoutsen
890dc0512b Update translations 2018-07-02 08:52:45 -04:00
Paulus Schoutsen
6b8fbd91c6 Use name for entities (#1380)
* Use name for entities

* Glance: title -> name
2018-07-02 08:44:10 -04:00
Jerad Meisner
06cf03bff0 Fix image filtering when no off state is defined (#1379)
* Fix image filtering when no off state is defined

* Change Offline to Unavailable.
2018-07-02 02:12:18 +02:00
c727
22ee205807 Love: picture elements: nowrap for buttons (#1378) 2018-07-01 21:15:20 +02:00
Paulus Schoutsen
7bbe8dc2f3 Version bump to 20180701.0 2018-07-01 12:57:13 -04:00
Marius
e410274684 Lovelace: entity-filter: hide card when entities[] empty (#1373)
* Implements https://github.com/home-assistant/ui-schema/issues/48

Fixed lint

* Updates based on review

Reset display on new config

Fixed reset as setConfig was not being called

Fixed lint
2018-07-01 12:55:27 -04:00
Paulus Schoutsen
76256699e0 Fix card size calculation stacks (#1375) 2018-07-01 12:25:28 -04:00
Paulus Schoutsen
dc5213a79a Fixes (#1377)
* Fix legacy wrapper in browsers without native custom elements

* Better error reporting for picture-elements

* Lint
2018-07-01 12:25:00 -04:00
Jerad Meisner
54fcb21917 Love: Allow custom title per entity in entities card (#1374)
* Allow custom title per entity in entities card

* Change entityConfig to config

* Only pass title to state-cards
2018-07-01 11:28:25 -04:00
Jerad Meisner
1a9af5595f Love: Added <hui-image> element for handling different image sources (#1365)
* Added hui-image element. Converted picture-glance and picture-entity.

* Fixed hui-image data bindings

* Hide image if no source. Error message l10n

* Pass entire state object to hui-image

* Renamed isObject function. Fix camera image updating.
2018-07-01 11:26:41 -04:00
c727
5f44009177 Love: Add badges to picture elements (#1371)
* Love: Add badges to picture elements

* Lint

* Fix toggle text

* Simplify service button config

* Add default for service data

* Lint
2018-06-30 15:52:02 +02:00
Marius
42026f096f Renamed row and column (#1370) 2018-06-30 01:22:55 +02:00
c727
122414e7bd Love: Set love as default page (#1368)
* Love: Set love as default page

* Make toggle, move to dev-info

* Typo
2018-06-29 15:56:40 -04:00
Paulus Schoutsen
c781163f6b Version bump to 20180629.1 2018-06-29 15:38:26 -04:00
Paulus Schoutsen
cdb7a6261e Random fixes (#1369)
* Random fixes

* weather card to use legacy wrapper

* Lint
2018-06-29 15:35:46 -04:00
Paulus Schoutsen
a8063f3359 Version bump to 20180629.0 2018-06-29 11:05:41 -04:00
Paulus Schoutsen
bb670b76a9 Migrate cards to use setConfig to get config. (#1363)
* Experiment with setConfig

* More cleanup

* fix filter card

* Wait for DOM to be done

* 1 line

* Lint

* Lint2

* Lint
2018-06-29 10:54:52 -04:00
Jerad Meisner
05816374a8 Love: Fix config parsing in hui-glance-card (#1364)
* Fix config parsing in hui-glance-card

* Don't modify config.
2018-06-29 10:20:52 -04:00
c727
5b67a3691a Love: change keys from "name" to "title" (#1367)
* Love: change keys from "name" to "title"

* Change action to tap_action
2018-06-29 16:08:04 +02:00
Jerad Meisner
fb2fc9fbbb Love: Add optional title to hui-glance-card (#1355)
* Add optional title to hui-glance-card

* Use entity instead of entity_id. Allow both simple and complex entities in glance card config.

* Fix lint errors.

* Make coerceEntitiesToObjects accept single entity or array.

* Fix entities helper function. Add entities validation function.

* Fix conflicts
2018-06-29 05:34:05 +02:00
c727
ee0308849e Love: cleanup (#1362)
* Love: cleanup

* Fix
2018-06-29 05:16:01 +02:00
c727
51f169aa13 Love: Add reload button to error screen (#1360)
* Love: Add reload button to error screen

* Move slot

* Feedback
2018-06-29 05:13:10 +02:00
c727
038f5b644b Love: Rework PictureEntityCard (#1359)
* Love: Rework picture-entity-card

* Rework

* Use OFFLINE const

* Add optional title

* Fix issue, lint
2018-06-28 22:36:52 -04:00
c727
3442700e1f Love: more cleanup (#1361)
* Love: more cleanup

* Fix

* Lint
2018-06-28 22:30:17 -04:00
c727
07d76739b4 Love: cleanup (#1358)
* Love: cleanup

* Lint

* Fix CopyPaste

* Change config key names for history

* Restore old card size

* Add function description

* Use createErrorCardConfig
2018-06-28 21:53:56 +02:00
Paulus Schoutsen
d40dea6d3b Fix auth redirect url (#1357) 2018-06-28 14:48:01 -04:00
c727
8bbc8e0bb8 Love: Add column and row card (#1353)
* Love: Add column and row card

* Lint

* Add row card, also broken CSS

* Add cardSize logic

* Fix CSS

* Working now

* Feedback

* Lint
2018-06-28 04:42:13 +02:00
c727
9e2d311ce6 Hassio: fix scroll issues (#1354)
* Hassio: fix scroll issues

* Feedback

* Lint

* Lint

* Move to dom
2018-06-28 04:20:16 +02:00
c727
de91aea3b9 Revert "Love: Add column and row card"
This reverts commit e0ccc1999a.
2018-06-27 22:12:01 +02:00
c727
e0ccc1999a Love: Add column and row card 2018-06-27 22:00:30 +02:00
Paulus Schoutsen
b55004d73b Bump version to 20180627.0 2018-06-27 14:20:48 -04:00
Paulus Schoutsen
3d18462ec0 Update translations 2018-06-27 14:20:43 -04:00
Paulus Schoutsen
654e74294d Default view (#1349)
* Do not rebuild config twice on tab change

* Allow setting default page
2018-06-27 14:18:58 -04:00
Paulus Schoutsen
20e92893e0 Organize createElement (#1348)
* Organize createElement

* Fix line-height
2018-06-27 14:18:05 -04:00
c727
f2d30ad850 Love: Permalinks for views (#1340)
* Love: Permalinks for views

* Cleanup

* Do not redraw unnecessarily
2018-06-27 14:05:00 -04:00
c727
88453733eb Love: Picture elements: Add service button and text state (#1343)
* Love: Picture elements: Add service button and text state

* Feedback

* Lint

* Separate div.element

* Remove line-height

* New class for state-text

* Add line height
2018-06-27 13:56:19 -04:00
c727
584e959f1a Fix weather card getUnit 2018-06-27 17:25:46 +02:00
c727
479de6c4c7 Love: Entities card: add turn on/off all (#1337)
* Love: Entities card: add turn on/off all

* Cleanup

* Fix hide toggle

* Lint

* Lint

* Feedback

* Lint

* Fix ent pic card
2018-06-27 17:20:18 +02:00
c727
be7900cd87 Fix air pressure uom in weather cards (#1346)
* Fix aire pressure uom in weather cards

* Feedback

* Lint
2018-06-27 17:16:16 +02:00
cdce8p
7bfc01b02c Fix climate state without translation (#1344) 2018-06-27 05:51:18 -04:00
c727
590bba0aca Love: Card to show entites on picture (#1341)
* Love: Card to show entites on picture

* Lint

* MVP + x

* Feedback

* Add toggle action

* Lint
2018-06-27 03:45:40 +02:00
c727
aa27ee609d Love: Improve code in glance picture (#1339)
* Live: Improve code in glance card

* Lint

* Fix constants
2018-06-26 10:52:53 -04:00
c727
e1e88aa8b2 love: Fix div overflow (#1338)
thought I tested this :( too many local branches....
2018-06-26 10:52:01 -04:00
c727
e3d7220c0b Love: Rework history graph (#1335)
* Love: Rework history graph

* Lint
2018-06-26 10:51:34 -04:00
c727
9fd1db0493 Love: move create card element to component, improve error card (#1328)
* Love: move create card element to component, improve error card

* Remove whenDefined

* Fix config check

* Allow enity_id only card config

* Feedback

* Fix conflicts

* Add import

* Lint

* Lint

* Lint -.-"
2018-06-26 10:50:51 -04:00
Paulus Schoutsen
748b5a8e41 Version bump to 20180625.0 2018-06-25 16:00:46 -04:00
Paulus Schoutsen
8991c966d2 Update translations 2018-06-25 16:00:29 -04:00
Paulus Schoutsen
2cfff991ac Do not use async await in custom panels (#1336)
* Do not use async await in custom panels

* Lint
2018-06-25 15:59:17 -04:00
Eu
376228e0fe [Lovelace] Add iframe card (#1330)
* Create hui-iframe-card.js

* Update compute-card-element.js

* Update hui-iframe-card.js

* Update hui-iframe-card.js

* Update hui-iframe-card.js

* Update hui-iframe-card.js

* Lint

* Update hui-iframe-card.js

* Change height to aspect_ratio
2018-06-25 15:24:04 -04:00
Mattias Welponer
4c1feb313b Add HomematicIP Cloud Config Flow picture (#1306)
* Add HomematicIP config picture

* Reduce size

* Remove the border

* Picture trimmed now properly

* Wrong file, this one is small and has no transparent border

* Created config_flows and moved the picture
2018-06-25 14:21:04 -04:00
c727
b0561d7766 Love: Add conversation button (#1333) 2018-06-25 15:54:42 +02:00
c727
bda2d42994 Love: Fix entity_pic in glance card (#1334) 2018-06-25 15:54:31 +02:00
Mariusz Łuciów
d225105e58 Fixed invalid contant type header (#1331)
The `application` is not a valid MimeType:
https://www.iana.org/assignments/media-types/media-types.xhtml#application
2018-06-24 21:53:11 +02:00
c727
313a3dd2c9 Hassio: Fix error in store, remove asyn await (#1325) 2018-06-23 00:36:15 +02:00
Paulus Schoutsen
c579d7fed3 Version bump to 20180622.1 2018-06-22 12:44:31 -04:00
c727
c83184654e Hassio: New API for HassOS (#1319)
* Hassio: New API for HassOS

* Fix

* Use async await
2018-06-22 12:44:11 -04:00
Paulus Schoutsen
7e0be4a2f6 Version bump to 20180622.0 2018-06-22 10:22:58 -04:00
Paulus Schoutsen
53e698c757 Compatibility fix for custom panel (#1321)
* Compatibility fix for custom panel

* Lint
2018-06-22 10:17:06 -04:00
c727
8d5c862908 Love: Fix stateObj not in states error (#1322)
* Love: Fix stateObj not in states error

* Add ()

* Make it dynamic
2018-06-22 10:06:30 -04:00
Paulus Schoutsen
d5266c1c56 Version bump to 20180621.2 2018-06-21 17:35:08 -04:00
Paulus Schoutsen
44d64bc7ce Catch for no resources defined 2018-06-21 17:34:42 -04:00
Paulus Schoutsen
545af4c6d2 Version bump to 20180621.1 2018-06-21 17:14:47 -04:00
Paulus Schoutsen
501033df15 Allow specifying external resources (#1318)
* Allow specifying external resources

* Lint
2018-06-21 17:14:25 -04:00
c727
1f82934c93 Cleanup hui-markdown-card (#1316) 2018-06-21 23:12:31 +02:00
Paulus Schoutsen
9d22645e87 Fix wrapping in the entities card (#1317) 2018-06-21 17:10:07 -04:00
Paulus Schoutsen
b312533948 Version bump to 20180621.0 2018-06-21 14:56:32 -04:00
Paulus Schoutsen
77f623d519 Lovelace: Small reorg (#1315)
* Small reorg

* Add markdown card

* Tweak closeness
2018-06-21 14:46:54 -04:00
c727
8cebddcccc Love: Pimp filter card (#1314)
* Love: Pimp filter card

* Make it work

* Update

* getCardSize

* Import elements

* Lint

* Lint

* Remove this._cardSize
2018-06-21 13:57:19 -04:00
Paulus Schoutsen
75502bac6e Bump min version for latest to use async/await (#1312)
* Bump min version for latest to use async/await

* Use async functions

* Load async support for es5

* Lint
2018-06-21 13:57:01 -04:00
Paulus Schoutsen
18b52b53cb Upgrade deps (#1311)
* Update polyfills

* Upgrade deps
2018-06-21 10:43:24 -04:00
Paulus Schoutsen
b6ee5442f0 Track when cards get defined (#1310) 2018-06-21 10:42:52 -04:00
c727
691b80c08a Lovelace: Add picture card (#1308)
* Lovelace: Add scene card

* Fix radius

* Lint

* Add acitvate text

* Change on-click name

* Requested changes

* Remove navigate

* 2

* Lint

* Fix Cannot read property '_entityDisplay' of undefined
2018-06-21 09:37:24 -04:00
c727
f8b38ced26 Lovelace: Add picture-glance card (#1309)
* Lovelace: Add glance-toggle card

* Update

* Option to force dialog

* Fix box height

* Rename const

* Change name, separate sensors

* Lint

* Lint
2018-06-20 23:16:35 -04:00
Paulus Schoutsen
63b123fc8f Fix hiding menu button when not needed 2018-06-20 16:12:42 -04:00
Paulus Schoutsen
a92c187627 Version bump to 20180620.0 2018-06-20 15:09:30 -04:00
c727
92111cd5be Exp. UI: Add glance card (#1305)
* Exp. UI: Add vertical entities card

* Remove iron-icon import

* Add light

* Change name

* Flex

* Fix CSS

* Rebuild view to work with themes

* Lint

* Default title Home Assistant

* Tweaks
2018-06-20 15:08:01 -04:00
Paulus Schoutsen
1f8f6f52bc Rename experimental UI to lovelace (#1307)
* Rename experimental UI to lovelace

* Lint
2018-06-20 14:18:18 -04:00
Adam Mills
626b054540 Use localized operation modes in climate more-info (#1304) 2018-06-19 22:37:06 -04:00
Paulus Schoutsen
4acfa2ba88 Show an error screen when panel cannot be resolved (#1303)
* Show an error screen when panel cannot be resolved

* Lint
2018-06-19 15:50:52 -04:00
Paulus Schoutsen
87bd9ed48a Ask for reload on service worker change (#1302)
* Ask for reload on service worker change

* Lint and remove alert

* Fix it once and for all

* Lint
2018-06-19 15:50:41 -04:00
Paulus Schoutsen
ce4280e816 Version bump to 20180619.0 2018-06-19 10:55:16 -04:00
Paulus Schoutsen
3382430c8f Update translations 2018-06-19 10:55:13 -04:00
c727
c186a5aab2 Hassio: Add scrollbar to supervisor logs (#1301) 2018-06-19 15:31:16 +02:00
c727
21dcbb3b9d Fixes and cleanup for #1299 and #1296 (#1300)
* Fixes and cleanup

* Rename function to genHassioIcons

* Update
2018-06-19 14:36:43 +02:00
c727
cd33e2568a Exp. UI: add support for "big" cards (#1296)
* Exp. UI: add support for "big" cards

* Lint

* Requested changes

* Revert outdated changes

* ...2

* ...3

* Feedback
2018-06-18 22:18:20 -04:00
c727
4cf7959b12 Hassio: Fix menu button icon (#1299)
* Hassio: Fix menu button icon

* Move comments

* Hups
2018-06-19 01:32:40 +02:00
c727
dc9a227aa3 Exp. UI: Add error card (#1298)
* Exp. UI: Add error card

* Cleanup

* Lint

* Typo

* Requested changes
2018-06-18 19:19:01 -04:00
c727
2a8462951b Hassio: Fix glitch in HA update card (HA 0.72+) (#1297) 2018-06-18 18:01:49 -04:00
c727
449751c59f Exp. UI: add errorHandling for CustomElement and getCardSize() (#1295)
* Exp. UI: add errorHandling for CustomElement and getCardSize()

* Add ";"

* Lint
2018-06-18 13:04:12 -04:00
c727
d2eb0ef23f Exp. UI: add support for more info dialog (#1294)
* Exp. UI: add support for more info dialog

* Sort items

* Rename HIDE_MORE_INFO to DOMAINS_HIDE_MORE_INFO
2018-06-18 10:07:58 -04:00
Paulus Schoutsen
d752060f7a Version bump to 20180618.0 2018-06-18 09:54:55 -04:00
Paulus Schoutsen
cc74374390 Update translations 2018-06-18 09:54:44 -04:00
Paulus Schoutsen
dd87502688 Fix config entries (#1293)
* Fix config entries

* Reset error msg when flow is closed
2018-06-18 09:53:37 -04:00
Paulus Schoutsen
4e608e6a2c Version bump to 20180617.0 2018-06-16 22:33:33 -04:00
Paulus Schoutsen
ba2c3edc87 Fix closing tag 2018-06-16 22:32:46 -04:00
Paulus Schoutsen
13c8a00e97 Cleanup deps (#1288)
* Upgrade uglify-js

* Remove unused deps

* Add views
2018-06-16 22:32:05 -04:00
Paulus Schoutsen
1076fd8fc4 Version bump to 20180616.0 2018-06-16 17:32:05 -04:00
Paulus Schoutsen
5f226d1809 Add experimental UI (#1205)
* Add experimental UI

* Allow theming a view

* Name it css

* Allow applying themes

* Add filter card

* Add normal column layout logic
2018-06-16 17:29:18 -04:00
c727
75e3f1f37b Remove icon-set validation from customize (#1286)
we could set to hass or mdi but the use could still use a custom set
2018-06-16 06:50:26 -04:00
Paulus Schoutsen
b43b34263e Version bump to 20180615.0 2018-06-15 13:43:41 -04:00
Paulus Schoutsen
f79feae120 Update translations 2018-06-15 13:43:24 -04:00
Paulus Schoutsen
052e659782 Clean up calendar panel (#1285) 2018-06-15 13:38:02 -04:00
Paulus Schoutsen
890c31fb96 Add calendar translation and icon 2018-06-15 12:59:43 -04:00
Thibault Cohen
58a0f6aab9 Add scheduler panel (#1146)
* Add scheduler panel

* Rename scheduler to calendar

* Continue

* First working version

* Fix lint errors

* Fix comments

* Fix calendar display

* Continue fixing comments

* Continue fixing comments 2

* Continue fixing comments 3

* Fix UI to work with the new PRs

* Use preact-compat instead of react

* Fix tests

* Move css file in a panels specific folder

* Fix tests

* Add Event details dialog

* Improve date format

* Remove event details

* Continue

* Continue calendar

* continue

* Continue

* Cleaning

* Fix PR comments

* Lint

* Clean useless import and css

* Fix PR comments

* Fix PR comments

* Fix PR comments

* Clean Event handler

* Fix week view

* Continue
2018-06-15 11:17:46 -04:00
c727
2905cefd39 Localize more_info_settings (#1284) 2018-06-15 11:13:00 -04:00
Paulus Schoutsen
67cef55f34 Fix grey background partial-cards 2018-06-12 22:22:56 -04:00
Paulus Schoutsen
710d98feda Version bump to 20180613.0 2018-06-12 21:16:55 -04:00
Paulus Schoutsen
b085121ab4 Update translations 2018-06-12 21:16:50 -04:00
c727
274e1a671f Localize media player dialog (#1279) 2018-06-12 20:45:06 -04:00
c727
98df34c0a8 Replace \$= with $= (#1280) 2018-06-12 20:44:43 -04:00
c727
e28c651930 Hassio random fixes (#1278)
* Fix img width in markdown

* Flexify add-on view

* Hide deployment if null

* Fix mobile add-on view
2018-06-12 23:51:20 +02:00
Yevgeniy
8e8d907090 Change weather card to support forecasts with two modes (#1277)
* Separation of date and time

* Remove <div>, hour to numeric, text uppercase

* Revert style, fix <br>
2018-06-12 21:29:21 +02:00
starkillerOG
cf3d864378 General sound mode support (#1275)
* Add sound mode support

* Add sound mode support

* Rebase Sound Mode support

* Cammel case fix

* Sound mode support

* Add sound mode support

* change to attr-for-selected

* Simplify sound mode support
2018-06-12 21:27:54 +02:00
Paulus Schoutsen
7f133d0316 Don't rely on get panels from websocket package (#1264) 2018-06-12 09:28:41 -04:00
Paulus Schoutsen
9717166fee Allow placeholders for config flow description (#1274) 2018-06-12 09:28:20 -04:00
Paulus Schoutsen
0b6214be2b Random fixes (#1276) 2018-06-12 09:27:46 -04:00
Paulus Schoutsen
7f93317314 Update partial-cards.js 2018-06-10 22:54:36 -04:00
Paulus Schoutsen
b89de4b494 Point es5 adapter to frontend-es5 (#1273) 2018-06-08 16:37:52 -04:00
Paulus Schoutsen
d243f2ead6 Build a new Hass.io panel (#1271)
* Build a new Hass.io panel

* Use webcomponents-lite.js

* Compress new panel

* Lint
2018-06-08 15:26:48 -04:00
Paulus Schoutsen
92930a2b94 Add es5 adapter to es5 panel (#1272) 2018-06-08 14:58:15 -04:00
Andrey
7a2aff712b Better show custom ui versions (#1269) 2018-06-08 09:35:27 -04:00
Paulus Schoutsen
0ae676d9ba Better configure Carto Basemaps (#1267) 2018-06-07 17:16:08 -04:00
Paulus Schoutsen
673f769237 Remove word "EXPERIMENTAL" from config entry menu option (#1268) 2018-06-07 17:15:49 -04:00
Jaak Laineste
bb442c824b fix map URLs (#1265)
Fix attribution and URL for basemaps as in https://github.com/CartoDB/basemap-styles. Disclaimer: I'm PM for CARTO basemaps.
2018-06-07 14:09:01 -04:00
Paulus Schoutsen
ab16a3712e Version bump to 20180607.0 2018-06-06 22:40:32 -04:00
Paulus Schoutsen
b71a4be67e Update translations 2018-06-06 22:40:24 -04:00
Paulus Schoutsen
eb91cedf68 Update config entries text (#1263) 2018-06-06 22:37:34 -04:00
Paulus Schoutsen
9ac1384e1f Remove has-scrolling-region attribute
Fixes #1250
2018-06-06 22:36:34 -04:00
Paulus Schoutsen
cab53b3324 Use websocket for entity registry update (#1261)
* Use websocket for entity registry update

* Lint
2018-06-06 22:34:34 -04:00
Paulus Schoutsen
bf4d0e6bc9 Use websocket to fetch themes and translations (#1260)
* Use websocket to fetch themes and translations

* Lint
2018-06-06 22:34:20 -04:00
Paulus Schoutsen
10c997b7b2 Remove no longer needed blocks (#1262) 2018-06-05 21:20:34 -04:00
Paulus Schoutsen
4d48a63141 Further simplify build (#1256)
* Remove manual copy

* Use Webpack to create gzip versions
2018-06-04 07:06:12 -04:00
Paulus Schoutsen
af14fc6548 Preact: Import components in pages that need them (#1257) 2018-06-04 07:05:51 -04:00
Paulus Schoutsen
4bd14a5280 Version bump to 20180603.0 2018-06-03 12:24:53 -04:00
Paulus Schoutsen
cf57cf853b Update translations" 2018-06-03 12:24:37 -04:00
Paulus Schoutsen
8133102bcb Re-add service worker caching (#1247)
* Re-add service worker caching

* Lint
2018-06-03 07:38:22 -04:00
c727
dbcae9cb77 Localize configurator, climate (#1253)
* Localize configurator

* Add climate

* Fix typo

* Lowercase
2018-06-03 07:38:07 -04:00
c727
cb284d9718 Localize lock dialog (#1249)
* Localize lock dialog

* Fix attribute binding

* Add ev
2018-06-03 07:37:35 -04:00
c727
d16f4c846a Pass hass to state-history-charts (#1252) 2018-06-03 07:36:27 -04:00
Paulus Schoutsen
ce3564625e Bump version to 20180601.0 2018-06-01 10:51:37 -04:00
Paulus Schoutsen
e928be353a Update translations 2018-06-01 10:51:21 -04:00
c727
addb8e3111 Localize cover, fan, light, media player, history charts (#1244)
* Localize cover, fan, light, media player, history charts

* Don't capitalize
2018-06-01 10:50:28 -04:00
c727
fa11fbc85d Localize notification toasts (#1243)
* Localize notification toasts

* Use correct placeholder syntax

* Lint

* Use original string
2018-06-01 10:07:33 -04:00
Paulus Schoutsen
c3d67133c2 Improve custom panel support (#1236)
* Add custom panel

* Lint

* Add reference to docs

* Use panel.config
2018-06-01 10:06:28 -04:00
c727
1a3966e55f Localize ha-relative-time (#1241)
* Localize relative time

* Add mixin

* Pass hass to ha-relative-time

* Remove debug

* Add hass

* Add hass everywhere

* Remove value from translation file

* Add quotes to attributes

* Lint

* Fix in hassio file

* Use current placeholder syntax

* Use correct syntax

* Move to ui.components
2018-06-01 09:55:00 -04:00
Marius
e11cca28fd Fixes #12707 Nest climate card contains redundant fields (#1234)
* Fixes #12707 Nest climate card contains redundant fields

Updated for better value handling

Fixed lint

* Remove some brackets
2018-06-01 14:58:34 +02:00
Paulus Schoutsen
1f14373117 Version bump to 20180531.0 2018-05-31 17:24:43 -04:00
Paulus Schoutsen
490c37e899 Update translations 2018-05-31 17:24:25 -04:00
c727
3c48973584 Make app toolbar text color themeable (#1225)
* Make app toolbar text color themeable

* Update ha-style.js

* Also theme tab selection bar
2018-05-31 17:23:43 -04:00
cdce8p
b378b92aa8 Fix paper-slider overflow issue (#1235)
* Fix overflow issue with slider pin

* Lint

* Reverted changes

* Style changes

* Centered position values a bit higher

* Use ha-labeled-slider

* Small update
2018-05-31 17:23:22 -04:00
Paulus Schoutsen
c0919cfe11 Add paper-time-input back (#1242) 2018-05-31 17:20:57 -04:00
c727
f96db5003a Automation dialog: add localization, fix CSS (#1227)
* Automation dialog: add localization, fix CSS

* Feedback

* Add bottom margin to dialog controls

* Remove margin for all
2018-05-30 22:57:45 -04:00
c727
a8fa8d46e5 ACP dialog: remove deprecated pattern check (#1238) 2018-05-30 20:12:57 -04:00
c727
673c7c5184 Remove is="custom-style" (#1237) 2018-05-30 19:59:31 -04:00
cdce8p
ff50414cbb Add Template extension points (#1230)
* Added first extension points for cover & climate

* Finished state-summary cards

* Cleanup
2018-05-30 11:41:11 -04:00
c727
b8ac150ee4 ACP dialog: localization, new codeFormat (#1226)
* ACP dialog: localization, new codeFormat

* Fix code validation

* Fix issues

* Fix issues
2018-05-30 09:32:30 -04:00
c727
2f6bb9af0c Correct relative time logic (#1231) 2018-05-30 13:18:14 +02:00
c727
348943f221 Weather card fix typo (#1229) 2018-05-30 01:24:28 +02:00
c727
74e0779d38 Add precipitation to weather card (#1098) (#1221) 2018-05-29 03:29:52 +02:00
Robert Accettura
21e4bc4ee4 Add pin pad to alarm panel (#1134)
* Add pin pad to alarm panel

* Update regex

* Add pin pad to alarm panel

* Lint

* Polymer3-ify

* Add new line
2018-05-29 02:51:03 +02:00
cdce8p
af6167b9c8 Fix cover icons for closing & opening (#1220)
* Fix cover icons for closing & opening

* Removed state &&
2018-05-29 02:18:38 +02:00
Paulus Schoutsen
eb29b73390 Hassio: no longer point at polymer repo 2018-05-28 19:49:40 -04:00
Paulus Schoutsen
e158709b1e Include iconset for hassio 2018-05-28 17:11:54 -04:00
Paulus Schoutsen
045b1d02be Restore old Hass.io HTML build (#1218) 2018-05-27 17:24:40 -04:00
Paulus Schoutsen
66012da4de Generate Hass and Hass.io specific iconset (#1214)
* Generate hass icons

* Generate Hass.io icons

* Convert hass.io to use hassio iconset

* Convert src to use hass iconset

* Give mdi-icons a chunk name

* gen-index-html aware of hass-icons

* Use ha-icon for rendering state icon
2018-05-27 17:04:18 -04:00
Paulus Schoutsen
294f0febbf Move Hass.io panel files to hassio folder (#1215) 2018-05-27 12:00:54 -04:00
Andrey
a79f98efbf Add webcomponents-bundle.js.map to dev version (#1216) 2018-05-27 11:56:22 -04:00
Andrey
dd57ddbef6 Try to use existing updateStyles for theming (#1217) 2018-05-27 11:56:01 -04:00
Paulus Schoutsen
d3b6740488 Version bump to 20180526.4 2018-05-26 19:55:30 -04:00
Paulus Schoutsen
f51503af4f Write old mdi.html exactly as hass.io expects (#1213)
* Write old mdi.html exactly as hass.io expects

* Create build dir if it doesn't exist
2018-05-26 19:55:08 -04:00
Paulus Schoutsen
0c92b356a1 Version bump to 20180526.3 2018-05-26 14:28:32 -04:00
Paulus Schoutsen
9393bb2fba Include ha-iconset-svg with mdi (#1212) 2018-05-26 14:28:14 -04:00
Paulus Schoutsen
61bc2d04f3 Version bump to 20180526.2 2018-05-26 11:50:27 -04:00
Paulus Schoutsen
71196b9704 Load icons via JS (#1211) 2018-05-26 11:50:03 -04:00
Paulus Schoutsen
29912d1b63 Update release script 2018-05-26 08:36:02 -04:00
Paulus Schoutsen
2d67a01ec2 Bump frontend to 20180526.1 2018-05-26 08:30:54 -04:00
Paulus Schoutsen
9d8f055f7b Version bump to 20180526.0 2018-05-26 08:26:43 -04:00
Paulus Schoutsen
c6f2f43767 Add old polyfill back (#1210) 2018-05-26 08:26:17 -04:00
PeteBa
f4c36e37bb Add entity_picture capability to plant card (#1145)
* Add entity_picture support to plant card

* Align font size with camera card
2018-05-25 18:26:47 -04:00
Paulus Schoutsen
d3c10d9b49 Forward change event vaadin combo box (#1208)
* Forward change event vaadin combo box

* Stop propagation
2018-05-25 16:46:54 -04:00
Paulus Schoutsen
4e9a7a4a23 Version bump to 20180524.0 2018-05-24 13:02:56 -04:00
Paulus Schoutsen
f24a26c686 Update translations 2018-05-24 13:02:40 -04:00
Paulus Schoutsen
df384dc23e Restore markdown for old Hass.io build (#1204) 2018-05-22 09:55:50 -04:00
Paulus Schoutsen
008fcbe1dc Update yarn.lock 2018-05-21 11:00:22 -04:00
Paulus Schoutsen
86a522ce65 Version bump to 20180521.0 2018-05-21 10:55:42 -04:00
Paulus Schoutsen
6bf34afc31 Fix ha paper slider (#1203)
* Fix ha-paper-slider

* Fix ha-paper-slider
2018-05-21 10:45:04 -04:00
Paulus Schoutsen
081e8d9824 Add html tag to legacy layer (#1202) 2018-05-21 10:21:46 -04:00
Paulus Schoutsen
8e6929659d Code split out more things (#1199) 2018-05-21 07:50:50 -04:00
Boyi C
4d50ab937a Some tweak for timeline chart (#1201)
* Some tweak for timeline chart

* remove comments
2018-05-21 07:50:29 -04:00
Paulus Schoutsen
0edf06bfb9 Filter out some modules (#1198) 2018-05-20 21:19:47 -04:00
Paulus Schoutsen
d1fcdfd5a3 Convert cover and media player models to classes (#1197) 2018-05-20 08:39:24 -04:00
Paulus Schoutsen
d7b2a03880 Don't use window to share CoverEntity (#1192)
* Don't use window to share CoverEntity

* Lint
2018-05-19 16:21:29 -04:00
Paulus Schoutsen
4a734fbffc Inline media player entity (#1191) 2018-05-19 16:12:49 -04:00
Paulus Schoutsen
41990767e2 Remove state history cache from window (#1193) 2018-05-19 16:12:38 -04:00
Paulus Schoutsen
0789c0884c Don't expose translation methods on window (#1194) 2018-05-19 16:12:26 -04:00
Paulus Schoutsen
4de7cbec30 Inline hass-attribute-util (#1196) 2018-05-19 16:12:11 -04:00
Paulus Schoutsen
1d144a101c Remove marked from window (#1195) 2018-05-19 16:12:03 -04:00
Paulus Schoutsen
1eda9155fd Version bump to 20180519.0 2018-05-19 10:37:43 -04:00
Paulus Schoutsen
43b0be9581 Fix hass.io panel 2018-05-19 10:37:22 -04:00
Paulus Schoutsen
52b6fe006f Version bump to 20180518.1 2018-05-18 18:11:46 -04:00
Paulus Schoutsen
365d660e79 Lint 2018-05-18 17:57:26 -04:00
cdce8p
34ec3e0ae5 Fix yarn dev script (#1186)
* Fix yarn dev script

* Removed yarn dev

* Update bootstrap
2018-05-18 15:17:50 -04:00
Paulus Schoutsen
059eda861e Fix placeholder camera image flash as broken image 2018-05-18 15:14:51 -04:00
Paulus Schoutsen
5ede26f162 Extract empty image 2018-05-18 15:12:24 -04:00
Paulus Schoutsen
960bdc0c9b Remove hassCallApi from window 2018-05-18 15:01:33 -04:00
Paulus Schoutsen
81fbda49bd Upgrade to home-assistant-js-websocket@2.0.1" 2018-05-18 13:36:38 -04:00
Paulus Schoutsen
e57d9f7751 Add websocket helpers to polymer (#1187)
* Add websocket helpers to polymer

* Lint

* Upgrade to home-assistant-js-websocket@2.0.0
2018-05-18 13:25:01 -04:00
Paulus Schoutsen
964ada87b7 Update dev link 2018-05-18 13:21:59 -04:00
cdce8p
ba3670c5db Fix fan rotation attributes (#1159) 2018-05-18 11:14:59 -04:00
Paulus Schoutsen
20ea9e5df7 Bump frontend to 20180518.0 2018-05-17 20:53:31 -04:00
Paulus Schoutsen
e1c9f3deea Everything through navigate mixin 2018-05-17 18:20:23 -04:00
Paulus Schoutsen
dba388f723 Version bump to 20180517.0 2018-05-17 17:53:26 -04:00
Paulus Schoutsen
3d1164f09c Update translations 2018-05-17 17:53:21 -04:00
Paulus Schoutsen
bc27f854f1 More cleanup (#1185)
* More cleanup

* Set up correct urls authorize.html

* Fix polymer lint

* Remove reference to bower

* Tweak uglify settings
2018-05-17 17:51:07 -04:00
Paulus Schoutsen
cb0db95abe Build hassio panel (#1184)
* Fix hass.io panel

* Add develop scripts

* Build hassio on Travis
2018-05-16 23:03:48 -04:00
Paulus Schoutsen
8ac08bc802 Remove unused import helper 2018-05-16 21:33:39 -04:00
Paulus Schoutsen
f70c0aea6c Org files (#1183)
* Organize files

* Import EventsMixin

* Import NavigateMixin

* Dissolve window.hassMixins

* Apply ElementMixin when we use it

* Update tests to point at right dir

* Eslint

* Clean

* Update mixins inside hassio

* Update lint command"

* Fix polymer lint
2018-05-16 13:47:34 -04:00
Paulus Schoutsen
d1adc2fed0 Version bump to 20180516.1 2018-05-16 09:38:42 -04:00
Paulus Schoutsen
1971223ad3 Code split voice and more info dialog out (#1182) 2018-05-16 09:38:01 -04:00
Paulus Schoutsen
3fa9896543 computeStateDomain instead of computeDmoain 2018-05-16 09:20:25 -04:00
Paulus Schoutsen
7b3b717f43 Version bump to 20180516.0 2018-05-16 08:55:16 -04:00
Paulus Schoutsen
405cb36904 Fix imports 2018-05-16 08:54:48 -04:00
c727
0c6f8c34fb P3: Replace hassUtil with imports (#1181)
* P3: Remove get is()

* P3: Replace hassUtil with imports

* Remove hass-util imports

* Fix errors
2018-05-16 14:03:04 +02:00
Paulus Schoutsen
23a2a479a5 Remove rollup (#1179)
* Remove rollup

* Fix build

* Add copy webpack plugin

* Touch service worker

* Remove unused ha-config-js-.js
2018-05-16 07:54:29 -04:00
c727
5a16095270 P3: Remove get is() (#1180) 2018-05-16 07:06:07 -04:00
Paulus Schoutsen
89cb8c87ae Fix map panel (#1178) 2018-05-15 18:00:07 -04:00
Paulus Schoutsen
96d7ec7cda Embed the preact code directly (#1177)
* Embed the preact code directly

* Do not transform object rest spread

* Lint

* Ignore preact from lint
2018-05-15 17:56:32 -04:00
Paulus Schoutsen
47642957c8 Don't run bower anymore when doing release 2018-05-15 14:14:38 -04:00
Paulus Schoutsen
65780de61e Version bump to 20180515.0 2018-05-15 14:06:23 -04:00
Paulus Schoutsen
646f0bb718 Stub service worker 2018-05-15 14:06:08 -04:00
Paulus Schoutsen
68fb35a401 Fix authorize path 2018-05-15 13:46:40 -04:00
Paulus Schoutsen
658b349755 Use url path instead of component name for path 2018-05-15 13:38:05 -04:00
Paulus Schoutsen
a4afc2e37a Polymer 3 modulize (#1154)
* Version bump to 20180510.1

* Fix hass util

* Fix translations

* Bye paper-time-input

* Add webpack config

* Add webpack to package.json

* Fix translation import

* Disable web animations polyfill bad import

* Disable importHref import

* Update webpack config to build authorize.js

* Build translations json

* Build frontend correctly

* Run eslint --fix

* Load markdown JS on demand (#1155)

* Add HTML imports (#1160)

* Fix localize (#1161)

* Fix Roboto in build (#1162)

* Load web animations polyfill (#1163)

* P3: Fix chart js (#1164)

* P3: Fix Chart JS

* Update timeline package

* P3: panel resolver (#1165)

* WIP

* Initial importing of panels

* Fix panel resolver

* Fix automation and script editor (#1166)

* Expose Polymer and Polymer.Element on window (#1167)

* Remove unused import

* eslint --fix

* Es5 build (#1168)

* Build for ES5

* Fix build_frontend

* Remove stale comment

* Migrate to use paper-material-styles (#1170)

* Send parsed date to history/logbook (#1171)

* Fork app storage behavior (#1172)

* Add paper input with type time (#1173)

* Fix authorize

* Lint

* Sort imports

* Lint

* Remove eslint-html

* Do not lint authorize.html

* Fix polymer lint

* Try chrome 62 for wct

* P3: Add patched iconset (#1175)

* Add patched iconset

* Lint

* Test with latest Chrome again

* Use less window.hassUtil

* Teporarily use my fecha fork

* Import correct intl.messageFormat

* Update wct-browser-legacy to 1.0.0

* Include polyfill in right place

* Fix IntlMessageFormat

* Fix test not having a global scope

* Rollup <_<

* Fork app-localize-behavior

* Disable wct tests

* Lint
2018-05-15 13:31:47 -04:00
Paulus Schoutsen
205d6a8347 Version bump to 20180510.1 2018-05-10 17:38:10 -04:00
Paulus Schoutsen
89333aa55e Update to home-assistant-js-websocket@1.2.1 2018-05-10 17:38:03 -04:00
Paulus Schoutsen
2a3325efd7 Version bump to 20180510.0 2018-05-10 14:26:38 -04:00
Paulus Schoutsen
3b7a206cec Add an authorize page for authentication (#1147)
* Use authorize page if auth provider

* Add webcomponent polyfill

* More fixes

* ES5 fix

* Lint

* Use redirect_uri

* upgrade uglify to fix tests?

* Update browsers used for testing
2018-05-10 14:25:36 -04:00
Paulus Schoutsen
912969111f Move all of hassUtil to JS (#1153)
* Move all of hassUtil to JS

* Fix tests
2018-05-09 21:33:31 -04:00
Paulus Schoutsen
9116f5733d Include util.js for hass.io (#1152) 2018-05-09 10:47:56 -04:00
Paulus Schoutsen
0fdf980fee Version bump to 20180509.0 2018-05-08 20:45:23 -04:00
c727
8ecc41388a Fix issues with new weather card (#1149)
* Fix issues with new weather card

* New line
2018-05-08 18:14:29 -04:00
Paulus Schoutsen
356e104096 Merge duplicate keys in travis yaml (#1150)
* Merge duplicate keys in travis yaml

* Update .travis.yml
2018-05-08 17:20:35 -04:00
Paulus Schoutsen
eeba117e4b Fix hass.io panel (#1148) 2018-05-08 17:54:38 +02:00
Paulus Schoutsen
3da55c6ab5 Version bump to 20180505.0 2018-05-05 11:34:48 -04:00
Paulus Schoutsen
faed5fbfe4 Update translations 2018-05-05 11:34:24 -04:00
cdce8p
6f738510fa Added sensor device_class 'light' (#1143)
* Added sensor device_class 'light'

* Changed icon

* Changed device_class name
2018-05-05 09:37:55 -04:00
Boyi C
de55c13355 Fix chart not updating #1104 (#1139) 2018-05-04 16:04:07 -04:00
Pascal Vizeli
38e1b16031 Update hassio-host-info.html (#1141) 2018-05-04 14:41:02 +02:00
Paulus Schoutsen
06341edc49 Fetch camera image via websocket connection (#1136)
* Fetch camera image via websocket connection

Lint

Cleanup

* setProperties
2018-05-03 22:04:25 +02:00
Paulus Schoutsen
9fc3d9d019 Fetch media player image from websocket (#1137) 2018-05-03 22:03:48 +02:00
Malte Franken
3e90db5fa3 Allows to define a custom "more info" dialog per entity (#1128) 2018-04-29 15:01:14 -04:00
c727
30555eda88 Remove Hassbian panel (#1132) 2018-04-29 18:08:03 +02:00
c727
ac38fdb9df Fix plant card batteryLvl 100 icon (#1130)
* Fix plant card batteryLvl 100 icon

* Update ha-plant-card.html
2018-04-28 19:29:36 -04:00
Paulus Schoutsen
4c6d9602ae Remove zoom plugin (#1104) 2018-04-27 14:09:25 -04:00
c727
811d99b68c Rework plant card (#1123)
* Rework plant card

* Lint

* Fix updates for battery icon
2018-04-27 10:26:34 -04:00
c727
a983a5dbc5 Weather card without chart (#1117)
* Weather card without chart

* Lint

* Add iron-icon

* Add night icon and translation

* More translations

* Lint

* Feedback

* More Flexbox KungFu

* Finishing

* Use hass lang instead of browser lang

* Add more info card

* Lint

* Improve support for other providers

* Support non-daily forcasts

* Here we go
2018-04-26 17:16:02 -04:00
Boyi C
f21db486eb Update timeline to 0.1.5, improve drawing for small element. (#1121) 2018-04-26 16:34:55 -04:00
NovapaX
e1b924a154 Update more-info-media_player.html (#1126)
Fixes https://github.com/home-assistant/home-assistant/issues/14098
2018-04-26 21:57:38 +02:00
Paulus Schoutsen
421b9ec800 Version bump to 20180425.0 2018-04-24 23:15:16 -04:00
Paulus Schoutsen
e8b84c6d52 Update translations 2018-04-24 23:14:55 -04:00
c727
86db23a957 Add translation for script and scene card (#1119)
* Add translation for script and scene card

* appliesMixin

* Change script button text to "execute"
2018-04-23 13:25:48 -04:00
Otto Winter
a22b62cf2a Add Sensor device_class support (#1115)
* Add Sensor Device Class Support

* ES6
2018-04-22 23:37:26 -04:00
Otto Winter
db2f588e86 Fix unavailable state icon (#1118) 2018-04-22 18:35:59 +02:00
c727
02cf337f1a Add www. to home-assistant URLs (#1111)
* Add www. to cloud skill URLs

* Update ha-config-cloud-login.html

* Update ha-panel-dev-info.html
2018-04-20 06:08:55 -04:00
c727
eafd7fb296 Update more-info-updater.html 2018-04-20 05:04:45 +02:00
Paulus Schoutsen
c0e3f8ec6b version bump to 20180420.0 2018-04-19 22:16:09 -04:00
Paulus Schoutsen
510cc6448e Update translations 2018-04-19 22:15:46 -04:00
Paulus Schoutsen
a832566715 Add Google Assistant integration (#1110)
* Add Google Assistant integration

* Fix card actions
2018-04-19 21:55:26 -04:00
Paulus Schoutsen
75ae672ef9 Update translations 2018-04-19 11:40:32 -04:00
NovapaX
570cb5d52b add default vacuum component icon (#1108) 2018-04-18 15:46:52 -04:00
NovapaX
afc4663870 allow label-badge-title font-weight theming (#1102)
* allow label-badge-title font-weight theming

* change to 400 weight

kept the variable for those who really prefer the thinness of before.
2018-04-18 14:16:13 -04:00
NovapaX
a5aaaf6a0a icon rename (#1105) 2018-04-18 20:15:31 +02:00
Adam Mills
288478978f Always run translation upload on master (#1106)
This ensures that if the master build gets cancelled when translations
change, or if any other weird situation happens, we know the
translations will be uploaded after the next build.
2018-04-18 14:11:31 -04:00
Adam Mills
e719f113d9 Fix for Lokalise backend misinterpretation of keys (#1107)
The Lokalise server has a bug that the internal portion of key
references was misinterpreted as a symfony key, and was getting auto
converted by the convert placeholders feature. Since we don't use this
we're turning it off to work around the bug.
2018-04-18 14:11:03 -04:00
NovapaX
2aa02ff561 Fix chart tooltip format for line charts (#1099)
* position tooltip correctly if chart is in history_graph card

* format & localize title in linechart

* tweak tooltip style/position
2018-04-18 09:44:43 -04:00
NovapaX
0a60ec2298 Fix paper-slider pin style (#1022)
* ha-paper-slider extends and copies paper-slider

* paper-slider -> ha-paper-slider

* remove promise

* this.is -> HaPaperSlider.is

* jsdoc to instruct linter

* suppress missing props

* fix linter

* more lint
2018-04-17 17:24:09 -04:00
NovapaX
cd3136908c classrename (#1097) 2018-04-17 21:17:10 +02:00
Paulus Schoutsen
6d547aaf21 Update release script to use twine 2018-04-17 10:17:09 -04:00
Paulus Schoutsen
85c4c51228 Version bump to 20180417.0 2018-04-17 10:11:34 -04:00
Paulus Schoutsen
5667f06a12 Update translations 2018-04-17 10:11:20 -04:00
Boyi C
5dc9efd995 Unify navigation to NavigateMixin (#1095)
* Unify page navigation to NavigateMixin

* revert unintended change

* Use template literal
2018-04-17 10:01:58 -04:00
Matt N
a2ec19e10f Don't send the Referer header to other origins. (#1092)
Avoid leaking the Home Assistant domain name (which often contains a person's name/alias) in the Referer header for non-same-origin requests.
2018-04-17 10:01:00 -04:00
NovapaX
8047313165 take zero height (#1089) 2018-04-17 10:00:47 -04:00
NovapaX
5068178aac Some more state wrapping fixes (#1082)
* climate state should never wrap

* some more state wrapping fixes
2018-04-17 10:00:11 -04:00
Paulus Schoutsen
a597749020 Use handler instead of domain (#1093) 2018-04-17 11:44:38 +02:00
NovapaX
1335a74605 Setting used paper-colors in ha-style (#1091)
* setting default paper-colors
clean up some whitespace/indentation

* better indentation
2018-04-15 16:16:11 +02:00
NovapaX
027165c8ac Prefix media-player-model and use it for more-info (#1088)
* prefix media player model with hass-
use model for more-info-mplayer

* missed a binding
2018-04-14 18:04:44 -04:00
Paulus Schoutsen
a512d9e910 Version bump to 20180414.0 2018-04-14 14:40:51 -04:00
Paulus Schoutsen
f385b6c80d Fix config entry localization (#1084) 2018-04-14 14:38:34 -04:00
Charles Garwood
fdfa09ed2e Add more-info dialog support to dev-states (#1071)
* Add state history card to dev-states

* add hass-mixins.html import

* Put icon for more-info next to entity_id
2018-04-13 21:35:49 -04:00
Boyi C
dc6ca7c774 Change padding logic (#1077) 2018-04-13 21:32:50 -04:00
NovapaX
f40d64d68c Easier theming and also apply theme to date picker (#1041)
* datepicker overlay backgrond

* style vaadin more

* cleanup diff

* make styling easier

* more vars

* sidebar text

* sidebar selected background backward compatible

* indent commented theming var

* fix sidebar text color incompatibility
2018-04-13 21:32:20 -04:00
NovapaX
961f43e4a5 correct max width. give small text some more space. vertical centering. (#1083) 2018-04-13 21:25:17 -04:00
NovapaX
2cf508e0b0 Some little tweaks (old browsers / iOS 9) (#1086)
* fix config panel flex

* fix media player card not shwwing picture

* prevent toggle being compressed / pushed away
2018-04-13 21:16:51 -04:00
c727
9d3b5c9d9b Hassio: select audio input/output for add-ons (#1078)
* Hassio: audio input/output for add-ons

* Lint

* Lint

* Lint...

* Pimp code

* Update to latest changes

* Lint

* Lint

* try again

* hm...

* Fix this.fire
2018-04-14 00:45:59 +02:00
Boyi C
57e500b109 Fix flex-box (#1076)
Small tweak styling
2018-04-12 08:58:46 +02:00
Paulus Schoutsen
d5776f750f Update Node version to latest LTS (#1080) 2018-04-11 21:01:25 -04:00
NovapaX
bfaebfe418 Pretty huge scrolling performance upgrade (#1069)
* turn ha-cards into its own layer
2018-04-10 09:25:00 +02:00
Charles Garwood
9cff9cac10 Add refresh button to logbook (#1072)
* Add refresh button to logbook

* cleanup old comment

* Address PR comments

* Code style update

* Remove id from paper-icon-button, style cleanup

* Update date handling, show refresh button for all days

* revert _currentDate changes
2018-04-09 10:59:48 -04:00
Charles Garwood
7967ab307c Adds date to systemlog entries (#1068)
* Adds date to systemlog entries

* Only return date if not today

* Fix lint

* Fix lint

* Address comments by c727

* tested and working this time

* fix lint

* remove unneeded formatDateTime function
2018-04-05 22:51:48 -04:00
Paulus Schoutsen
b57116f39c Bump version to 20180404.0 2018-04-03 16:48:46 -07:00
NovapaX
51f4028343 Fix scrollable clipping controls because of webkit-overflow-scrolling: touch; (#1065)
* change labeled slider

* fix `-webkit-overflow-scrolling: touch` clipping positioned elements

* Revert "change labeled slider"

This reverts commit fc34cb712b.
2018-04-03 16:47:26 -07:00
NovapaX
c83a05c1ea add issue template (#1067) 2018-04-03 16:43:28 -07:00
NovapaX
b102925323 fixing #940 (#1066) 2018-04-03 16:32:06 -07:00
John Arild Berentsen
1cda7791c1 give pollingintensity default value (#1059) 2018-04-01 12:03:32 -07:00
Andrey
efa956a0b5 Allow theming badge label color and hide empty label. (#1060) 2018-04-01 12:03:04 -07:00
Paulus Schoutsen
0a5767913a Update version to 20180401.0 2018-03-31 17:42:37 -07:00
Paulus Schoutsen
859ffdb66d Update translations 2018-03-31 17:42:30 -07:00
c727
4c65767e5a Fix TypeError for views (#1045)
* Fix TypeError for views

quick and dirty fix, maybe this file needs some more cleanup

problem:
if you have `default_view` in groups.yaml and reload groups in `computeViewStates(currentView, hass, defaultView)`
`defaultView` is (still) defined but but `hass.states.group.default_view` doesn't exist

Fix: #893

* Update partial-cards.html

* Add ;

* Lint
2018-03-31 17:35:33 -07:00
NovapaX
d7d167fbf9 Make paper-scrollable in fullscreen dialog resize properly (#1052)
* remove min-height to make paper-scrollable work properly.
Hack fullscreen background behind it

* apply fix to hassio-markdown-dialog
2018-03-31 17:32:02 -07:00
NovapaX
6447e98caa Fix language selection (#1056)
* fix attr-for-selected not finding language-tag

* look for attribute instead of property

* change to data-binding structure
2018-03-31 17:31:27 -07:00
NovapaX
d8fb01ab44 Hide empty 'Currently' on climate statecard (#1047)
* hide currently if no value

* zero is falsy. align items

* don't hide falsy values

* computed property instead of observer

* guard null/undefined
2018-03-31 17:29:49 -07:00
Paulus Schoutsen
77330d03b3 Guard for both undefined and null (#1053) 2018-03-31 12:09:22 -07:00
NovapaX
88ad376045 Don't uppercase unit_of_measurement in state-badge (#1025)
* determine unit from state. set case via label-is-state attr

* use css var and classnames

* use classnames and mixin

* use css var

* fallback, both needed and way more elegant
2018-03-29 17:35:51 -07:00
NovapaX
ed0696ea9c hide brightness slider on unavailable light (#1046) 2018-03-29 17:20:51 -07:00
Paulus Schoutsen
5508805f0b Version bump to 20180330.0 2018-03-29 16:59:38 -07:00
Paulus Schoutsen
d2688cab75 Fix markdown rendering 2018-03-29 16:58:23 -07:00
Paulus Schoutsen
06502cb93a Fix a bunch of lint errors (#1044)
* Fix a bunch of lint errors

* Add behavior jsdoc

* Convert ha-markdown to polymer element

* Update lint command
2018-03-29 16:57:15 -07:00
Paulus Schoutsen
0e227708b9 Fix tooltip with title on hass-subpage (#1048) 2018-03-30 01:39:53 +02:00
Paulus Schoutsen
e46d2e2934 Fix property 2018-03-28 16:34:39 -07:00
Paulus Schoutsen
caf1c2fdd1 Update markdown 2018-03-28 16:19:29 -07:00
Kory Prince
209a118833 Remove extra quoting to resolve issues on macOS (#1039) 2018-03-28 16:18:48 -07:00
NovapaX
0790cd1ac9 Improve chart loading behaviour and some other chart fixes (#1042)
* show is loading and animate chart display

* let tooltip overflow in more-info

* graph chart tooltip overflow

* style toopltip a bit more like material design guidelines

* smoother tooltip appearing

* timeline transition time

* max-widht -> width
2018-03-28 16:16:25 -07:00
c727
fb8fb09c73 Change attribute checks to handle if value == 0 (#1037)
if (0) is false
2018-03-27 23:57:01 -07:00
Paulus Schoutsen
7081fb5123 Update markdown 2018-03-27 23:52:35 -07:00
Kory Prince
6c2126fb5f Use build script for markdown-js.html (#1038)
* add script to build and minify markdown-js.html from npm

* update markdown-js.html from build script
2018-03-27 23:52:27 -07:00
Kory Prince
af1581b4c5 Migrate to Marked.js + js-xss for Markdown parsing (#1026)
* Migrate to Marked.js + js-xss for Markdown parsing

* Update JS

Updating JS with latest source code from NPM to ensure it has not been altered
2018-03-26 21:13:54 -07:00
NovapaX
38542e1f0c Set theme variables on html element (#1023)
* set theme on html element

* style toggle buttons with primary color

* Fix lint
2018-03-26 17:31:41 -07:00
NovapaX
d87d845dbc Fix long more-info toolbar title. (#1034)
Max 2-lines. Ellipsis overflow on supported browsers.
2018-03-26 17:28:35 -07:00
PeteBa
7be6d17b37 Change brightness to be real-time rather than max value (#1029) 2018-03-26 21:44:09 +02:00
NovapaX
981e94e84d Merge pull request #1032 from NovapaX/fix/state-info-badge-colors
Fix state-info badge colors (on polyfilled browsers)
2018-03-26 11:00:53 +02:00
NovapaX
c04c30337f Contain slots and scope css instead of using ::slotted
Polyfill converts `::slotted(*)` to `host-tag > *` which messes up
styles of descendents that are not slotted.
2018-03-26 10:50:10 +02:00
Paulus Schoutsen
8451f9487e Version bump to 20180326.0 2018-03-25 18:10:25 -07:00
Kory Prince
41e7235ccf use encodeURIComponent to encode API password (#1027) 2018-03-25 09:34:59 +02:00
c727
3b76238241 Hassio: support new mode (stable, beta, dev) (#1024)
* Hassio: support new mode (stable, beta, dev)

* mode -> channel

* Fix beta data
2018-03-24 22:14:48 +01:00
NovapaX
796ec4a4b0 Use hue, saturation and a brightness filter for state badge (#1021)
* Use hue and saturation values. Use css filter for brightness.

* Assign style properties at once.

* label => if else logic
2018-03-23 10:01:33 -07:00
Marc Khouri
6ee9808d42 Fixup styling of config entries (#1020)
* Fixup styling of config entries

Fixup the (temporary) styling of config entries by not using `paper-item`,
which made entries clickable / focusable

* Missed dependency
2018-03-22 23:16:50 -07:00
Marc Khouri
399d14a5e0 Add styling to Config Entries (#1011)
* Add some styling to Config Entries

This commit adds some styling to the (experimental) Config Entries

* re-add localization

Note: I'm having issues with localization on my current setup -- it doesn't
seem to be working for me 🤷. This commit just keeps the same localization
as there was previously, no change

* Update based on PR review

* Remove stale annotations
2018-03-22 10:32:32 -07:00
Paulus Schoutsen
42f3294523 Version bump to 20180322.0 2018-03-21 21:19:23 -07:00
Paulus Schoutsen
d609ce241e Update translations 2018-03-21 21:15:11 -07:00
Adam Mills
e5a5c353c4 Don't render minimum color temp with gray border (#1017) 2018-03-21 15:22:44 -07:00
Adam Mills
0df4aa6117 Use new light HS API for the color picker (#982) 2018-03-21 17:35:16 -04:00
c727
6bdf1c8b80 Hassio: show hardware (#997)
* Hassio: list hardware

* Hassio: show hardware

* Remove debug

* Travis

* Concept

* Lint

* Raised button

* Lint
2018-03-21 12:26:46 -07:00
NovapaX
421b9abc7d fix media-player source selection loop (#1012) 2018-03-21 18:20:14 +01:00
NovapaX
b107e0e15c Stop paper-slider to change value on touchdown on the sliderbar (#1006)
* Stop paper-slider to change value on touchdown on the sliderbar.
This prevents interfering with intended scroll. Touch-tap on the
sliderbar still works. Mouse-behavior doesn't change eiter.

* change property syntax
2018-03-19 14:42:51 -07:00
NovapaX
fe6c8faad7 fix vaadin overlay height (e.g in services picker) (#1007)
see: https://github.com/vaadin/vaadin-combo-box/issues/432
2018-03-19 14:42:05 -07:00
Andrey
46a2f4fd72 Make sure packages are up to date when releasing (#1004) 2018-03-17 17:26:45 -07:00
NovapaX
3324c7e01c Nicer scrolling for more-info (#1005)
* nicer more-info scrolling (momentum & rubberband)

* move chart into scrolling region.
Fixes resizing issues of the paper-dialog (and scrolling area) because
of chart rendering after loading.
2018-03-17 17:26:02 -07:00
Paulus Schoutsen
8146794857 Version bump to 20180316.0 2018-03-16 15:38:59 -07:00
Andrey
b03c361198 When /states/bad_view is selected - fall back to default view. (#1002) 2018-03-16 15:38:27 -07:00
cdce8p
860860099e Changed cover icon condition (#995) 2018-03-16 03:38:37 +01:00
Paulus Schoutsen
b80c52dab2 Fix race condition setting current language (#996) 2018-03-15 12:33:32 -07:00
c727
e0ca88b3ad Hassio enable beta updates from UI (#993)
* Hassio enable beta updates from UI

* Feedback

* Feedback2
2018-03-15 05:58:09 +01:00
Paulus Schoutsen
196ea97917 Use Home Assistant icon for homeassistant domain" (#994) 2018-03-15 04:19:29 +01:00
Paulus Schoutsen
4f55103a12 Version bump to 20180315.0 2018-03-14 16:13:10 -07:00
Paulus Schoutsen
9082b47687 Update translations 2018-03-14 16:13:10 -07:00
Andrey
05da295f27 Charts improvements (#992)
* Charts improvements

* Improve last-odd legend item.

* Revert dblclick

* Lint
2018-03-14 16:11:37 -07:00
NovapaX
9dc809cdb9 State display wrapping and fix full screen more-info (#991)
* state-info lower min-width, remove unnesecary wrapping div

* State normal line height, align flex baseline. Get rid of wrapping div

* fix full screen more-info-dialog
2018-03-14 11:42:10 -07:00
Ville Skyttä
09fe2172b2 Spelling fixes (#989) 2018-03-14 13:03:00 +01:00
Ville Skyttä
3d101116a2 Fix and update "Update Instructions" link (#990) 2018-03-14 12:58:48 +01:00
Paulus Schoutsen
2ed5b7e7c1 Move effects control down (#988)
It's the least important control in the whole more info picker, yet was taking up the prime spot.
2018-03-13 23:58:12 -07:00
NovapaX
7066b40e4c Apply paper-dialog-behavior instead of nesting paper-dialogs (#987)
* disable ha-url-sync

* apply a paper-dialog-behavior mixin to dialogs

* Revert "disable ha-url-sync"

This reverts commit 4758a81af61d9f6979a93c0a899d3788fb48090e.

* fix css :host attribute selector

* move hass back to the components
2018-03-12 18:20:04 -07:00
NovapaX
2c79094fb4 Change more-info-dialog name to ha-more-info-dialog (#986)
* change more-info name to ha-more-info-dialog (like other dialogs)

* rename element

* fix closing tag
2018-03-12 12:34:51 -07:00
c727
198e2dd11f Show JS version and custom UIs in dev info (#981)
* Show JS version and custom UIs in dev info

* Custom UIs

* Move to bottom
2018-03-11 16:35:49 -07:00
c727
3234777154 Add Norsk Nynorsk to languages (#984) 2018-03-11 15:13:50 -07:00
Adam Mills
0ec4cd668f Use backend translation for config entries (#980)
* Use backend translation for config entries

* Accept label/error callbacks on ha-form

* Add hassMixins import to ha-form
2018-03-11 12:47:52 -07:00
Paulus Schoutsen
f1736024cc Version bump to 20180310.0 2018-03-10 10:19:19 -08:00
Adam Mills
29f9b2d201 Fix backend translations load without selection (#979) 2018-03-10 10:06:25 -08:00
Paulus Schoutsen
97eec435ab Version bump to 20180309.0 2018-03-09 07:53:33 -08:00
c727
b52d2967df Hassio: confirm add-on uninstall (#977)
* Hassio: confirm add-on uninstall

* Travis
2018-03-08 18:11:43 -08:00
Paulus Schoutsen
964b048a93 Update translations 2018-03-08 16:16:43 -08:00
c727
a3ac015f84 Hassio show changelogs (#969)
* Hassio show changelogs

* wip

* update

* Travis

* Travis2
2018-03-08 16:14:07 -08:00
Paulus Schoutsen
85ab32d752 Upgrade home-assistant-js-websocket 2018-03-08 16:12:53 -08:00
c727
a1dbd18a9a Hassio snapshot: download + design tweaks (#972)
* Hassio snapshot download, upload

* some improvements

* Remove event

* Remove upload stuff

* Feedback

* Make downloads as suggested

* More updates

* Add tooltips
2018-03-08 15:52:52 -08:00
c727
08d4e0af18 Fix relativeTime format for Date() === dateObj (#974)
* Fix relativeTime format for Date() === dateObj

* Feedback

* Update hass-util.html
2018-03-07 17:31:13 +01:00
Adam Mills
1fbad393bf Lokalise upload fix (#976)
* Pin lokalise sceript to working version

* Include cleanups from the home-assistant scripts
2018-03-07 09:46:33 -05:00
c727
675a3adfbe Remove scrollbar in Hass.io iframe (#973) 2018-03-05 21:43:33 -08:00
Paulus Schoutsen
d0fc088c06 Version bump to 20180305.0 2018-03-05 15:18:59 -08:00
Paulus Schoutsen
ca6ec8bb0f Fix dev info panel dialog overlay (#971) 2018-03-05 15:18:37 -08:00
Paulus Schoutsen
f9b7268b9a Update translations 2018-03-05 15:11:19 -08:00
Paulus Schoutsen
bec9162198 Simplify the cloud screens (#967)
* Simplify the cloud

* lint

* Simplify registration flash message text

* Address comments

* Update title
2018-03-05 13:42:56 -08:00
Andrey
710139bf4b Clean charts and persist hidden lines (#970) 2018-03-05 13:40:53 -08:00
Paulus Schoutsen
e41b5238c2 Config entry tweaks (#960)
* Add support for picking an option to ha-form

* Fix overlay of paper-dialog inside app-layout

* Handle flows that finish/abort straight away

* Lint

* Remove alerts

* Remove userCreatedFlow from properties

* Don't use setProperties for 1 property
2018-03-05 13:06:22 -08:00
Paulus Schoutsen
d188821765 Prefer set properties (#968)
* Use set properties

* Address comments

* Update partial-cards.html
2018-03-05 00:12:55 -08:00
Andrey
19705a9c2b IntersectionObserver fixes (#964)
* IntersectionObserver fixes

* handle 'card -> entities -> card' case

* fix typo
2018-03-04 10:22:53 -08:00
Andrey
addad74019 Add css variables to toggle buttons colors (#966) 2018-03-04 10:20:54 -08:00
Boyi C
9dc33de49f Update chartjs to 2.7.2 (#963)
* Update chartjs to 2.7.2

* lint

* lint
2018-03-03 17:43:27 -08:00
c727
39172f8c49 Hassio reload addons and snapshots (#937)
* Hassio reload addons and snapshots

* Add refresh button again

* Travis

* Remove Eventlistener
2018-03-01 17:23:47 +01:00
Adam Mills
101794c88e Load and subscribe to backend translations (#894)
* Load backend translations

* Add support for component level state translations

* Fix selected language backend translation loading
2018-02-28 19:32:48 -08:00
c727
bae1ab822c Add Welsh + Indonesian to languages (#873)
* Add Welsh to languages

* Add Indonesian
2018-03-01 04:03:57 +01:00
NovapaX
f87dbc5735 retru importHref once to solve a webkit refresh issue (#958) 2018-02-28 13:59:01 -08:00
Sean Wilson
7377db312b Add 'lock' device class (#800)
* Add 'lock' device class

* Invert lock settings as per https://github.com/home-assistant/home-assistant/pull/11640
2018-02-28 13:25:33 -08:00
NovapaX
bb6c46180d Hide the date-clear icon and style vaadin-date-input like a paper input (#956)
* styling the vaadin-date-input like a paper input.

* move date-picker styles to ha-style
so they get reused automatically

* move vaadin date-picker-styles to thier own file.

* only disable clear button on required field.
and some style changes
2018-02-28 12:56:18 -08:00
Paulus Schoutsen
3ddb456970 Version bump to 20180228.1 2018-02-28 10:47:57 -08:00
Paulus Schoutsen
3fbd5e351e Add user agent check to frontend (#955)
* Add user agent check to frontend

* Remove auto generated comment.
2018-02-28 10:46:24 -08:00
Max Prokhorov
9c6d28fbc4 Chart.js labels and ticks with proper locale formatting (#948)
* Use hassUtil to format time in timeline tooltip

* Also format time in timeline ticks

* Use hassUtil.formatTime instead of moment.format
2018-02-28 10:40:38 -08:00
NovapaX
5966e872cf reinstate connectedCallback (#957)
using the debouncer this time so no harm
2018-02-28 19:19:09 +02:00
Paulus Schoutsen
9ca00d1c85 Version bump to 20180228.0 2018-02-27 20:47:46 -08:00
NovapaX
16734c7423 Fix history data processing (#951)
* don't call filterchanged twice. it's already an observer.

* fix data comparison
Compare new data from ha-state-history-data to existing data and replace
if changed

* remove unnecessary styles

* prevent multiple updates of chart-data

* remove console

* remove another console

* directly binding because debouncing in history-data element
shortening debounce time, works fine at 0

* remove inacurate comment
2018-02-27 20:40:25 -08:00
NovapaX
26b9ddf3ed fix safari es6 bug (#950)
and also at least log the error we catch. (don't know why the catch is
there, so not removing it)
2018-02-27 20:00:33 -08:00
Paulus Schoutsen
73608a73e7 Update zoom icon (#954) 2018-02-27 19:48:49 -08:00
Paulus Schoutsen
c2b090b912 Import mixin to silence build warning (#952) 2018-02-27 19:35:49 -08:00
Paulus Schoutsen
f75147c799 Reset height when not observing (#949) 2018-02-27 19:05:07 -08:00
Paulus Schoutsen
5296dcfe85 Entity Registry UI (#921)
* Entity Registry UI

* Tweak style in fullscreen

* Fix UI comments

* Fix imports

* Change title margin

* Fix graph rendering

* More style fixes

* Remove unused parameter
2018-02-27 19:04:58 -08:00
NovapaX
24bafceb71 Remove tap highlight on mobile Safari (#911)
* remove tap highlight

* indentation fix
removing tab that was already there

* Best of both worlds
Makes tap higlight visible on clickable elements on cards. (provides
some basic tap-feedback on iOS safari)

* allow highlight on sidebar links, add comment
2018-02-27 18:35:20 -08:00
c727
579adb0455 Hassio password protected snapshots (#936)
* Hassio password protected snapshots

* Remove space

* Travis

* Add checkmark to password

* Improve empty password detection

* Update

* Improvement for snapshot name

* Update

* Update hassio-snapshot.html

* Feedback

* Remove autofocus from password

* hidden -> dom-if
2018-02-27 18:09:06 -08:00
Paulus Schoutsen
3430996700 Migrate to app-drawer-layout (#929) 2018-02-27 17:38:19 -08:00
Andrey
ebc21aaa40 Disconnect unused more-info (#945) 2018-02-27 14:00:50 -08:00
c727
a88c6f49a2 Hassio sort add-ons on dashboard (#944) 2018-02-27 15:04:19 +01:00
c727
d27d9dd5da Hassio fix addon update info (#939) 2018-02-27 01:38:40 -08:00
Boyi C
807837a0dc Make the chart color more eye-friendly. (#941)
* Fix chart legend not showing correctly when data has 1 series.

* Change to flexbox

* Change timeline chart color to a palette.
2018-02-27 01:24:40 -08:00
Paulus Schoutsen
bb6b0ff714 Version bump to 20180227.0 2018-02-26 22:20:22 -08:00
Paulus Schoutsen
1ba34b1f78 Update translations" 2018-02-26 22:20:01 -08:00
NovapaX
44c325a929 prevent state display line-wrapping (#932)
* prevent state display line-wrapping
Only for applies to default statecards (state-card-display), not for
component specific statecards.

* compute class names function

* apply style to calculated class

* var -> const
2018-02-26 22:10:05 -08:00
NovapaX
294dec59a7 Fix display issues on iOS 9.3.5 (#901)
* Fix global default definition selector

* taking the brute force approach

* Some clarification in comment.
Feel free to change or remove. I thought this would be usefull as this
is a severe code duplacation that justifies some comment/clarification.

* Add link to PR/discussion for future reference

* Revert "taking the brute force approach"

This reverts commit 77d9920cd9.

# Conflicts:
#	src/resources/ha-style.html

* change comment

* always include paper-styles before custom style
2018-02-26 16:16:39 -08:00
Adam Mills
d4b257854d Add localization to the automation editor (#923)
* Add localization to the automation editor

* Unnest automation strings from `section`
2018-02-26 16:15:51 -08:00
Paulus Schoutsen
9f3458fcd1 Guard for contentWindow == null (#930) 2018-02-26 11:44:15 -08:00
Paulus Schoutsen
ff658c86ff Fix deprecated CSS (#928)
* Fix nested var

* Fix deprecated @apply syntax

* Hassio
2018-02-26 11:43:58 -08:00
Boyi C
0ab240c678 Fix chart legend not showing correctly when data has 1 series. (#926)
* Fix chart legend not showing correctly when data has 1 series.

* Change to flexbox
2018-02-26 10:46:20 -08:00
NovapaX
672bfb375f Fix paper card alignment in safari (#933) 2018-02-26 16:14:22 +01:00
Paulus Schoutsen
cdb9936795 Fix cards not getting updated (#927) 2018-02-26 00:24:07 -08:00
NovapaX
8b719778d0 search and replace (#924) 2018-02-25 19:44:03 -08:00
c727
1a18ee2755 Hassio fix issues with snapshot dialog (#920) 2018-02-25 01:34:34 -08:00
c727
5f5ac3834d Hassio rename advanced2 (#910)
* Change advanced to system

* Change advanced to system
2018-02-24 08:20:24 +01:00
c727
cdd4cabb4b Hassio, use CSS vars to avoid conflicts with themes (#918)
* Hassio, use CSS vars to avoid conflicts with themes

* More
2018-02-23 15:07:09 -08:00
c727
b47c5beacf Hassio remove TZ hack (#915) 2018-02-23 18:18:27 +01:00
c727
0ffb31999e Hass.io switch to tab navigation (#879)
* Hass.io switch to tab navigation

* Fixes

* Changes based on feedback

* Fix main

* move header back to main

* Remove space

* Navigation as suggested, replaced iron-pages
2018-02-23 01:26:29 +01:00
Paulus Schoutsen
c149ac735a Version bump to 20180221.1 2018-02-21 12:40:51 -08:00
Paulus Schoutsen
bb946d9eec Clean up cloud routing (#909)
* Clean up cloud routing

* Lint
2018-02-21 11:48:28 -08:00
Andrey
ea57e71c8b Optionally use Intersection Observer to late-load cards (#906) 2018-02-21 00:00:52 -08:00
Paulus Schoutsen
346022c48e Version bump to 20180221.0 2018-02-20 17:54:33 -08:00
Paulus Schoutsen
0a070a3fda Nav fixes (#908)
* Fail if script is not editable

* Fix config nav
2018-02-20 17:53:35 -08:00
Paulus Schoutsen
24c9dd0472 Version bump to 20180220.0 2018-02-20 09:07:37 -08:00
Paulus Schoutsen
9f27f75397 Upgrade chartjs timeline to 0.1.4 2018-02-20 09:05:15 -08:00
Paulus Schoutsen
35c8c70783 Lazy load iron page entries in config panel (#903) 2018-02-20 09:03:09 -08:00
Paulus Schoutsen
6a5de599df Change valueMin and Max props (#905) 2018-02-19 21:47:23 -08:00
Tabakhase
72a0b3520d Bring back zoom in charts using chartjs-plugin-zoom (#890)
* add chartjs-plugin-zoom + hammerjs

* adds a "unzoom" button for chartjs-plugin-zoom

* limits chartjs zoom and pan area by scanning all axis
2018-02-18 08:12:30 -08:00
Adam Mills
7acab579b4 Use new lokalise builtin unzip for download (#900) 2018-02-17 19:49:14 -08:00
Paulus Schoutsen
9de71db3cb Version bump to 20180216.0 2018-02-16 15:05:48 -08:00
Paulus Schoutsen
f3c3bb8c43 Config panel for Config Entries (#861)
* Initial implementation

* Update UI

* Update

* Address comments

* More comments

* Lint
2018-02-16 14:36:11 -08:00
Nash Kaminski
012e0981f2 [Bug] Do not overwrite the content of JSONTextField while the user is editing such (#895)
* Do not overwrite the context of JSONTextField while the user is editing such

* Style changes

* Handle case where valid JSON could potentially be overwritten.
2018-02-16 10:40:46 -08:00
Otto Winter
83e34f3f95 Fix template panel link (#898) 2018-02-16 09:20:43 -08:00
Paulus Schoutsen
f83a9d7339 Dev dependencies (#897)
* Upgrade eslint

* Upgrade rollup

* Upgrade mocha

* Upgrade gulp

* Upgrade more gulp

* Upgrade frontend stuff
2018-02-16 09:03:13 -08:00
Paulus Schoutsen
5731c1fa28 Load the chart resources in dev too (#896)
When switching to always loading the resources on demand, I forgot to change the default value to be always false instead of dev. This caused the charts not to load in dev.
2018-02-15 21:38:44 -08:00
Paulus Schoutsen
7860133709 Revert deps upgrade (#892) 2018-02-15 12:32:18 -08:00
Marius
1783696ecb more-info-climate.html use supported_features (#849)
* Added supported features for controls

* Improved supported features

* Removed lines resulted from rebase

* Fixed lint and review

* Added more supported_features and fixed fan mode bug
2018-02-13 23:20:11 -08:00
c727
10c07673c1 Fix mark items as (un)complete in shopping list (#887)
* Fix mark items as (un)complete in shopping list

Fix: #885

* Update ha-panel-shopping-list.html
2018-02-12 21:09:16 -08:00
Paulus Schoutsen
e2ff04e40b Lint 2018-02-11 10:31:12 -08:00
Paulus Schoutsen
932d8afbed Version bump to 20180211.0 2018-02-11 09:44:48 -08:00
Paulus Schoutsen
1cf18a34b8 Update dependencies 2018-02-11 09:44:28 -08:00
Paulus Schoutsen
7f461defc1 Improve UX template editor (#878)
* Improve UX template editor

* Address comments
2018-02-11 09:42:52 -08:00
Paulus Schoutsen
4c5d85746c Fingerprint charts (#883)
* Fingerprint charts URL

* cache in service worker
2018-02-11 09:01:17 -08:00
Boyi C
b6ad4edd32 Fix missing arguments in history-data. (#880) 2018-02-10 10:08:04 +02:00
Boyi C
c6030e6edc Replace Google Charts with Chart.js (#429)
* chartjs test

* [WIP] Modified for Chart.js

* Tweaking styles ( tooltips and lines )

* Almost done
TODO:
Change tooltips to HTML tag
Improve color function

* More work on Tooltips

* Improve update logic
Fix linting

* resolve conflict

* [WIP]
Create new tooltip mode hack.
Add axis padding to top and botton to prevent axis cutoff

* TODO: cleanup

* FIXME: tooltip in history graph not working correctly
reorganize some code

* fix build problem

* Fix color and tooltip issue
Fix label max width for timeline chart

* update dep

* Fix strange color after build due to `uglify` bug with reference the minified version.
Make line chart behavior more similar to Google Charts.
Make the chart honor to `unknown` and other state by manually calculate point value.

* fix bugs

* Remove label for only one data in timeline chart.
Fix bug for infinite loop in some cases

* Add HTML legend to chart.

* Fix isSingleDevice bug due to calculation.
Add isSingleDevice property support.

* fix for lint

* Replace innerHTML code with polymer node.

* Replace tooltip with HTML code

* fix tooltip style

* move default tooltip mode to plugin

* LINTING

* fix
Move localize history data to Timeline Chart.
Fix timeline static color.
Rework on chart resize.

* Bug fix:
Chart may disappear on some case.
Timeline chart calculation issue.
Change timeline chart hidden logic.

* fix tooltip
rework for resize event

* lint

* element

* Replace `var` to `let`.
Move import and ChartJs injection code to `ha-chart-scripts.html`.

* lint: convert more let to const

* fix font
fix undef

* update bower.json

* move

* Load chart code on demand
2018-02-09 22:39:15 -08:00
Paulus Schoutsen
500edbad0d Version bump to 20180209.0 2018-02-09 14:32:17 -08:00
Abílio Costa
3701e022bc Badge sorting (#844)
* sort badges correctly in user-defined group

* rename sorting list that is used for badges and groups

* remove trailing space

* better array iteration

* Revert "better array iteration"

This reverts commit 0a87b3350c.

* simplify sorting of badges
2018-02-09 14:30:35 -08:00
Paulus Schoutsen
be3f35c8cd Update translations 2018-02-09 14:28:21 -08:00
c727
81c49628e4 Hass.io card design for dashboard updateinfo (#877)
* Hass.io card design for dashboard updateinfo

* Remove test stuff
2018-02-09 22:49:17 +01:00
c727
ac628787ac Hass.io improve store (#875)
* Hass.io improve store

* Improve code
2018-02-09 22:48:58 +01:00
c727
6ce72444ae Hass.io improved snapshot view (#872)
* HASSIO Improved snapshot view

* HASSIO Improved snapshot view2

* Update main

* Feedback

* Travis

* Travis 2
2018-02-08 22:16:13 +01:00
c727
710c2f1094 Hass.io improved add-on view (#874)
* Rename

* Improvements

* Travis

* Feedback

* Typo
2018-02-08 22:15:51 +01:00
Steltek
1f703fbdda Make the password field autofocus on the login screen. (#862)
* Author:    Michel Meyers <debian@tcnnet.com>
Committer: Michel Meyers <debian@tcnnet.com>

Make the password field autofocus on the login screen.

* Update login-form.html
2018-02-07 16:39:50 -08:00
Marius
76153d1e17 Fixing #775 (#854) 2018-02-07 15:21:07 -08:00
Marius
ec930d2c56 HASSIO Improved addon view (#869)
* Improved addon view
Moved files to avoid conflicts with @c727
Modified data to addons
Removed unused properties
Removed blank line and unused class
Added link to polymer-element
Redone grouping

* Changes based on feedback

* Revert flex box

Maybe someone else can help to center the icon and text

* Display timestamp in new line

* Update hassio-card-content.html
2018-02-07 22:57:43 +01:00
cdce8p
9e09d5b095 ZWave Node Management - Show hidden nodes (#864) 2018-02-07 20:41:45 +02:00
Victor Cerutti
6ad0c254b5 Fix resizeObserver loop #12192 (#867)
When the slider width is updated, resizeObserver prevent for firing the function another time.
Exemple: https://jsfiddle.net/ba1ad26e/11/
Compete doc: https://wicg.github.io/ResizeObserver/#html-event-loop
Solution: Observe the width change of the card instead of the slider. If the state value is hidden/displayed, it won't change again the slider width and so it will prevent the msg in the log
Drawback: the function cannot use the width sent by the resizeObserver anymore as it's no longer the slider width but the card width
2018-02-05 22:31:00 -08:00
c727
a6340fb856 Fix themes for Hass.io Panel (#860)
* Fix themes for Hass.io Panel

* Link hass-util
2018-02-02 17:20:31 -08:00
Andrey
21ee9b297d Switch to babel env preset (#859) 2018-02-01 16:18:47 -08:00
Andrey
da807dc508 Add Object.values polyfill (#858) 2018-02-01 16:16:53 -08:00
Daniel Høyer Iversen
384d5fc8a9 Remove duplicate call to getDataArray (#853) 2018-01-31 20:14:19 +02:00
Paulus Schoutsen
fcea1fa57d Version bump to 20180130.0 2018-01-29 15:42:21 -08:00
Paulus Schoutsen
4f99bd6811 Update translations 2018-01-29 15:41:25 -08:00
Andrey
0256f73404 Pass language to charts and fix JS error (#847) 2018-01-29 00:28:03 -08:00
Andrey
a1b578f81e Report JS errors to backend (#842) 2018-01-27 11:50:13 -08:00
Andrey
13f8fa7e11 Add version to JS (#839)
* Add version to JS

* Throw if version wasn't found
2018-01-26 23:27:11 -08:00
Fabien Piuzzi
c11a525a2d Added support for humidity display in the climate state (#838) 2018-01-26 10:54:14 -08:00
covrig
d21c1bc615 Add input_text mode:password (#837) 2018-01-26 10:47:53 -08:00
Paulus Schoutsen
42d11c5a3f Version bump to 20180126.0 2018-01-25 23:25:09 -08:00
Paulus Schoutsen
41fe6e8021 Update translations 2018-01-25 23:24:13 -08:00
c727
c3e35a27ba Get language from languages[] first, detect CN (#830) 2018-01-22 23:24:27 -08:00
c727
89464c16ff Fix play/pause icon (#825)
* Fix play/pause icon

* Fix hidden
2018-01-21 19:50:12 -08:00
Paulus Schoutsen
9c2f6e591d Run Hass.io panel in an iframe (#678)
* Run Hass.io in an iframe

* Update hass.io build script

* Lint

* Lint

* Fix build script

* Lint
2018-01-21 00:39:56 -08:00
Andrey
3c95559f33 Extract climate state into a separate component (#820) 2018-01-20 22:09:45 -08:00
Matthias Dötsch
50ed7678a1 Add translate tags to "cards" (#818)
* Add translate tags to "cards"

affected cards:
 - camera card
 - persistent notification
 - weather

* Add translate tags to "cards"

code style

* Add translate tags to "cards"

changes from code review
2018-01-20 22:08:47 -08:00
Adam Mills
8649c5352b Core config translations (#821)
* Config dashboard translations

* Simplify config pages

* Core/Core/Validation

* Core/Core/Reloading

* Core/Core/Server_Management

* Core/Push_Notifications

* Core/Translation

* Core/Themes

* Initial hassbian config translations

* Switch to sentence cases
2018-01-20 22:08:22 -08:00
PeteBa
31bc099cef Aligning the front-end card with latest Plant component changes (#633)
* Aligning with latest backend plant component changes

* Address review comments and plant component alignment

* Revert PR636 to reinstate card

* Add plant domain icon
2018-01-20 21:48:24 -08:00
Victor Cerutti
447dd6640f feature : display input number next to slider (#808)
* feature : display input number next to slider

* Improvements for Box mode of input number

Add unit when available and align the value to the right

* fix for small width cards

hide state if slider width<100px

* add a space between if and (

* Fix value display after a window resize

State value is now hiding or showing correctly after a window resize, using iron-resize component

* fixes eslint validator

* Fix a typo in state-card

* Improvement : Apply all properties altogether

As suggered by @andrey-git, I made use of setProperties

* Watch for mode update of input_number

If a mode is updated and the box switches from "box" to "slider", it now also update the visibility of the state value depending on the slider width

* Update width showing state value

* Use ResizeObserver when available

* Fix conditionnal mistake

Related @andrey-git review here https://github.com/home-assistant/home-assistant-polymer/pull/808#pullrequestreview-90048982
2018-01-20 21:47:15 -08:00
Andrey
31d2b6ffe1 Disconnect dom in invisible tabs (#790)
* Clear dom in invisible tabs

* Disconnect DOM of inactive tabs
2018-01-20 21:47:04 -08:00
Andrey
aced689207 History improvements (#817) 2018-01-20 21:45:53 -08:00
Paulus Schoutsen
3736d45318 Version bump to 20180119.0 2018-01-19 09:53:18 -08:00
Paulus Schoutsen
5749e2f07c Update translations 2018-01-19 09:53:07 -08:00
Paulus Schoutsen
783f356679 Add timer card and badge (#810)
* Add timer card and badge

* Disable interval on disconnect

* Tests!

* One more test case

* Remove padStart

* Remove state from timer state card
2018-01-19 09:26:06 -08:00
c727
85d58ba134 Always show locationName in Title (#602)
* Always show locationName in Title

* Handle if no name set

* Fix lint

* Feedback

* Readd L66-L68

* Feedback and fix for default_view

* Fix c&p

* Change default name for default_view to "Default view"

* Make everyone happy

* Make everyone happy2

* Fix CP

* Handle no homeassistant.name in config
2018-01-18 22:10:04 -08:00
Andrey
8b8ba5875f Fix for browsers without SW (#805)
* Fix for browsers without SW

* Improve check
2018-01-17 17:10:15 -08:00
Paulus Schoutsen
9131a7c7e3 Add LastPass workaround (#811) 2018-01-17 10:07:08 -08:00
Marius
3e0193c704 Bug fix for #761 and color enhance when temperature in flux (#772)
* Correct triggering temperature when min is reached and user clicks extra #761

* Fixed build problems from lint

* Fixed as per feedback from @c727

* Updated based on PR feedback from @andrey-git

* Improved defect based on better solution from @andrey-git

* Updated vars to const based on feedback

* Updated control to support better changing values regardless of step based on feedback
2018-01-16 17:02:55 +02:00
Fabian Affolter
40731152e9 Enable probot move (#807) 2018-01-16 09:26:08 +01:00
Victor Cerutti
811e9e2a0e fix slider showed in box mode (#802)
fixes https://github.com/home-assistant/home-assistant/issues/11094
2018-01-16 10:14:41 +02:00
Alok Saboo
4029508b3f Fix icon for device_class occupancy (#801) 2018-01-15 14:39:36 -08:00
Andrey
6fd8ad52b0 Move horizontal padding from state-cards to containing entity-card (#799) 2018-01-14 20:48:37 -08:00
Andrey
fbe44598ac Cleanup of partial-cards (#798) 2018-01-12 13:31:39 -08:00
Andrey
58b2a28fe5 Make sure climate more-info dropdowns are upto date (#797) 2018-01-11 22:50:47 -08:00
Paulus Schoutsen
0b47d1f6a5 Version bump to 20180112.0 2018-01-11 15:50:18 -08:00
Andrey
d6fd21521c Add on/off to climate more-info (#794) 2018-01-10 14:07:03 -08:00
Paulus Schoutsen
e9dfa79f36 Add Alexa info to cloud account page (#793) 2018-01-10 13:19:28 -08:00
Paulus Schoutsen
728d781843 Fix history jump (#792) 2018-01-10 09:39:53 -08:00
Paulus Schoutsen
f2358acf2d Version bump to 20180110.0 2018-01-10 00:51:42 -08:00
Paulus Schoutsen
c8e4ac422b Update translations 2018-01-10 00:50:42 -08:00
Andrey
48b0857edb Make sure toggle is always up-to date (#783)
* Make sure toggle is always upto date

* Move logic to observer
2018-01-09 16:44:53 -08:00
Andrey
c06be58a33 Fix possible JS error (#789) 2018-01-07 14:13:49 -08:00
Paulus Schoutsen
7231976af6 Fix nested group more info (#788) 2018-01-07 13:25:10 -08:00
baflo
ea16ebd4f0 Changed behaviour of selecting base entity. (#735) 2018-01-06 21:49:44 -08:00
Andrey
0b9bd62251 Update canToggleState with toggleable climate (#782) 2018-01-04 23:57:23 -08:00
Nigel Rook
1d13126bb5 Use current date for input_datetime time rendering (#754)
* Use current date for input_datetime time rendering

Chrome has a bug where it fails to render times correctly using
toLocaleTimeString for certain dates in the past with non-normal
daylight saving rules. For the UK and New Zealand, this includes
1970-01-01. Instead of using this as the date when rendering the time
for a time only input_datetime, use the current date.

* Add comment

* Lint
2018-01-02 05:02:26 -08:00
Matt Schmitt
27d343b488 Update icons to match with actual state (#769) 2018-01-01 18:04:06 -08:00
Paulus Schoutsen
0a091a272c Version bump to 20180102.0 2018-01-01 17:12:20 -08:00
Marius
5728d8ad1b Fixed issue #767 Operation mode influence between different thermostats (#771)
* Fixed issue #767 Operation mode influence between different thermostats

* Capitalised Operation to be consistent with the rest of controls
2017-12-31 13:50:01 +02:00
Marius
bdea42f0b7 Fix for #371 (#774) 2017-12-31 13:39:59 +02:00
c727
fdcc73c6cc Change all keys for "Open"/"Closed" to cover-keys (#773) 2017-12-31 13:38:47 +02:00
Andrey
9e2396375e Fix history panel (#757) 2017-12-30 16:41:16 -08:00
Marius
5085c78f7e Fixing Climate More-info does not allow dual temp target setting (#765)
* Fixing #236

* Fixed build errors

* Updated PR based on feedback from @andrey-git

* Improved side by side style for dual temperature control

* Removed unused styling

* Removed code that is no longer needed after correction from feedback

* Updated based on feedback on discord

* Corrected errors from lint and refactored more vars to const
Fixed lint
2017-12-30 13:11:04 +02:00
Paulus Schoutsen
eeb949a081 Allow resending email verification (#770) 2017-12-29 12:43:28 -08:00
ciotlosm
0fd84a2f8d Fixing thermostat bugs (scrolling and state) #758 and #763 (#766)
* Fixing bug more-info-climate card interface scroll bug #758

* Fixes #763

* Renamed class to match value based on PR feedback
2017-12-28 21:21:55 +02:00
Matt Schmitt
4379df0d5c Additional device classes for binary sensors (#749)
* Add additional device classes for binary sensor

* Minor updates

* Travis fixes

* Update per comments

* Update per comments
2017-12-28 13:03:23 -05:00
Andrey
cf4d867fa1 Fix sw urls caching (#739)
* Fix sw urls caching

* Remove navigateFallback

* Syntax fix
2017-12-23 14:29:55 -08:00
Adam Mills
b3ded276b5 Properly localize unknown/unavailable sensors (#752) 2017-12-23 16:16:40 -05:00
Adam Mills
38088acf14 Use localized state display for timeline charts (#746)
* Fix import typo

* Use localized state names on timeline charts

* Track language in cache metadata
2017-12-23 14:02:33 -05:00
Adam Mills
1b60a93fcc Add translations for the login form (#751) 2017-12-23 14:02:14 -05:00
Adam Mills
e7df8cb195 Mailbox empty state styling (#750) 2017-12-23 12:06:34 -05:00
Paulus Schoutsen
440145ab1b Version bump to 20171223.0 2017-12-22 21:28:51 -08:00
Franck Nijhof
0c840e1751 Adds Rebuild button for local add-ons (#734) 2017-12-22 21:18:04 -08:00
Franck Nijhof
36c658096a 💄 Sort add-ons in the Hass.io add-ons store (#733)
Signed-off-by: Franck Nijhof <frenck@addons.community>
2017-12-22 21:17:04 -08:00
Adam Mills
34fd3e4899 Map and mailbox translations (#748)
* Map translations

* Mailbox panel translations
2017-12-22 21:16:02 -08:00
Andrey
b16bc88eb5 Switch to Zopfli compression (#744)
* Switch to Zopfli compression

* Lint
2017-12-22 21:12:54 -08:00
Andrey
60ac82edc5 Another fix for app-header-layout (#738) 2017-12-22 21:07:46 -08:00
Adam Mills
f0f1a56537 Show RGB picker when RGB not in state attrs (#736)
* Show RGB picker when RGB not in state attrs

* Use supported_features and hide controls when off
2017-12-22 21:06:29 -08:00
Adam Mills
097a8cfdc6 Translations for logbook/history panels (#741)
* Translations for logbook/history panels

* Switch to base localize function

* Move periods to generic durations keys

These are going to end up part of a duration class of keys that will be
more widely used.
2017-12-22 14:22:13 -05:00
Boyi C
1b66492db9 Fix for older Chrome browser. (#747)
* Fix for older Chrome browser.
Follow up for
home-assistant/home-assistant-polymer#730

* fix
2017-12-22 12:07:32 +02:00
Andrey
e202f08193 Charts fixes (#742) 2017-12-21 22:25:21 +02:00
Andrey
6b180988fd Make sure tap listener is added at most once. (#745)
* Make sure tap listener is added at most once.

* Add comment
2017-12-21 17:15:05 +02:00
Adam Mills
c8c21e6fac Refactor out our localize custom variant (#743) 2017-12-19 09:18:50 -05:00
David
af8f77779b Define textual state for connectivity device_class (#740)
* Define textual state for connectivity device_class

Define textual state for connectivity `device_class` for `binary_sensor`.

Without this addition, a `binary_sensor` using the connectivity `device_class` is simply shown as `Off` or `On`. The icon does change but only if the user hasn't defined a custom icon.

* Change wording

Change `Offline`/`Online` to `Disconnected`/`Connected`
2017-12-18 09:40:28 -05:00
Andrey
1aa1ac709d Fix climate chart with unavailable states (#737) 2017-12-18 08:38:58 +02:00
Paulus Schoutsen
91fadccf33 Version bump to 20171216.0 2017-12-15 23:29:48 -08:00
Paulus Schoutsen
0904af2ad2 Refresh account status while connecting (#727)
* Refresh account status while connecting

* Lint
2017-12-15 23:22:22 -08:00
Andrey
aa5ff72710 Don't use global event. It is unsupported in Chrome64 (#732) 2017-12-14 09:02:38 -08:00
Adam Mills
f8261d93d3 Problem device class (#726)
* Problem device class

* Move OK/Problem master to binary_sensor
2017-12-13 20:02:35 -08:00
c727
f385c7e7d5 Change "Reset to dafaults" to "Discard Changes" (#731)
https://github.com/home-assistant/hassio/issues/278
2017-12-13 08:31:43 -08:00
Boyi C
788650f8e5 Fix for some browsers (#730)
Move polyfill block before all scripts, it should fix page not loading issue on old browsers.
2017-12-13 00:36:00 -08:00
Adam Mills
0018a9a9c8 Fix bug on initial fragment load (#725) 2017-12-11 21:58:28 -08:00
Adam Mills
bf126b6c5e Translations for domain names (#724) 2017-12-10 15:45:48 -08:00
Adam Mills
c18247cd6b Sync translations post log_out move (#723) 2017-12-10 14:24:28 -05:00
Adam Mills
fa2cc68139 Sidebar translations (#722) 2017-12-10 13:47:33 -05:00
Adam Mills
8dde92d572 Fix pushSupported not bubbling to config-core (#721) 2017-12-10 09:57:58 -08:00
Andrey
baccd6fb88 Hide group header in case of empty name (#704) 2017-12-05 23:59:21 -08:00
Paulus Schoutsen
b99d9923ea Version bump to 20171206.0 2017-12-05 23:38:48 -08:00
Paulus Schoutsen
9d0e89e792 Update translations 2017-12-05 23:37:28 -08:00
Matt Schmitt
13f5e33087 Add device class for low battery (#696)
* Add device class for low battery

* Fix per comments

* Update per comments

* Update per comments

Sorting and revert back to “Normal” for state description

* Fix Travis error
2017-12-05 23:05:30 -08:00
Guillaume Rischard
a061a58494 Saved 180 KB out of 865 KB. 23.9% per file on average (up to 85.6%) (#717) 2017-12-05 22:56:14 -08:00
Andrey
9b3448d44c Make full path check before using google.visualization (#716)
* Make full path check before using visualization

* Missing check
2017-12-05 22:54:53 -08:00
Andrey
9ae2325834 Convert toggle margin to padding (#715) 2017-12-05 22:54:20 -08:00
Alok Saboo
688de2ff2d Use proper open close mdi icons (#718) 2017-12-05 22:47:29 -08:00
Adam Mills
e0a63a2ee3 Panel translation fragments (#691)
* Move flatten to separate gulp task

* Split translation fragments into separate files

* Load translation fragments when switching panels

* Fix gulpfile lint

* Move app-location to home-assistant.html

* Compute panel navigation in home-assistant.html

* Only pass down panelUrl from home-assistant.html

* Store panelUrl on hass

* Store computed panel on hass object

* Revert "Store computed panel on hass object"

This reverts commit 0f150b1faa2b91588a432ab346821b633b349d1a.

IMO this didn't really make the code cleaner. Just wanted to see how it
would look. Keeping it here as a reverted commit in case we do want to
use it.
2017-12-05 09:12:42 -05:00
Alok Saboo
2765c88d3f Fix mdi icons (#707) 2017-12-04 23:32:32 -08:00
Andrey
b092cdd04d Another dropdown-hidden-behind-header fix (#709) 2017-12-04 17:19:03 -08:00
Adam Mills
a723c62f4f Separate more JS util logic to be unit tested (#705)
* Move featureClassNames to js util

* Add tests for featureClassNames

* Strip empty feature class names

* Move canToggleDomain to js util

* Add tests for canToggleDomain

* Refactor canToggleDomain to ensure boolean return

* Switch to chai assert for richer syntax options

* Move canToggleState to js util

* Tests for canToggleState

* Enable linting for mocha tests

* Move stateCardType to js util

* Add tests for stateCardType

* Move stateMoreInfoType to js util

* Tests for stateMoreInfoType

* Include mdn Array includes polyfill
2017-12-03 20:56:16 -08:00
Paulus Schoutsen
c1e7f4cc77 Add iron-label to bower.json 2017-12-03 17:10:21 -08:00
Paulus Schoutsen
b0837059d4 Version bump to 20171204.0 2017-12-03 17:04:39 -08:00
NovapaX
8dc81b1daa Color wheel fixes (#706)
* hide overflow properly

* only try to do rgb stuff on init if we have a value

* just to be sure
2017-12-03 17:03:34 -08:00
Adam Mills
77cc77396b Fix push-notification toggle reset on failure (#701) 2017-12-03 15:30:14 -08:00
Adam Mills
7303e55f63 Move push notifications to config panel (#700) 2017-12-03 15:28:39 -08:00
Paulus Schoutsen
b73c3ed233 Add missing return to service picker 2017-12-01 23:33:40 -08:00
Paulus Schoutsen
f9cd2d9612 Version bump to 20171130.0 2017-11-30 11:39:54 -08:00
Paulus Schoutsen
90e6f59a74 Merge script and automation editor JS (#693)
* Merge script and automation editor JS

* Also consolidate the files
2017-11-30 11:38:21 -08:00
NovapaX
27046b00c6 Replacing the color picker with a Hue-Saturation color wheel. (#695)
* first workable version of a colorwheel

* don't stretch it too big smaller screens

* better touch/drag behaviour
+ some properties centralized

* changed coordinate system, dragable marker

* little tweaks and cleanups

* touch drag color tooltip

* Segments, color via attribute, throttling, CSS-styling, small fixes

* inmproved segment behaviour

* styling with css vars/mixins

* structuring, commenting and cleanup

* properly prevent user select

* don't import debounce

* settled on some default color segmentation and wheel styling

* getting rid of the hidden #wheel element
just set css vars on the backgroundLayer and get those via
getCumputedStyle

* remove the #wheel css declaration too

* width is just a stupid word that looks too much like with

* move the color circle/tooltip a bit higher

* quote all attributes
2017-11-30 11:20:16 -08:00
Andrey
7cfa694980 Fix initialization error in script/automation editors. (#699) 2017-11-30 11:19:26 -08:00
Lukas Barth
640e6eb1ef Climate: add supported_features (#642)
* Honor new supported_features

* Re-add legacy classes

* Move current temperature / humidity to attribute-based
2017-11-30 11:12:32 -08:00
Andrey
7d20d8fe71 Badge fixes (#694)
* Badge fixes

* Make sure label height is unchanged
2017-11-28 22:51:38 -08:00
uchagani
2680a3f7e3 Added armed_custom_bypass status. (#673)
Added icons for armed_night and armed_custom_bypass.
2017-11-27 22:39:24 -08:00
Paulus Schoutsen
326fa00365 Version bump to 20171127.0 2017-11-26 17:47:36 -08:00
Paulus Schoutsen
8054aa744e Listen to every change, not just final change event (#688) 2017-11-26 17:21:57 -08:00
Paulus Schoutsen
10ddb7faac Minify once, reduce build warnings (#692)
* Minify once, reduce build warnings

* Remove rollup-plugin-uglify

* address comment
2017-11-26 17:20:55 -08:00
Kane610
288ffad23a Configurator logo for deCONZ (#689)
* Configurator logo for deCONZ

* Resized image to 256x256
2017-11-26 12:34:48 -08:00
Paulus Schoutsen
9aaf50b089 Update translations 2017-11-26 12:14:50 -08:00
LvivEchoes
de5a33d1c7 Ukrainian language added (#624) 2017-11-26 12:14:20 -08:00
Lukas Porubcan
edf8cbb95b Added Slovak language translation (#651)
* Added Slovak language translation

* removed sk.json
2017-11-26 12:13:45 -08:00
Paulus Schoutsen
70d09641f8 Fix mocha opts 2017-11-26 12:08:27 -08:00
Paulus Schoutsen
bc94dce8f7 Fix bugs in service picker and service dev tool (#687) 2017-11-26 10:05:07 -08:00
John Arild Berentsen
48ecfe07a2 Usercode card was misplaced in fullscreen (#685) 2017-11-26 15:04:46 +02:00
John Arild Berentsen
958c5bf935 Fix failing build (#684) 2017-11-26 10:17:03 +02:00
Paulus Schoutsen
db0438dd4d Version bump to 20171126.0 2017-11-25 21:51:34 -08:00
Paulus Schoutsen
3ba15cb7b5 Fix error when creating new automation (#683)
* Import correct computeStateDomain

* ha-service-picker to not crash when no hass

* Fix routing be less active

* Fix combo box value sync
2017-11-25 21:43:52 -08:00
Paulus Schoutsen
69eb10c6dd Update translations 2017-11-25 16:08:57 -08:00
Paulus Schoutsen
508e1fd737 Fix build 2017-11-25 16:08:26 -08:00
Paulus Schoutsen
0707528bd7 Entity dropdown improvement (#674)
* Ignore hass changes while dropdown is open

* Upgrade vaadin-combo-box

* Fix styling on dev-service panel

* Fix styling for ha-entity-dropdown

* Fix height vaadin-combo-box dropdown

* Rename ha-entity-dropdown to ha-entity-picker

* More entity improvement (#675)

* Update script and automation editor to use entity picker

* Add entity and service picker to service dev panel

* Lint
2017-11-25 16:00:43 -08:00
Paulus Schoutsen
28457747e7 Fix eslint import extension (#682)
* Fix eslint import extension

* Update eslint hound

* Enable no unresolved for normal usage
2017-11-25 11:14:44 -08:00
John Arild Berentsen
5f5a62d094 Zwave usercodes, bugfix for #10754 (#677)
* Bugfix for #10754

* Adjustments

* Fix sloppiness
2017-11-24 23:57:21 -08:00
Paulus Schoutsen
80a11206af remove unused on-tap 2017-11-24 21:32:21 -08:00
Paulus Schoutsen
c330b87506 Shopping List: Allow adding items (#647)
* Shopping List: Allow adding items

* Remove unused parts
2017-11-24 21:27:55 -08:00
Paulus Schoutsen
a960559639 Add eslint mocha options (#671)
* Add eslint mocha options

* Please hound

* Remove deprecated --compiler option
2017-11-24 21:01:15 -08:00
Klaas Hoekema
6c2cd420f5 Set 'heating' graph series only for climate graphs (#665)
PR #617 added a steppedArea series to climate graphs to show when the
thermostat is calling for heat. It also accidentally converted the second
series in every graph to steppedArea. This moves the option specification
into the `if (domain === 'thermostat' || domain === 'climate')` block so
it will only be applied when it's relevant (and gets it closer to the
series it's configuring).

It also calculates the series index by counting the number of columns
immediately after the target one is added. Which still isn't elegant,
but seems solidly better than hard-coding the index as `1`.
2017-11-23 12:27:31 -08:00
c727
95288f8c3d Add Latvian to languages (#669) 2017-11-23 12:26:41 -08:00
Andrey
2cfda880ac Don't use file extend in hound .eslintrc. It is not supported. (#670)
* Don't use file extend in hound .eslintrc. It is not supported.

* Extend the other way around
2017-11-22 15:59:16 -08:00
Paulus Schoutsen
713117d4d9 Add an entity picker (#666)
* Add an entity picker

* Lint
2017-11-22 14:37:25 -08:00
linvinus
db630677a4 fix for #667 (#668)
* fix #667

* fix travis errors
2017-11-22 14:35:58 +02:00
Paulus Schoutsen
3a100bff23 Make ha-markdown use no polymer (#662) 2017-11-21 21:15:04 -08:00
c727
ea4fd25330 Don't cut off help text on mobile devices (#663) 2017-11-21 19:28:04 +02:00
Paulus Schoutsen
0dd1d4f478 Version bump to 20171121.1 2017-11-20 21:58:40 -08:00
Paulus Schoutsen
57ecbf27ca Update translations 2017-11-20 21:57:22 -08:00
Paulus Schoutsen
3d90d1d016 Tweak index.html (#657) 2017-11-20 21:52:35 -08:00
Adam Mills
3412edb843 Compute state display tests (#643)
* Move computeDomain and format functions to js

* Add tests for computeStateDisplay

* Always recalculate state display

* Remove LANGUAGE from hassUtils object

* Move AppLocalizeBehavior import to mixins

* Import mixins to state-card-display

* Safety check on computeStateDisplay

* Don't store computed domains on stateObj

* Integration tests for state-card-display

* Include extractDomain code in polymer repo

* Remove util function null checking

* Dont render test element without hass and stateObj

* Revert "Don't store computed domains on stateObj"

This reverts commit e3509d7182.

* Revert "Always recalculate state display"

This reverts commit 27c24e2694.
2017-11-20 21:46:36 -08:00
Alok Saboo
7e77a7c32c Add presence device_class for binary_sensor (#659)
* Add presence device_class

* Added translations

* Update en.json
2017-11-20 21:45:08 -08:00
Paulus Schoutsen
cb5c9b3f3f Convert configurator to markdown (#644)
* Convert configurator to markdown

* Lint

* Change order
2017-11-20 21:41:53 -08:00
Adam Mills
8d790e9601 Add icons for input_datetime (#661) 2017-11-20 21:23:19 -08:00
Paulus Schoutsen
2ff0be8529 version bump to 20171121.0 2017-11-20 20:45:46 -08:00
Paulus Schoutsen
0b9e7d5fa2 Don't use custom element constructor (#658) 2017-11-20 20:44:58 -08:00
c727
e5974ab71b Add Korean and Bosnian (#650) 2017-11-19 13:35:47 -08:00
Andrey
5a65fd7526 Add missig style (#653) 2017-11-19 10:41:39 -08:00
Paulus Schoutsen
4f18bdf0ea Tweak create account verbiage 2017-11-19 10:30:48 -08:00
Adam Mills
fbc9755796 Keep language/resources on login (#646) 2017-11-18 20:04:40 -08:00
Paulus Schoutsen
d658beacea Version bump to 20171118.0 2017-11-17 19:08:54 -08:00
Pierre Ståhl
01fab1075e Clear log entries if clear is pressed (#637)
* Clear log entries if clear is pressed

* Fix comparisons

* Clear entries instead of refresh
2017-11-17 10:54:12 -08:00
Andrey
415b0b127f Don't put functions in global scope (#640) 2017-11-17 10:27:56 -08:00
Andrey
1a71ee5af3 Prevent hound from running eslint on html files (#638) 2017-11-17 09:05:13 -08:00
Paulus Schoutsen
1c2d713846 Version bump to 20171117.1 2017-11-16 22:07:35 -08:00
John Arild Berentsen
b15edbd4fd Add option to retrieve n amount of last lines from log. (#604)
* Add option to retrieve n amount of last lines from log.

* Move line logic to backend

* Review changes

* Review changes

* Only print text

* Use query params instead of url path to specify lines
2017-11-16 22:07:03 -08:00
Paulus Schoutsen
d79ae551b2 Version bump to 20171117.0 2017-11-16 22:02:53 -08:00
Paulus Schoutsen
6074de356c Disable plant card (#636) 2017-11-16 21:52:07 -08:00
Paulus Schoutsen
72f22f6214 Update translations 2017-11-16 21:47:28 -08:00
Pierre Ståhl
c0df1e2a89 Add frontend for system log (#603)
* Add frontend for system log

* Minor review fixes

* Cleanup
2017-11-16 21:25:46 -08:00
c727
1af77e682d Add pt-BR to languages (#625) 2017-11-16 21:20:23 -08:00
Andrey
7db89d5bc2 Clean rollup (#634) 2017-11-16 21:19:29 -08:00
Andrey
ef5155984f Use keys in state_badge::alarm_control_panel (#631) 2017-11-16 21:15:05 -08:00
PeteBa
8f0ebcb69d WIP: Ha-card for plant component (#583)
* Ha-card for plant component

* Feedback updates and grid css

* Revert grid css
2017-11-15 23:29:55 -08:00
Adam Mills
70c082716f MVP tests for hass-util.html (#629)
* MVP tests for hass-util.html

* MVP util.js to allow individual JS function export

* Use mocha to unit test js logic

* Isolate mocha test directory

* Move mocha opts to separate file

* Default export of util function

* Use reify for mocha tests instead of babel
2017-11-15 21:42:54 -08:00
Adam Mills
3ff9fe1041 Build ES5/ES6 in parallel to share gulp deps (#615)
* Build ES5/ES6 in parallel to share gulp deps

* Rollup es5 files into build-temp-es5

* Use correct ES5 path for compatibility.js
2017-11-15 18:05:52 -08:00
Andrey
41e97a6f83 Clone app-header-layout (#632)
* Fix group more-info not updating

* Remove old observer

* Upgrade translate(0) hack
2017-11-15 17:12:09 -08:00
Paulus Schoutsen
8078158a56 Version bump to 20171115.0 2017-11-14 22:47:22 -08:00
Paulus Schoutsen
57997be342 Update translations 2017-11-14 22:46:56 -08:00
Paulus Schoutsen
6fac4e9027 Expose build type on window (#630)
* Expose build type on window

* Build two panels for Hass.io
2017-11-14 22:39:20 -08:00
Klaas Hoekema
de87c5b19b Add shaded area to show when calling for heat (#617)
Adds a series to the climate graph to shade the area under the current
temperature line red when the thermostat is calling for heat.

Uses the current temperature because it's guaranteed to be in the right
temperature range for the graph and it should minimize overlap since by
definition when the thermostat is calling for heat the current temp would
be below the target temp.

Uses `steppedArea` because most other series types don't handle
intermittent (i.e. with sections of `null` throughout) data very well.
2017-11-14 20:44:24 -08:00
Adam Mills
8cf0c0e94d Fix build attempting to include translationMaster (#628)
* Fix build attempting to include translationMaster

* Use full gulp path to run with no extra setup
2017-11-14 20:36:46 -08:00
Andrey
675a7a3b86 Fix group more-info not updating (#622)
* Fix group more-info not updating

* Remove old observer
2017-11-13 08:29:47 -08:00
Andrey
a4bcf062d5 Add missed mixin to ha-call-api-button (#620) 2017-11-13 08:28:28 -08:00
Adam Mills
056e9e0d74 Translations for core states (#575)
* Fix deeper nested translations build

* Make fallback to message optional

* Use translated state names

* Remove unused switch cases

* Use src en.json as fallback instead of downloaded

* Use separate translations for badge states

* Eliminate unnecessary StatesMixin

* Remove now unused localize fallback parameter

* Fix capitalization to match material guidelines

* Move media player text generation back to model

* Make localize args object

* Change Mixin to use computed function

* Revert to normal args spread for haLocalize

* Rename to computeHaLocalize

* Allow state to default for badge and media player

* Denormalize en.json with Lokalise placeholders

* Fix cleanups missed after master merge

* Split zwave query stage states to separate keys

* Throw error to fail gulp build

* Fix zwave template and regression on general state
2017-11-12 17:48:42 -08:00
Paulus Schoutsen
926c46b701 Tweak cloud config (#618) 2017-11-12 11:44:59 -08:00
c727
1314caba97 Add new languages to metadata (#591)
* Add new languages to metadata

* Update translationMetadata.json

* Add et

* Add ca (twitter request)

* Add en-US

* Remove en-US

* Add es-419

* Add ta
2017-11-12 14:14:33 +02:00
Adam Mills
1ab551116e Fix login form with translations (#612)
* Revert "Fix not showing login form (#564)"

This reverts commit d2faeaffe7.

* Don't lose translation resources on logout

* Fix lint
2017-11-11 18:16:15 -05:00
Paulus Schoutsen
1f9fc46576 Version bump to 20171111.0 2017-11-11 13:33:50 -08:00
Paulus Schoutsen
3701683d4b Pre-construct frontend index.html (#609)
* Pre-construct frontend index.html

* Only preload things that matter

* Fix entry point in dev mode

* Template Service worker url

* Update referenced service worker
2017-11-11 13:30:14 -08:00
c727
f106767eae Don't add more-info-card if hidden (#549)
* Don't add more-info-card if hidden

* Fix c&p

* Use itemForElement

* Fix travis

* Update ha-entities-card.html

* Update ha-entities-card.html

* Remove brackets
2017-11-11 13:19:04 -08:00
Andrey
b7d2b2fcfd Remove src/translations/ from polymer build (only used in gulp). Remove unused zwave-node-options.html (#613) 2017-11-11 13:07:22 -08:00
Adam Mills
508b5d6d77 Minify translations downloaded from Lokalise (#611) 2017-11-11 15:33:47 -05:00
Andrey
adac8e55d7 Updates packages and clean gulp/ JS (#610) 2017-11-11 11:32:22 -08:00
Paulus Schoutsen
a2612af6a9 Version bump to 20171110.0 2017-11-10 22:39:38 -08:00
UnrealKazu
67e040ad8e Add filters to dev-state page (#595)
* Add filter functionality for entities and states

Entities and states can now be filtered by entering a string in their respective input fields.

* Add filter functionality for attributes

Attributes can now also be filtered. Without a colon in the search string, if any attribute's key or value matches the string, the entity is matched. If there is a colon, keys and values are matched separately, and the entity is only matched if both key and value match.

* Hide attribute filter in narrow mode

When the browser triggers narrow mode the attribute filter now hides properly.

* Improve eslint adherence

The code is now correctly linted against the HASS eslint standard.

Also simplified the code which distinguished arrays from strings when matching.
2017-11-10 21:48:51 -08:00
Andrey
152df2297a Change serving of JS-version dependent files to frontend_es5 and frontend_latest (#608) 2017-11-10 21:44:03 -08:00
Adam Mills
6de540a0b1 Fix WCT config - specify generic Safari 10 (#607)
Apparently the minimum safari version has been bumped from 10.0 to 10.1.
We can just specify 10 here to be more generic.
2017-11-10 14:38:16 -05:00
Andrey
583abedd34 Support serving ES6 JS to clients (#596)
* Support serving ES6 JS to clients

* Make es6 default dir and es5 a special dir

* Fix package building

* Fix build_frontend script
2017-11-10 09:05:37 -08:00
Adam Mills
86128d54b4 Auto deploy base translations with Travis (#599) 2017-11-09 19:15:55 -08:00
Adam Mills
f81429702c Replace existing translations on upload (#597) 2017-11-09 13:42:45 -05:00
Adam Mills
5722b6bbdb Accept Lokalise token from environment (#598) 2017-11-08 23:59:10 -05:00
Stephen Yeargin
bac3d8c17e Add-Ons > Add space between text and repository link (#594)
A subtle change, but improves how it is displayed.
2017-11-08 17:35:43 +02:00
John Arild Berentsen
9f6edeec6e Add Save config button (#568) 2017-11-07 12:47:21 -05:00
Adam Mills
11f4f3b3c9 Update zwave to use new state values (#584)
* Update zwave to use new state values

* Support for zwave initializing state

* Show query stage on card for zwave entities

* Move logic to compteStateState
2017-11-07 10:14:01 -05:00
NovapaX
4f4224953f fix mask-icon (#582)
* fix mask-icon
Somehow there was a rectangle in the export with some opacity making the
mask-icon not work properly (got a bit ugly)

* svg reduced to bare minimum
2017-11-06 14:49:12 -08:00
c727
f600a8e7f4 Add new requested languages (#579)
* Add new requested languages

* Add Hindi, Telugu, Bengali

* Correct order
2017-11-06 11:14:14 -05:00
Adam Mills
aa389bf206 Safety check for translations upload script (#573) 2017-11-05 20:11:12 -08:00
Paulus Schoutsen
a8b5d07d66 Version bump to 20171106.0 2017-11-05 18:25:51 -08:00
Adam Mills
f16886f63d Add Spanish to the translation metadata (#572)
Fixes #569
2017-11-05 17:45:36 -08:00
c727
d1325da6e6 Fix Capitalization in English translation (#571)
* Fix Capitalization in English translation

https://material.io/guidelines/style/writing.html#writing-capitalization-punctuation

* Add Spanish
2017-11-05 17:45:08 -08:00
Paulus Schoutsen
95031fdd79 Fix import 2017-11-05 12:46:53 -08:00
Paulus Schoutsen
fe439723ee Fix more event mixin missing (#570) 2017-11-05 12:37:57 -08:00
Andrey
798a2bbd34 Merge pull request #566 from andrey-git/caching
Fix rules for SW runtime file caching.
2017-11-05 21:57:54 +02:00
Andrey
0dc3bc7926 Update gen-service-worker.js 2017-11-05 21:51:30 +02:00
andrey-git
3025b6049f Update rules 2017-11-05 20:59:46 +02:00
Simon
ba5f401890 Introduced a new device class "plug" for the binary sensor. (#558)
* Introduced a new device class "plug" for the binary sensor.

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

* removed plug as domain
2017-11-05 10:23:57 -08:00
andrey-git
db9dc653e0 Remove stale comment 2017-11-05 19:55:55 +02:00
John Arild Berentsen
9b0f4fa234 Add new Z-Wave services, heal_node and test_node (#565)
* Add new Z-Wave services, heal_node and test_node

* lint
2017-11-05 09:44:18 -08:00
andrey-git
2596d2ba52 Change networkFirst to networkOnly 2017-11-05 19:38:39 +02:00
andrey-git
904c3db3ea Fix rules for SW file caching. 2017-11-05 19:26:27 +02:00
Adam Mills
90b80880ed Store current translations in git (#563)
* Store current translations in git

* Handle empty strings in translation downloads

* Use more consice filtering

* Skip empty keys on translation download
2017-11-04 16:44:07 -07:00
Paulus Schoutsen
d2faeaffe7 Fix not showing login form (#564) 2017-11-04 12:47:28 -07:00
Adam Mills
6959b1849f Store language native names in git (#556)
* Don't delete the gitignore file

* Store translation native names in git
2017-11-03 21:31:22 -07:00
Andrey
c3a6495eb1 Don't load mdi icons with JS - it doesn't do anything. (#546) 2017-11-03 20:36:00 -07:00
Adam Mills
fdf2fa3d3f Migrate to Lokalise for managing translations (#555) 2017-11-03 20:34:47 -07:00
Paulus Schoutsen
551cbe5afa Version bump to 20171103.0 2017-11-02 22:50:59 -07:00
Paulus Schoutsen
a574bf8e0f Update tos&privacy links 2017-11-02 22:50:59 -07:00
NovapaX
28a0f2405e add favicon.svg to public/icons (#548)
* add favicon.svg to public/icons

* remove old logo, change name to mask-icon
2017-11-02 20:55:15 -07:00
Andrey
d2e9918f88 Allow passive events (#551) 2017-11-02 20:54:41 -07:00
902 changed files with 104102 additions and 31478 deletions

View File

@@ -1,6 +1,4 @@
node_modules
bower_components
hass_frontend
build
build-temp
hass_frontend_es5
.git

View File

@@ -1,5 +1,5 @@
{
"extends": "airbnb-base",
"extends": ["airbnb-base", "prettier"],
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
@@ -9,16 +9,25 @@
"settings": {
"react": {
"pragma": "h"
},
"import/resolver": {
"webpack": {
"config": "webpack.config.js"
}
}
},
"globals": {
"__DEV__": false,
"__DEMO__": false,
"__BUILD__": false,
"__VERSION__": false,
"__STATIC_PATH__": false,
"Polymer": true,
"webkitSpeechRecognition": false,
"ResizeObserver": false
},
"env": {
"browser": true
"browser": true,
"mocha": true
},
"rules": {
"class-methods-use-this": 0,
@@ -40,10 +49,15 @@
"no-multi-assign": 0,
"radix": 0,
"no-alert": 0,
"no-return-await": 0,
"prefer-destructuring": 0,
"no-restricted-globals": 0,
"no-restricted-globals": [2, "event"],
"prefer-promise-reject-errors": 0,
"import/prefer-default-export": 0,
"import/no-unresolved": 0,
"import/extensions": [2, "ignorePackages"],
"object-curly-newline": 0,
"default-case": 0,
"react/jsx-no-bind": [2, { "ignoreRefs": true }],
"react/jsx-no-duplicate-props": 2,
"react/self-closing-comp": 2,
@@ -53,13 +67,11 @@
"react/no-find-dom-node": 2,
"react/no-is-mounted": 2,
"react/jsx-no-comment-textnodes": 2,
"react/jsx-curly-spacing": 2,
"react/jsx-no-undef": 2,
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2
"react/jsx-uses-vars": 2,
"no-restricted-syntax": [0, "ForOfStatement"],
"prettier/prettier": "error"
},
"plugins": [
"html",
"react"
]
"plugins": ["react", "prettier"]
}

15
.eslintrc.json Normal file
View File

@@ -0,0 +1,15 @@
{
"extends": "./.eslintrc-hound.json",
"plugins": [
"react"
],
"env": {
"browser": true
},
"parser": "babel-eslint",
"rules": {
"import/no-unresolved": 2,
"linebreak-style": 0,
"implicit-arrow-linebreak": 0
}
}

11
.gitattributes vendored Normal file
View File

@@ -0,0 +1,11 @@
# Ensure Docker script files uses LF to support Docker for Windows.
# Ensure "git config --global core.autocrlf input" before you clone
* text eol=lf
*.ts whitespace=error
*.js whitespace=error
*.ico binary
*.jpg binary
*.png binary
*.zip binary
*.mp3 binary

33
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,33 @@
<!-- 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!
-->
**Home Assistant release with the issue:**
<!--
- Frontend -> Developer tools -> Info
- Or use this command: hass --version
-->
**Last working Home Assistant release (if known):**
**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.
-->
**Javascript errors shown in the web inspector (if applicable):**
```
```
**Additional information:**

13
.github/move.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
# Configuration for move-issues - https://github.com/dessant/move-issues
# Delete the command comment. Ignored when the comment also contains other content
deleteCommand: true
# Close the source issue after moving
closeSourceIssue: true
# Lock the source issue after moving
lockSourceIssue: false
# Set custom aliases for targets
# aliases:
# r: repo
# or: owner/repo

4
.github/release-drafter.yml vendored Normal file
View File

@@ -0,0 +1,4 @@
template: |
## What's Changed
$CHANGES

15
.gitignore vendored
View File

@@ -1,10 +1,11 @@
build/*
build-temp/*
build
build-translations/*
node_modules/*
bower_components/*
npm-debug.log
.DS_Store
hass_frontend/*
hass_frontend_es5/*
.reify-cache
# Python stuff
*.py[cod]
@@ -19,3 +20,11 @@ venv
lib
bin
dist
# vscode
.vscode/*
!.vscode/extensions.json
# Secrets
.lokalise_token
yarn-error.log

View File

@@ -3,4 +3,4 @@ jshint:
eslint:
enabled: true
config_file: .eslintrc
config_file: .eslintrc-hound.json

2
.nvmrc
View File

@@ -1 +1 @@
8.8.1
8.11.1

View File

@@ -3,22 +3,24 @@ language: node_js
cache:
yarn: true
directories:
- bower_components
install:
- yarn install
- ./node_modules/.bin/bower install
addons:
firefox: latest
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
- bower_components
install: yarn install
script:
- npm run build
- hassio/script/build_hassio
- npm run test
- xvfb-run wct
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct --plugin sauce; fi
# - 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

7
.vscode/extensions.json vendored Executable file
View File

@@ -0,0 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"eg2.tslint",
"esbenp.prettier-vscode"
]
}

View File

@@ -1,25 +1,31 @@
FROM node:8.2.1-alpine
FROM node:8.11.1-alpine
# install yarn
ENV PATH /root/.yarn/bin:$PATH
## Install/force base tools
RUN apk update \
&& apk add curl bash binutils tar git python3 \
&& apk add make g++ curl bash binutils tar git python2 python3 \
&& rm -rf /var/cache/apk/* \
&& /bin/bash \
&& touch ~/.bashrc \
&& curl -o- -L https://yarnpkg.com/install.sh | bash
&& touch ~/.bashrc
## Install yarn
RUN curl -o- -L https://yarnpkg.com/install.sh | bash
## Setup the project
RUN mkdir -p /frontend
WORKDIR /frontend
ENV NODE_ENV production
COPY package.json yarn.lock ./
COPY package.json ./
RUN yarn
COPY bower.json ./
RUN ./node_modules/.bin/bower install --allow-root
RUN yarn install --frozen-lockfile
COPY . .
CMD [ "/bin/bash", "./script/build_frontend" ]
COPY script/docker_entrypoint.sh /usr/bin/docker_entrypoint.sh
RUN chmod +x /usr/bin/docker_entrypoint.sh
CMD [ "docker_entrypoint.sh" ]

View File

@@ -1,4 +1,5 @@
include README.md
include LICENSE.md
graft hass_frontend
graft hass_frontend_es5
recursive-exclude * *.py[co]

View File

@@ -1,17 +1,33 @@
# Home Assistant Polymer [![Build Status](https://travis-ci.org/home-assistant/home-assistant-polymer.svg?branch=master)](https://travis-ci.org/home-assistant/home-assistant-polymer)
This is the repository for the official [Home Assistant](https://home-assistant.io) frontend. The frontend is built on top of the following technologies:
* [Websockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)
* [Polymer](https://www.polymer-project.org/)
* [Rollup](http://rollupjs.org/) to package Home Assistant JS
* [Bower](https://bower.io) for Polymer package management
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/)
[View demo of the Polymer frontend](https://home-assistant.io/demo/)
[More information about Home Assistant](https://home-assistant.io)
[Frontend development instructions](https://home-assistant.io/developers/frontend/)
- [View demo of the Polymer frontend](https://home-assistant.io/demo/)
- [More information about Home Assistant](https://home-assistant.io)
- [Frontend development instructions](https://developers.home-assistant.io/docs/en/frontend_index.html)
## Development
- Initial setup: `script/setup`
- Development: [Instructions](https://developers.home-assistant.io/docs/en/frontend_development.html)
- Production build: `script/build_frontend`
- Gallery: `cd gallery && script/develop_gallery`
- Hass.io: [Instructions](https://developers.home-assistant.io/docs/en/hassio_hass.html)
## Frontend development
### Classic environment
A complete guide can be found at the following [link](https://www.home-assistant.io/developers/frontend/). It describes a short guide for the build of project.
### Docker environment
It is possible to compile the project and/or run commands in the development environment having only the [Docker](https://www.docker.com) pre-installed in the system. On the root of project you can do:
* `sh ./script/docker_run.sh build` Build all the project with one command
* `sh ./script/docker_run.sh bash` Open an interactive shell (the same environment generated by the *classic environment*) where you can run commands. This bash work on your project directory and any change on your file is automatically present within your build bash.
**Note**: if you have installed `npm` in addition to the `docker`, you can use the commands `npm run docker_build` and `npm run bash` to get a full build or bash as explained above
## License
Home Assistant is open-source and Apache 2 licensed. Feel free to browse the repository, learn and reuse parts in your own projects.

View File

@@ -1,62 +0,0 @@
{
"name": "home-assistant",
"version": "0.1.0",
"authors": [
"Paulus Schoutsen <Paulus@PaulusSchoutsen.nl>"
],
"main": "src/home-assistant.html",
"license": "MIT",
"private": true,
"dependencies": {
"app-layout": "^2.0.0",
"app-localize-behavior": "PolymerElements/app-localize-behavior#~2.0.0",
"app-route": "PolymerElements/app-route#^2.0.0",
"app-storage": "^2.0.2",
"fecha": "~2.3.0",
"font-roboto-local": "~1.0.1",
"font-roboto": "PolymerElements/font-roboto-local#~1.0.1",
"google-apis": "GoogleWebComponents/google-apis#~2.0.0",
"iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^2.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^2.0.0",
"iron-icon": "PolymerElements/iron-icon#^2.0.0",
"iron-image": "PolymerElements/iron-image#^2.1.1",
"iron-input": "PolymerElements/iron-input#^2.0.0",
"iron-media-query": "PolymerElements/iron-media-query#^2.0.0",
"iron-pages": "PolymerElements/iron-pages#^2.0.0",
"leaflet": "^1.0.2",
"neon-animation": "PolymerElements/neon-animation#^2.0.1",
"paper-button": "PolymerElements/paper-button#^2.0.0",
"paper-card": "PolymerElements/paper-card#^2.0.0",
"paper-checkbox": "PolymerElements/paper-checkbox#^2.0.0",
"paper-dialog": "PolymerElements/paper-dialog#^2.0.0",
"paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^2.1.0",
"paper-drawer-panel": "PolymerElements/paper-drawer-panel#^2.0.0",
"paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#^2.0.0",
"paper-fab": "PolymerElements/paper-fab#^2.0.0",
"paper-icon-button": "PolymerElements/paper-icon-button#^2.0.0",
"paper-input": "PolymerElements/paper-input#^2.0.1",
"paper-item": "PolymerElements/paper-item#^2.0.0",
"paper-listbox": "PolymerElements/paper-listbox#^2.0.0",
"paper-material": "PolymerElements/paper-material#^2.0.0",
"paper-menu-button": "PolymerElements/paper-menu-button#^2.0.0",
"paper-progress": "PolymerElements/paper-progress#^2.0.1",
"paper-radio-button": "PolymerElements/paper-radio-button#^2.0.0",
"paper-radio-group": "PolymerElements/paper-radio-group#^2.0.0",
"paper-scroll-header-panel": "~2.0.0",
"paper-slider": "PolymerElements/paper-slider#^2.0.1",
"paper-spinner": "PolymerElements/paper-spinner#^2.0.0",
"paper-styles": "PolymerElements/paper-styles#^2.0.0",
"paper-tabs": "PolymerElements/paper-tabs#^2.0.0",
"paper-time-input": "ryanburns23/paper-time-input#^2.0.4",
"paper-toast": "PolymerElements/paper-toast#^2.0.0",
"paper-toggle-button": "PolymerElements/paper-toggle-button#^2.0.0",
"polymer": "^2.1.1",
"vaadin-combo-box": "vaadin/vaadin-combo-box#^2.0.0",
"vaadin-date-picker": "vaadin/vaadin-date-picker#^2.0.0",
"web-animations-js": "^2.2.5",
"webcomponentsjs": "^1.0.10"
},
"devDependencies": {
"web-component-tester": "^6.3.0"
}
}

35
config/babel.js Normal file
View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

After

Width:  |  Height:  |  Size: 226 KiB

6
gallery/.eslintrc.json Normal file
View File

@@ -0,0 +1,6 @@
{
"extends": "../.eslintrc.json",
"rules": {
"no-console": 0
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

18
gallery/public/index.html Normal file
View File

@@ -0,0 +1,18 @@
<!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>

17
gallery/script/build_gallery Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
# Run the gallery
# Stop on errors
set -e
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

13
gallery/script/develop_gallery Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
# Run the gallery
# Stop on errors
set -e
cd "$(dirname "$0")/.."
cd ..
./node_modules/.bin/gulp build-translations gen-icons
cd gallery
../node_modules/.bin/webpack-dev-server

View File

@@ -0,0 +1,97 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import JsYaml from "js-yaml";
import HomeAssistant from "../data/hass";
import { demoConfig } from "../data/demo_config";
import { demoServices } from "../data/demo_services";
import demoResources from "../data/demo_resources";
import demoStates from "../data/demo_states";
import createCardElement from "../../../src/panels/lovelace/common/create-card-element";
class DemoCard extends PolymerElement {
static get template() {
return html`
<style>
.root {
display: flex;
}
h2 {
margin: 0 0 20px;
color: var(--primary-color);
}
#card {
width: 400px;
}
pre {
width: 400px;
margin: 16px;
overflow: auto;
}
@media only screen and (max-width: 800px) {
.root {
flex-direction: column;
}
pre {
margin-left: 0;
}
}
</style>
<h2>[[config.heading]]</h2>
<div class="root">
<div id="card"></div>
<template is="dom-if" if="[[showConfig]]">
<pre>[[_trim(config.config)]]</pre>
</template>
</div>
`;
}
static get properties() {
return {
hass: {
type: Object,
observer: "_hassChanged",
},
config: {
type: Object,
observer: "_configChanged",
},
showConfig: Boolean,
};
}
_configChanged(config) {
const card = this.$.card;
while (card.lastChild) {
card.removeChild(card.lastChild);
}
const el = createCardElement(JsYaml.safeLoad(config.config)[0]);
if (this.hass) {
el.hass = this.hass;
} else {
const hass = new HomeAssistant(demoStates);
hass.config = demoConfig;
hass.services = demoServices;
hass.resources = demoResources;
hass.language = "en";
hass.states = demoStates;
el.hass = hass;
}
card.appendChild(el);
}
_hassChanged(hass) {
const card = this.$.card.lastChild;
if (card) card.hass = hass;
}
_trim(config) {
return config.trim();
}
}
customElements.define("demo-card", DemoCard);

View File

@@ -0,0 +1,58 @@
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";
class DemoCards extends PolymerElement {
static get template() {
return html`
<style>
.cards {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
demo-card {
margin: 16px 16px 32px;
}
app-toolbar {
background-color: var(--light-primary-color);
}
.filters {
margin-left: 60px;
}
</style>
<app-toolbar>
<div class="filters">
<paper-toggle-button checked="{{_showConfig}}"
>Show config</paper-toggle-button
>
</div>
</app-toolbar>
<div class="cards">
<template is="dom-repeat" items="[[configs]]">
<demo-card
config="[[item]]"
show-config="[[_showConfig]]"
hass="[[hass]]"
></demo-card>
</template>
</div>
`;
}
static get properties() {
return {
configs: Object,
hass: Object,
_showConfig: {
type: Boolean,
value: false,
},
};
}
}
customElements.define("demo-cards", DemoCards);

View File

@@ -0,0 +1,92 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../../../src/state-summary/state-card-content";
import "../../../src/dialogs/more-info/controls/more-info-content";
import "../../../src/components/ha-card";
class DemoMoreInfo extends PolymerElement {
static get template() {
return html`
<style>
:host {
display: flex;
align-items: start;
}
ha-card {
width: 333px;
}
state-card-content {
display: block;
padding: 16px;
}
more-info-content {
padding: 0 16px;
}
pre {
width: 400px;
margin: 16px;
overflow: auto;
}
@media only screen and (max-width: 800px) {
:host {
flex-direction: column;
}
pre {
margin-left: 0;
}
}
</style>
<ha-card>
<state-card-content
state-obj="[[_stateObj]]"
hass="[[hass]]"
in-dialog
></state-card-content>
<more-info-content
hass="[[hass]]"
state-obj="[[_stateObj]]"
></more-info-content>
</ha-card>
<template is="dom-if" if="[[showConfig]]">
<pre>[[_jsonEntity(_stateObj)]]</pre>
</template>
`;
}
static get properties() {
return {
hass: Object,
entityId: String,
showConfig: Boolean,
_stateObj: {
type: Object,
computed: "_getState(entityId, hass.states)",
},
};
}
_getState(entityId, states) {
return states[entityId];
}
_jsonEntity(stateObj) {
// We are caching some things on stateObj
// (it sucks, we will remove in the future)
const tmp = {};
Object.keys(stateObj).forEach((key) => {
if (key[0] !== "_") {
tmp[key] = stateObj[key];
}
});
return JSON.stringify(tmp, null, 2);
}
}
customElements.define("demo-more-info", DemoMoreInfo);

View File

@@ -0,0 +1,58 @@
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";
class DemoMoreInfos extends PolymerElement {
static get template() {
return html`
<style>
.cards {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
demo-more-info {
margin: 16px 16px 32px;
}
app-toolbar {
background-color: var(--light-primary-color);
}
.filters {
margin-left: 60px;
}
</style>
<app-toolbar>
<div class="filters">
<paper-toggle-button checked="{{_showConfig}}"
>Show entity</paper-toggle-button
>
</div>
</app-toolbar>
<div class="cards">
<template is="dom-repeat" items="[[entities]]">
<demo-more-info
entity-id="[[item]]"
show-config="[[_showConfig]]"
hass="[[hass]]"
></demo-more-info>
</template>
</div>
`;
}
static get properties() {
return {
entities: Array,
hass: Object,
_showConfig: {
type: Boolean,
value: false,
},
};
}
}
customElements.define("demo-more-infos", DemoMoreInfos);

View File

@@ -0,0 +1,11 @@
export const demoConfig = {
elevation: 300,
latitude: 51.5287352,
longitude: -0.381773,
unit_system: {
length: "km",
mass: "kg",
temperature: "°C",
volume: "L",
},
};

View File

@@ -0,0 +1,264 @@
export default {
en: {
"state.default.off": "Off",
"state.default.on": "On",
"state.default.unknown": "Unknown",
"state.default.unavailable": "Unavailable",
"state.alarm_control_panel.armed": "Armed",
"state.alarm_control_panel.disarmed": "Disarmed",
"state.alarm_control_panel.armed_home": "Armed home",
"state.alarm_control_panel.armed_away": "Armed away",
"state.alarm_control_panel.armed_night": "Armed night",
"state.alarm_control_panel.armed_custom_bypass": "Armed custom bypass",
"state.alarm_control_panel.pending": "Pending",
"state.alarm_control_panel.arming": "Arming",
"state.alarm_control_panel.disarming": "Disarming",
"state.alarm_control_panel.triggered": "Triggered",
"state.automation.off": "Off",
"state.automation.on": "On",
"state.binary_sensor.default.off": "Off",
"state.binary_sensor.default.on": "On",
"state.binary_sensor.battery.off": "Normal",
"state.binary_sensor.battery.on": "Low",
"state.binary_sensor.cold.off": "Normal",
"state.binary_sensor.cold.on": "Cold",
"state.binary_sensor.connectivity.off": "Disconnected",
"state.binary_sensor.connectivity.on": "Connected",
"state.binary_sensor.door.off": "Closed",
"state.binary_sensor.door.on": "Open",
"state.binary_sensor.garage_door.off": "Closed",
"state.binary_sensor.garage_door.on": "Open",
"state.binary_sensor.gas.off": "Clear",
"state.binary_sensor.gas.on": "Detected",
"state.binary_sensor.heat.off": "Normal",
"state.binary_sensor.heat.on": "Hot",
"state.binary_sensor.lock.off": "Locked",
"state.binary_sensor.lock.on": "Unlocked",
"state.binary_sensor.moisture.off": "Dry",
"state.binary_sensor.moisture.on": "Wet",
"state.binary_sensor.motion.off": "Clear",
"state.binary_sensor.motion.on": "Detected",
"state.binary_sensor.occupancy.off": "Clear",
"state.binary_sensor.occupancy.on": "Detected",
"state.binary_sensor.opening.off": "Closed",
"state.binary_sensor.opening.on": "Open",
"state.binary_sensor.presence.off": "Away",
"state.binary_sensor.presence.on": "Home",
"state.binary_sensor.problem.off": "OK",
"state.binary_sensor.problem.on": "Problem",
"state.binary_sensor.safety.off": "Safe",
"state.binary_sensor.safety.on": "Unsafe",
"state.binary_sensor.smoke.off": "Clear",
"state.binary_sensor.smoke.on": "Detected",
"state.binary_sensor.sound.off": "Clear",
"state.binary_sensor.sound.on": "Detected",
"state.binary_sensor.vibration.off": "Clear",
"state.binary_sensor.vibration.on": "Detected",
"state.binary_sensor.window.off": "Closed",
"state.binary_sensor.window.on": "Open",
"state.calendar.off": "Off",
"state.calendar.on": "On",
"state.camera.recording": "Recording",
"state.camera.streaming": "Streaming",
"state.camera.idle": "Idle",
"state.climate.off": "Off",
"state.climate.on": "On",
"state.climate.heat": "Heat",
"state.climate.cool": "Cool",
"state.climate.idle": "Idle",
"state.climate.auto": "Auto",
"state.climate.dry": "Dry",
"state.climate.fan_only": "Fan only",
"state.climate.eco": "Eco",
"state.climate.electric": "Electric",
"state.climate.performance": "Performance",
"state.climate.high_demand": "High demand",
"state.climate.heat_pump": "Heat pump",
"state.climate.gas": "Gas",
"state.configurator.configure": "Configure",
"state.configurator.configured": "Configured",
"state.cover.open": "Open",
"state.cover.opening": "Opening",
"state.cover.closed": "Closed",
"state.cover.closing": "Closing",
"state.cover.stopped": "Stopped",
"state.device_tracker.home": "Home",
"state.device_tracker.not_home": "Away",
"state.fan.off": "Off",
"state.fan.on": "On",
"state.group.off": "Off",
"state.group.on": "On",
"state.group.home": "Home",
"state.group.not_home": "Away",
"state.group.open": "Open",
"state.group.opening": "Opening",
"state.group.closed": "Closed",
"state.group.closing": "Closing",
"state.group.stopped": "Stopped",
"state.group.locked": "Locked",
"state.group.unlocked": "Unlocked",
"state.group.ok": "OK",
"state.group.problem": "Problem",
"state.input_boolean.off": "Off",
"state.input_boolean.on": "On",
"state.light.off": "Off",
"state.light.on": "On",
"state.lock.locked": "Locked",
"state.lock.unlocked": "Unlocked",
"state.media_player.off": "Off",
"state.media_player.on": "On",
"state.media_player.playing": "Playing",
"state.media_player.paused": "Paused",
"state.media_player.idle": "Idle",
"state.media_player.standby": "Standby",
"state.plant.ok": "OK",
"state.plant.problem": "Problem",
"state.remote.off": "Off",
"state.remote.on": "On",
"state.scene.scening": "Scening",
"state.script.off": "Off",
"state.script.on": "On",
"state.sensor.off": "Off",
"state.sensor.on": "On",
"state.sun.above_horizon": "Above horizon",
"state.sun.below_horizon": "Below horizon",
"state.switch.off": "Off",
"state.switch.on": "On",
"state.weather.clear-night": "Clear, night",
"state.weather.cloudy": "Cloudy",
"state.weather.fog": "Fog",
"state.weather.hail": "Hail",
"state.weather.lightning": "Lightning",
"state.weather.lightning-rainy": "Lightning, rainy",
"state.weather.partlycloudy": "Partly cloudy",
"state.weather.pouring": "Pouring",
"state.weather.rainy": "Rainy",
"state.weather.snowy": "Snowy",
"state.weather.snowy-rainy": "Snowy, rainy",
"state.weather.sunny": "Sunny",
"state.weather.windy": "Windy",
"state.weather.windy-variant": "Windy",
"state.zwave.default.initializing": "Initializing",
"state.zwave.default.dead": "Dead",
"state.zwave.default.sleeping": "Sleeping",
"state.zwave.default.ready": "Ready",
"state.zwave.query_stage.initializing": "Initializing ({query_stage})",
"state.zwave.query_stage.dead": "Dead ({query_stage})",
"state_badge.default.unknown": "Unk",
"state_badge.default.unavailable": "Unavai",
"state_badge.alarm_control_panel.armed": "Armed",
"state_badge.alarm_control_panel.disarmed": "Disarm",
"state_badge.alarm_control_panel.armed_home": "Armed",
"state_badge.alarm_control_panel.armed_away": "Armed",
"state_badge.alarm_control_panel.armed_night": "Armed",
"state_badge.alarm_control_panel.armed_custom_bypass": "Armed",
"state_badge.alarm_control_panel.pending": "Pend",
"state_badge.alarm_control_panel.arming": "Arming",
"state_badge.alarm_control_panel.disarming": "Disarm",
"state_badge.alarm_control_panel.triggered": "Trig",
"state_badge.device_tracker.home": "Home",
"state_badge.device_tracker.not_home": "Away",
"ui.card.alarm_control_panel.code": "Code",
"ui.card.alarm_control_panel.clear_code": "Clear",
"ui.card.alarm_control_panel.disarm": "Disarm",
"ui.card.alarm_control_panel.arm_home": "Arm home",
"ui.card.alarm_control_panel.arm_away": "Arm away",
"ui.card.automation.last_triggered": "Last triggered",
"ui.card.automation.trigger": "Trigger",
"ui.card.camera.not_available": "Image not available",
"ui.card.climate.currently": "Currently",
"ui.card.climate.on_off": "On / off",
"ui.card.climate.target_temperature": "Target temperature",
"ui.card.climate.target_humidity": "Target humidity",
"ui.card.climate.operation": "Operation",
"ui.card.climate.fan_mode": "Fan mode",
"ui.card.climate.swing_mode": "Swing mode",
"ui.card.climate.away_mode": "Away mode",
"ui.card.climate.aux_heat": "Aux heat",
"ui.card.cover.position": "Position",
"ui.card.cover.tilt_position": "Tilt position",
"ui.card.fan.speed": "Speed",
"ui.card.fan.oscillate": "Oscillate",
"ui.card.fan.direction": "Direction",
"ui.card.light.brightness": "Brightness",
"ui.card.light.color_temperature": "Color temperature",
"ui.card.light.white_value": "White value",
"ui.card.light.effect": "Effect",
"ui.card.lock.code": "Code",
"ui.card.lock.lock": "Lock",
"ui.card.lock.unlock": "Unlock",
"ui.card.media_player.source": "Source",
"ui.card.media_player.sound_mode": "Sound mode",
"ui.card.media_player.text_to_speak": "Text to speak",
"ui.card.persistent_notification.dismiss": "Dismiss",
"ui.card.scene.activate": "Activate",
"ui.card.script.execute": "Execute",
"ui.card.weather.attributes.air_pressure": "Air pressure",
"ui.card.weather.attributes.humidity": "Humidity",
"ui.card.weather.attributes.temperature": "Temperature",
"ui.card.weather.attributes.visibility": "Visibility",
"ui.card.weather.attributes.wind_speed": "Wind speed",
"ui.card.weather.cardinal_direction.e": "E",
"ui.card.weather.cardinal_direction.ene": "ENE",
"ui.card.weather.cardinal_direction.ese": "ESE",
"ui.card.weather.cardinal_direction.n": "N",
"ui.card.weather.cardinal_direction.ne": "NE",
"ui.card.weather.cardinal_direction.nne": "NNE",
"ui.card.weather.cardinal_direction.nw": "NW",
"ui.card.weather.cardinal_direction.nnw": "NNW",
"ui.card.weather.cardinal_direction.s": "S",
"ui.card.weather.cardinal_direction.se": "SE",
"ui.card.weather.cardinal_direction.sse": "SSE",
"ui.card.weather.cardinal_direction.ssw": "SSW",
"ui.card.weather.cardinal_direction.sw": "SW",
"ui.card.weather.cardinal_direction.w": "W",
"ui.card.weather.cardinal_direction.wnw": "WNW",
"ui.card.weather.cardinal_direction.wsw": "WSW",
"ui.card.weather.forecast": "Forecast",
"ui.common.loading": "Loading",
"ui.common.cancel": "Cancel",
"ui.components.entity.entity-picker.entity": "Entity",
"ui.components.relative_time.past": "{time} ago",
"ui.components.relative_time.future": "In {time}",
"ui.components.relative_time.never": "Never",
"ui.components.relative_time.duration.second":
"{count} {count, plural,\n one {second}\n other {seconds}\n}",
"ui.components.relative_time.duration.minute":
"{count} {count, plural,\n one {minute}\n other {minutes}\n}",
"ui.components.relative_time.duration.hour":
"{count} {count, plural,\n one {hour}\n other {hours}\n}",
"ui.components.relative_time.duration.day":
"{count} {count, plural,\n one {day}\n other {days}\n}",
"ui.components.relative_time.duration.week":
"{count} {count, plural,\n one {week}\n other {weeks}\n}",
"ui.components.history_charts.loading_history": "Loading state history...",
"ui.components.history_charts.no_history_found": "No state history found.",
"ui.components.service-picker.service": "Service",
"ui.dialogs.more_info_settings.save": "Save",
"ui.dialogs.more_info_settings.name": "Name",
"ui.duration.second":
"{count} {count, plural,\n one {second}\n other {seconds}\n}",
"ui.duration.minute":
"{count} {count, plural,\n one {minute}\n other {minutes}\n}",
"ui.duration.hour":
"{count} {count, plural,\n one {hour}\n other {hours}\n}",
"ui.duration.day":
"{count} {count, plural,\n one {day}\n other {days}\n}",
"ui.duration.week":
"{count} {count, plural,\n one {week}\n other {weeks}\n}",
"ui.login-form.password": "Password",
"ui.login-form.remember": "Remember",
"ui.login-form.log_in": "Log in",
"ui.notification_toast.entity_turned_on": "Turned on {entity}.",
"ui.notification_toast.entity_turned_off": "Turned off {entity}.",
"ui.notification_toast.service_called": "Service {service} called.",
"ui.notification_toast.service_call_failed":
"Failed to call service {service}.",
"ui.notification_toast.connection_lost": "Connection lost. Reconnecting…",
"ui.sidebar.developer_tools": "Developer tools",
"ui.sidebar.log_out": "Log out",
"attribute.weather.humidity": "Humidity",
"attribute.weather.visibility": "Visibility",
"attribute.weather.wind_speed": "Wind speed",
},
};

View File

@@ -0,0 +1,96 @@
export const demoServices = {
configurator: ["configure"],
tts: ["demo_say", "clear_cache"],
cover: [
"open_cover",
"close_cover",
"open_cover_tilt",
"close_cover_tilt",
"set_cover_tilt_position",
"set_cover_position",
"stop_cover_tilt",
"stop_cover",
],
group: ["set", "reload", "remove", "set_visibility"],
alarm_control_panel: [
"alarm_arm_night",
"alarm_disarm",
"alarm_trigger",
"alarm_arm_home",
"alarm_arm_away",
"alarm_arm_custom_bypass",
],
conversation: ["process"],
notify: ["demo_test_target_name", "notify"],
lock: ["open", "lock", "unlock"],
input_select: [
"select_previous",
"set_options",
"select_next",
"select_option",
],
recorder: ["purge"],
persistent_notification: ["create", "dismiss"],
timer: ["pause", "cancel", "finish", "start"],
input_boolean: ["turn_off", "toggle", "turn_on"],
fan: [
"set_speed",
"turn_on",
"turn_off",
"set_direction",
"oscillate",
"toggle",
],
climate: [
"set_humidity",
"set_operation_mode",
"set_aux_heat",
"turn_on",
"set_hold_mode",
"set_away_mode",
"turn_off",
"set_fan_mode",
"set_temperature",
"set_swing_mode",
],
switch: ["turn_off", "toggle", "turn_on"],
script: ["turn_off", "demo", "reload", "toggle", "turn_on"],
scene: ["turn_on"],
system_log: ["clear", "write"],
camera: ["disable_motion_detection", "enable_motion_detection", "snapshot"],
image_processing: ["scan"],
media_player: [
"media_previous_track",
"clear_playlist",
"shuffle_set",
"media_seek",
"turn_on",
"media_play_pause",
"media_next_track",
"media_pause",
"volume_down",
"volume_set",
"media_stop",
"toggle",
"media_play",
"play_media",
"volume_mute",
"turn_off",
"select_sound_mode",
"select_source",
"volume_up",
],
input_number: ["set_value", "increment", "decrement"],
device_tracker: ["see"],
homeassistant: [
"stop",
"check_config",
"reload_core_config",
"turn_on",
"turn_off",
"restart",
"toggle",
],
light: ["turn_off", "toggle", "turn_on"],
input_text: ["set_value"],
};

File diff suppressed because it is too large Load Diff

143
gallery/src/data/entity.js Normal file
View File

@@ -0,0 +1,143 @@
const now = () => new Date().toISOString();
const randomTime = () =>
new Date(new Date().getTime() - Math.random() * 80 * 60 * 1000).toISOString();
/* eslint-disable no-unused-vars */
export class Entity {
constructor(domain, objectId, state, baseAttributes) {
this.domain = domain;
this.objectId = objectId;
this.entityId = `${domain}.${objectId}`;
this.lastChanged = randomTime();
this.lastUpdated = randomTime();
this.state = state;
// These are the attributes that we always write to the state machine
this.baseAttributes = baseAttributes;
this.attributes = baseAttributes;
}
async handleService(domain, service, data) {
console.log(
`Unmocked service for ${this.entityId}: ${domain}/${service}`,
data
);
}
update(state, attributes = {}) {
this.state = state;
this.lastUpdated = now();
this.lastChanged =
state === this.state ? this.lastChanged : this.lastUpdated;
this.attributes = Object.assign({}, this.baseAttributes, attributes);
console.log("update", this.entityId, this);
this.hass.updateStates({
[this.entityId]: this.toState(),
});
}
toState() {
return {
entity_id: this.entityId,
state: this.state,
attributes: this.attributes,
last_changed: this.lastChanged,
last_updated: this.lastUpdated,
};
}
}
export class LightEntity extends Entity {
async handleService(domain, service, data) {
if (!["homeassistant", this.domain].includes(domain)) return;
if (service === "turn_on") {
// eslint-disable-next-line
let { brightness, hs_color, brightness_pct } = data;
// eslint-disable-next-line
brightness = (255 * brightness_pct) / 100;
this.update(
"on",
Object.assign(this.attributes, {
brightness,
hs_color,
})
);
} else if (service === "turn_off") {
this.update("off");
} else if (service === "toggle") {
if (this.state === "on") {
this.handleService(domain, "turn_off", data);
} else {
this.handleService(domain, "turn_on", data);
}
}
}
}
export class LockEntity extends Entity {
async handleService(domain, service, data) {
if (domain !== this.domain) return;
if (service === "lock") {
this.update("locked");
} else if (service === "unlock") {
this.update("unlocked");
}
}
}
export class CoverEntity extends Entity {
async handleService(domain, service, data) {
if (domain !== this.domain) return;
if (service === "open_cover") {
this.update("open");
} else if (service === "close_cover") {
this.update("closing");
}
}
}
export class ClimateEntity extends Entity {
async handleService(domain, service, data) {
if (domain !== this.domain) return;
if (service === "set_operation_mode") {
this.update(
data.operation_mode === "heat" ? "heat" : data.operation_mode,
Object.assign(this.attributes, {
operation_mode: data.operation_mode,
})
);
}
}
}
export class GroupEntity extends Entity {
async handleService(domain, service, data) {
if (!["homeassistant", this.domain].includes(domain)) return;
await Promise.all(
this.attributes.entity_id.map((ent) => {
const entity = this.hass.mockEntities[ent];
return entity.handleService(entity.domain, service, data);
})
);
this.update(service === "turn_on" ? "on" : "off");
}
}
const TYPES = {
climate: ClimateEntity,
light: LightEntity,
lock: LockEntity,
cover: CoverEntity,
group: GroupEntity,
};
export default (domain, objectId, state, baseAttributes = {}) =>
new (TYPES[domain] || Entity)(domain, objectId, state, baseAttributes);

36
gallery/src/data/hass.js Normal file
View File

@@ -0,0 +1,36 @@
export default class FakeHass {
constructor(states = {}) {
this.states = states;
this._wsCommands = {};
}
addWSCommand(command, callback) {
this._wsCommands[command] = callback;
}
async callService(domain, service, serviceData) {
console.log("callService", { domain, service, serviceData });
return Promise.resolve();
}
async callWS(msg) {
const callback = this._wsCommands[msg.type];
return callback
? callback(msg)
: Promise.reject({
code: "command_not_mocked",
message: "This command is not implemented in the gallery.",
});
}
async sendWS(msg) {
const callback = this._wsCommands[msg.type];
if (callback) {
callback(msg);
} else {
console.error(`Unknown command: ${msg.type}`);
}
console.log("sendWS", msg);
}
}

View File

@@ -0,0 +1,112 @@
import { fireEvent } from "../../../src/common/dom/fire_event";
import { demoConfig } from "./demo_config";
import { demoServices } from "./demo_services";
import demoResources from "./demo_resources";
const ensureArray = (val) => (Array.isArray(val) ? val : [val]);
export default (elements, { initialStates = {} } = {}) => {
elements = ensureArray(elements);
const wsCommands = {};
const restResponses = {};
let hass;
const entities = {};
function updateHass(obj) {
hass = Object.assign({}, hass, obj);
elements.forEach((el) => {
el.hass = hass;
});
}
updateHass({
// Home Assistant properties
config: demoConfig,
services: demoServices,
language: "en",
resources: demoResources,
states: initialStates,
themes: {},
connection: {
subscribeEvents: async (callback, event) => {
console.log("subscribeEvents", event);
return () => console.log("unsubscribeEvents", event);
},
},
// Mock properties
mockEntities: entities,
// Home Assistant functions
async callService(domain, service, data) {
fireEvent(elements[0], "show-notification", {
message: `Called service ${domain}/${service}`,
});
if (data.entity_id) {
await Promise.all(
ensureArray(data.entity_id).map((ent) =>
entities[ent].handleService(domain, service, data)
)
);
} else {
console.log("unmocked callService", domain, service, data);
}
},
async callWS(msg) {
const callback = wsCommands[msg.type];
return callback
? callback(msg)
: Promise.reject({
code: "command_not_mocked",
message: "This command is not implemented in the gallery.",
});
},
async sendWS(msg) {
const callback = wsCommands[msg.type];
if (callback) {
callback(msg);
} else {
console.error(`Unknown command: ${msg.type}`);
}
console.log("sendWS", msg);
},
async callApi(method, path, parameters) {
const callback = restResponses[path];
return callback
? callback(method, path, parameters)
: Promise.reject(`Mock for {path} is not implemented`);
},
// Mock functions
updateHass,
updateStates(newStates) {
updateHass({
states: Object.assign({}, hass.states, newStates),
});
},
addEntities(newEntities) {
const states = {};
ensureArray(newEntities).forEach((ent) => {
ent.hass = hass;
entities[ent.entityId] = ent;
states[ent.entityId] = ent.toState();
});
this.updateStates(states);
},
mockWS(type, callback) {
wsCommands[type] = callback;
},
mockAPI(path, callback) {
restResponses[path] = callback;
},
});
return hass;
};

View File

@@ -0,0 +1,79 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import getEntity from "../data/entity";
import provideHass from "../data/provide_hass";
import "../components/demo-cards";
const ENTITIES = [
getEntity("alarm_control_panel", "alarm", "disarmed", {
friendly_name: "Alarm",
}),
getEntity("alarm_control_panel", "alarm_armed", "armed_home", {
friendly_name: "Alarm",
}),
];
const CONFIGS = [
{
heading: "Basic Example",
config: `
- type: alarm-panel
entity: alarm_control_panel.alarm
`,
},
{
heading: "With Title",
config: `
- type: alarm-panel
entity: alarm_control_panel.alarm_armed
title: My Alarm
`,
},
{
heading: "Using only Arm_Home State",
config: `
- type: alarm-panel
entity: alarm_control_panel.alarm
states:
- arm_home
`,
},
{
heading: "Invalid Entity",
config: `
- type: alarm-panel
entity: alarm_control_panel.alarm1
`,
},
];
class DemoAlarmPanelEntity extends PolymerElement {
static get template() {
return html`
<demo-cards
id="demos"
hass="[[hass]]"
configs="[[_configs]]"
></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
hass: Object,
};
}
ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
}
}
customElements.define("demo-hui-alarm-panel-card", DemoAlarmPanelEntity);

View File

@@ -0,0 +1,84 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import getEntity from "../data/entity";
import provideHass from "../data/provide_hass";
import "../components/demo-cards";
const ENTITIES = [
getEntity("light", "controller_1", "on", {
friendly_name: "Controller 1",
}),
getEntity("light", "controller_2", "on", {
friendly_name: "Controller 2",
}),
getEntity("light", "floor", "off", {
friendly_name: "Floor light",
}),
getEntity("light", "kitchen", "on", {
friendly_name: "Kitchen light",
}),
];
const CONFIGS = [
{
heading: "Controller",
config: `
- type: entities
entities:
- light.controller_1
- light.controller_2
- type: divider
- light.floor
- light.kitchen
`,
},
{
heading: "Demo",
config: `
- type: conditional
conditions:
- entity: light.controller_1
state: "on"
- entity: light.controller_2
state_not: "off"
card:
type: entities
entities:
- light.controller_1
- light.controller_2
- light.floor
- light.kitchen
`,
},
];
class DemoConditional extends PolymerElement {
static get template() {
return html`
<demo-cards
id="demos"
hass="[[hass]]"
configs="[[_configs]]"
></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
hass: Object,
};
}
ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
}
}
customElements.define("demo-hui-conditional-card", DemoConditional);

View File

@@ -0,0 +1,198 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import getEntity from "../data/entity";
import provideHass from "../data/provide_hass";
import "../components/demo-cards";
const ENTITIES = [
getEntity("light", "bed_light", "on", {
friendly_name: "Bed Light",
}),
getEntity("group", "kitchen", "on", {
entity_id: ["light.bed_light"],
order: 8,
friendly_name: "Kitchen",
}),
getEntity("lock", "kitchen_door", "locked", {
friendly_name: "Kitchen Door",
}),
getEntity("cover", "kitchen_window", "open", {
friendly_name: "Kitchen Window",
supported_features: 11,
}),
getEntity("scene", "romantic_lights", "scening", {
entity_id: ["light.bed_light", "light.ceiling_lights"],
friendly_name: "Romantic lights",
}),
getEntity("device_tracker", "demo_paulus", "home", {
source_type: "gps",
latitude: 32.877105,
longitude: 117.232185,
gps_accuracy: 91,
battery: 71,
friendly_name: "Paulus",
}),
getEntity("climate", "ecobee", "auto", {
current_temperature: 73,
min_temp: 45,
max_temp: 95,
temperature: null,
target_temp_high: 75,
target_temp_low: 70,
fan_mode: "Auto Low",
fan_list: ["On Low", "On High", "Auto Low", "Auto High", "Off"],
operation_mode: "auto",
operation_list: ["heat", "cool", "auto", "off"],
hold_mode: "home",
swing_mode: "Auto",
swing_list: ["Auto", "1", "2", "3", "Off"],
unit_of_measurement: "°F",
friendly_name: "Ecobee",
supported_features: 1014,
}),
getEntity("input_number", "noise_allowance", 5, {
min: 0,
max: 10,
step: 1,
mode: "slider",
unit_of_measurement: "dB",
friendly_name: "Allowed Noise",
icon: "mdi:bell-ring",
}),
];
const CONFIGS = [
{
heading: "Basic",
config: `
- type: entities
entities:
- scene.romantic_lights
- device_tracker.demo_paulus
- cover.kitchen_window
- group.kitchen
- lock.kitchen_door
- light.bed_light
- light.non_existing
- climate.ecobee
- input_number.noise_allowance
`,
},
{
heading: "With title, toggle-able",
config: `
- type: entities
entities:
- scene.romantic_lights
- device_tracker.demo_paulus
- cover.kitchen_window
- group.kitchen
- lock.kitchen_door
- light.bed_light
- climate.ecobee
- input_number.noise_allowance
title: Random group
`,
},
{
heading: "With title, toggle = false",
config: `
- type: entities
entities:
- scene.romantic_lights
- device_tracker.demo_paulus
- cover.kitchen_window
- group.kitchen
- lock.kitchen_door
- light.bed_light
- climate.ecobee
- input_number.noise_allowance
title: Random group
show_header_toggle: false
`,
},
{
heading: "With title, can't toggle",
config: `
- type: entities
entities:
- device_tracker.demo_paulus
title: Random group
`,
},
{
heading: "Custom name, secondary info, custom icon",
config: `
- type: entities
entities:
- entity: scene.romantic_lights
name: ¯\\_(ツ)_/¯
- entity: device_tracker.demo_paulus
secondary_info: entity-id
- entity: cover.kitchen_window
secondary_info: last-changed
- entity: group.kitchen
icon: mdi:home-assistant
- lock.kitchen_door
- entity: light.bed_light
icon: mdi:alarm-light
name: Bed Light Custom Icon
- climate.ecobee
- input_number.noise_allowance
title: Random group
show_header_toggle: false
`,
},
{
heading: "Special rows",
config: `
- type: entities
entities:
- type: call-service
icon: mdi:power
name: Bed light
action_name: Toggle light
service: light.toggle
service_data:
entity_id: light.bed_light
- type: section
label: Links
- type: weblink
url: http://google.com/
icon: mdi:google
name: Google
- type: divider
- type: divider
style:
height: 30px
margin: 4px 0
background: center / contain url("/images/divider.png") no-repeat
`,
},
];
class DemoEntities extends PolymerElement {
static get template() {
return html`
<demo-cards id="demos" configs="[[_configs]]"></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
};
}
ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
}
}
customElements.define("demo-hui-entities-card", DemoEntities);

View File

@@ -0,0 +1,99 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import getEntity from "../data/entity";
import provideHass from "../data/provide_hass";
import "../components/demo-cards";
const ENTITIES = [
getEntity("light", "bed_light", "on", {
friendly_name: "Bed Light",
}),
];
const CONFIGS = [
{
heading: "Basic example",
config: `
- type: entity-button
entity: light.bed_light
`,
},
{
heading: "With Name",
config: `
- type: entity-button
name: Bedroom
entity: light.bed_light
`,
},
{
heading: "With Icon",
config: `
- type: entity-button
entity: light.bed_light
icon: mdi:hotel
`,
},
{
heading: "Without State",
config: `
- type: entity-button
entity: light.bed_light
show_state: false
`,
},
{
heading: "Custom Tap Action (toggle)",
config: `
- type: entity-button
entity: light.bed_light
tap_action: toggle
`,
},
{
heading: "Running Service",
config: `
- type: entity-button
entity: light.bed_light
service: light.toggle
`,
},
{
heading: "Invalid Entity",
config: `
- type: entity-button
entity: sensor.invalid_entity
`,
},
];
class DemoEntityButtonEntity extends PolymerElement {
static get template() {
return html`
<demo-cards
id="demos"
hass="[[hass]]"
configs="[[_configs]]"
></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
hass: Object,
};
}
ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
}
}
customElements.define("demo-hui-entity-button-card", DemoEntityButtonEntity);

View File

@@ -0,0 +1,115 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import getEntity from "../data/entity";
import provideHass from "../data/provide_hass";
import "../components/demo-cards";
const ENTITIES = [
getEntity("device_tracker", "demo_paulus", "work", {
source_type: "gps",
latitude: 32.877105,
longitude: 117.232185,
gps_accuracy: 91,
battery: 71,
friendly_name: "Paulus",
}),
getEntity("device_tracker", "demo_anne_therese", "school", {
source_type: "gps",
latitude: 32.877105,
longitude: 117.232185,
gps_accuracy: 91,
battery: 71,
friendly_name: "Anne Therese",
}),
getEntity("device_tracker", "demo_home_boy", "home", {
source_type: "gps",
latitude: 32.877105,
longitude: 117.232185,
gps_accuracy: 91,
battery: 71,
friendly_name: "Home Boy",
}),
getEntity("light", "bed_light", "on", {
friendly_name: "Bed Light",
}),
getEntity("light", "kitchen_lights", "on", {
friendly_name: "Kitchen Lights",
}),
getEntity("light", "ceiling_lights", "off", {
friendly_name: "Ceiling Lights",
}),
];
const CONFIGS = [
{
heading: "Controller",
config: `
- type: entities
entities:
- light.bed_light
- light.ceiling_lights
- light.kitchen_lights
`,
},
{
heading: "Basic",
config: `
- type: entity-filter
entities:
- device_tracker.demo_anne_therese
- device_tracker.demo_home_boy
- device_tracker.demo_paulus
- light.bed_light
- light.ceiling_lights
- light.kitchen_lights
state_filter:
- "on"
- home
`,
},
{
heading: "With card config",
config: `
- type: entity-filter
entities:
- device_tracker.demo_anne_therese
- device_tracker.demo_home_boy
- device_tracker.demo_paulus
- light.bed_light
- light.ceiling_lights
- light.kitchen_lights
state_filter:
- "on"
- not_home
card:
type: glance
show_state: false
`,
},
];
class DemoFilter extends PolymerElement {
static get template() {
return html`
<demo-cards id="demos" configs="[[_configs]]"></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
};
}
ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
}
}
customElements.define("demo-hui-entity-filter-card", DemoFilter);

View File

@@ -0,0 +1,83 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../components/demo-cards";
const CONFIGS = [
{
heading: "Basic example",
config: `
- type: gauge
entity: sensor.brightness
`,
},
{
heading: "With title",
config: `
- type: gauge
title: Humidity
entity: sensor.outside_humidity
`,
},
{
heading: "Custom Unit of Measurement",
config: `
- type: gauge
entity: sensor.outside_temperature
unit_of_measurement: C
`,
},
{
heading: "Setting Severity Levels",
config: `
- type: gauge
entity: sensor.brightness
severity:
red: 32
green: 0
yellow: 23
`,
},
{
heading: "Setting Min and Max Values",
config: `
- type: gauge
entity: sensor.brightness
min: 0
max: 38
`,
},
{
heading: "Invalid Entity",
config: `
- type: gauge
entity: sensor.invalid_entity
`,
},
{
heading: "Non-Numeric Value",
config: `
- type: gauge
entity: plant.bonsai
`,
},
];
class DemoGaugeEntity extends PolymerElement {
static get template() {
return html`
<demo-cards configs="[[_configs]]"></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
};
}
}
customElements.define("demo-hui-gauge-card", DemoGaugeEntity);

View File

@@ -0,0 +1,240 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import getEntity from "../data/entity";
import provideHass from "../data/provide_hass";
import "../components/demo-cards";
const ENTITIES = [
getEntity("device_tracker", "demo_paulus", "home", {
source_type: "gps",
latitude: 32.877105,
longitude: 117.232185,
gps_accuracy: 91,
battery: 71,
friendly_name: "Paulus",
}),
getEntity("media_player", "living_room", "playing", {
volume_level: 1,
is_volume_muted: false,
media_content_id: "eyU3bRy2x44",
media_content_type: "movie",
media_duration: 300,
media_position: 45.017773,
media_position_updated_at: "2018-07-19T10:44:45.919514+00:00",
media_title: "♥♥ The Best Fireplace Video (3 hours)",
app_name: "YouTube",
sound_mode: "Dummy Music",
sound_mode_list: ["Dummy Music", "Dummy Movie"],
shuffle: false,
friendly_name: "Living Room",
entity_picture:
"/api/media_player_proxy/media_player.living_room?token=e925f8db7f7bd1f317e4524dcb8333d60f6019219a3799a22604b5787f243567&cache=bc2ffb49c4f67034",
supported_features: 115597,
}),
getEntity("sun", "sun", "below_horizon", {
next_dawn: "2018-07-19T20:48:47+00:00",
next_dusk: "2018-07-20T11:46:06+00:00",
next_midnight: "2018-07-19T16:17:28+00:00",
next_noon: "2018-07-20T04:17:26+00:00",
next_rising: "2018-07-19T21:16:31+00:00",
next_setting: "2018-07-20T11:18:22+00:00",
elevation: 67.69,
azimuth: 338.55,
friendly_name: "Sun",
}),
getEntity("cover", "kitchen_window", "open", {
friendly_name: "Kitchen Window",
supported_features: 11,
}),
getEntity("light", "kitchen_lights", "on", {
friendly_name: "Kitchen Lights",
}),
getEntity("light", "ceiling_lights", "off", {
friendly_name: "Ceiling Lights",
}),
getEntity("lock", "kitchen_door", "locked", {
friendly_name: "Kitchen Door",
}),
];
const CONFIGS = [
{
heading: "Basic example",
config: `
- type: glance
entities:
- device_tracker.demo_paulus
- media_player.living_room
- sun.sun
- cover.kitchen_window
- light.kitchen_lights
- lock.kitchen_door
- light.ceiling_lights
`,
},
{
heading: "With title",
config: `
- type: glance
title: This is glance
entities:
- device_tracker.demo_paulus
- media_player.living_room
- sun.sun
- cover.kitchen_window
- light.kitchen_lights
- lock.kitchen_door
- light.ceiling_lights
`,
},
{
heading: "Custom column width",
config: `
- type: glance
column_width: calc(100% / 7)
entities:
- device_tracker.demo_paulus
- media_player.living_room
- sun.sun
- cover.kitchen_window
- light.kitchen_lights
- lock.kitchen_door
- light.ceiling_lights
`,
},
{
heading: "No name",
config: `
- type: glance
show_name: false
entities:
- device_tracker.demo_paulus
- media_player.living_room
- sun.sun
- cover.kitchen_window
- light.kitchen_lights
- lock.kitchen_door
- light.ceiling_lights
`,
},
{
heading: "No state",
config: `
- type: glance
show_state: false
entities:
- device_tracker.demo_paulus
- media_player.living_room
- sun.sun
- cover.kitchen_window
- light.kitchen_lights
- lock.kitchen_door
- light.ceiling_lights
`,
},
{
heading: "No name and no state",
config: `
- type: glance
show_name: false
show_state: false
entities:
- device_tracker.demo_paulus
- media_player.living_room
- sun.sun
- cover.kitchen_window
- light.kitchen_lights
- lock.kitchen_door
- light.ceiling_lights
`,
},
{
heading: "Custom name, custom icon",
config: `
- type: glance
entities:
- entity: device_tracker.demo_paulus
name: ¯\\_(ツ)_/¯
icon: mdi:home-assistant
- media_player.living_room
- sun.sun
- cover.kitchen_window
- entity: light.kitchen_lights
icon: mdi:alarm-light
- lock.kitchen_door
- light.ceiling_lights
`,
},
{
heading: "Custom tap action",
config: `
- type: glance
entities:
- entity: lock.kitchen_door
tap_action: toggle
- entity: light.ceiling_lights
tap_action: call-service
service: light.turn_on
- device_tracker.demo_paulus
- media_player.living_room
- sun.sun
- cover.kitchen_window
- light.kitchen_lights
`,
},
{
heading: "Selectively hidden name",
config: `
- type: glance
entities:
- device_tracker.demo_paulus
- entity: media_player.living_room
name:
- sun.sun
- entity: cover.kitchen_window
name:
- light.kitchen_lights
`,
},
{
heading: "Primary theme",
config: `
- type: glance
theming: primary
entities:
- device_tracker.demo_paulus
- media_player.living_room
- sun.sun
- cover.kitchen_window
- light.kitchen_lights
- lock.kitchen_door
- light.ceiling_lights
`,
},
];
class DemoPicEntity extends PolymerElement {
static get template() {
return html`
<demo-cards id="demos" configs="[[_configs]]"></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
};
}
ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
}
}
customElements.define("demo-hui-glance-card", DemoPicEntity);

View File

@@ -0,0 +1,57 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../components/demo-cards";
const CONFIGS = [
{
heading: "Without title",
config: `
- type: iframe
url: https://embed.windy.com/embed2.html
`,
},
{
heading: "With title",
config: `
- type: iframe
url: https://embed.windy.com/embed2.html
title: Weather radar
`,
},
{
heading: "Height-Width 3:4",
config: `
- type: iframe
url: https://embed.windy.com/embed2.html
aspect_ratio: 75%
`,
},
{
heading: "Height-Width 1:1",
config: `
- type: iframe
url: https://embed.windy.com/embed2.html
aspect_ratio: 100%
`,
},
];
class DemoIframe extends PolymerElement {
static get template() {
return html`
<demo-cards configs="[[_configs]]"></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
};
}
}
customElements.define("demo-hui-iframe-card", DemoIframe);

View File

@@ -0,0 +1,48 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import getEntity from "../data/entity";
import provideHass from "../data/provide_hass";
import "../components/demo-cards";
const ENTITIES = [
getEntity("light", "bed_light", "on", {
friendly_name: "Bed Light",
brightness: 130,
}),
];
const CONFIGS = [
{
heading: "Basic example",
config: `
- type: light
entity: light.bed_light
`,
},
];
class DemoLightEntity extends PolymerElement {
static get template() {
return html`
<demo-cards id="demos" configs="[[_configs]]"></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
};
}
ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
}
}
customElements.define("demo-hui-light-card", DemoLightEntity);

View File

@@ -0,0 +1,149 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import getEntity from "../data/entity";
import provideHass from "../data/provide_hass";
import "../components/demo-cards";
const ENTITIES = [
getEntity("device_tracker", "demo_paulus", "not_home", {
source_type: "gps",
latitude: 32.877105,
longitude: 117.232185,
gps_accuracy: 91,
battery: 71,
friendly_name: "Paulus",
}),
getEntity("device_tracker", "demo_home_boy", "home", {
source_type: "gps",
latitude: 32.87334,
longitude: 117.22745,
gps_accuracy: 20,
battery: 53,
friendly_name: "Home Boy",
}),
getEntity("zone", "home", "zoning", {
latitude: 32.87354,
longitude: 117.22765,
radius: 100,
friendly_name: "Home",
icon: "mdi:home",
}),
];
const CONFIGS = [
{
heading: "Without title",
config: `
- type: map
entities:
- entity: device_tracker.demo_paulus
- device_tracker.demo_home_boy
- zone.home
`,
},
{
heading: "With title",
config: `
- type: map
entities:
- entity: device_tracker.demo_paulus
- zone.home
title: Where is Paulus?
`,
},
{
heading: "Height-Width 1:2",
config: `
- type: map
entities:
- entity: device_tracker.demo_paulus
- zone.home
aspect_ratio: 50%
`,
},
{
heading: "Default Zoom",
config: `
- type: map
default_zoom: 12
entities:
- entity: device_tracker.demo_paulus
- zone.home
`,
},
{
heading: "Default Zoom too High",
config: `
- type: map
default_zoom: 20
entities:
- entity: device_tracker.demo_paulus
- zone.home
`,
},
{
heading: "Single Marker",
config: `
- type: map
entities:
- device_tracker.demo_paulus
`,
},
{
heading: "Single Marker Default Zoom",
config: `
- type: map
default_zoom: 8
entities:
- device_tracker.demo_paulus
`,
},
{
heading: "No Entities",
config: `
- type: map
entities:
- light.bed_light
`,
},
{
heading: "No Entities, Default Zoom",
config: `
- type: map
default_zoom: 8
entities:
- light.bed_light
`,
},
];
class DemoMap extends PolymerElement {
static get template() {
return html`
<demo-cards
id="demos"
hass="[[hass]]"
configs="[[_configs]]"
></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
hass: Object,
};
}
ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
}
}
customElements.define("demo-hui-map-card", DemoMap);

View File

@@ -0,0 +1,272 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../components/demo-cards";
const CONFIGS = [
{
heading: "markdown-it demo",
config: `
- type: markdown
content: >
# h1 Heading 8-)
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading
## Horizontal Rules
___
---
***
## Typographic replacements
Enable typographer option to see result.
(c) (C) (r) (R) (tm) (TM) (p) (P) +-
test.. test... test..... test?..... test!....
!!!!!! ???? ,, -- ---
"Smartypants, double quotes" and 'single quotes'
## Emphasis
**This is bold text**
__This is bold text__
*This is italic text*
_This is italic text_
~~Strikethrough~~
## Blockquotes
> Blockquotes can also be nested...
>> ...by using additional greater-than signs right next to each other...
> > > ...or with spaces between arrows.
## Lists
Unordered
+ Create a list by starting a line with \`+\`, \`-\`, or \`*\`
+ Sub-lists are made by indenting 2 spaces:
- Marker character change forces new list start:
* Ac tristique libero volutpat at
+ Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
+ Very easy!
Ordered
1. Lorem ipsum dolor sit amet
2. Consectetur adipiscing elit
3. Integer molestie lorem at massa
1. You can use sequential numbers...
1. ...or keep all the numbers as \`1.\`
Start numbering with offset:
57. foo
1. bar
## Code
Inline \`code\`
Indented code
// Some comments
line 1 of code
line 2 of code
line 3 of code
Block code "fences"
\`\`\`
Sample text here...
\`\`\`
Syntax highlighting
\`\`\` js
var foo = function (bar) {
return bar++;
};
console.log(foo(5));
\`\`\`
## Tables
| Option | Description |
| ------ | ----------- |
| data | path to data files to supply the data that will be passed into templates. |
| engine | engine to be used for processing templates. Handlebars is the default. |
| ext | extension to be used for dest files. |
Right aligned columns
| Option | Description |
| ------:| -----------:|
| data | path to data files to supply the data that will be passed into templates. |
| engine | engine to be used for processing templates. Handlebars is the default. |
| ext | extension to be used for dest files. |
## Links
[link text](http://dev.nodeca.com)
[link with title](http://nodeca.github.io/pica/demo/ "title text!")
Autoconverted link https://github.com/nodeca/pica (enable linkify to see)
## Images
![Minion](https://octodex.github.com/images/minion.png)
![Stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroopocat")
Like links, Images also have a footnote style syntax
![Alt text][id]
With a reference later in the document defining the URL location:
[id]: https://octodex.github.com/images/dojocat.jpg "The Dojocat"
## Plugins
The killer feature of \`markdown-it\` is very effective support of
[syntax plugins](https://www.npmjs.org/browse/keyword/markdown-it-plugin).
### [Emojies](https://github.com/markdown-it/markdown-it-emoji)
> Classic markup: :wink: :crush: :cry: :tear: :laughing: :yum:
>
> Shortcuts (emoticons): :-) :-( 8-) ;)
see [how to change output](https://github.com/markdown-it/markdown-it-emoji#change-output) with twemoji.
### [Subscript](https://github.com/markdown-it/markdown-it-sub) / [Superscript](https://github.com/markdown-it/markdown-it-sup)
- 19^th^
- H~2~O
### [<ins>](https://github.com/markdown-it/markdown-it-ins)
++Inserted text++
### [<mark>](https://github.com/markdown-it/markdown-it-mark)
==Marked text==
### [Footnotes](https://github.com/markdown-it/markdown-it-footnote)
Footnote 1 link[^first].
Footnote 2 link[^second].
Inline footnote^[Text of inline footnote] definition.
Duplicated footnote reference[^second].
[^first]: Footnote **can have markup**
and multiple paragraphs.
[^second]: Footnote text.
### [Definition lists](https://github.com/markdown-it/markdown-it-deflist)
Term 1
: Definition 1
with lazy continuation.
Term 2 with *inline markup*
: Definition 2
{ some code, part of Definition 2 }
Third paragraph of definition 2.
_Compact style:_
Term 1
~ Definition 1
Term 2
~ Definition 2a
~ Definition 2b
### [Abbreviations](https://github.com/markdown-it/markdown-it-abbr)
This is HTML abbreviation example.
It converts "HTML", but keep intact partial entries like "xxxHTMLyyy" and so on.
*[HTML]: Hyper Text Markup Language
### [Custom containers](https://github.com/markdown-it/markdown-it-container)
::: warning
*here be dragons*
:::
`,
},
];
class DemoMarkdown extends PolymerElement {
static get template() {
return html`
<demo-cards configs="[[_configs]]"></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
};
}
}
customElements.define("demo-hui-markdown-card", DemoMarkdown);

View File

@@ -0,0 +1,105 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import getEntity from "../data/entity";
import provideHass from "../data/provide_hass";
import "../components/demo-cards";
const ENTITIES = [
getEntity("media_player", "bedroom", "playing", {
media_content_type: "movie",
media_title: "Epic sax guy 10 hours",
app_name: "YouTube",
supported_features: 32,
}),
getEntity("media_player", "family_room", "paused", {
media_content_type: "music",
media_title: "I Wanna Be A Hippy (Flamman & Abraxas Radio Mix)",
media_artist: "Technohead",
supported_features: 16417,
}),
getEntity("media_player", "family_room_no_play", "paused", {
media_content_type: "movie",
media_title: "Epic sax guy 10 hours",
app_name: "YouTube",
supported_features: 33,
}),
getEntity("media_player", "living_room", "playing", {
media_content_type: "tvshow",
media_title: "Chapter 1",
media_series_title: "House of Cards",
app_name: "Netflix",
supported_features: 1,
}),
getEntity("media_player", "lounge_room", "idle", {
media_content_type: "music",
media_title: "I Wanna Be A Hippy (Flamman & Abraxas Radio Mix)",
media_artist: "Technohead",
supported_features: 1,
}),
getEntity("media_player", "theater", "off", {
media_content_type: "movie",
media_title: "Epic sax guy 10 hours",
app_name: "YouTube",
supported_features: 33,
}),
getEntity("media_player", "android_cast", "playing", {
media_title: "Android Screen Casting",
app_name: "Screen Mirroring",
supported_features: 21437,
}),
];
const CONFIGS = [
{
heading: "Media Players",
config: `
- type: entities
entities:
- entity: media_player.bedroom
name: Skip, no pause
- entity: media_player.family_room
name: Paused, music
- entity: media_player.family_room_no_play
name: Paused, no play
- entity: media_player.living_room
name: Pause, No skip, tvshow
- entity: media_player.android_cast
name: Screen casting
- entity: media_player.lounge_room
name: Chromcast Idle
- entity: media_player.theater
name: 'Player Off'
`,
},
];
class DemoHuiMediaPlayerRows extends PolymerElement {
static get template() {
return html`
<demo-cards
id="demos"
hass="[[hass]]"
configs="[[_configs]]"
></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
hass: Object,
};
}
ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
}
}
customElements.define("demo-hui-media-player-rows", DemoHuiMediaPlayerRows);

View File

@@ -0,0 +1,103 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import getEntity from "../data/entity";
import provideHass from "../data/provide_hass";
import "../components/demo-cards";
const ENTITIES = [
getEntity("light", "bed_light", "on", {
friendly_name: "Bed Light",
}),
getEntity("group", "all_lights", "on", {
entity_id: ["light.bed_light"],
order: 8,
friendly_name: "All Lights",
}),
getEntity("camera", "demo_camera", "idle", {
access_token:
"2f5bb163fb91cd8770a9494fa5e7eab172d8d34f4aba806eb6b59411b8c720b8",
friendly_name: "Demo camera",
entity_picture:
"/api/camera_proxy/camera.demo_camera?token=2f5bb163fb91cd8770a9494fa5e7eab172d8d34f4aba806eb6b59411b8c720b8",
}),
getEntity("binary_sensor", "movement_backyard", "on", {
friendly_name: "Movement Backyard",
device_class: "motion",
}),
];
const CONFIGS = [
{
heading: "Card with few elements",
config: `
- type: picture-elements
image: /images/floorplan.png
elements:
- type: service-button
title: Lights Off
style:
top: 97%
left: 90%
padding: 0px
service: light.turn_off
service_data:
entity_id: group.all_lights
- type: icon
icon: mdi:cctv
entity: camera.demo_camera
style:
top: 12%
left: 6%
transform: rotate(-60deg) scaleX(-1)
--iron-icon-height: 30px
--iron-icon-width: 30px
--iron-icon-stroke-color: black
--iron-icon-fill-color: rgba(50, 50, 50, .75)
- type: image
entity: light.bed_light
tap_action: toggle
image: /images/light_bulb_off.png
state_image:
'on': /images/light_bulb_on.png
state_filter:
'on': brightness(130%) saturate(1.5) drop-shadow(0px 0px 10px gold)
'off': brightness(80%) saturate(0.8)
style:
top: 35%
left: 65%
width: 7%
padding: 50px 50px 100px 50px
- type: state-icon
entity: binary_sensor.movement_backyard
style:
top: 8%
left: 35%
`,
},
];
class DemoPicElements extends PolymerElement {
static get template() {
return html`
<demo-cards id="demos" configs="[[_configs]]"></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
};
}
ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
}
}
customElements.define("demo-hui-picture-elements-card", DemoPicElements);

View File

@@ -0,0 +1,85 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../components/demo-cards";
const CONFIGS = [
{
heading: "State on",
config: `
- type: picture-entity
image: /images/kitchen.png
entity: light.kitchen_lights
`,
},
{
heading: "State off",
config: `
- type: picture-entity
image: /images/bed.png
entity: light.bed_light
`,
},
{
heading: "Entity unavailable",
config: `
- type: picture-entity
image: /images/living_room.png
entity: light.non_existing
`,
},
{
heading: "Camera entity",
config: `
- type: picture-entity
entity: camera.demo_camera
`,
},
{
heading: "Hidden name",
config: `
- type: picture-entity
image: /images/kitchen.png
entity: light.kitchen_lights
show_name: false
`,
},
{
heading: "Hidden state",
config: `
- type: picture-entity
image: /images/kitchen.png
entity: light.kitchen_lights
show_state: false
`,
},
{
heading: "Both hidden",
config: `
- type: picture-entity
image: /images/kitchen.png
entity: light.kitchen_lights
show_name: false
show_state: false
`,
},
];
class DemoPicEntity extends PolymerElement {
static get template() {
return html`
<demo-cards configs="[[_configs]]"></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
};
}
}
customElements.define("demo-hui-picture-entity-card", DemoPicEntity);

View File

@@ -0,0 +1,105 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../components/demo-cards";
const CONFIGS = [
{
heading: "Title, dialog, toggle",
config: `
- type: picture-glance
image: /images/living_room.png
title: Living room
entities:
- switch.decorative_lights
- light.ceiling_lights
- binary_sensor.movement_backyard
- binary_sensor.basement_floor_wet
`,
},
{
heading: "Title, dialog, no toggle",
config: `
- type: picture-glance
image: /images/living_room.png
title: Living room
entities:
- binary_sensor.movement_backyard
- binary_sensor.basement_floor_wet
`,
},
{
heading: "Title, no dialog, toggle",
config: `
- type: picture-glance
image: /images/living_room.png
title: Living room
entities:
- switch.decorative_lights
- light.ceiling_lights
`,
},
{
heading: "No title, dialog, toggle",
config: `
- type: picture-glance
image: /images/living_room.png
entities:
- switch.decorative_lights
- light.ceiling_lights
- binary_sensor.movement_backyard
- binary_sensor.basement_floor_wet
`,
},
{
heading: "No title, dialog, no toggle",
config: `
- type: picture-glance
image: /images/living_room.png
entities:
- binary_sensor.movement_backyard
- binary_sensor.basement_floor_wet
`,
},
{
heading: "No title, no dialog, toggle",
config: `
- type: picture-glance
image: /images/living_room.png
entities:
- switch.decorative_lights
- light.ceiling_lights
`,
},
{
heading: "Custom icon",
config: `
- type: picture-glance
image: /images/living_room.png
title: Living room
entities:
- entity: switch.decorative_lights
icon: mdi:power
- binary_sensor.basement_floor_wet
`,
},
];
class DemoPicGlance extends PolymerElement {
static get template() {
return html`
<demo-cards configs="[[_configs]]"></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
};
}
}
customElements.define("demo-hui-picture-glance-card", DemoPicGlance);

View File

@@ -0,0 +1,52 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import provideHass from "../data/provide_hass";
import "../components/demo-cards";
const CONFIGS = [
{
heading: "List example",
config: `
- type: shopping-list
`,
},
{
heading: "List with title example",
config: `
- type: shopping-list
title: Shopping List
`,
},
];
class DemoShoppingListEntity extends PolymerElement {
static get template() {
return html`
<demo-cards id="demos" configs="[[_configs]]"></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
};
}
ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.mockAPI("shopping_list", () => [
{ name: "list", id: 1, complete: false },
{ name: "all", id: 2, complete: false },
{ name: "the", id: 3, complete: false },
{ name: "things", id: 4, complete: true },
]);
}
}
customElements.define("demo-hui-shopping-list-card", DemoShoppingListEntity);

View File

@@ -0,0 +1,114 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import getEntity from "../data/entity";
import provideHass from "../data/provide_hass";
import "../components/demo-cards";
const ENTITIES = [
getEntity("light", "kitchen_lights", "on", {
friendly_name: "Kitchen Lights",
}),
getEntity("device_tracker", "demo_paulus", "work", {
source_type: "gps",
latitude: 32.877105,
longitude: 117.232185,
gps_accuracy: 91,
battery: 71,
friendly_name: "Paulus",
}),
getEntity("device_tracker", "demo_anne_therese", "school", {
source_type: "gps",
latitude: 32.877105,
longitude: 117.232185,
gps_accuracy: 91,
battery: 71,
friendly_name: "Anne Therese",
}),
getEntity("device_tracker", "demo_home_boy", "home", {
source_type: "gps",
latitude: 32.877105,
longitude: 117.232185,
gps_accuracy: 91,
battery: 71,
friendly_name: "Home Boy",
}),
];
const CONFIGS = [
{
heading: "Vertical Stack",
config: `
- type: vertical-stack
cards:
- type: picture-entity
image: /images/kitchen.png
entity: light.kitchen_lights
- type: glance
entities:
- device_tracker.demo_anne_therese
- device_tracker.demo_home_boy
- device_tracker.demo_paulus
`,
},
{
heading: "Horizontal Stack",
config: `
- type: horizontal-stack
cards:
- type: picture-entity
image: /images/kitchen.png
entity: light.kitchen_lights
- type: glance
entities:
- device_tracker.demo_anne_therese
- device_tracker.demo_home_boy
- device_tracker.demo_paulus
`,
},
{
heading: "Combination of both",
config: `
- type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: picture-entity
image: /images/kitchen.png
entity: light.kitchen_lights
- type: glance
entities:
- device_tracker.demo_anne_therese
- device_tracker.demo_home_boy
- device_tracker.demo_paulus
- type: picture-entity
image: /images/bed.png
entity: light.bed_light
`,
},
];
class DemoStack extends PolymerElement {
static get template() {
return html`
<demo-cards id="demos" configs="[[_configs]]"></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
};
}
ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
}
}
customElements.define("demo-hui-stack-card", DemoStack);

View File

@@ -0,0 +1,85 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import getEntity from "../data/entity";
import provideHass from "../data/provide_hass";
import "../components/demo-cards";
const ENTITIES = [
getEntity("climate", "ecobee", "auto", {
current_temperature: 73,
min_temp: 45,
max_temp: 95,
temperature: null,
target_temp_high: 75,
target_temp_low: 70,
fan_mode: "Auto Low",
fan_list: ["On Low", "On High", "Auto Low", "Auto High", "Off"],
operation_mode: "auto",
operation_list: ["heat", "cool", "auto", "off"],
hold_mode: "home",
swing_mode: "Auto",
swing_list: ["Auto", "1", "2", "3", "Off"],
friendly_name: "Ecobee",
supported_features: 1014,
}),
getEntity("climate", "nest", "heat", {
current_temperature: 17,
min_temp: 15,
max_temp: 25,
temperature: 19,
fan_mode: "Auto Low",
fan_list: ["On Low", "On High", "Auto Low", "Auto High", "Off"],
operation_mode: "heat",
operation_list: ["heat", "cool", "auto", "off"],
hold_mode: "home",
swing_mode: "Auto",
swing_list: ["Auto", "1", "2", "3", "Off"],
friendly_name: "Nest",
supported_features: 1014,
}),
];
const CONFIGS = [
{
heading: "Range example",
config: `
- type: thermostat
entity: climate.ecobee
- type: thermostat
entity: climate.nest
`,
},
{
heading: "Single temp example",
config: `
- type: thermostat
entity: climate.nest
`,
},
];
class DemoThermostatEntity extends PolymerElement {
static get template() {
return html`
<demo-cards id="demos" configs="[[_configs]]"></demo-cards>
`;
}
static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
};
}
ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
}
}
customElements.define("demo-hui-thermostat-card", DemoThermostatEntity);

View File

@@ -0,0 +1,59 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../../../src/dialogs/more-info/controls/more-info-content";
import "../../../src/components/ha-card";
import getEntity from "../data/entity";
import provideHass from "../data/provide_hass";
import "../components/demo-more-infos";
/* eslint-disable no-unused-vars */
const SUPPORT_BRIGHTNESS = 1;
const SUPPORT_COLOR_TEMP = 2;
const SUPPORT_EFFECT = 4;
const SUPPORT_FLASH = 8;
const SUPPORT_COLOR = 16;
const SUPPORT_TRANSITION = 32;
const SUPPORT_WHITE_VALUE = 128;
const ENTITIES = [
getEntity("light", "bed_light", "on", {
friendly_name: "Basic Light",
}),
getEntity("light", "kitchen_light", "on", {
friendly_name: "Brightness Light",
brightness: 80,
supported_features: SUPPORT_BRIGHTNESS,
}),
];
class DemoMoreInfoLight extends PolymerElement {
static get template() {
return html`
<demo-more-infos
hass="[[hass]]"
entities="[[_entities]]"
></demo-more-infos>
`;
}
static get properties() {
return {
_entities: {
type: Array,
value: ENTITIES.map((ent) => ent.entityId),
},
};
}
ready() {
super.ready();
const hass = provideHass(this);
hass.addEntities(ENTITIES);
}
}
customElements.define("demo-more-info-light", DemoMoreInfoLight);

12
gallery/src/entrypoint.js Normal file
View File

@@ -0,0 +1,12 @@
import "@polymer/paper-styles/typography";
import "@polymer/polymer/lib/elements/dom-if";
import "@polymer/polymer/lib/elements/dom-repeat";
import "../../src/resources/hass-icons";
import "../../src/resources/ha-style";
import "../../src/resources/roboto";
import "../../src/components/ha-iconset-svg";
import "./ha-gallery";
document.body.appendChild(document.createElement("ha-gallery"));

204
gallery/src/ha-gallery.js Normal file
View File

@@ -0,0 +1,204 @@
import "@polymer/app-layout/app-header-layout/app-header-layout";
import "@polymer/app-layout/app-header/app-header";
import "@polymer/app-layout/app-toolbar/app-toolbar";
import "@polymer/iron-icon/iron-icon";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-item/paper-item";
import "@polymer/paper-item/paper-item-body";
import "@polymer/paper-icon-button/paper-icon-button";
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../../src/managers/notification-manager";
const DEMOS = require.context("./demos", true, /^(.*\.(js$))[^.]*$/im);
const fixPath = (path) => path.substr(2, path.length - 5);
class HaGallery extends PolymerElement {
static get template() {
return html`
<style include="iron-positioning ha-style">
:host {
-ms-user-select: initial;
-webkit-user-select: initial;
-moz-user-select: initial;
}
app-header-layout {
min-height: 100vh;
}
paper-icon-button.invisible {
visibility: hidden;
}
.pickers {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: start;
}
.pickers paper-card {
width: 400px;
display: block;
margin: 16px 8px;
}
.pickers paper-card:last-child {
margin-bottom: 16px;
}
.intro {
margin: -1em 0;
}
p a {
color: var(--primary-color);
}
a paper-item {
color: var(--primary-text-color);
text-decoration: none;
}
</style>
<app-header-layout>
<app-header slot="header" fixed>
<app-toolbar>
<paper-icon-button
icon="hass:arrow-left"
on-click="_backTapped"
class$='[[_computeHeaderButtonClass(_demo)]]'
></paper-icon-button>
<div main-title>[[_withDefault(_demo, "Home Assistant Gallery")]]</div>
</app-toolbar>
</app-header>
<div class='content'>
<div id='demo'></div>
<template is='dom-if' if='[[!_demo]]'>
<div class='pickers'>
<paper-card heading="Lovelace card demos">
<div class='card-content intro'>
<p>
Lovelace has many different cards. Each card allows the user to tell a different story about what is going on in their house. These cards are very customizable, as no household is the same.
</p>
<p>
This gallery helps our developers and designers to see all the different states that each card can be in.
</p>
<p>
Check <a href='https://www.home-assistant.io/lovelace'>the official website</a> for instructions on how to get started with Lovelace.</a>.
</p>
</div>
<template is='dom-repeat' items='[[_lovelaceDemos]]'>
<a href='#[[item]]'>
<paper-item>
<paper-item-body>{{ item }}</paper-item-body>
<iron-icon icon="hass:chevron-right"></iron-icon>
</paper-item>
</a>
</template>
</paper-card>
<paper-card heading="More Info demos">
<div class='card-content intro'>
<p>
More info screens show up when an entity is clicked.
</p>
</div>
<template is='dom-repeat' items='[[_moreInfoDemos]]'>
<a href='#[[item]]'>
<paper-item>
<paper-item-body>{{ item }}</paper-item-body>
<iron-icon icon="hass:chevron-right"></iron-icon>
</paper-item>
</a>
</template>
</paper-card>
</div>
</template>
</div>
</app-header-layout>
<notification-manager id='notifications'></notification-manager>
`;
}
static get properties() {
return {
_demo: {
type: String,
value: document.location.hash.substr(1),
observer: "_demoChanged",
},
_demos: {
type: Array,
value: DEMOS.keys().map(fixPath),
},
_lovelaceDemos: {
type: Array,
computed: "_computeLovelace(_demos)",
},
_moreInfoDemos: {
type: Array,
computed: "_computeMoreInfos(_demos)",
},
};
}
ready() {
super.ready();
this.addEventListener("show-notification", (ev) =>
this.$.notifications.showDialog({ message: ev.detail.message })
);
this.addEventListener("hass-more-info", (ev) => {
if (ev.detail.entityId) {
this.$.notifications.showDialog({
message: `Showing more info for ${ev.detail.entityId}`,
});
}
});
window.addEventListener("hashchange", () => {
this._demo = document.location.hash.substr(1);
});
}
_withDefault(value, def) {
return value || def;
}
_demoChanged(demo) {
const root = this.$.demo;
while (root.lastChild) root.removeChild(root.lastChild);
if (demo) {
DEMOS(`./${demo}.js`);
const el = document.createElement(demo);
root.appendChild(el);
}
}
_computeHeaderButtonClass(demo) {
return demo ? "" : "invisible";
}
_backTapped() {
document.location.hash = "";
}
_computeLovelace(demos) {
return demos.filter((demo) => demo.includes("hui"));
}
_computeMoreInfos(demos) {
return demos.filter((demo) => demo.includes("more-info"));
}
}
customElements.define("ha-gallery", HaGallery);

75
gallery/webpack.config.js Normal file
View File

@@ -0,0 +1,75 @@
const path = require("path");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const { babelLoaderConfig } = require("../config/babel.js");
const isProd = process.env.NODE_ENV === "production";
const chunkFilename = isProd ? "chunk.[chunkhash].js" : "[name].chunk.js";
const buildPath = path.resolve(__dirname, "dist");
const publicPath = isProd ? "./" : "http://localhost:8080/";
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: true }),
{
test: /\.css$/,
use: "raw-loader",
},
{
test: /\.(html)$/,
use: {
loader: "html-loader",
options: {
exportAsEs6Default: true,
},
},
},
],
},
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/@polymer/font-roboto-local/fonts",
to: "static/fonts",
},
{
from: "../node_modules/leaflet/dist/images",
to: "static/images/leaflet/",
},
]),
isProd &&
new UglifyJsPlugin({
extractComments: true,
sourceMap: true,
uglifyOptions: {
// Disabling because it broke output
mangle: false,
},
}),
].filter(Boolean),
resolve: {
extensions: [".ts", ".js", ".json"],
},
output: {
filename: "[name].js",
chunkFilename: chunkFilename,
path: buildPath,
publicPath,
},
devServer: {
contentBase: "./public",
},
};

View File

@@ -1,5 +1,7 @@
{
"rules": {
"no-restricted-syntax": 0
"import/no-extraneous-dependencies": 0,
"no-restricted-syntax": 0,
"no-console": 0
}
}

View File

@@ -1,58 +0,0 @@
const {
Analyzer,
FSUrlLoader
} = require('polymer-analyzer');
const Bundler = require('polymer-bundler').Bundler;
const parse5 = require('parse5');
const { streamFromString } = require('./stream');
// Bundle an HTML file and convert it to a stream
async function bundledStreamFromHTML(path, bundlerOptions = {}) {
const bundler = new Bundler(bundlerOptions);
const manifest = await bundler.generateManifest([path]);
const result = await bundler.bundle(manifest);
return streamFromString(
path, parse5.serialize(result.documents.get(path).ast));
}
async function analyze(root, paths) {
const analyzer = new Analyzer({
urlLoader: new FSUrlLoader(root),
});
return analyzer.analyze(paths);
}
async function findDependencies(root, element) {
const deps = new Set();
async function resolve(files) {
const analysis = await analyze(root, files);
const toResolve = [];
for (const file of files) {
const doc = analysis.getDocument(file);
for (const importEl of doc.getFeatures({ kind: 'import' })) {
const url = importEl.url;
if (!deps.has(url)) {
deps.add(url);
toResolve.push(url);
}
}
}
if (toResolve.length > 0) {
return resolve(toResolve);
}
}
await resolve([element]);
return deps;
}
module.exports = {
bundledStreamFromHTML,
findDependencies,
};

View File

@@ -1,33 +0,0 @@
/**
* Polymer build strategy to strip imports, even if explictely imported
*/
module.exports.stripImportsStrategy = function (urls) {
return (bundles) => {
for (const bundle of bundles) {
for (const url of urls) {
bundle.stripImports.add(url);
}
}
return bundles;
};
};
/**
* Polymer build strategy to strip everything but the entrypoints
* for bundles that match a specific entry point.
*/
module.exports.stripAllButEntrypointStrategy = function (entryPoint) {
return (bundles) => {
for (const bundle of bundles) {
if (bundle.entrypoints.size === 1 &&
bundle.entrypoints.has(entryPoint)) {
for (const file of bundle.files) {
if (!bundle.entrypoints.has(file)) {
bundle.stripImports.add(file);
}
}
}
}
return bundles;
};
};

View File

@@ -1,21 +0,0 @@
const stream = require('stream');
const gutil = require('gulp-util');
function streamFromString(filename, string) {
var src = stream.Readable({ objectMode: true });
src._read = function () {
this.push(new gutil.File({
cwd: '',
base: '',
path: filename,
contents: new Buffer(string)
}));
this.push(null);
};
return src;
}
module.exports = {
streamFromString,
};

View File

@@ -1,27 +0,0 @@
const gulpif = require('gulp-if');
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');
const { gulp: cssSlam } = require('css-slam');
const htmlMinifier = require('gulp-html-minifier');
const { HtmlSplitter } = require('polymer-build');
module.exports.minifyStream = function (stream) {
const sourcesHtmlSplitter = new HtmlSplitter();
return stream
.pipe(sourcesHtmlSplitter.split())
.pipe(gulpif(/[^app]\.js$/, babel({
sourceType: 'script',
presets: [
['es2015', { modules: false }]
]
})))
.pipe(gulpif(/\.js$/, uglify({ sourceMap: false })))
.pipe(gulpif(/\.css$/, cssSlam()))
.pipe(gulpif(/\.html$/, cssSlam()))
.pipe(gulpif(/\.html$/, htmlMinifier({
collapseWhitespace: true,
removeComments: true
})))
.pipe(sourcesHtmlSplitter.rejoin());
};

View File

@@ -1,7 +1,8 @@
var path = require('path');
var path = require("path");
module.exports = {
static_dir: path.resolve(__dirname, '../..'),
polymer_dir: path.resolve(__dirname, '..'),
build_dir: path.resolve(__dirname, '../build'),
polymer_dir: path.resolve(__dirname, ".."),
build_dir: path.resolve(__dirname, "../build"),
output: path.resolve(__dirname, "../hass_frontend"),
output_es5: path.resolve(__dirname, "../hass_frontend_es5"),
};

View File

@@ -1,77 +0,0 @@
self.addEventListener("push", function(event) {
var data;
if (event.data) {
data = event.data.json();
event.waitUntil(
self.registration.showNotification(data.title, data)
.then(function(notification){
firePushCallback({
type: "received",
tag: data.tag,
data: data.data
}, data.data.jwt);
})
);
}
});
self.addEventListener('notificationclick', function(event) {
var url;
notificationEventCallback('clicked', event);
event.notification.close();
if (!event.notification.data || !event.notification.data.url) {
return;
}
url = event.notification.data.url;
if (!url) return;
event.waitUntil(
clients.matchAll({
type: 'window',
})
.then(function (windowClients) {
var i;
var client;
for (i = 0; i < windowClients.length; i++) {
client = windowClients[i];
if (client.url === url && 'focus' in client) {
return client.focus();
}
}
if (clients.openWindow) {
return clients.openWindow(url);
}
return undefined;
})
);
});
self.addEventListener('notificationclose', function(event) {
notificationEventCallback('closed', event);
});
function notificationEventCallback(event_type, event){
firePushCallback({
action: event.action,
data: event.notification.data,
tag: event.notification.tag,
type: event_type
}, event.notification.data.jwt);
}
function firePushCallback(payload, jwt){
// Don't send the JWT in the payload.data
delete payload.data.jwt;
// If payload.data is empty then just remove the entire payload.data object.
if (Object.keys(payload.data).length === 0 && payload.data.constructor === Object) {
delete payload.data;
}
fetch('/api/notify.html5/callback', {
method: 'POST',
headers: new Headers({'Content-Type': 'application/json',
'Authorization': 'Bearer '+jwt}),
body: JSON.stringify(payload)
});
}

View File

@@ -1,58 +0,0 @@
const gulp = require('gulp');
const filter = require('gulp-filter');
const { PolymerProject, } = require('polymer-build');
const {
composeStrategies,
generateShellMergeStrategy,
} = require('polymer-bundler');
const mergeStream = require('merge-stream');
const rename = require('gulp-rename');
const polymerConfig = require('../../polymer');
const minifyStream = require('../common/transform').minifyStream;
const {
stripImportsStrategy,
stripAllButEntrypointStrategy
} = require('../common/strategy');
function renamePanel(path) {
// Rename panels to be panels/* and not their subdir
if (path.basename.substr(0, 9) === 'ha-panel-' && path.extname === '.html') {
path.dirname = 'panels/';
}
// Rename frontend
if (path.dirname === 'src' && path.basename === 'home-assistant' &&
path.extname === '.html') {
path.dirname = '';
path.basename = 'frontend';
}
}
gulp.task('build', ['ru_all', 'build-translations'], () => {
const strategy = composeStrategies([
generateShellMergeStrategy(polymerConfig.shell),
stripImportsStrategy([
'bower_components/font-roboto/roboto.html',
'bower_components/paper-styles/color.html',
]),
stripAllButEntrypointStrategy('panels/hassio/ha-panel-hassio.html')
]);
const project = new PolymerProject(polymerConfig);
return mergeStream(minifyStream(project.sources()),
minifyStream(project.dependencies()))
.pipe(project.bundler({
strategy,
strip: true,
sourcemaps: false,
stripComments: true,
inlineScripts: true,
inlineCss: true,
implicitStrip: true,
}))
.pipe(rename(renamePanel))
.pipe(filter(['**', '!src/entrypoint.html']))
.pipe(gulp.dest('build/'));
});

View File

@@ -1,6 +0,0 @@
const del = require('del');
const gulp = require('gulp');
gulp.task('clean', () => {
return del(['build', 'build-temp']);
});

View File

@@ -1,9 +0,0 @@
const gulp = require('gulp');
const runSequence = require('run-sequence');
gulp.task('default', () => {
return runSequence.use(gulp)(
'clean',
'build'
);
});

114
gulp/tasks/gen-icons.js Normal file
View File

@@ -0,0 +1,114 @@
const gulp = require("gulp");
const path = require("path");
const fs = require("fs");
const config = require("../config");
const ICON_PACKAGE_PATH = path.resolve(
__dirname,
"../../node_modules/@mdi/svg/"
);
const META_PATH = path.resolve(ICON_PACKAGE_PATH, "meta.json");
const ICON_PATH = path.resolve(ICON_PACKAGE_PATH, "svg");
const OUTPUT_DIR = path.resolve(__dirname, "../../build");
const MDI_OUTPUT_PATH = path.resolve(OUTPUT_DIR, "mdi.html");
const HASS_OUTPUT_PATH = path.resolve(OUTPUT_DIR, "hass-icons.html");
const BUILT_IN_PANEL_ICONS = [
"calendar", // Calendar
"settings", // Config
"home-assistant", // Hass.io
"poll-box", // History panel
"format-list-bulleted-type", // Logbook
"mailbox", // Mailbox
"account-location", // Map
"cart", // Shopping List
];
// Given an icon name, load the SVG file
function loadIcon(name) {
const iconPath = path.resolve(ICON_PATH, `${name}.svg`);
try {
return fs.readFileSync(iconPath, "utf-8");
} catch (err) {
return null;
}
}
// Given an SVG file, convert it to an iron-iconset-svg definition
function transformXMLtoPolymer(name, xml) {
const start = xml.indexOf("><path") + 1;
const end = xml.length - start - 6;
const path = xml.substr(start, end);
return `<g id="${name}">${path}</g>`;
}
// Given an iconset name and icon names, generate a polymer iconset
function generateIconset(name, iconNames) {
const iconDefs = iconNames
.map((name) => {
const iconDef = loadIcon(name);
if (!iconDef) {
throw new Error(`Unknown icon referenced: ${name}`);
}
return transformXMLtoPolymer(name, iconDef);
})
.join("");
return `<ha-iconset-svg name="${name}" 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);
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);
for (let i = 0; i < files.length; i++) {
const filename = path.join(startPath, files[i]);
const stat = fs.lstatSync(filename);
if (stat.isDirectory()) {
mapFiles(filename, filter, mapFunc);
} else if (filename.indexOf(filter) >= 0) {
mapFunc(filename);
}
}
}
// Find all icons used by the project.
function findIcons(path, iconsetName) {
const iconRegex = new RegExp(`${iconsetName}:[\\w-]+`, "g");
const icons = new Set();
function processFile(filename) {
const content = fs.readFileSync(filename);
let match;
// eslint-disable-next-line
while ((match = iconRegex.exec(content))) {
// strip off "hass:" and add to set
icons.add(match[0].substr(iconsetName.length + 1));
}
}
mapFiles(path, ".js", processFile);
mapFiles(path, ".ts", processFile);
return Array.from(icons);
}
function genHassIcons() {
const iconNames = findIcons("./src", "hass").concat(BUILT_IN_PANEL_ICONS);
fs.existsSync(OUTPUT_DIR) || fs.mkdirSync(OUTPUT_DIR);
fs.writeFileSync(HASS_OUTPUT_PATH, generateIconset("hass", iconNames));
}
gulp.task("gen-icons-mdi", () => genMDIIcons());
gulp.task("gen-icons-hass", () => genHassIcons());
gulp.task("gen-icons", ["gen-icons-hass", "gen-icons-mdi"], () => {});
module.exports = {
findIcons,
generateIconset,
};

View File

@@ -1,117 +0,0 @@
/*
Generate a caching service worker for HA
Will be called as part of build_frontend.
Expects home-assistant-polymer repo as submodule of HA repo.
Creates a caching service worker based on the CURRENT content of HA repo.
Output service worker to build/service_worker.js
TODO:
- Use gulp streams
- Fix minifying the stream
*/
var gulp = require('gulp');
var crypto = require('crypto');
var file = require('gulp-file');
var fs = require('fs');
var path = require('path');
var swPrecache = require('sw-precache');
var uglifyJS = require('uglify-js');
const config = require('../config');
const DEV = !!JSON.parse(process.env.BUILD_DEV || 'true');
var rootDir = 'hass_frontend';
var panelDir = path.resolve(rootDir, 'panels');
var dynamicUrlToDependencies = {};
var staticFingerprinted = [
'frontend.html',
'mdi.html',
'core.js',
'compatibility.js',
'translations/en.json',
];
// These panels will always be registered inside HA and thus can
// be safely assumed to be able to preload.
var panelsFingerprinted = [
'dev-event', 'dev-info', 'dev-service', 'dev-state', 'dev-template',
'dev-mqtt', 'kiosk',
];
function md5(filename) {
return crypto.createHash('md5')
.update(fs.readFileSync(filename)).digest('hex');
}
gulp.task('gen-service-worker', () => {
var genPromise = null;
if (DEV) {
var devBase = 'console.warn("Service worker caching disabled in development")';
genPromise = Promise.resolve(devBase);
} else {
// Create fingerprinted versions of our dependencies.
staticFingerprinted.forEach(fn => {
var parts = path.parse(fn);
var base = parts.dir.length > 0 ? parts.dir + '/' + parts.name : parts.name;
var hash = md5(rootDir + '/' + base + parts.ext);
var url = '/static/' + base + '-' + hash + parts.ext;
var fpath = rootDir + '/' + base + parts.ext;
dynamicUrlToDependencies[url] = [fpath];
});
panelsFingerprinted.forEach(panel => {
var fpath = panelDir + '/ha-panel-' + panel + '.html';
var hash = md5(fpath);
var url = '/static/panels/ha-panel-' + panel + '-' + hash + '.html';
dynamicUrlToDependencies[url] = [fpath];
});
var fallbackList = '(?!(?:static|api|local|service_worker.js|manifest.json))';
var options = {
navigateFallback: '/',
navigateFallbackWhitelist: [RegExp('^(?:' + fallbackList + '.)*$')],
dynamicUrlToDependencies: dynamicUrlToDependencies,
staticFileGlobs: [
rootDir + '/icons/favicon.ico',
rootDir + '/icons/favicon-192x192.png',
rootDir + '/webcomponents-lite.min.js',
rootDir + '/fonts/roboto/Roboto-Light.ttf',
rootDir + '/fonts/roboto/Roboto-Medium.ttf',
rootDir + '/fonts/roboto/Roboto-Regular.ttf',
rootDir + '/fonts/roboto/Roboto-Bold.ttf',
rootDir + '/images/card_media_player_bg.png',
],
runtimeCaching: [{
urlPattern: /\/static\/translations\//,
handler: 'cacheFirst',
}, {
urlPattern: RegExp('^[^/]*/' + fallbackList + '.'),
handler: 'fastest',
}],
stripPrefix: 'hass_frontend',
replacePrefix: 'static',
verbose: true,
// Allow our users to refresh to get latest version.
clientsClaim: true,
};
genPromise = swPrecache.generate(options);
}
var swHass = fs.readFileSync(path.resolve(__dirname, '../service-worker.js.tmpl'), 'UTF-8');
// Fix this
// if (!DEV) {
// genPromise = genPromise.then(
// swString => uglifyJS.minify(swString, { fromString: true }).code);
// }
return genPromise.then(swString => swString + '\n' + swHass)
.then(swString => file('service_worker.js', swString)
.pipe(gulp.dest(config.build_dir)));
});

View File

@@ -1,47 +0,0 @@
var gulp = require('gulp');
const rename = require('gulp-rename');
const {
stripImportsStrategy,
} = require('../common/strategy');
const minifyStream = require('../common/transform').minifyStream;
const {
bundledStreamFromHTML,
findDependencies
} = require('../common/html');
const { polymer_dir } = require('../config');
const DEPS_TO_STRIP = [
'bower_components/font-roboto/roboto.html',
'bower_components/paper-styles/color.html',
'bower_components/iron-meta/iron-meta.html',
];
const DEPS_TO_STRIP_RECURSIVELY = [
'bower_components/polymer/polymer.html',
];
gulp.task(
'hassio-panel',
async () => {
const toStrip = [...DEPS_TO_STRIP];
for (let dep of DEPS_TO_STRIP_RECURSIVELY) {
toStrip.push(dep);
const deps = await findDependencies(polymer_dir, dep);
for (const importUrl of deps) {
toStrip.push(importUrl);
}
}
const stream = await bundledStreamFromHTML(
'panels/hassio/hassio-main.html', {
strategy: stripImportsStrategy(toStrip)
}
);
return minifyStream(stream)
.pipe(rename('hassio-main.html'))
.pipe(gulp.dest('build-temp/'));
}
);

View File

@@ -1,30 +0,0 @@
const gulp = require('gulp');
const rollupEach = require('gulp-rollup-each');
const rollupConfig = require('../../rollup.config');
gulp.task('run_rollup', () => {
return gulp.src([
'js/core.js',
'js/compatibility.js',
'js/automation-editor/automation-editor.js',
'js/script-editor/script-editor.js',
'demo_data/demo_data.js',
])
.pipe(rollupEach(rollupConfig, rollupConfig))
.pipe(gulp.dest('build-temp'));
});
gulp.task('ru_all', ['run_rollup'], () => {
gulp.src([
'build-temp/core.js',
'build-temp/compatibility.js',
])
.pipe(gulp.dest('build/'));
});
gulp.task('watch_ru_all', ['ru_all'], () => {
gulp.watch([
'js/**/*.js',
'demo_data/**/*.js'
], ['ru_all']);
});

View File

@@ -1,110 +1,297 @@
const path = require('path');
const gulp = require('gulp');
const foreach = require('gulp-foreach');
const hash = require('gulp-hash');
const insert = require('gulp-insert');
const merge = require('gulp-merge-json');
const minify = require('gulp-jsonminify');
const rename = require('gulp-rename');
const transform = require('gulp-json-transform');
const path = require("path");
const gulp = require("gulp");
const foreach = require("gulp-foreach");
const hash = require("gulp-hash");
const insert = require("gulp-insert");
const merge = require("gulp-merge-json");
const minify = require("gulp-jsonminify");
const rename = require("gulp-rename");
const transform = require("gulp-json-transform");
const inDir = 'translations'
const outDir = 'build/translations';
const inDir = "translations";
const workDir = "build-translations";
const fullDir = workDir + "/full";
const coreDir = workDir + "/core";
const outDir = workDir + "/output";
// Panel translations which should be split from the core translations. These
// should mirror the fragment definitions in polymer.json, so that we load
// additional resources at equivalent points.
const TRANSLATION_FRAGMENTS = [
"config",
"history",
"logbook",
"mailbox",
"profile",
"shopping-list",
"page-authorize",
"page-onboarding",
];
const tasks = [];
function recursive_flatten (prefix, data) {
var output = {};
Object.keys(data).forEach(function (key) {
if (typeof(data[key]) === 'object') {
output = Object.assign({}, output, recursive_flatten(key + '.', data[key]));
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])
);
} else {
output[prefix + key] = data[key];
}
});
return output
return output;
}
function flatten (data) {
return recursive_flatten('', data);
function flatten(data) {
return recursiveFlatten("", data);
}
var taskName = 'build-translation-native-names';
gulp.task(taskName, function() {
return gulp.src(inDir + '/*.json')
.pipe(transform(function(data, file) {
// Look up the native name for each language and generate a json
// object with all available languages and native names
const lang = path.basename(file.relative, '.json');
return {[lang]: {nativeName: data.language[lang]}};
}))
.pipe(merge({
fileName: 'translationNativeNames.json',
}))
.pipe(gulp.dest('build-temp'));
});
tasks.push(taskName);
var taskName = 'build-merged-translations';
gulp.task(taskName, function () {
return gulp.src(inDir + '/*.json')
.pipe(foreach(function(stream, file) {
// For each language generate a merged json file. It begins with en.json as
// a failsafe for untranslated strings, and merges all parent tags into one
// file for each specific subtag
const tr = path.basename(file.history[0], '.json');
const subtags = tr.split('-');
const src = [inDir + '/en.json']; // Start with en as a fallback for missing translations
for (i = 1; i <= subtags.length; i++) {
const lang = subtags.slice(0, i).join('-');
src.push(inDir + '/' + lang + '.json');
function emptyFilter(data) {
const newData = {};
Object.keys(data).forEach((key) => {
if (data[key]) {
if (typeof data[key] === "object") {
newData[key] = emptyFilter(data[key]);
} else {
newData[key] = data[key];
}
return gulp.src(src)
.pipe(merge({
fileName: tr + '.json',
}))
.pipe(transform(function(data, file) {
// Polymer.AppLocalizeBehavior requires flattened json
return flatten(data);
}))
.pipe(minify())
.pipe(gulp.dest(outDir));
}));
});
tasks.push(taskName);
}
});
return newData;
}
var taskName = 'build-translation-fingerprints';
gulp.task(taskName, ['build-merged-translations'], function() {
return gulp.src(outDir + '/*.json')
.pipe(rename({
extname: "",
}))
.pipe(hash({
algorithm: 'md5',
hashLength: 32,
template: '<%= name %>-<%= hash %>.json',
}))
.pipe(hash.manifest('translationFingerprints.json'))
.pipe(transform(function(data, file) {
Object.keys(data).map(function(key, index) {
data[key] = {fingerprint: data[key]};
/**
* Replace Lokalise key placeholders with their actual values.
*
* We duplicate the behavior of Lokalise here so that placeholders can
* be included in src/translations/en.json, but still be usable while
* developing locally.
*
* @link https://docs.lokalise.co/article/KO5SZWLLsy-key-referencing
*/
const re_key_reference = /\[%key:([^%]+)%\]/;
function lokalise_transform(data, original) {
const output = {};
Object.entries(data).forEach(([key, value]) => {
if (value instanceof Object) {
output[key] = lokalise_transform(value, original);
} 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`
);
}
return replace;
});
return data;
}))
.pipe(gulp.dest('build-temp'));
}
});
return output;
}
/**
* This task will build a master translation file, to be used as the base for
* all languages. This starts with src/translations/en.json, and replaces all
* Lokalise key placeholders with their target values. Under normal circumstances,
* this will be the same as translations/en.json However, we build it here to
* facilitate both making changes in development mode, and to ensure that the
* project is buildable immediately after merging new translation keys, since
* the Lokalise update to translations/en.json will not happen immediately.
*/
let taskName = "build-master-translation";
gulp.task(taskName, function() {
return gulp
.src("src/translations/en.json")
.pipe(
transform(function(data, file) {
return lokalise_transform(data, data);
})
)
.pipe(rename("translationMaster.json"))
.pipe(gulp.dest(workDir));
});
tasks.push(taskName);
var taskName = 'build-translations';
gulp.task(taskName, ['build-translation-fingerprints', 'build-translation-native-names'], function() {
return gulp.src([
'build-temp/translationFingerprints.json',
'build-temp/translationNativeNames.json',
taskName = "build-merged-translations";
gulp.task(taskName, ["build-master-translation"], function() {
return gulp.src(inDir + "/*.json").pipe(
foreach(function(stream, file) {
// For each language generate a merged json file. It begins with the master
// translation as a failsafe for untranslated strings, and merges all parent
// tags into one file for each specific subtag
//
// TODO: This is a naive interpretation of BCP47 that should be improved.
// Will be OK for now as long as we don't have anything more complicated
// than a base translation + region.
const tr = path.basename(file.history[0], ".json");
const subtags = tr.split("-");
const src = [workDir + "/translationMaster.json"];
for (let i = 1; i <= subtags.length; i++) {
const lang = subtags.slice(0, i).join("-");
src.push(inDir + "/" + lang + ".json");
}
return gulp
.src(src)
.pipe(transform((data) => emptyFilter(data)))
.pipe(
merge({
fileName: tr + ".json",
})
)
.pipe(gulp.dest(fullDir));
})
);
});
tasks.push(taskName);
const splitTasks = [];
TRANSLATION_FRAGMENTS.forEach((fragment) => {
taskName = "build-translation-fragment-" + fragment;
gulp.task(taskName, ["build-merged-translations"], function() {
// Return only the translations for this fragment.
return gulp
.src(fullDir + "/*.json")
.pipe(
transform((data) => ({
ui: {
panel: {
[fragment]: data.ui.panel[fragment],
},
},
}))
)
.pipe(gulp.dest(workDir + "/" + fragment));
});
tasks.push(taskName);
splitTasks.push(taskName);
});
taskName = "build-translation-core";
gulp.task(taskName, ["build-merged-translations"], function() {
// Remove the fragment translations from the core translation.
return gulp
.src(fullDir + "/*.json")
.pipe(
transform((data) => {
TRANSLATION_FRAGMENTS.forEach((fragment) => {
delete data.ui.panel[fragment];
});
return data;
})
)
.pipe(gulp.dest(coreDir));
});
tasks.push(taskName);
splitTasks.push(taskName);
taskName = "build-flattened-translations";
gulp.task(taskName, splitTasks, function() {
// Flatten the split versions of our translations, and move them into outDir
return gulp
.src(
TRANSLATION_FRAGMENTS.map(
(fragment) => workDir + "/" + fragment + "/*.json"
).concat(coreDir + "/*.json"),
{ base: workDir }
)
.pipe(
transform(function(data) {
// Polymer.AppLocalizeBehavior requires flattened json
return flatten(data);
})
)
.pipe(minify())
.pipe(
rename((filePath) => {
if (filePath.dirname === "core") {
filePath.dirname = "";
}
})
)
.pipe(gulp.dest(outDir));
});
tasks.push(taskName);
taskName = "build-translation-fingerprints";
gulp.task(taskName, ["build-flattened-translations"], function() {
return gulp
.src(outDir + "/**/*.json")
.pipe(
rename({
extname: "",
})
)
.pipe(
hash({
algorithm: "md5",
hashLength: 32,
template: "<%= name %>-<%= hash %>.json",
})
)
.pipe(hash.manifest("translationFingerprints.json"))
.pipe(
transform(function(data) {
// After generating fingerprints of our translation files, consolidate
// all translation fragment fingerprints under the translation name key
const newData = {};
Object.entries(data).forEach(([key, value]) => {
const parts = key.split("/");
let translation = key;
if (parts.length === 2) {
translation = parts[1];
}
if (!(translation in newData)) {
newData[translation] = {
fingerprints: {},
};
}
newData[translation].fingerprints[key] = value;
});
return newData;
})
)
.pipe(gulp.dest(workDir));
});
tasks.push(taskName);
taskName = "build-translations";
gulp.task(taskName, ["build-translation-fingerprints"], function() {
return gulp
.src([
"src/translations/translationMetadata.json",
workDir + "/translationFingerprints.json",
])
.pipe(merge({}))
.pipe(insert.wrap('<script>\nwindow.translationMetadata = ', ';\n</script>'))
.pipe(rename('translationMetadata.html'))
.pipe(gulp.dest('build-temp'));
.pipe(
transform(function(data) {
const newData = {};
Object.entries(data).forEach(([key, value]) => {
// Filter out translations without native name.
if (data[key].nativeName) {
newData[key] = data[key];
} else {
console.warn(
`Skipping language ${key}. Native name was not translated.`
);
}
if (data[key]) newData[key] = value;
});
return newData;
})
)
.pipe(
transform((data) => ({
fragments: TRANSLATION_FRAGMENTS,
translations: data,
}))
)
.pipe(rename("translationMetadata.json"))
.pipe(gulp.dest(workDir));
});
tasks.push(taskName);

1
hassio/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
hassio-icons.html

8
hassio/config.js Normal file
View File

@@ -0,0 +1,8 @@
const path = require("path");
module.exports = {
// Target directory for the build.
buildDir: path.resolve(__dirname, "build"),
// Path where the Hass.io frontend will be publicly available.
publicPath: "/api/hassio/app",
};

14
hassio/script/build_hassio Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/sh
# Builds the Hass.io app for production
# Stop on errors
set -e
cd "$(dirname "$0")/.."
OUTPUT_DIR=build
rm -rf $OUTPUT_DIR
node script/gen-icons.js
NODE_ENV=production ../node_modules/.bin/webpack -p --config webpack.config.js

12
hassio/script/develop Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
# Run the Hass.io development server
# Stop on errors
set -e
OUTPUT_DIR=build
rm -rf $OUTPUT_DIR
mkdir $OUTPUT_DIR
node script/gen-icons.js
../node_modules/.bin/webpack --watch --progress

12
hassio/script/gen-icons.js Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env node
const fs = require("fs");
const { findIcons, generateIconset } = require("../../gulp/tasks/gen-icons.js");
const MENU_BUTTON_ICON = "menu";
function genHassioIcons() {
const iconNames = findIcons("./src", "hassio").concat(MENU_BUTTON_ICON);
fs.writeFileSync("./hassio-icons.html", generateIconset("hassio", iconNames));
}
genHassioIcons();

View File

@@ -0,0 +1,93 @@
import "@polymer/paper-card/paper-card";
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../components/hassio-card-content";
import "../resources/hassio-style";
import NavigateMixin from "../../../src/mixins/navigate-mixin";
class HassioAddonRepository extends NavigateMixin(PolymerElement) {
static get template() {
return html`
<style include="iron-flex ha-style hassio-style">
paper-card {
cursor: pointer;
}
a.repo {
display: block;
color: var(--primary-text-color);
}
</style>
<template is="dom-if" if="[[addons.length]]">
<div class="card-group">
<div class="title">
[[repo.name]]
<div class="description">
Maintained by [[repo.maintainer]]
<a class="repo" href="[[repo.url]]" target="_blank"
>[[repo.url]]</a
>
</div>
</div>
<template
is="dom-repeat"
items="[[addons]]"
as="addon"
sort="sortAddons"
>
<paper-card on-click="addonTapped">
<div class="card-content">
<hassio-card-content
hass="[[hass]]"
title="[[addon.name]]"
description="[[addon.description]]"
icon="[[computeIcon(addon)]]"
icon-title="[[computeIconTitle(addon)]]"
icon-class="[[computeIconClass(addon)]]"
></hassio-card-content>
</div>
</paper-card>
</template>
</div>
</template>
`;
}
static get properties() {
return {
hass: Object,
repo: Object,
addons: Array,
};
}
sortAddons(a, b) {
return a.name.toUpperCase() < b.name.toUpperCase() ? -1 : 1;
}
computeIcon(addon) {
return addon.installed && addon.installed !== addon.version
? "hassio:arrow-up-bold-circle"
: "hassio:puzzle";
}
computeIconTitle(addon) {
if (addon.installed)
return addon.installed !== addon.version
? "New version available"
: "Add-on is installed";
return "Add-on is not installed";
}
computeIconClass(addon) {
if (addon.installed)
return addon.installed !== addon.version ? "update" : "installed";
return "";
}
addonTapped(ev) {
this.navigate(`/hassio/addon/${ev.model.addon.slug}`);
}
}
customElements.define("hassio-addon-repository", HassioAddonRepository);

View File

@@ -0,0 +1,92 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "./hassio-addon-repository";
import "./hassio-repositories-editor";
class HassioAddonStore extends PolymerElement {
static get template() {
return html`
<style include="iron-flex ha-style">
hassio-addon-repository {
margin-top: 24px;
}
</style>
<hassio-repositories-editor
hass="[[hass]]"
repos="[[repos]]"
></hassio-repositories-editor>
<template is="dom-repeat" items="[[repos]]" as="repo" sort="sortRepos">
<hassio-addon-repository
hass="[[hass]]"
repo="[[repo]]"
addons="[[computeAddons(repo.slug)]]"
></hassio-addon-repository>
</template>
`;
}
static get properties() {
return {
hass: Object,
addons: Array,
repos: Array,
};
}
ready() {
super.ready();
this.addEventListener("hass-api-called", (ev) => this.apiCalled(ev));
this.loadData();
}
apiCalled(ev) {
if (ev.detail.success) {
this.loadData();
}
}
sortRepos(a, b) {
if (a.slug === "local") {
return -1;
}
if (b.slug === "local") {
return 1;
}
if (a.slug === "core") {
return -1;
}
if (b.slug === "core") {
return 1;
}
return a.name.toUpperCase() < b.name.toUpperCase() ? -1 : 1;
}
computeAddons(repo) {
return this.addons.filter(function(addon) {
return addon.repository === repo;
});
}
loadData() {
this.hass.callApi("get", "hassio/addons").then(
(info) => {
this.addons = info.data.addons;
this.repos = info.data.repositories;
},
() => {
this.addons = [];
this.repos = [];
}
);
}
refreshData() {
this.hass.callApi("post", "hassio/addons/reload").then(() => {
this.loadData();
});
}
}
customElements.define("hassio-addon-store", HassioAddonStore);

View File

@@ -0,0 +1,120 @@
import "@polymer/iron-icon/iron-icon";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-input/paper-input";
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 HassioRepositoriesEditor extends PolymerElement {
static get template() {
return html`
<style include="ha-style hassio-style">
.add {
padding: 12px 16px;
}
iron-icon {
color: var(--secondary-text-color);
margin-right: 16px;
display: inline-block;
}
paper-input {
width: calc(100% - 49px);
display: inline-block;
}
</style>
<div class="card-group">
<div class="title">
Repositories
<div class="description">
Configure which add-on repositories to fetch data from:
</div>
</div>
<template
id="list"
is="dom-repeat"
items="[[repoList]]"
as="repo"
sort="sortRepos"
>
<paper-card>
<div class="card-content">
<hassio-card-content
hass="[[hass]]"
title="[[repo.name]]"
description="[[repo.url]]"
icon="hassio:github-circle"
></hassio-card-content>
</div>
<div class="card-actions">
<ha-call-api-button
hass="[[hass]]"
path="hassio/supervisor/options"
data="[[computeRemoveRepoData(repoList, repo.url)]]"
class="warning"
>Remove</ha-call-api-button
>
</div>
</paper-card>
</template>
<paper-card>
<div class="card-content add">
<iron-icon icon="hassio:github-circle"></iron-icon>
<paper-input
label="Add new repository by URL"
value="{{repoUrl}}"
></paper-input>
</div>
<div class="card-actions">
<ha-call-api-button
hass="[[hass]]"
path="hassio/supervisor/options"
data="[[computeAddRepoData(repoList, repoUrl)]]"
>Add</ha-call-api-button
>
</div>
</paper-card>
</div>
`;
}
static get properties() {
return {
hass: Object,
repos: {
type: Array,
observer: "reposChanged",
},
repoList: Array,
repoUrl: String,
};
}
reposChanged(repos) {
this.repoList = repos.filter(
(repo) => repo.slug !== "core" && repo.slug !== "local"
);
this.repoUrl = "";
}
sortRepos(a, b) {
return a.name < b.name ? -1 : 1;
}
computeRemoveRepoData(repoList, url) {
const list = repoList
.filter((repo) => repo.url !== url)
.map((repo) => repo.url);
return { addons_repositories: list };
}
computeAddRepoData(repoList, url) {
const list = repoList ? repoList.map((repo) => repo.url) : [];
list.push(url);
return { addons_repositories: list };
}
}
customElements.define("hassio-repositories-editor", HassioRepositoriesEditor);

View File

@@ -0,0 +1,142 @@
import "web-animations-js/web-animations-next-lite.min";
import "@polymer/paper-button/paper-button";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
import "@polymer/paper-item/paper-item";
import "@polymer/paper-listbox/paper-listbox";
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../../../src/resources/ha-style";
import EventsMixin from "../../../src/mixins/events-mixin";
class HassioAddonAudio extends EventsMixin(PolymerElement) {
static get template() {
return html`
<style include="ha-style">
:host,
paper-card,
paper-dropdown-menu {
display: block;
}
.errors {
color: var(--google-red-500);
margin-bottom: 16px;
}
paper-item {
width: 450px;
}
.card-actions {
text-align: right;
}
</style>
<paper-card heading="Audio">
<div class="card-content">
<template is="dom-if" if="[[error]]">
<div class="errors">[[error]]</div>
</template>
<paper-dropdown-menu label="Input">
<paper-listbox
slot="dropdown-content"
attr-for-selected="device"
selected="{{selectedInput}}"
>
<template is="dom-repeat" items="[[inputDevices]]">
<paper-item device\$="[[item.device]]"
>[[item.name]]</paper-item
>
</template>
</paper-listbox>
</paper-dropdown-menu>
<paper-dropdown-menu label="Output">
<paper-listbox
slot="dropdown-content"
attr-for-selected="device"
selected="{{selectedOutput}}"
>
<template is="dom-repeat" items="[[outputDevices]]">
<paper-item device\$="[[item.device]]"
>[[item.name]]</paper-item
>
</template>
</paper-listbox>
</paper-dropdown-menu>
</div>
<div class="card-actions">
<paper-button on-click="_saveSettings">Save</paper-button>
</div>
</paper-card>
`;
}
static get properties() {
return {
hass: Object,
addon: {
type: Object,
observer: "addonChanged",
},
inputDevices: Array,
outputDevices: Array,
selectedInput: String,
selectedOutput: String,
error: String,
};
}
addonChanged(addon) {
this.setProperties({
selectedInput: addon.audio_input || "null",
selectedOutput: addon.audio_output || "null",
});
if (this.outputDevices) return;
const noDevice = [{ device: "null", name: "-" }];
this.hass.callApi("get", "hassio/hardware/audio").then(
(resp) => {
const dev = resp.data.audio;
const input = Object.keys(dev.input).map((key) => ({
device: key,
name: dev.input[key],
}));
const output = Object.keys(dev.output).map((key) => ({
device: key,
name: dev.output[key],
}));
this.setProperties({
inputDevices: noDevice.concat(input),
outputDevices: noDevice.concat(output),
});
},
() => {
this.setProperties({
inputDevices: noDevice,
outputDevices: noDevice,
});
}
);
}
_saveSettings() {
this.error = null;
const path = `hassio/addons/${this.addon.slug}/options`;
this.hass
.callApi("post", path, {
audio_input: this.selectedInput === "null" ? null : this.selectedInput,
audio_output:
this.selectedOutput === "null" ? null : this.selectedOutput,
})
.then(
() => {
this.fire("hass-api-called", { success: true, path: path });
},
(resp) => {
this.error = resp.body.message;
}
);
}
}
customElements.define("hassio-addon-audio", HassioAddonAudio);

View File

@@ -0,0 +1,111 @@
import "@polymer/iron-autogrow-textarea/iron-autogrow-textarea";
import "@polymer/paper-button/paper-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";
class HassioAddonConfig extends PolymerElement {
static get template() {
return html`
<style include="ha-style">
:host {
display: block;
}
paper-card {
display: block;
}
.card-actions {
@apply --layout;
@apply --layout-justified;
}
.errors {
color: var(--google-red-500);
margin-bottom: 16px;
}
iron-autogrow-textarea {
width: 100%;
font-family: monospace;
}
.syntaxerror {
color: var(--google-red-500);
}
</style>
<paper-card heading="Config">
<div class="card-content">
<template is="dom-if" if="[[error]]">
<div class="errors">[[error]]</div>
</template>
<iron-autogrow-textarea
id="config"
value="{{config}}"
></iron-autogrow-textarea>
</div>
<div class="card-actions">
<ha-call-api-button
class="warning"
hass="[[hass]]"
path="hassio/addons/[[addonSlug]]/options"
data="[[resetData]]"
>Reset to defaults</ha-call-api-button
>
<paper-button on-click="saveTapped" disabled="[[!configParsed]]"
>Save</paper-button
>
</div>
</paper-card>
`;
}
static get properties() {
return {
hass: Object,
addon: {
type: Object,
observer: "addonChanged",
},
addonSlug: String,
config: {
type: String,
observer: "configChanged",
},
configParsed: Object,
error: String,
resetData: {
type: Object,
value: {
options: null,
},
},
};
}
addonChanged(addon) {
this.config = addon ? JSON.stringify(addon.options, null, 2) : "";
}
configChanged(config) {
try {
this.$.config.classList.remove("syntaxerror");
this.configParsed = JSON.parse(config);
} catch (err) {
this.$.config.classList.add("syntaxerror");
this.configParsed = null;
}
}
saveTapped() {
this.error = null;
this.hass
.callApi("post", `hassio/addons/${this.addonSlug}/options`, {
options: this.configParsed,
})
.catch((resp) => {
this.error = resp.body.message;
});
}
}
customElements.define("hassio-addon-config", HassioAddonConfig);

View File

@@ -0,0 +1,298 @@
import "@polymer/iron-icon/iron-icon";
import "@polymer/paper-button/paper-button";
import "@polymer/paper-card/paper-card";
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/buttons/ha-call-api-button";
import "../../../src/components/ha-markdown";
import "../../../src/resources/ha-style";
import EventsMixin from "../../../src/mixins/events-mixin";
import "../components/hassio-card-content";
class HassioAddonInfo extends EventsMixin(PolymerElement) {
static get template() {
return html`
<style include="ha-style">
:host {
display: block;
}
paper-card {
display: block;
margin-bottom: 16px;
}
.addon-header {
@apply --paper-font-headline;
}
.light-color {
color: var(--secondary-text-color);
}
.addon-version {
float: right;
font-size: 15px;
vertical-align: middle;
}
.description {
margin-bottom: 16px;
}
.logo img {
max-height: 60px;
margin: 16px 0;
display: block;
}
.state div {
width: 150px;
display: inline-block;
}
paper-toggle-button {
display: inline;
}
iron-icon.running {
color: var(--paper-green-400);
}
iron-icon.stopped {
color: var(--google-red-300);
}
ha-call-api-button {
font-weight: 500;
color: var(--primary-color);
}
.right {
float: right;
}
ha-markdown img {
max-width: 100%;
}
</style>
<template is="dom-if" if="[[computeUpdateAvailable(addon)]]">
<paper-card heading="Update available! 🎉">
<div class="card-content">
<hassio-card-content
hass="[[hass]]"
title="[[addon.name]] [[addon.last_version]] is available"
description="You are currently running version [[addon.version]]"
icon="hassio:arrow-up-bold-circle"
icon-class="update"
></hassio-card-content>
</div>
<div class="card-actions">
<ha-call-api-button
hass="[[hass]]"
path="hassio/addons/[[addonSlug]]/update"
>Update</ha-call-api-button
>
<template is="dom-if" if="[[addon.changelog]]">
<paper-button on-click="openChangelog">Changelog</paper-button>
</template>
</div>
</paper-card>
</template>
<paper-card>
<div class="card-content">
<div class="addon-header">
[[addon.name]]
<div class="addon-version light-color">
<template is="dom-if" if="[[addon.version]]">
[[addon.version]]
<template is="dom-if" if="[[isRunning]]">
<iron-icon
title="Add-on is running"
class="running"
icon="hassio:circle"
></iron-icon>
</template>
<template is="dom-if" if="[[!isRunning]]">
<iron-icon
title="Add-on is stopped"
class="stopped"
icon="hassio:circle"
></iron-icon>
</template>
</template>
<template is="dom-if" if="[[!addon.version]]">
[[addon.last_version]]
</template>
</div>
</div>
<div class="description light-color">
[[addon.description]].<br />
Visit
<a href="[[addon.url]]" target="_blank">[[addon.name]] page</a> for
details.
</div>
<template is="dom-if" if="[[addon.logo]]">
<a href="[[addon.url]]" target="_blank" class="logo">
<img src="/api/hassio/addons/[[addonSlug]]/logo" />
</a>
</template>
<template is="dom-if" if="[[addon.version]]">
<div class="state">
<div>Start on boot</div>
<paper-toggle-button
on-change="startOnBootToggled"
checked="[[computeStartOnBoot(addon.boot)]]"
></paper-toggle-button>
</div>
<div class="state">
<div>Auto update</div>
<paper-toggle-button
on-change="autoUpdateToggled"
checked="[[addon.auto_update]]"
></paper-toggle-button>
</div>
</template>
</div>
<div class="card-actions">
<template is="dom-if" if="[[addon.version]]">
<paper-button class="warning" on-click="_unistallClicked"
>Uninstall</paper-button
>
<template is="dom-if" if="[[addon.build]]">
<ha-call-api-button
class="warning"
hass="[[hass]]"
path="hassio/addons/[[addonSlug]]/rebuild"
>Rebuild</ha-call-api-button
>
</template>
<template is="dom-if" if="[[isRunning]]">
<ha-call-api-button
class="warning"
hass="[[hass]]"
path="hassio/addons/[[addonSlug]]/restart"
>Restart</ha-call-api-button
>
<ha-call-api-button
class="warning"
hass="[[hass]]"
path="hassio/addons/[[addonSlug]]/stop"
>Stop</ha-call-api-button
>
</template>
<template is="dom-if" if="[[!isRunning]]">
<ha-call-api-button
hass="[[hass]]"
path="hassio/addons/[[addonSlug]]/start"
>Start</ha-call-api-button
>
</template>
<template
is="dom-if"
if="[[computeShowWebUI(addon.webui, isRunning)]]"
>
<a
href="[[pathWebui(addon.webui)]]"
tabindex="-1"
target="_blank"
class="right"
><paper-button>Open web UI</paper-button></a
>
</template>
</template>
<template is="dom-if" if="[[!addon.version]]">
<ha-call-api-button
hass="[[hass]]"
path="hassio/addons/[[addonSlug]]/install"
>Install</ha-call-api-button
>
</template>
</div>
</paper-card>
<template is="dom-if" if="[[addon.long_description]]">
<paper-card>
<div class="card-content">
<ha-markdown content="[[addon.long_description]]"></ha-markdown>
</div>
</paper-card>
</template>
`;
}
static get properties() {
return {
hass: Object,
addon: Object,
addonSlug: String,
isRunning: {
type: Boolean,
computed: "computeIsRunning(addon)",
},
};
}
computeIsRunning(addon) {
return addon && addon.state === "started";
}
computeUpdateAvailable(addon) {
return (
addon &&
!addon.detached &&
addon.version &&
addon.version !== addon.last_version
);
}
pathWebui(webui) {
return webui && webui.replace("[HOST]", document.location.hostname);
}
computeShowWebUI(webui, isRunning) {
return webui && isRunning;
}
computeStartOnBoot(state) {
return state === "auto";
}
startOnBootToggled() {
const data = { boot: this.addon.boot === "auto" ? "manual" : "auto" };
this.hass.callApi("POST", `hassio/addons/${this.addonSlug}/options`, data);
}
autoUpdateToggled() {
const data = { auto_update: !this.addon.auto_update };
this.hass.callApi("POST", `hassio/addons/${this.addonSlug}/options`, data);
}
openChangelog() {
this.hass
.callApi("get", `hassio/addons/${this.addonSlug}/changelog`)
.then((resp) => resp, () => "Error getting changelog")
.then((content) => {
this.fire("hassio-markdown-dialog", {
title: "Changelog",
content: content,
});
});
}
_unistallClicked() {
if (!confirm("Are you sure you want to uninstall this add-on?")) {
return;
}
const path = `hassio/addons/${this.addonSlug}/uninstall`;
const eventData = {
path: path,
};
this.hass
.callApi("post", path)
.then(
(resp) => {
eventData.success = true;
eventData.response = resp;
},
(resp) => {
eventData.success = false;
eventData.response = resp;
}
)
.then(() => {
this.fire("hass-api-called", eventData);
});
}
}
customElements.define("hassio-addon-info", HassioAddonInfo);

View File

@@ -0,0 +1,60 @@
import "@polymer/paper-button/paper-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/resources/ha-style";
class HassioAddonLogs extends PolymerElement {
static get template() {
return html`
<style include="ha-style">
:host,
paper-card {
display: block;
}
pre {
overflow-x: auto;
}
</style>
<paper-card heading="Log">
<div class="card-content"><pre>[[log]]</pre></div>
<div class="card-actions">
<paper-button on-click="refresh">Refresh</paper-button>
</div>
</paper-card>
`;
}
static get properties() {
return {
hass: Object,
addonSlug: {
type: String,
observer: "addonSlugChanged",
},
log: String,
};
}
addonSlugChanged(slug) {
if (!this.hass) {
setTimeout(() => {
this.addonChanged(slug);
}, 0);
return;
}
this.refresh();
}
refresh() {
this.hass
.callApi("get", `hassio/addons/${this.addonSlug}/logs`)
.then((info) => {
this.log = info;
});
}
}
customElements.define("hassio-addon-logs", HassioAddonLogs);

View File

@@ -0,0 +1,124 @@
import "@polymer/paper-card/paper-card";
import "@polymer/paper-input/paper-input";
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 "../../../src/resources/ha-style";
import EventsMixin from "../../../src/mixins/events-mixin";
class HassioAddonNetwork extends EventsMixin(PolymerElement) {
static get template() {
return html`
<style include="ha-style">
:host {
display: block;
}
paper-card {
display: block;
}
.errors {
color: var(--google-red-500);
margin-bottom: 16px;
}
.card-actions {
@apply --layout;
@apply --layout-justified;
}
</style>
<paper-card heading="Network">
<div class="card-content">
<template is="dom-if" if="[[error]]">
<div class="errors">[[error]]</div>
</template>
<table>
<tbody>
<tr>
<th>Container</th>
<th>Host</th>
</tr>
<template is="dom-repeat" items="[[config]]">
<tr>
<td>[[item.container]]</td>
<td>
<paper-input
value="{{item.host}}"
no-label-float=""
></paper-input>
</td>
</tr>
</template>
</tbody>
</table>
</div>
<div class="card-actions">
<ha-call-api-button
class="warning"
hass="[[hass]]"
path="hassio/addons/[[addonSlug]]/options"
data="[[resetData]]"
>Reset to defaults</ha-call-api-button
>
<paper-button on-click="saveTapped">Save</paper-button>
</div>
</paper-card>
`;
}
static get properties() {
return {
hass: Object,
addonSlug: String,
config: Object,
addon: {
type: Object,
observer: "addonChanged",
},
error: String,
resetData: {
type: Object,
value: {
network: null,
},
},
};
}
addonChanged(addon) {
if (!addon) return;
const network = addon.network || {};
const items = Object.keys(network).map((key) => ({
container: key,
host: network[key],
}));
this.config = items.sort(function(el1, el2) {
return el1.host - el2.host;
});
}
saveTapped() {
this.error = null;
const data = {};
this.config.forEach(function(item) {
data[item.container] = parseInt(item.host);
});
const path = `hassio/addons/${this.addonSlug}/options`;
this.hass
.callApi("post", path, {
network: data,
})
.then(
() => {
this.fire("hass-api-called", { success: true, path: path });
},
(resp) => {
this.error = resp.body.message;
}
);
}
}
customElements.define("hassio-addon-network", HassioAddonNetwork);

View File

@@ -0,0 +1,185 @@
import "@polymer/app-layout/app-header-layout/app-header-layout";
import "@polymer/app-layout/app-header/app-header";
import "@polymer/app-layout/app-toolbar/app-toolbar";
import "@polymer/app-route/app-route";
import "@polymer/paper-icon-button/paper-icon-button";
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../../../src/components/ha-menu-button";
import "../../../src/resources/ha-style";
import "../hassio-markdown-dialog";
import "./hassio-addon-audio";
import "./hassio-addon-config";
import "./hassio-addon-info";
import "./hassio-addon-logs";
import "./hassio-addon-network";
class HassioAddonView extends PolymerElement {
static get template() {
return html`
<style include="iron-flex ha-style">
:host {
color: var(--primary-text-color);
--paper-card-header-color: var(--primary-text-color);
}
.content {
padding: 24px 0 32px;
display: flex;
flex-direction: column;
align-items: center;
}
hassio-addon-info,
hassio-addon-network,
hassio-addon-audio,
hassio-addon-config {
margin-bottom: 24px;
width: 600px;
}
hassio-addon-logs {
max-width: calc(100% - 8px);
min-width: 600px;
}
@media only screen and (max-width: 600px) {
hassio-addon-info,
hassio-addon-network,
hassio-addon-audio,
hassio-addon-config,
hassio-addon-logs {
max-width: 100%;
min-width: 100%;
}
}
</style>
<app-route
route="[[route]]"
pattern="/addon/:slug"
data="{{routeData}}"
active="{{routeMatches}}"
></app-route>
<app-header-layout has-scrolling-region="">
<app-header fixed="" slot="header">
<app-toolbar>
<ha-menu-button
hassio
narrow="[[narrow]]"
show-menu="[[showMenu]]"
></ha-menu-button>
<paper-icon-button
icon="hassio:arrow-left"
on-click="backTapped"
></paper-icon-button>
<div main-title="">Hass.io: add-on details</div>
</app-toolbar>
</app-header>
<div class="content">
<hassio-addon-info
hass="[[hass]]"
addon="[[addon]]"
addon-slug="[[routeData.slug]]"
></hassio-addon-info>
<template is="dom-if" if="[[addon.version]]">
<hassio-addon-config
hass="[[hass]]"
addon="[[addon]]"
addon-slug="[[routeData.slug]]"
></hassio-addon-config>
<template is="dom-if" if="[[addon.audio]]">
<hassio-addon-audio
hass="[[hass]]"
addon="[[addon]]"
></hassio-addon-audio>
</template>
<template is="dom-if" if="[[addon.network]]">
<hassio-addon-network
hass="[[hass]]"
addon="[[addon]]"
addon-slug="[[routeData.slug]]"
></hassio-addon-network>
</template>
<hassio-addon-logs
hass="[[hass]]"
addon-slug="[[routeData.slug]]"
></hassio-addon-logs>
</template>
</div>
</app-header-layout>
<hassio-markdown-dialog
title="[[markdownTitle]]"
content="[[markdownContent]]"
></hassio-markdown-dialog>
`;
}
static get properties() {
return {
hass: Object,
showMenu: Boolean,
narrow: Boolean,
route: Object,
routeData: {
type: Object,
observer: "routeDataChanged",
},
routeMatches: Boolean,
addon: Object,
markdownTitle: String,
markdownContent: {
type: String,
value: "",
},
};
}
ready() {
super.ready();
this.addEventListener("hass-api-called", (ev) => this.apiCalled(ev));
this.addEventListener("hassio-markdown-dialog", (ev) =>
this.openMarkdown(ev)
);
}
apiCalled(ev) {
const path = ev.detail.path;
if (!path) return;
if (path.substr(path.lastIndexOf("/") + 1) === "uninstall") {
this.backTapped();
} else {
this.routeDataChanged(this.routeData);
}
}
routeDataChanged(routeData) {
if (!this.routeMatches || !routeData || !routeData.slug) return;
this.hass.callApi("get", `hassio/addons/${routeData.slug}/info`).then(
(info) => {
this.addon = info.data;
},
() => {
this.addon = null;
}
);
}
backTapped() {
history.back();
}
openMarkdown(ev) {
this.setProperties({
markdownTitle: ev.detail.title,
markdownContent: ev.detail.content,
});
this.shadowRoot.querySelector("hassio-markdown-dialog").openDialog();
}
}
customElements.define("hassio-addon-view", HassioAddonView);

View File

@@ -0,0 +1,83 @@
import "@polymer/iron-icon/iron-icon";
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../../../src/components/ha-relative-time";
class HassioCardContent extends PolymerElement {
static get template() {
return html`
<style>
iron-icon {
margin-right: 16px;
margin-top: 16px;
float: left;
color: var(--secondary-text-color);
}
iron-icon.update {
color: var(--paper-orange-400);
}
iron-icon.running,
iron-icon.installed {
color: var(--paper-green-400);
}
iron-icon.hassupdate,
iron-icon.snapshot {
color: var(--paper-item-icon-color);
}
.title {
color: var(--primary-text-color);
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.addition {
color: var(--secondary-text-color);
overflow: hidden;
position: relative;
height: 2.4em;
line-height: 1.2em;
}
ha-relative-time {
display: block;
}
</style>
<iron-icon
icon="[[icon]]"
class\$="[[iconClass]]"
title="[[iconTitle]]"
></iron-icon>
<div>
<div class="title">[[title]]</div>
<div class="addition">
<template is="dom-if" if="[[description]]">
[[description]]
</template>
<template is="dom-if" if="[[datetime]]">
<ha-relative-time
hass="[[hass]]"
class="addition"
datetime="[[datetime]]"
></ha-relative-time>
</template>
</div>
</div>
`;
}
static get properties() {
return {
hass: Object,
title: String,
description: String,
datetime: String,
icon: {
type: String,
value: "hass:help-circle",
},
iconTitle: String,
iconClass: String,
};
}
}
customElements.define("hassio-card-content", HassioCardContent);

View File

@@ -0,0 +1,91 @@
import "@polymer/paper-card/paper-card";
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../components/hassio-card-content";
import "../resources/hassio-style";
import NavigateMixin from "../../../src/mixins/navigate-mixin";
class HassioAddons extends NavigateMixin(PolymerElement) {
static get template() {
return html`
<style include="ha-style hassio-style">
paper-card {
cursor: pointer;
}
</style>
<div class="content card-group">
<div class="title">Add-ons</div>
<template is="dom-if" if="[[!addons.length]]">
<paper-card>
<div class="card-content">
You don't have any add-ons installed yet. Head over to
<a href="#" on-click="openStore">the add-on store</a> to get
started!
</div>
</paper-card>
</template>
<template
is="dom-repeat"
items="[[addons]]"
as="addon"
sort="sortAddons"
>
<paper-card on-click="addonTapped">
<div class="card-content">
<hassio-card-content
hass="[[hass]]"
title="[[addon.name]]"
description="[[addon.description]]"
icon="[[computeIcon(addon)]]"
icon-title="[[computeIconTitle(addon)]]"
icon-class="[[computeIconClass(addon)]]"
></hassio-card-content>
</div>
</paper-card>
</template>
</div>
`;
}
static get properties() {
return {
hass: Object,
addons: Array,
};
}
sortAddons(a, b) {
return a.name < b.name ? -1 : 1;
}
computeIcon(addon) {
return addon.installed !== addon.version
? "hassio:arrow-up-bold-circle"
: "hassio:puzzle";
}
computeIconTitle(addon) {
if (addon.installed !== addon.version) return "New version available";
return addon.state === "started"
? "Add-on is running"
: "Add-on is stopped";
}
computeIconClass(addon) {
if (addon.installed !== addon.version) return "update";
return addon.state === "started" ? "running" : "";
}
addonTapped(ev) {
this.navigate("/hassio/addon/" + ev.model.addon.slug);
ev.target.blur();
}
openStore(ev) {
this.navigate("/hassio/store");
ev.target.blur();
}
}
customElements.define("hassio-addons", HassioAddons);

View File

@@ -0,0 +1,38 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "./hassio-addons";
import "./hassio-hass-update";
import EventsMixin from "../../../src/mixins/events-mixin";
class HassioDashboard extends EventsMixin(PolymerElement) {
static get template() {
return html`
<style include="iron-flex ha-style">
.content {
margin: 0 auto;
}
</style>
<div class="content">
<hassio-hass-update
hass="[[hass]]"
hass-info="[[hassInfo]]"
></hassio-hass-update>
<hassio-addons
hass="[[hass]]"
addons="[[supervisorInfo.addons]]"
></hassio-addons>
</div>
`;
}
static get properties() {
return {
hass: Object,
supervisorInfo: Object,
hassInfo: Object,
};
}
}
customElements.define("hassio-dashboard", HassioDashboard);

View File

@@ -0,0 +1,102 @@
import "@polymer/paper-button/paper-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">
<div class="title">Update available! 🎉</div>
<paper-card>
<div class="card-content">
<hassio-card-content
hass="[[hass]]"
title="Home Assistant [[hassInfo.last_version]] is available"
description="You are currently running version [[hassInfo.version]]"
icon="hassio:home-assistant"
icon-class="hassupdate"
></hassio-card-content>
<template is="dom-if" if="[[error]]">
<div class="error">Error: [[error]]</div>
</template>
<p>
<a
href="https://www.home-assistant.io/latest-release-notes/"
target="_blank"
>Read the release notes</a
>
</p>
</div>
<div class="card-actions">
<ha-call-api-button
hass="[[hass]]"
path="hassio/homeassistant/update"
>Update</ha-call-api-button
>
<a
href="https://github.com/home-assistant/home-assistant/releases"
target="_blank"
><paper-button>Release notes</paper-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;
}
}
customElements.define("hassio-hass-update", HassioHassUpdate);

4
hassio/src/entrypoint.js Normal file
View File

@@ -0,0 +1,4 @@
window.loadES5Adapter().then(() => {
import(/* webpackChunkName: "hassio-icons" */ "./resources/hassio-icons.js");
import(/* webpackChunkName: "hassio-main" */ "./hassio-main.js");
});

51
hassio/src/hassio-app.js Normal file
View File

@@ -0,0 +1,51 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "./hassio-main";
import "./resources/hassio-icons";
class HassioApp extends PolymerElement {
static get template() {
return html`
<template is="dom-if" if="[[hass]]">
<hassio-main
hass="[[hass]]"
narrow="[[narrow]]"
show-menu="[[showMenu]]"
route="[[route]]"
></hassio-main>
</template>
`;
}
static get properties() {
return {
hass: Object,
narrow: Boolean,
showMenu: Boolean,
route: Object,
hassioPanel: {
type: Object,
value: window.parent.hassioPanel,
},
};
}
ready() {
super.ready();
window.setProperties = this.setProperties.bind(this);
this.addEventListener("location-changed", () => this._locationChanged());
this.addEventListener("hass-open-menu", () => this._menuEvent(true));
this.addEventListener("hass-close-menu", () => this._menuEvent(false));
}
_menuEvent(shouldOpen) {
this.hassioPanel.fire(shouldOpen ? "hass-open-menu" : "hass-close-menu");
}
_locationChanged() {
this.hassioPanel.navigate(window.location.pathname);
}
}
customElements.define("hassio-app", HassioApp);

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