Erik Montnemery
008ac8d10d
Improve statistics metadata WS API ( #77209 )
2022-08-31 11:30:45 +02:00
Erik Montnemery
4655ed995e
Fix resetting of attributes in EntityRegistry.async_get_or_create ( #77516 )
...
* Fix resetting of attributes in EntityRegistry.async_get_or_create
* Fix typing
* Fix resetting config entry
* Improve test
* Update tests
2022-08-30 21:07:50 +02:00
Erik Montnemery
2497ff5a39
Add energy and gas sensors to demo integration ( #77206 )
2022-08-24 11:09:23 +02:00
Erik Montnemery
606d544157
Use recorder get_instance function to improve typing ( #75567 )
2022-07-22 11:58:26 +02:00
Franck Nijhof
7adb0f0ef5
Custom component -> Custom integration ( #75404 )
2022-07-18 22:10:22 +02:00
Paulus Schoutsen
b62c0dcb32
Guard invalid data sensor significant change ( #74369 )
2022-07-03 22:03:13 -07:00
Erik Montnemery
baa810aabb
Improve warnings for datetime and date sensors with invalid states ( #73598 )
2022-06-17 12:17:13 +02:00
Erik Montnemery
5f2b4001f3
Separate recorder database schema from other classes ( #72977 )
...
* Separate recorder database schema from other classes
* fix logbook imports
* migrate new tests
* few more
* last one
* fix merge
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-06-07 14:41:43 +02:00
Erik Montnemery
edd7a3427c
Remove support for databases without ROW_NUMBER ( #72092 )
2022-05-18 21:52:38 -05:00
J. Nick Koston
7c9c0e911a
Move do_adhoc_statistics to recorder test helpers ( #71544 )
2022-05-08 12:45:57 -07:00
J. Nick Koston
29bda196b5
Break apart recorder into tasks and core modules ( #71222 )
2022-05-02 21:53:56 -07:00
Erik Montnemery
3016b5fbfc
Use recorder fixtures and helpers in tests ( #70773 )
2022-04-26 06:08:00 -10:00
Erik Montnemery
28ebab9c5a
Simplify waiting for recorder in tests ( #70647 )
2022-04-25 12:04:47 +02:00
Erik Montnemery
982e314de6
Use recorder_mock in tests ( #70363 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-04-22 19:29:44 -10:00
Erik Montnemery
7b1e0e42f7
Allow device conditions and triggers for unitless sensors ( #70337 )
2022-04-21 09:31:15 -07:00
Erik Montnemery
de9f39745b
Fix race in _process_recorder_platform ( #70339 )
...
* Fix race in _process_recorder_platform
* Update homeassistant/components/recorder/__init__.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update tests
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-04-21 09:03:05 +02:00
Erik Montnemery
5e50a8abd5
Mark device triggers from hidden or auxiliary entities as secondary ( #70335 )
...
* Mark device triggers from hidden or auxiliary entities as secondary
* Update tests
2022-04-21 08:01:32 +02:00
Erik Montnemery
150f173eed
Mark device conditions from hidden or auxiliary entities as secondary ( #70333 )
2022-04-20 21:41:59 +02:00
Diogo Gomes
03874d1b65
Correct state restoring for Utility Meter sensors ( #66851 )
...
* fix merge
* backward compatability
* add status
* increase coverage
* increase further the coverage
* adds support for Decimal in SensorExtraStoredData
* more precise
* review
* don't restore broken last_reset
* increase coverage
* address review comments
* stale
* coverage increase
* Update homeassistant/components/utility_meter/sensor.py
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* catch corrupt files and respective tests
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-04-19 09:01:52 +02:00
Erik Montnemery
ba07663e7d
Fix adjusting statistics in ft³ ( #69913 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-04-12 14:08:38 -07:00
Erik Montnemery
80ff1ecb2a
Fix adjusting 5-minute statistics ( #69921 )
2022-04-12 18:10:17 +02:00
Erik Montnemery
e830032b33
Remove deprecated temperature conversion of non temperature sensors ( #69069 )
2022-04-04 20:02:40 +02:00
Erik Montnemery
87100c2517
Drop deprecated support for unit_of_measurement from sensor ( #69061 )
2022-04-01 08:22:19 -07:00
Erik Montnemery
9471e4d77c
Don't override temperature unit for sensors ( #68910 )
2022-03-30 10:15:00 -07:00
Erik Montnemery
91f6e58e9a
Allow customizing unit for temperature and pressure sensors ( #64366 )
...
* Allow customizing unit for temperature and pressure sensors
* pylint
* Adjust google_wifi tests
* Address review comments and add tests
* Improve rounding when scaling
* Tweak rounding
* Further tweak rounding
* Allow setting entity options with config/entity_registry/update
* Address review comments
* Tweak tests
* Load custom unit when sensor is added
* Override async_internal_added_to_hass
* Adjust tests after rebase
* Apply suggestions from code review
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Address review comments
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-03-30 15:43:04 +02: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
Erik Montnemery
b5c5da96ac
Add WS API to adjust incorrect energy statistics ( #65147 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-03-22 15:18:30 -07:00
Erik Montnemery
cf4033b1bc
Simplify time zone setting in tests ( #68330 )
...
* Simplify timezone setting in tests
* Fix typo
* Adjust caldav tests
* Adjust input_datetime tests
* Adjust time_date tests
* Adjust tod tests
* Adjust helper tests
* Adjust recorder tests
* Adjust risco tests
* Adjust aemet tests
* Adjust flux tests
* Adjust forecast_solar tests
* Revert unnecessary change in forecast_solar test
* Adjust climacell tests
* Adjust google tests
* Adjust sensor tests
* Adjust sonarr tests
* Adjust template tests
* Adjust zodiac tests
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-03-20 10:25:15 +01:00
Erik Montnemery
009b31941a
Support restoring SensorEntity native_value ( #66068 )
2022-02-08 14:00:26 -08:00
Franck Nijhof
e242796394
Remove deprecated format for date(time) sensors ( #65734 )
2022-02-04 23:42:29 -08:00
Erik Montnemery
13abac101b
Drop legacy support for sensor sum statistics ( #63884 )
2022-01-11 13:59:08 +01:00
Erik Montnemery
3083f059cc
Drop last_reset attribute for non 'total' sensors ( #63880 )
...
* Drop last_reset attribute for non 'total' sensors
* Adjust MQTT tests
* Add exception for utility_meter
* Rewrite exception for utility_meter
* Add comment in utility_meter
* Tweak comment
2022-01-11 13:58:35 +01:00
Erik Montnemery
8e8e49d3e7
Add sensor device classes for apparent and reactive power ( #62010 )
2021-12-23 10:29:38 +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
Erik Montnemery
684c380ce2
Use SensorDeviceClass enum in sensor device automations ( #62480 )
2021-12-21 14:07:01 +01:00
Ville Skyttä
ea58432721
Use DeviceAutomationType in tests/components/[s-z]* ( #62450 )
2021-12-21 11:56:00 +01:00
Robert Hillis
07532c3153
Use enums in sensor tests ( #62152 )
2021-12-17 11:07:18 +01:00
Erik Montnemery
aa36dde148
Correct rest sensor configured to generate timestamps ( #61429 )
2021-12-10 09:59:27 -08:00
Erik Montnemery
49a27e12ad
Add support to entity registry for overriding device_class ( #59985 )
2021-11-22 08:38:06 -08:00
Franck Nijhof
69b7495324
Sensor: Handle local->UTC conversion and reject timezoneless timestamps ( #59971 )
2021-11-22 17:04:06 +01:00
Franck Nijhof
01efe1eba2
Add datetime object as valid StateType ( #52671 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-11-18 14:11:44 +01:00
epenet
a3885f4fda
Add frequency device class for sensor ( #59700 )
...
Co-authored-by: Hedda <rockerc.harley@gmail.com>
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-15 14:33:50 +01:00
Erik Montnemery
d1ee041997
Test sensor unit conversion ( #59546 )
2021-11-11 10:36:53 -08: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
9a26a8cfd8
Add support for daily and monthly statistics ( #57576 )
...
* Add support for daily and monthly statistics
* Remove debug code
* Format code
* Don't use dateutil package
* Remove 2 TODOs
* Remove TODO
* Add comments
2021-10-19 08:29:23 +02:00
Erik Montnemery
a5603c0076
Improve warning prints for sensor statistics ( #57605 )
2021-10-13 08:15:04 -07:00
Erik Montnemery
ee98849360
Always include start point for statistics ( #57182 )
2021-10-12 10:39:36 -07:00
Erik Montnemery
ffeb73a4f6
Add statistics tests for sensor with changing device class ( #57317 )
2021-10-12 09:09:32 -07:00
Erik Montnemery
0139bfa749
Detect if mysql and sqlite support row_number ( #57475 )
2021-10-11 21:17:18 -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
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
8c5efafdd8
Add 5-minute statistics for sensors ( #56006 )
...
* Add 5-minute statistics for sensors
* Address pylint issues
* Black
* Apply suggestion from code review
* Apply suggestions from code review
* Improve tests
2021-09-16 10:57:15 +02:00
Erik Montnemery
d2a9f7904a
Include end time of statistics data points in API response ( #56063 )
...
* Include end time of statistics data points in API response
* Correct typing
* Update tests
2021-09-13 10:02:24 +02:00
Erik Montnemery
80fd330479
Add sum_decrease and sum_increase statistics ( #55850 )
2021-09-08 23:35:53 -07:00
Erik Montnemery
232943c93d
Add significant change support to AQI type sensors ( #55833 )
2021-09-08 12:47:48 -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
Erik Montnemery
38d42de2c0
Handle negative numbers in sensor long term statistics ( #55708 )
...
* Handle negative numbers in sensor long term statistics
* Use negative states in tests
2021-09-04 10:47:42 +02:00
Erik Montnemery
93c086d830
Correct sum statistics when only last_reset has changed ( #55498 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-08-31 21:30:52 -07:00
Erik Montnemery
5d1a193eca
Improve log for sum statistics ( #55502 )
2021-08-31 19:15:22 +02:00
Erik Montnemery
f9225bad5f
Make new cycles for sensor sum statistics start with 0 as zero-point ( #55473 )
2021-08-31 10:45:17 +02:00
Erik Montnemery
722aa0895e
Improve statistics error messages when sensor's unit is changing ( #55436 )
...
* Improve error messages when sensor's unit is changing
* Improve test coverage
2021-08-30 12:51:46 +02:00
Erik Montnemery
7e70252de5
Handle statistics for sensor with changing state class ( #55316 )
2021-08-27 16:18:49 +02:00
Erik Montnemery
0a07ff4d23
Warn if a sensor with state_class_total has a decreasing value twice ( #55251 )
2021-08-26 14:27:14 +02:00
Erik Montnemery
bb42eb1176
Warn if a sensor with state_class_total has a decreasing value ( #55197 )
2021-08-25 13:01:55 +02:00
Erik Montnemery
ffbd2d79c8
Generate statistics for all sensors with a supported state_class ( #54882 )
...
* Generate statistics for all sensors
* Fix bugs, add tests
* Address review comments
* Cleanup warnings
* Simplify tests
* Simplify selection of statistics
* Fix tests
2021-08-25 13:00:35 +02:00
Paulus Schoutsen
1e05c81fe6
Fix recorder test ( #55169 )
...
Co-authored-by: Erik <erik@montnemery.com>
2021-08-25 08:48:13 +02:00
Erik Montnemery
fa9f91325c
Allow small dip in total_increasing sensor without detecting a reset ( #55153 )
2021-08-24 17:23:55 +02:00
Erik Montnemery
8877f37da0
Fix statistics for sensors setting last_reset ( #55136 )
...
* Re-add state_class total to sensor
* Make energy cost sensor enforce state_class total_increasing
* Drop state_class total
* Only report energy sensor issues once
2021-08-24 17:02:34 +02:00
Jc2k
2dd4de060b
Add device class for volatile organic compounds ( #55050 )
2021-08-23 11:14:43 +02:00
Erik Montnemery
2fa07777cd
Warn if unit_of_measurement is set on instances of SensorEntityDescription ( #54867 )
...
* Add class BaseEntityDescription without unit_of_measurement
* Refactor according to review comments
* Tweak
* Fix offending integrations
* Fix offending integrations
2021-08-20 15:54:57 +02:00
Erik Montnemery
e1926caeb9
Remove STATE_CLASS_TOTAL and last_reset from sensor ( #54755 )
...
* Remove STATE_CLASS_TOTAL
* Update mill sensor
* Update tests
* Kill last_reset
* Return ATTR_LAST_RESET to utility_meter
* Update energy cost sensor
* Restore last_reset for backwards compatibility
* Re-add and update deprecation warning
* Update tests
* Fix utility_meter
* Update EnergyCostSensor
* Tweak
* Fix rebase mistake
* Fix test
2021-08-18 10:03:27 +02:00
Erik Montnemery
3a78f1fce6
Force STATE_CLASS_TOTAL_INCREASING to reset to 0 ( #54751 )
...
* Force STATE_CLASS_TOTAL_INCREASING to reset to 0
* Tweak
* Correct detection of new cycle
* Fix typing
2021-08-17 23:05:31 +02:00
Jc2k
de0460de61
Add device classes that were part of deprecated air quality entity ( #54075 )
2021-08-16 23:33:28 +02:00
Erik Montnemery
029873a088
Add support for total and total_increasing sensor state classes ( #54523 )
...
* Add support for amount and meter sensor state classes
* Ignore last_reset for STATE_CLASS_METER sensors
* Update tests
* Rename STATE_CLASS_METER to STATE_CLASS_AMOUNT_INCREASING
* Rename STATE_CLASS_AMOUNT to STATE_CLASS_TOTAL
* Fix typo
* Log warning if last_reset set together with state_class measurement
* Fix warning message
2021-08-13 12:35:23 +02:00
Bram Kragten
e23750b2a4
Add device class `gas` and enable statistics for it ( #54110 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-08-11 09:58:19 -07:00
Erik Montnemery
4e07ab1b32
Move temperature conversions to sensor base class (1/8) ( #48261 )
...
* Move temperature conversions to entity base class (1/8)
* Update integrations a-c
* Leave old temperature conversion until all integrations are migrated
* tweak
* Use contextlib.suppress
* Remove the MeasurableUnitEntity mixin
* Address comments, add tests
* Fix f-string
* Drop deprecation warning from base entity class
* Update with _attr-shorthand
* Fix rebase mistakes
* Fix additional rebase mistakes
* Only report temperature conversion once
* Fix additional rebase mistakes
* Format homeassistant/components/bbox/sensor.py
* Fix check for overidden _attr_state
* Remove test workarounds from implementation
* Remove useless None-check
* Tweaks
* Migrate new sensors a-c
* Update climacell
* Push deprecation of temperature conversion forward
* Override __repr__ in SensorEntity
* Include native_value in SensorEntity attributes
* Pylint
* Black
* Black
* Fix rebase mistakes
* black
* Fix rebase mistakes
* Revert changes in august/sensor.py
* Revert handling of unit converted restored state
* Apply code review suggestion
* Fix arlo test
2021-08-11 10:45:05 +02:00
Paulus Schoutsen
f71980a634
Create stats for all sensors that have % unit and are measurement ( #53576 )
2021-07-27 21:56:34 +02:00
Erik Montnemery
ddc788bf8e
Include future statistics in history/list_statistic_ids ( #52942 )
...
* Include future statistics in history/list_statistic_ids
* Improve tests
2021-07-14 11:54:55 +02:00
Erik Montnemery
16d2dcbfb2
Improve sensor statistics tests ( #52386 )
2021-07-02 09:51:47 +02:00
Erik Montnemery
0476c7f9ee
Normalize temperature statistics to °C ( #52297 )
...
* Normalize temperature statistics to °C
* Fix tests
* Support temperature conversion to and from K, improve tests
* Fix test
* Add tests, pylint
2021-06-30 14:17:58 +02:00
Erik Montnemery
c785db4ffa
Normalize energy statistics to kWh ( #52238 )
2021-06-29 12:20:10 +02:00
Erik Montnemery
06fc21e287
Improve editing of device conditions referencing non-added sensor ( #51835 )
2021-06-14 15:22:31 +02:00
Erik Montnemery
a1e3283f8f
Improve editing of device automations referencing non-added sensors ( #51312 )
2021-06-08 23:28:08 -07:00
Erik Montnemery
39c94e8daa
Fix flaky statistics tests ( #51214 )
...
* Fix flaky statistics tests
* Tweak
2021-05-28 22:37:17 +02:00
Erik Montnemery
b339d73109
Weight sensor average statistics by state durations ( #51150 )
...
* Weight sensor average statistics by state durations
* Fix test
2021-05-28 13:16:52 +02:00
Erik Montnemery
e16a8063a5
Compile statistics for energy sensors ( #50829 )
...
* Compile statistics for energy sensors
* Update tests
* Rename abs_value to state
* Tweak
* Recreate statistics table
* Pylint
* Try to fix test
* Fix statistics for multiple energy sensors
* Fix energy statistics when last_reset is not set
2021-05-20 13:05:15 +02:00
Joakim Sørensen
2f10f59717
Block custom integrations with missing or invalid version ( #49916 )
2021-05-17 15:48:41 +02:00
Erik Montnemery
89dd3292ba
Initial draft of statistics ( #49852 )
2021-05-16 10:23:37 -07:00
Martin Hjelmare
fdbef90a57
Remove device class timestamp from device condition and trigger ( #48431 )
...
* Remove unit from garmin connect
* Remove unit from hvv departures
* Remove device class timestamp from device condition and trigger
* Remove unit from systemmonitor
* Use device class constant for timestamp in ring
2021-04-01 15:05:10 +02:00
Alexei Chetroi
79b5ca9415
Add device classes for CO and CO2 measurements ( #47487 )
2021-03-07 00:52:43 +01:00
Ville Skyttä
dc880118a4
Lint suppression cleanups ( #47248 )
...
* Unused pylint suppression cleanups
* Remove outdated pylint bug references
* Add flake8-noqa config and note to run it every now and then
* Add codes to noqa's
* Unused noqa cleanups
2021-03-02 09:02:04 +01:00
Anders Melchiorsen
26ce316c18
Do not trigger when numeric_state is true at startup ( #46424 )
2021-02-20 09:11:36 +01:00
Paulus Schoutsen
352d0870e3
Light significant changes + sensor tweaks ( #45583 )
2021-01-26 22:11:06 +01:00
Paulus Schoutsen
712a5a098d
Add significant change filtering to Google ( #45566 )
2021-01-26 21:45:09 +01:00
Paulus Schoutsen
d082be787f
Add "significant change" base ( #45555 )
2021-01-26 14:13:27 +01:00
Paulus Schoutsen
b3be708db6
Add default config if not there ( #43321 )
...
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-11-25 15:10:04 +01:00
springstan
d2b1918e9c
Drop UNIT_ prefix for percentage constant ( #39383 )
2020-09-05 21:09:14 +02:00
fabiocastagnino
02d572aae5
Add device classes for electrical measurement ( #36800 )
...
* added device classes for electrical measurement
(cherry picked from commit 2409fe19ed43bef568a0cca826652867d3a2d71a)
* upadte power factor unit (%)
* update power factor unit (%)
2020-08-08 21:04:18 +02:00
Paulus Schoutsen
276f3afb00
Do async_setup_platform in background ( #36244 )
...
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-31 22:18:30 -07:00
Franck Nijhof
d7e9959442
String formatting improvements for tests (2) ( #33666 )
2020-04-05 00:33:07 +02:00
springstan
f1a0ca7cd3
Add and use percentage constant ( #32094 )
...
* Add and use percentage constant
* Fix pylint error and broken test
2020-02-28 11:46:48 -08:00
Christian Clauss
1d537ad416
Fix typo: serivce --> service ( #31217 )
2020-01-27 19:56:26 +01:00
Bas Nijholt
df85a50f3b
Sort imports according to PEP8 for sensor ( #29683 )
2019-12-09 11:57:49 +01:00
Erik Montnemery
475b43500a
Add above and below to sensor condition extra_fields ( #27364 )
...
* Add above and below to sensor condition extra_fields
* Change unit_of_measurement to suffix in extra_fields
* Check if sensor has unit when getting capabilities
* Improve tests
2019-10-26 06:55:42 +08:00
Erik Montnemery
4700d647b0
Minor tweaks for sensor device automations ( #27829 )
...
* Minor tweaks for sensor device automations
* Change unit_of_measurement to suffix in extra_fields
* Address review comment
2019-10-22 11:40:07 -07:00
Erik Montnemery
7f20210e93
Include unit_of_measurement in sensor device trigger capabilities ( #27265 )
...
* Expose unit_of_measurement in sensor device trigger
* Update test
2019-10-08 12:52:25 -07:00
Erik Montnemery
b8f41dbb75
Add device condition support to sensor entities ( #27163 )
...
* Add device condition support to sensor entities
* Fix typing
2019-10-04 10:11:14 -07:00
Erik Montnemery
89ebc17fb1
Only generate device trigger for sensor with unit ( #27152 )
2019-10-03 13:30:59 -07:00
Erik Montnemery
9902209ad2
Add above and below to sensor trigger extra_fields ( #27160 )
2019-10-03 22:17:58 +02:00
Erik Montnemery
3e99743244
Add device trigger support to sensor entities ( #27133 )
...
* Add device trigger support to sensor entities
* Fix typing
* Fix tests, add test helper for comparing lists
2019-10-03 06:14:35 +02:00
Paulus Schoutsen
e9ea5c2ccb
Move tests to right folder ( #23790 )
...
* Move tests to right folder
* Fix test leaving files behind
2019-05-10 13:20:50 -07:00
Penny Wood
bf4b7a82b4
Move platforms patch ( #22168 )
...
* move mold sensor
* Get tests working
* Move moon and season sensor strings.
* Renamed sensor strings.
2019-03-19 06:43:15 -07:00
Penny Wood
f195ecca4b
Consolidate all platforms that have tests ( #22109 )
...
* Moved climate components with tests into platform dirs.
* Updated tests from climate component.
* Moved binary_sensor components with tests into platform dirs.
* Updated tests from binary_sensor component.
* Moved calendar components with tests into platform dirs.
* Updated tests from calendar component.
* Moved camera components with tests into platform dirs.
* Updated tests from camera component.
* Moved cover components with tests into platform dirs.
* Updated tests from cover component.
* Moved device_tracker components with tests into platform dirs.
* Updated tests from device_tracker component.
* Moved fan components with tests into platform dirs.
* Updated tests from fan component.
* Moved geo_location components with tests into platform dirs.
* Updated tests from geo_location component.
* Moved image_processing components with tests into platform dirs.
* Updated tests from image_processing component.
* Moved light components with tests into platform dirs.
* Updated tests from light component.
* Moved lock components with tests into platform dirs.
* Moved media_player components with tests into platform dirs.
* Updated tests from media_player component.
* Moved scene components with tests into platform dirs.
* Moved sensor components with tests into platform dirs.
* Updated tests from sensor component.
* Moved switch components with tests into platform dirs.
* Updated tests from sensor component.
* Moved vacuum components with tests into platform dirs.
* Updated tests from vacuum component.
* Moved weather components with tests into platform dirs.
* Fixed __init__.py files
* Fixes for stuff moved as part of this branch.
* Fix stuff needed to merge with balloob's branch.
* Formatting issues.
* Missing __init__.py files.
* Fix-ups
* Fixup
* Regenerated requirements.
* Linting errors fixed.
* Fixed more broken tests.
* Missing init files.
* Fix broken tests.
* More broken tests
* There seems to be a thread race condition.
I suspect the logger stuff is running in another thread, which means waiting until the aio loop is done is missing the log messages.
Used sleep instead because that allows the logger thread to run. I think the api_streams sensor might not be thread safe.
* Disabled tests, will remove sensor in #22147
* Updated coverage and codeowners.
2019-03-18 23:07:39 -07:00
Paulus Schoutsen
f5076188ef
Consolidate all platforms that have no tests ( #22096 )
...
* Consolidate
* Fix tests
* Update imports
* Fix import
* Use importlib because integration and package share name
* Fix more tests
* Update .coveragerc and CODEOWNERS
2019-03-16 20:44:05 -07:00
Paulus Schoutsen
f8921f84d7
skip flaky test ( #21981 )
2019-03-12 14:19:11 -07:00
Willem Burgers
458548daec
Fix TypeError ( #21734 )
...
* timediff is of type timedelta. Divide by timedelta does not work.
- convert a timedelta to int
- make sure the test inputs real timestamps
* Convert the total_seconds to decimal and round the result
readings are of type Decimal, so fix test to reflect that
* split line into multiple statements
Line too long
* use total_seconds instead of timediff
* Make both values float instead of Decimal
2019-03-09 17:51:15 +01:00
Willem Burgers
2017e45d78
fix derived rate, fixes #20097 ( #21620 )
...
* fix derived rate, fixes #20097
* fix derived rate, fixes #20097
* Fix typo
thnx @amelchio
* Make the test more realistic
Took values from my own smart meter for the test
* Update test to ignore rounding issues
2019-03-03 23:42:52 +01:00
Giorgos Logiotatidis
5a5c97acb3
Add timeout option to sensor.rest and binary_sensor.rest. ( #20065 )
2019-02-26 10:23:46 -08:00
siberx
616c7628d7
Fixes the sensor.filter outlier filter (handle step-changes correctly) ( #21332 )
...
* Fix outlier filter median return, Add/update filter outlier tests
* Switch outlier filter to store raw vals (handles step-changes correctly)
* Filter store_raw as attribute instead of filter_state parameter
* Fix linting issues
2019-02-23 13:51:33 +00:00
Rohan Kapoor
481439d387
Deprecate conf_update_interval ( #20924 )
...
* Deprecate update_interval and replace with scan_interval
* Update tests
* Fix Darksky tests
* Fix Darksky tests correctly
This reverts commit a73384a223ba8a93c682042d9351cd5a7a399183.
* Provide the default for the non deprecated option
* Don't override default schema for sensors
2019-02-17 06:23:09 +01:00
Diogo Gomes
f1f3074612
Add integration method to sensor.integration ( #21050 )
...
* add integration method and respective new methods
* ack @ottowinter tip
* align const name with value
2019-02-13 20:26:27 -08:00
arigilder
0d98f9783f
Add lagging hdate for sensors that should lag to update ( #20655 )
...
* Add lagging hdate for sensors that should lag to update
* Fix indentation
* Lint fix
2019-02-11 23:34:48 +01:00
Paulus Schoutsen
f3b20d138e
Embed Z-Wave platforms ( #20810 )
2019-02-07 22:50:59 +01:00
Paulus Schoutsen
b8cc547fa3
Move components to folders ( #20774 )
...
* Move all components into folders
* Move component tests into folders
* Fix init moving
* Move tests
* Lint
* Update coverage
* Fix service descriptions
* Update CODEOWNERS
2019-02-05 19:31:15 -08:00
Daniel Høyer Iversen
ef6b0b8e0b
Update flake8 to 3.7.5 ( #20761 )
...
* Upgrade flake8
* Upgrade flake8
* Add noqa for hound
2019-02-05 11:12:09 +01:00
emontnemery
b1faad0a50
Use PLATFORM_SCHEMA_BASE as base schema for additional components. ( #20578 )
...
* Disable extra=vol.ALLOW_EXTRA for additional platforms.
* Remove PLATFORM_SCHEMA_2
* Add entity_namespace to base platform schema
2019-02-04 21:52:19 -08:00
Paulus Schoutsen
e2d3c27e85
Embed all platforms into components ( #20677 )
...
* Consolidate all components with platforms
* Organize tests
* Fix more tests
* Fix Verisure tests
* one final test fix
* Add change
* Fix coverage
2019-02-02 07:13:16 -08:00
Diogo Gomes
ca143f8a35
print() left behind ( #20689 )
2019-02-02 14:54:46 +01:00
Diogo Gomes
384a9625c9
fix test commented in #20678 ( #20680 )
2019-02-01 22:11:50 -08:00
Paulus Schoutsen
c9671f8205
Test is broken
2019-02-01 16:31:53 -08:00
Jason Hu
d7b61f7ff6
Move mqtt_mock to tests/components/mqtt/conftest.py ( #20621 )
...
* Move mqtt_mock to tests/components/mqtt/conftest.py
* Move mqtt room presence sensor test to tests/components/mqtt
* Revert "Move mqtt room presence sensor test to tests/components/mqtt"
This reverts commit e08bc143
* Decouple mqtt room presence sensor test and mqtt_mock
2019-01-31 21:22:29 +01:00
Sander Zumbrink
e20c2aa113
Add precision parameter to dsmr sensor ( #19873 )
...
* Added precision parameter to dsmr sensor
* Added precision parameter to dsmr sensor, added whitespace after comma
* Added precision parameter to dsmr sensor
* Added precision parameter to dsmr sensor, fixed test
* Changed try except as requested
2019-01-31 16:46:54 +01:00
Diogo Gomes
b0ff51b0ef
Add an Integration sensor ( #19703 )
...
* initial version
* Tested
* set state added
* lint
* lint
* remove artifacts
* Use Decimal instead of float
* simplify
* travis lint fix
* addres comments by @ottowinter
* remove job
* better sanity check
* lower error -> warning
* hound
* fix state validation
* refactor energy -> integration
* address @MartinHjelmare comments
* new style string format
* remove async_set_state
* patching the source function
2019-01-29 08:25:36 +01:00
Andrey Kupreychik
d4c7515681
Add time_throttle filter to sensor.filter ( #20334 )
...
* Added time_throttle filter
* Added time_throttle filter test
* Updated comments for time_throttle filter
2019-01-25 10:07:45 +00:00
Daniel Høyer Iversen
1bd31e3459
Change STATE_UNKOWN to None ( #20337 )
...
* Change STATE_UNKOWN to None
* Change STATE_UNKOWN to None
* tests
* tests
* tests
* tests
* tests
* style
* fix comments
* fix comments
* update fan test
2019-01-24 08:20:20 +01:00
Nikolay Vasilchuk
075b575bde
Support device_class for rest sensor ( #20132 )
...
* Ready
* Tests fixed
2019-01-16 10:03:53 -08:00
Robert Svensson
a3f0d55737
Change deCONZ to embedded platforms ( #20113 )
...
Move all platforms into components/deconz
2019-01-15 19:29:56 +01:00
emontnemery
5b53bd6aa0
Move MQTT platforms under the component ( #20050 )
...
* Move MQTT platforms under the component
2019-01-15 17:31:06 +01:00
Paulus Schoutsen
6cba51fd0e
Lint
2019-01-11 16:31:16 -08:00
Paulus Schoutsen
578bfe9798
Fix fail2ban tests
2019-01-11 15:01:24 -08:00
Fredrik Erlandsson
b9a488912a
Add support for 'via_hub' for device_info ( #19454 )
...
* Add support for 'via_hub'
* Update config schema
* add domain to via_hub
* add tests for via_hub
2019-01-11 13:11:13 -08:00