47 Commits

Author SHA1 Message Date
Philip Allgaier
899eab4e5c
Ensure 0 does not get formatted to empty string (#8971) 2021-04-23 09:29:03 +02:00
Philip Allgaier
f6e223c18d
Use const everywhere for "group.default_view" (#8918) 2021-04-15 09:54:32 +02:00
Donnie
538028a003
Refactor sequence matching to accept item rather than word array (#8866)
* Refactor sequence matching to require an item rather than array of words to filter against

* change 'words' to 'strings'. Add tsdoc description for ScorableTextItem

* Replace type checking with 'as' to clean up code
2021-04-14 15:29:10 -07:00
Donnie
7d5ecb8ba4
Update fuzzy scorer from VSCode (#8793) 2021-04-05 12:15:09 -07:00
Josh McCarty
f43c420d59
Create number formatting options on the profile panel (#7925) 2021-03-28 18:32:48 +02:00
Donnie
6de8b4e35f
Quick Bar: Use command category labels instead of icons (#7692)
* Change commands to use category labels instead of icons. Fixes several translation issues.

* Hydrate with latest dev and resolve conflicts

* Replace custom pill element with material chips

* Add category icons. Fix dark mode text colors

* Update src/components/ha-chip-set.ts

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

* Update src/dialogs/quick-bar/ha-quick-bar.ts

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

* Update src/dialogs/quick-bar/ha-quick-bar.ts

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

* Update src/components/ha-chip.ts

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

* Update src/components/ha-chip.ts

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

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2021-03-25 08:21:48 -07:00
Joakim Sørensen
a648e9be49
Fix atLeastVersion (#8437)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2021-02-23 22:17:22 +01:00
Philip Allgaier
fe13853b8b
Allow timestamp attribute formatting + central timestamp formats (#8162) 2021-01-22 20:24:31 +01:00
Josh McCarty
14db37459f
Formats number state with selected language in compute_state_display (#7516) 2020-10-30 22:58:52 +01:00
Donnie
6f2a759ba3
Add scoring and sorting to sequence matcher (#7367)
* Replace sequence matcher with VS Code's score-based implementation

* Remove everything not related to fuzzyScore and matchSubstring

* Fix bug when filter length <= 3

* Add licensing and credit to Microsoft

* Remove unnecessary character codes

* Remove old sequence matcher, update tests, fix issue with not finding best score in list of words

* Remove unnecessary sequence precheck, refactor client api to remove array

* Fix issue with score sorting not implemented correctly and thus not actually sorting by score

* Update src/common/string/filter/sequence-matching.ts

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

* Remove unnecessary string return from fuzzy matcher. Clean up code

* Remove globals from filter. Move sorting logic into matcher

* Update function description, make score property optional.

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-10-20 09:01:16 -07:00
Donnie
63f60019d1
Add friendly name to quick bar list and filter (#7306)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-10-13 17:26:12 -05:00
Donnie
ddcf89e6a2
Add tests for fuzzy sequence matcher (#7328) 2020-10-13 11:50:36 +02:00
Bram Kragten
4759c89628
Bring back lazy load more info + helper (#7131) 2020-09-28 13:29:02 +02:00
Philip Allgaier
2139a80a7a
Use proper constants for "unavailable" checks (#6922)
* Use proper constants for "unavailable"

* Additional usage of constants
2020-09-10 22:59:45 +02:00
Paulus Schoutsen
2f7d744228
Rename whitelist error to allowed (#6372) 2020-07-13 10:19:29 -07:00
Paulus Schoutsen
7b7e023103
Remove support for deprecated hidden property (#6220)
* Remove support for deprecated hidden property

* Lint

* Make sure to keep zones out of generated LL
2020-06-23 15:09:54 -07:00
Paulus Schoutsen
d27a17cf8e
Get state translations from backend (#5581)
* Get state translations from backend

* Fix tests
2020-04-21 17:15:13 +02:00
Bram Kragten
82f80db558
Update typescript, prettier, tslint -> eslint (#5536)
* Update typescript, prettier, tslint -> eslint

* Organize imports

* Use glob for eslint fix react import
2020-04-14 09:05:45 -07:00
Ruslan Sayfutdinov
c977f22047
Show seconds in the UI (#4765) 2020-02-06 10:38:38 -08:00
Ian Richardson
1f4d359050 Replace all default exports in common/ with named exports (#3790) 2019-09-23 10:57:47 +02:00
Paulus Schoutsen
652cd10483
Use Node 12 (#3141)
* Use Node 12

* Remove tests that don't work in Node
2019-04-30 12:16:41 -07:00
Paulus Schoutsen
be6d89bb7a
Revert a tsconfig change (#3075) 2019-04-08 17:08:59 -07:00
Paulus Schoutsen
0c406335f5
Upgrade deps (#3038)
* Upgrade deps

* Revert workbox back to 3

* Fix var name
2019-04-02 12:14:10 -07:00
Paulus Schoutsen
49fa74cc07
Fix incorrect state display being cached (#2356)
* Fix incorrect state display being cached

* Remove test for cache
2018-12-19 13:05:39 +01:00
Paulus Schoutsen
b3b9ca9c3f
Fix setting aspect ratio in percentage (#2289)
* Fix setting aspect ratio in percentage

* Use endsWith

* Fix invalid test
2018-12-13 23:36: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
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
Paulus Schoutsen
fbc1a722bd Normalize all line endings 2018-11-02 16:00:25 +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
34bfc12647
Prettier 💎 (#1737)
* Add prettier

* Apply Prettier
2018-10-11 12:22:11 +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
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
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
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
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
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
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
Andrey
0b9bd62251 Update canToggleState with toggleable climate (#782) 2018-01-04 23:57:23 -08:00
Adam Mills
b3ded276b5
Properly localize unknown/unavailable sensors (#752) 2017-12-23 16:16:40 -05:00
Adam Mills
c8c21e6fac
Refactor out our localize custom variant (#743) 2017-12-19 09:18:50 -05: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
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
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
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 e3509d71823ff5e42a4dcf4849a98c5bb6cb391c.

* Revert "Always recalculate state display"

This reverts commit 27c24e2694ee6f7c147782532268b3a67998d49b.
2017-11-20 21:46:36 -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