27 Commits

Author SHA1 Message Date
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
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
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
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
Adam Mills
fb0b1286d2 Convert remaining elements to ES6 classes (#538)
* Convert remaining elements to ES6 classes

* Use native DOM methods for tests

* Fix Polymer 2 debounce call
2017-10-29 21:47:03 -07:00
Andrey
bc0d44ca81 Upgrade eslint to 4.8.0 (#445)
* Upgrade eslint

* Fix post-merge errors
2017-10-08 21:08:06 -07:00
Andrey
4755b0438c Make sure graphs extend till the intended end time (#378) 2017-08-06 09:31:07 -07:00
Paulus Schoutsen
8b6db691ef Road to polymer 2 pt 2 (#310)
* Remove default-primary-color var

* Swap out paper-menu for paper-listbox
2017-06-18 19:30:18 -07:00
Paulus Schoutsen
bb83687d93 Polymer 2 prepare (#309)
* Remove unused paper-range-slider

* Update app-storage

* Upgrade paper-slider to 2.0

* Upgrade paper-scroll-header-panel

* Update paper-card

* Update slots

* Working upgrades

* More slots

* Upgrade app-layout

* More slot upgrades

* Vaadin components to Polymer hybrid ones

* Polymer 2 fixes

* Update polymer to 1.9.2

* Lint
2017-06-18 11:29:20 -07:00
Anders Melchiorsen
5357fc25d8 Rewrite _currentDate to work in all time zones (#266)
* Rewrite _currentDate to work in all time zones

The method toISOString() returns a timestamp in UTC. Thus, midnight in the CET
timezone (UTC+1) was converted into yesterday@2300 and then that date was used
as the current date.

This made the logbook and history start with yesterday's data, at least for
locations east of UTC.

The new version avoids this by using methods that work in local time.

* Remove an embarrassing amount of lint

* Rewrite to be more concise

Proposed by @armills.
2017-04-25 19:56:23 -07:00
Adam Mills
abbdc6f055 Display history charts up to end of selected time (#254)
* Display history charts up to end time

* Back into JS world
2017-04-03 23:00:10 -07:00
Paulus Schoutsen
67b59f1976 Shadow dom fixes (#241)
* Fix color picker

* Fix map panel CSS

* Convert logbook to use vaadin date picker

* Fix logbook clear date

* Migrate history panel to use vaadin date picker

* Remove pikaday

* Lint

* history panel: disable on loading
2017-03-19 21:55:52 -07:00
Andrey
f396c9acde Support multi-day history charts (#207)
* Support multi-day history charts

* Fix lint

* Reduce the periods to 1/3/7 days.

* Switch to end_time param instead of days

* Move async waiting from history-data to panel-history
2017-02-14 21:34:30 -08:00
Paulus Schoutsen
06edb22651 Fix dates on history and logbook 2017-01-30 09:06:08 -08:00
Paulus Schoutsen
a1057681f1 Initial getting rid of HA-JS (#180)
Getting rid of HA-JS
2017-01-29 18:34:45 -08:00
Michaël Arnauts
5d6cd514ab Tweak panel padding so they match with eachother (#171) 2017-01-06 11:21:16 +01:00
Michaël Arnauts
57071f7250 Fix locale for non-english users (#170)
* Take navigator.languages into account when determining the preferred language

* Lookup language only once, use it also for other date/time functions

* Show the date picker value in localized date

* Show the date picker value in localized date (in history)
2017-01-05 14:38:27 +01:00
Paulus Schoutsen
c4b17a24a3 Fix imports thanks to polymer-lint 2016-08-02 09:06:22 -07:00
Paulus Schoutsen
057adee010 Migrate panels to app elements 2016-07-30 22:48:39 -07:00
Adam Mills
b3efdd9efa Additional comments for pikaday field binding 2016-07-27 14:27:27 -04:00
Adam Mills
77e8c78d62 travis fixes 2016-07-26 14:05:06 -04:00
Adam Mills
0a0a24e5eb History and Logbook panel fixes 2016-07-26 13:57:56 -04:00
Adam Mills
1203312ac3 Fix indentation 2016-07-25 18:31:20 -04:00
Adam Mills
eb7dc87971 Use local timezone for log and history dates 2016-07-25 12:02:36 -04:00
Paulus Schoutsen
8c3f760683 Lint panels 2016-07-19 02:25:26 -07:00
Paulus Schoutsen
111b6c6f48 More ES6->ES5 conversion 2016-07-17 23:18:48 -07:00
Paulus Schoutsen
4029f16e97 Reorg into panels (#75) 2016-07-16 23:19:49 -07:00