Commit graph

105 commits

Author SHA1 Message Date
epenet
96c442349f
Introduce unit enums for sound pressure (#83450)
* Introduce unit enums for sound pressure

* Adjust based on architecture comment

* Adjust
2022-12-08 20:06:02 +01:00
epenet
90438edc17
Introduce unit enums for irradiance (#83414) 2022-12-08 18:41:38 +01:00
Franck Nijhof
ce00f093d6
Add enum device_class and state options property to sensor entities (#82489) 2022-12-02 09:11:15 +01:00
Erik Montnemery
607a0e7697
Reduce size of get_statistics_during_period WS API response (#82131) 2022-11-16 17:36:30 +01:00
Erik Montnemery
3d3349240f
Don't trigger statistics issues when sensor units are equivalent (#80099) 2022-10-25 09:50:01 +02:00
Erik Montnemery
577f7904b5
Minor improvements of recorder typing (#80165)
* Minor improvements of recorder typing

* Only allow specifying statistic_ids as lists
2022-10-12 14:59:10 +02:00
Erik Montnemery
a391b8dd9d
Support correcting sensor volume unit (#80081) 2022-10-11 13:51:28 +02:00
Erik Montnemery
c52b900bfe
Minor cleanup of sensor statistics (#80082) 2022-10-11 12:24:52 +02:00
Erik Montnemery
69d935b7bd
Teach long term statistics that unit 'rpm' is same as 'RPM' (#80012)
* Teach long term statistics that unit 'rpm' is same as 'RPM'

* Add tests
2022-10-11 10:32:01 +02:00
Erik Montnemery
aa5575ba65
Only validate sensors in sensor.recorder.validate_statistics (#79749) 2022-10-06 21:17:46 +02:00
Erik Montnemery
0a59d37e62
Correct how unit used for statistics is determined (#79725) 2022-10-06 14:01:54 -04:00
Erik Montnemery
e93deaa8aa
Simplify long term statistics by always supporting unit conversion (#79557) 2022-10-03 21:50:05 -04:00
Erik Montnemery
a2e3978d53
Don't normalize units of long term statistics (#79320)
* Don't normalize units of long term statistics

* Update statistics.py
2022-10-03 21:42:44 +02:00
Erik Montnemery
2de273500e
Remove state_unit_of_measurement from metadata DB table (#79370)
* Remove state_unit_of_measurement from metadata DB table

* Adjust test
2022-10-01 18:55:00 +02:00
epenet
5389ff3253
Add new weight device class (#79185) 2022-09-28 12:13:49 +02:00
Erik Montnemery
9084beda32
Keep storing statistics for sensors which change device class (#79155) 2022-09-27 14:33:28 -04:00
epenet
12e4d18038
Add volume to SensorDeviceClass (#77960)
* Add volume to SensorDeviceClass

* Adjust recorder

* Adjust tests

* Adjust sensor UNIT_CONVERTERS

* Adjust recorder

* Update strings.json
2022-09-27 19:37:52 +02:00
epenet
7c448416e1
Add speed to SensorDeviceClass (#77953)
* Add speed to SensorDeviceClass

* Adjust recorder

* Adjust tests

* Adjust sensor UNIT_CONVERTERS

* Add tests

* Add websocket tests

* Update strings.json
2022-09-27 17:19:34 +01:00
epenet
bfcc18e5b8
Add distance to SensorDeviceClass (#77951)
* Add distance to SensorDeviceClass

* Adjust recorder

* Adjust tests

* Adjust recorder

* Update __init__.py

* Update test_websocket_api.py

* Update test_websocket_api.py

* Update test_websocket_api.py

* Update strings.json

* Fix tests

* Adjust docstring
2022-09-27 15:34:00 +01:00
Erik Montnemery
5bcef1c7ce
Indicate in statistics issues when units can be converted (#79121) 2022-09-27 13:51:38 +02:00
epenet
c1bc26b413
Finish migration of recorder to unit conversion (#78985) 2022-09-25 21:14:18 -04:00
epenet
ddf56baf7a
Move temperature utility to unit_conversion (#78960) 2022-09-22 18:31:50 +02:00
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