Commit graph

83 commits

Author SHA1 Message Date
epenet
c8491c4404
Move volume utility to unit_conversion (#78955)
* Move volume utility to unit_conversion

* Split tests
2022-09-22 17:49:45 +02:00
epenet
523d8d246b
Move pressure utility to unit_conversion (#78953) 2022-09-22 16:44:09 +02:00
epenet
0767cdd935
Move energy and power utilites to unit_conversion (#78950)
* Move energy and power utilites to unit_conversion

* Move tests
2022-09-22 15:39:49 +02:00
epenet
6002377d4f
Convert UnitConverter protocol to a class (#78934)
* Convert UnitConverter protocl to a class

* Remove logic change

* Use TypeVar

* Remove NORMALIZED_UNIT from pressure

* Reduce size of PR

* Reduce some more

* Once more

* Once more

* Remove DEVICE_CLASS
2022-09-22 14:15:22 +02:00
epenet
713fb874a8
Add NORMALISED_UNIT to UnitConverter (#78920)
* Add NORMALISED_UNIT to UnitConverter

* Adjust statistics

* Rename
2022-09-22 08:50:08 +02:00
epenet
ca78b1a77d
Add new energy utility (#78883)
* Add new energy utility

* Adjust STATISTIC_UNIT_TO_VALID_UNITS
2022-09-21 19:40:40 +02:00
epenet
d7382aadfe
Add new power utility (#78867)
* Add power utility

* Fix tests
2022-09-21 14:48:38 +02:00
Erik Montnemery
dd20a7ea62
Display statistics in the source's unit (#78031) 2022-09-15 12:01:24 -04:00
epenet
7871a517a8
Import constants from root (#78271) 2022-09-12 18:53:05 +02:00
Erik Montnemery
008ac8d10d
Improve statistics metadata WS API (#77209) 2022-08-31 11:30:45 +02:00
Franck Nijhof
7adb0f0ef5
Custom component -> Custom integration (#75404) 2022-07-18 22:10:22 +02:00
J. Nick Koston
3737b58e85
Avoid fetching metadata multiple times during stat compile (#70397) 2022-04-22 00:25:42 -10:00
J. Nick Koston
89807f0d2d
Reduce the number of queries needed to compile statistics (#69731)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-04-15 09:13:29 -07:00
J. Nick Koston
5c7c09726a
Cleanup recorder history typing (#69408) 2022-04-07 00:09:05 -10:00
J. Nick Koston
c5c34bc0d7
Typing and code quality for recorder history (#68647) 2022-03-24 17:58:38 -07:00
Erik Montnemery
61cc8e32f3
Include has_mean + has_sum in statistics metadata WS response (#68546)
* Include has_mean + has_sum in statistics metadata WS response

* Don't include has_mean/has_sum in history/list_statistic_ids

* Adjust tests

* Do include has_mean/has_sum in history/list_statistic_ids
2022-03-24 10:12:01 +01:00
Pawel
bcb8c7ec3c
Add API endpoint get_statistics_metadata (#68471)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-03-21 21:14:47 -07:00
Marc Mueller
ac50248938
Add type ignore error codes [other] (#66781) 2022-02-17 23:10:25 -08:00
Erik Montnemery
13abac101b
Drop legacy support for sensor sum statistics (#63884) 2022-01-11 13:59:08 +01:00
Marc Mueller
c384596899
Use SensorDeviceClass in sensor and helpers packages (#63452) 2022-01-05 14:59:51 +01:00
Mike Degatano
50188e06ac
Add link into statistics unit mismatch warning (#62217) 2022-01-02 22:13:21 +01:00
Erik Montnemery
6151bbe5c8
Improve debug log when warning about a dip in total_increasing sensor (#62501) 2021-12-21 17:22:40 +01:00
Michael
90e52cd3ad
Use relative imports [S-Z] (#61576) 2021-12-13 09:39:13 +01:00
Erik Montnemery
dc5888ab4a
Correct recorder.statistics.get_last_statistics (#61421) 2021-12-10 10:09:29 -08:00
xpac1985
b41e020f85
Better warning if unit of sensor is unsupported for its device class (#60665)
* Better warning if unit of sensor is unsupported for its device class

* Prettify the code
2021-12-01 18:18:58 +01:00
Erik Montnemery
f594bc353b
Add support for external statistics (#56607)
* Support external statistics

* Update tests

* Lint

* Adjust code after rebase

* Separate external statistic_id with :, add name to metadata

* Adjust tests

* Simplify get_metadata_with_session

* Address review comments

* Allow updating external statistics

* Validate input

* Adjust tests after rebase

* Pylint

* Adjust tests

* Improve test coverage
2021-10-26 10:26:50 +02:00
Erik Montnemery
558c2556f1
Report all unrecorded sensors in statistics tool (#58092) 2021-10-20 15:58:28 +02:00
Erik Montnemery
e3534eec87
Report orphaned statistics in statistic validation (#57324) 2021-10-20 15:57:22 +02:00
Erik Montnemery
dde8ac4eb5
Add support for kPa to sensor statistics (#58032) 2021-10-19 21:43:08 +02:00
Erik Montnemery
bb9053e93d
Add MWh as an energy unit (#58034) 2021-10-19 11:08:44 -07:00
Erik Montnemery
a5603c0076
Improve warning prints for sensor statistics (#57605) 2021-10-13 08:15:04 -07:00
Erik Montnemery
ffeb73a4f6
Add statistics tests for sensor with changing device class (#57317) 2021-10-12 09:09:32 -07:00
Paulus Schoutsen
eba1d7d16a
Guard for bad last reset (#57344) 2021-10-08 10:48:52 -07:00
Erik Montnemery
69875cbd11
Improve sensor statistics validation (#56892) 2021-10-04 09:47:44 -07:00
Erik Montnemery
6af1a835e6
Optimize statistics generation (#56821)
* Optimize statistics generation

* pylint
2021-09-30 17:14:36 +02:00
Erik Montnemery
6954614e62
Warn if total_increasing sensor has negative states (#56564) 2021-09-30 07:49:16 -07:00
Erik Montnemery
8c3fc95fb8
Fallback to state machine in statistics (#56785) 2021-09-29 14:57:16 -07:00
Erik Montnemery
40ecf22bac
Remove automatic splitting of net meters from statistics (#56772) 2021-09-29 17:20:17 +02:00
Marc Mueller
364767ff22
Import Callable from collections.abc (4) (#56778) 2021-09-29 16:15:36 +02:00
Erik Montnemery
552485bb05
Tweak list_statistic_ids (#55845)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-09-28 00:05:26 -07:00
Erik Montnemery
58f465f271
Don't reset meter when last_reset is set to None (#56609) 2021-09-27 12:17:09 +02:00
Erik Montnemery
7452998081
Convert last_reset timestamps to UTC (#56561)
* Convert last_reset timestamps to UTC

* Add test

* Apply suggestion from code review
2021-09-24 09:16:50 +02:00
Erik Montnemery
92253f5192
Minor refactoring of periodic statistics (#56492) 2021-09-22 13:31:33 -07:00
Erik Montnemery
6f36419c6f
Improve statistics validation (#56457) 2021-09-20 17:54:25 +02:00
Erik Montnemery
d899d15a1e
Add statistics validation (#56020)
* Add statistics validation

* Remove redundant None-check

* Move validate_statistics WS API to recorder

* Apply suggestion from code review
2021-09-13 13:44:22 +02:00
Erik Montnemery
89281a273c
Correct confusing log message in sensor statistics (#56016) 2021-09-09 23:26:29 -07:00
Erik Montnemery
80fd330479
Add sum_decrease and sum_increase statistics (#55850) 2021-09-08 23:35:53 -07:00
Erik Montnemery
27764e9985
Fix handling of imperial units in long term statistics (#55959) 2021-09-08 08:08:48 -07:00
Erik Montnemery
9f1e503784
Do not allow inf or nan sensor states in statistics (#55943) 2021-09-08 08:05:16 -07:00
Erik Montnemery
b99a22cd4d
Re-add state_class total to sensor (#55103)
* Re-add state_class total to sensor

* Make energy cost sensor enforce state_class total_increasing

* Bump deprecation of last_reset for state_class measurement

* Correct rebase mistakes
2021-09-06 18:28:58 +02:00