Commit Graph

357 Commits

Author SHA1 Message Date
J. Nick Koston
2a9f043039 Use ULID short format for context ids (#71119) 2022-05-01 21:44:54 -07:00
J. Nick Koston
d03760d0bb Switch to using ULIDs for context_ids (#70246) 2022-04-18 22:45:41 -07:00
Marc Mueller
c9cc2eb7c8 Fix flaky datetime test (#68524) 2022-03-23 09:30:01 +01:00
Paulus Schoutsen
929df2bc29 Improve error handling process_play_media_url (#68322) 2022-03-20 20:25:15 -07:00
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 ontime.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