Joakim Sørensen
9a6f5bbc04
Update whoami URL ( #67793 )
2022-03-07 11:11:25 +01:00
J. Nick Koston
ffcac67d99
Add is_ipv4_address and is_ipv6_address utils ( #66472 )
2022-02-13 15:23:11 -06:00
Tobias Sauerwein
8b38fa58aa
Bump pytest to 7.0.0 ( #65981 )
2022-02-08 10:03:27 +01:00
J. Nick Koston
676edb610f
Add coverage for color_rgbww_to_rgb, fix divzero case ( #65721 )
2022-02-05 10:59:32 -06:00
Franck Nijhof
fa09cf663e
Update black to 22.1.0 ( #65788 )
2022-02-05 14:19:37 +01:00
Paulus Schoutsen
5da923c341
Protect state.as_dict from mutation ( #65693 )
2022-02-04 14:45:25 -08:00
J. Nick Koston
26ff6d2aa0
Fix warm/cold reversal in rgbww_to_color_temperature ( #65677 )
2022-02-04 11:36:30 -08:00
Erik Montnemery
63680f0b36
Make util.async_.protect_loop name names ( #65493 )
2022-02-03 14:06:40 +01:00
Erik Montnemery
5a34feb7de
Don't warn on time.sleep injected by the debugger ( #65420 )
2022-02-02 08:58:14 -08:00
Erik Montnemery
2caad1a474
Add support for converting to and from mmHg ( #64844 )
2022-01-24 22:57:56 +01:00
Erik Montnemery
7c110eeef4
Remove Windows workarounds from tests/utils/test_json.py ( #64311 )
2022-01-17 19:34:46 +01:00
Matthias Alphart
dc58bc375a
Warn on`time.sleep` in event loop ( #63766 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-01-11 17:55:24 +01:00
Franck Nijhof
20bdcc7fff
Replace hass.helpers: async_get_clientsession() ( #63910 )
2022-01-11 17:33:50 +01:00
Paulus Schoutsen
1ea3a17d89
Allow sending webhooks via WS connection ( #62725 )
2022-01-07 10:41:36 -08:00
J. Nick Koston
d325de7510
Add additional guarding to color_rgb_to_rgbww ( #62220 )
2021-12-19 09:44:53 -06:00
J. Nick Koston
94ae6ac2b2
Handle color temp to RGBWW conversion ( #61473 )
...
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-12-16 05:39:33 -06:00
J. Nick Koston
3eabd69666
Fix exception in color_rgb_to_rgbww ( #61466 )
2021-12-10 22:19:54 -08:00
Marvin Wichmann
707fe67c00
Move StrEnum to homeassistant.backports and move Platform to homeassistant.const ( #60880 )
...
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-12-03 09:31:17 +01:00
Erik Montnemery
9f4a99fe81
Revert "Add bytes support for bitwise template operations" ( #60854 )
2021-12-03 08:50:29 +01:00
Franck Nijhof
3c66706a49
Clean up deprecated sanitize_filename and sanitize_path ( #60859 )
2021-12-02 15:35:11 -05:00
Erik Montnemery
88068fa97f
Remove unused OrderedEnum ( #60392 )
2021-11-26 11:10:39 +01:00
Jan Bouwhuis
d33457b7bc
Add bytes support for bitwise template operations ( #60211 )
...
* Add bytes support for bitwise template operations
* spelling
* Update bitwise tests
* remove try block for bytes conversion
* do not accept empty `bytes` object
2021-11-24 15:15:27 +01:00
Ville Skyttä
053c456199
Change device entry type to an StrEnum ( #59940 )
...
Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-11-22 18:14:15 +01:00
rianadon
ecf00a1eae
Add accumulated precipitation to unit system ( #59657 )
...
* Add accumulated precipitation to unit system
* Fix template test
* Fix typo of testing pressure instead of precipitation
* Add extra arguments so unit system test passes
2021-11-19 09:18:44 +01:00
rianadon
7cc7bbb76d
Add speed to units system ( #58437 )
...
* Use speed units in unit system
* Use more obvious conversion factor for unit system speed test
* Use wind_speed instead of speed, use m/s
2021-11-18 16:08:42 +01:00
Erik Montnemery
fa952364cc
Remove test_check_package_version_does_not_match ( #59785 )
2021-11-16 07:54:08 -08:00
J. Nick Koston
96f7b0d910
Use atomicwrites for mission critical core files ( #59606 )
2021-11-15 11:19:31 +01:00
Matthias Alphart
f8f060b72b
Make util.color._match_max_scale public ( #59207 )
2021-11-10 22:29:16 -08:00
J. Nick Koston
ebb25ab0e6
Make yaml file writes safer ( #59384 )
2021-11-10 22:19:56 -08:00
Tim Rightnour
93395f9b68
Add support for PRESSURE_CBAR (centibars) ( #58762 )
...
* Add support for PRESSURE_CBAR (centibars). This is the standard UOM for tensiometers.
While the data could be converted into something like MBAR, and displayed
like that, the correct UOM for this type of sensor is CBAR. Displaying
it as MBAR would be the same as displaying air pressure as feet of Hg, while
technically correct, it's hard to understand when reading.
Adding support for this UOM will fix errors in the UI(statistics) about the unit not
matching a unit of the device_class.
* Add tests for PRESSURE_CBAR
2021-11-10 09:44:05 +01:00
rianadon
a102c425a9
Add speed conversion function & add speed to units system ( #53846 )
...
* Add speed conversion function
* Add test for speed utility functions
* Update unit system tests
* Fix incorrect unit conversions in tests
* Fix some test errors
* Calculate speed units from smaller set of constants
* Fix typo in speed test
* Use pytest.approx for checking floating point values
* Change other instance of speeds needing to be pytest.approx
* Revert changes to unit system
* Fix oopsie in defining in/day and in/hr
* Parametrize test
* Add comments describing calculations & remove duplicate test
2021-11-09 08:12:28 +01:00
Otto Winter
a9c0f89c09
Fix find_next_time_expression_time ( #58894 )
...
* Better tests
* Fix find_next_time_expression_time
* Add tests for Nov 7th 2021, Chicago transtion
* Update event tests
* Update test_event.py
* small performance improvement
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-11-01 17:45:13 +01:00
Glenn Waters
e4f15c42e0
Add kPa as a pressure unit ( #56885 )
2021-10-01 08:08:04 -07:00
Paulus Schoutsen
19c54b8cbf
Drop unused ruamel ( #55672 )
2021-09-03 22:17:10 -07: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
Marc Mueller
553521a76b
Add mixin classes for required keys in EntityDescription ( #53610 )
2021-07-28 11:50:13 +02:00
Joakim Sørensen
85c1614204
Add currency to location data ( #53575 )
2021-07-27 21:05:16 -07:00
Ville Skyttä
470f2dd73f
Upgrade pyupgrade to 2.21.2, apply its changes ( #52987 )
2021-07-19 10:46:09 +02:00
J. Nick Koston
1ba5c1c9fb
Fix deadlock at shutdown with python 3.9 ( #52613 )
2021-07-07 09:23:24 +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
Joakim Sørensen
7ff14b47a8
Use whoami for location lookup ( #50934 )
2021-05-22 20:34:48 -07:00
J. Nick Koston
bf2d40adfe
Migrate from pytz to python-dateutil ( #49643 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-05-07 22:46:26 -07:00
Marc Mueller
f1d48ddfe3
Update pylint to 2.8.0 ( #49637 )
2021-04-24 14:39:24 -10:00
J. Nick Koston
04a0ca14e0
Ensure shutdown does not deadlock ( #49282 )
2021-04-18 08:55:51 -10:00
J. Nick Koston
d71f913a12
Ensure original log handlers are restored at close ( #49230 )
...
Error messages after close were not being logged
2021-04-15 10:53:48 +02:00
Paulus Schoutsen
051531d9c1
Clean up mobile app ( #48607 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-04-01 16:22:08 -07:00
J. Nick Koston
f91de1c8b9
Add support for capturing renewals to dhcp discovery ( #48242 )
2021-03-30 15:41:12 +02:00
Franck Nijhof
ad13a9295e
Merge multiple context managers in tests ( #48146 )
2021-03-27 09:17:15 +01:00
J. Nick Koston
b50dcef94f
Block detectable I/O in the event loop ( #48387 )
...
We added a warning when this happens last April and gave developers
a year to fix the instability. We now prevent the instability by
raising RuntimeError when code attempts to do known I/O in the
event loop instead of the executor.
We now provide a suggestion on how to fix the code that is causing
the issue.
2021-03-27 08:54:49 +01:00
J. Nick Koston
c340a39275
Handle range conversions that do not start at 1 ( #48298 )
2021-03-24 12:33:44 -10:00
Franck Nijhof
6932cf9534
Use contextlib.suppress where possible ( #48189 )
2021-03-23 14:36:43 +01:00
Franck Nijhof
5a2b5fe7c5
Yoda assertion style removed is ( #48142 )
2021-03-20 13:55:10 +01:00
Franck Nijhof
e47d8da3b4
Remove defunct test from percentage util ( #48125 )
2021-03-19 17:16:45 -05:00
Franck Nijhof
8a56dbf587
Add flake8 comprehensions checks to pre-commit & CI ( #48111 )
2021-03-19 13:41:09 +01:00
Paulus Schoutsen
7fe3c472e9
Improve bad JSON data reporting ( #47932 )
...
* Improve bad data reporting
* Fix tests
Co-authored-by: Erik <erik@montnemery.com>
2021-03-15 10:41:25 +01:00
J. Nick Koston
9a686d148e
Ensure startup can proceed when there is package metadata cruft ( #47706 )
...
If a package fails to install or partially installed importlib
version can return None. We now try pkg_resources first, then
try importlib, and handle the case where version unexpectedly
returns None
2021-03-10 21:12:02 -10:00
Paulus Schoutsen
2df644c6cc
Clean up secret loading ( #47034 )
2021-03-02 12:58:53 -08:00
Paulus Schoutsen
633a7aeb22
Remove deprecated credstash + keyring ( #47033 )
2021-02-25 09:48:19 +01:00
Tom Parker-Shemilt
27d16af36b
Don't allow recursive secrets loading ( #41812 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-14 14:23:31 +01:00
J. Nick Koston
9f59515bb8
Fix shutdown deadlock with run_callback_threadsafe ( #45807 )
2021-02-01 10:54:39 +01:00
J. Nick Koston
068d1b5eb8
Separate fan speeds into percentages and presets modes ( #45407 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: John Carr <john.carr@unrouted.co.uk>
2021-01-27 17:44:36 -06:00
Thomas Hollstegge
78b057ce02
Make sure generated slugs are not empty ( #43153 )
2021-01-27 12:25:49 +01:00
Joakim Sørensen
b1c2cde40b
Changes to filename and path validation ( #45529 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-01-26 15:53:21 +01:00
Paulus Schoutsen
0930aae208
Avoid misuse sanitize_path, clarify docs ( #45469 )
2021-01-23 18:28:57 +01:00
Pascal Vizeli
a7a4875f52
Add more debug details to running timeouts ( #43644 )
...
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-01-04 13:10:39 +01:00
Franck Nijhof
65cf2fcb6f
Drop asynctest ( #44746 )
2021-01-01 22:31:56 +01:00
Paulus Schoutsen
1c9c99571e
Use !input instead of !placeholder ( #43820 )
...
* Use !input instead of !placeholder
* Update input name
* Lint
* Move tests around
2020-12-01 18:21:36 +01:00
J. Nick Koston
94bf55e29b
Limit concurrency of async_get_integration to avoid creating extra threads ( #43085 )
...
* Limit concurrency of async_get_integration to avoid creating extra threads
Since async_get_integration is waiting on the disk most of the time
it would end up creating many new threads because the disk could
not deliver the data in time.
* pylint
2020-11-10 21:34:54 -10:00
springstan
67b3552165
Add more units to distance conversion util ( #40181 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-11-09 11:38:15 +01:00
Paulus Schoutsen
0fb587727c
Add initial blueprint support ( #42469 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2020-11-02 15:00:13 +01:00
Dmitry
b106149588
Fix string parameter processing in parse_time_expression ( #41468 ) ( #41469 )
2020-10-09 11:48:49 +02:00
J. Nick Koston
8d5c124deb
Improve performance of generating non-cryptographically secure uuids ( #41314 )
2020-10-07 16:37:01 +02:00
J. Nick Koston
e08ee282ab
Abort execution of template renders that overwhelm the system ( #40647 )
2020-09-28 14:43:22 +02:00
J. Nick Koston
f8704a2dfc
Ensure we always fire time pattern changes after microsecond 0 ( #39302 )
2020-08-28 16:27:25 +02:00
Franck Nijhof
1c2ebdf307
Upgrade black to 20.8b1 ( #39287 )
2020-08-27 13:56:20 +02:00
Paulus Schoutsen
51a63c1fc4
Drop last bits of asyncio.coroutine ( #39280 )
2020-08-26 16:57:52 +02:00
J. Nick Koston
bee6d87e7a
Standardize uuid generation for events/storage/registry ( #39184 )
2020-08-24 17:21:30 +02:00
Bas Nijholt
0427d87ba4
Bump codespell from v1.16.0 to v1.17.1 and fix new spelling errors ( #38663 )
2020-08-08 14:41:02 +02:00
Pascal Vizeli
c291d4aa7d
Intelligent timeout handler for setup/bootstrap ( #38329 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-05 14:58:19 +02:00
J. Nick Koston
a91f5b7192
Prevent ping integration from blocking startup ( #38504 )
2020-08-05 12:43:35 +02:00
Jelle Raaijmakers
ef254a1c3d
Round time values in get_age() to better approximate the actual age ( #37125 )
2020-07-09 11:19:38 -07:00
Paulus Schoutsen
3ee3ae7633
Fix cloudhooks coming in for non existing webhooks ( #36836 )
...
* Fix cloudhooks coming in for non existing webhooks
* Fix tests"
2020-06-15 16:30:40 -07:00
Paulus Schoutsen
fae80621fb
Guard blowing up converting 0 mired/kelvin ( #35486 )
2020-06-04 08:48:39 -07:00
J. Nick Koston
1297a09344
Avoid locking in the logging queue handler ( #35700 )
...
* Avoid locking in the logging queue handler
We do not need a lock here as the underlying queue is already
thread safe.
* Add coverage for logging handle
2020-05-17 14:39:27 +02:00
J. Nick Koston
73616520c0
Use built in queue log handlers to avoid formatting logs in the event loop ( #35633 )
...
* Use built in queue log handlers to avoid formatting logs in the event loop
Logging is now formatted and written in another thread to
ensure there is minimal impact on the event loop when
a log message is processed.
This change replaces the existing AsyncHandler log handler
as python 3.7+ now offers an off the shelf solution
* add a simple test
* s/async_migrate_log_handlers_to_queue/async_activate_log_queue_handler/g
2020-05-16 09:29:58 -05:00
Franck Nijhof
2223592486
Add get_url helper, deprecate base_url ( #35224 )
2020-05-08 02:29:47 +02:00
Erik Montnemery
f1ecac92df
Fail tests if wrapped callbacks or coroutines throw ( #35010 )
2020-05-06 14:14:57 -07:00
Paulus Schoutsen
2af984917e
Use asynctest-mock in most places ( #35109 )
...
* Use asynctest-mock in most places
* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00
Paulus Schoutsen
ec47216388
Use built-in test helpers on 3.8 ( #34901 )
2020-04-30 13:29:50 -07:00
Paulus Schoutsen
e7f8d6bbf7
Fix more tests on Python 3.8 ( #34703 )
2020-04-25 15:52:50 -07:00
Paulus Schoutsen
d011b46985
Patch http.client to not do I/O in the event loop ( #34194 )
2020-04-15 15:32:10 -07:00
Paulus Schoutsen
d93c09327a
Report unserializable data in websocket ( #34072 )
...
* Report unserializable data in websocket
* Fix tests
* log types too
2020-04-13 23:46:41 -07:00
springstan
eae21be5b9
Improve string formatting v6 ( #33698 )
2020-04-07 23:14:28 +02:00
Franck Nijhof
60bc517d01
Collection of core tests improvements ( #33757 )
...
* Collection of core tests improvements
* Added some more
* Fix aiohttp client response release
2020-04-07 09:33:23 -07:00
J. Nick Koston
4a32a0f1da
Expand network util to check for link local addresses ( #33499 )
2020-04-01 11:24:30 -07:00
Paulus Schoutsen
a6b5d73f1c
Report which data causes JSON serialization error ( #31901 )
2020-02-17 10:49:42 -08:00
Ville Skyttä
5e2ba2eb77
Enable some more bandit checks ( #30857 )
...
* Enable B108 (hardcoded tmp dir), address findings
* Enable B602 (subprocess popen with shell), address findings
* Enable B604 (start process with shell), address findings
* Enable B306 (mktemp), B307 (eval), and B325 (tempnam), no issues to address
2020-01-20 18:44:55 +02:00
Paulus Schoutsen
e1205409f3
Handle location API being exhausted ( #30798 )
2020-01-16 17:31:12 +01:00
Ville Skyttä
5216477353
Be consistent with Home Assistant and Hass.io spelling ( #30500 )
...
* Be consistent with Home Assistant spelling
* Be consistent with Hass.io spelling
2020-01-05 14:09:17 +02:00
Ville Skyttä
e6388e186c
Remove unnecessary string literal concatenations ( #30360 )
2020-01-02 21:17:10 +02:00