Commit Graph
462 Commits
Author SHA1 Message Date
J. Nick KostonandGitHub 3eabd69666 Fix exception in color_rgb_to_rgbww (#61466) 2021-12-10 22:19:54 -08:00
Allen PorterandGitHub ab75efda9a Add debug logging for pip install command (#61057) 2021-12-05 13:30:02 -08:00
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 MontnemeryandGitHub 9f4a99fe81 Revert "Add bytes support for bitwise template operations" (#60854) 2021-12-03 08:50:29 +01:00
Franck NijhofandGitHub c8b0a3b667 Revert "Move Platform StrEnum to const" (#60875) 2021-12-02 14:19:08 -08:00
Franck NijhofandGitHub 6e220d5d17 Move Platform StrEnum to const (#60857) 2021-12-02 22:30:52 +01:00
Franck NijhofandGitHub 3c66706a49 Clean up deprecated sanitize_filename and sanitize_path (#60859) 2021-12-02 15:35:11 -05:00
Marc MuellerandGitHub a90ef488a1 Add return type annotation to StrEnum (#60624) 2021-11-30 16:26:02 +01:00
Franck NijhofandGitHub 6e3f522d4b Fix StrEnum backport return type issue (#60610) 2021-11-30 11:16:56 +01:00
Erik MontnemeryandGitHub 88068fa97f Remove unused OrderedEnum (#60392) 2021-11-26 11:10:39 +01:00
Jan BouwhuisandGitHub 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
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
rianadonandGitHub 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
rianadonandGitHub 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
5fc51130ea Replace util.get_local_ip in favor of components.network.async_get_source_ip() - part 4 (#58669)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-11-15 09:18:57 -08:00
J. Nick KostonandGitHub 96f7b0d910 Use atomicwrites for mission critical core files (#59606) 2021-11-15 11:19:31 +01:00
Matthias AlphartandGitHub f8f060b72b Make util.color._match_max_scale public (#59207) 2021-11-10 22:29:16 -08:00
J. Nick KostonandGitHub ebb25ab0e6 Make yaml file writes safer (#59384) 2021-11-10 22:19:56 -08:00
Tim RightnourandGitHub 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
rianadonandGitHub 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
1cd9be7538 Fix recursive limit in find_next_time_expression_time (#58914)
* Fix recursive limit in find_next_time_expression_time

* Add test case

* Update test_event.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-11-02 00:11:17 +01:00
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
Marc MuellerandGitHub e0c0d00833 Use assignment expressions 39 (#58829) 2021-10-31 18:56:25 +01:00
Ville SkyttäandGitHub b0e1bab58b Use http.HTTPStatus in util.aiohttp (#58456) 2021-10-26 13:13:27 +02:00
Boris KandGitHub 8b02703585 Fix color util links to Philips Hue documentation (#57099) 2021-10-05 11:19:09 +02:00
Glenn WatersandGitHub e4f15c42e0 Add kPa as a pressure unit (#56885) 2021-10-01 08:08:04 -07:00
Marc MuellerandGitHub 77ee72cbb9 Import Callable from collections.abc (1) (#56775) 2021-09-29 16:32:11 +02:00
Marc MuellerandGitHub 7af67d34cf Use assignment expressions 01 (#56394) 2021-09-18 13:31:35 -10:00
Marc MuellerandGitHub b3181a0ab2 Use NamedTuple for RGBColor (#55698) 2021-09-04 09:25:25 +02:00
Paulus SchoutsenandGitHub 19c54b8cbf Drop unused ruamel (#55672) 2021-09-03 22:17:10 -07:00
Ville SkyttäandGitHub 848c0be58a Avoid some implicit generic Anys (#54577) 2021-08-16 23:12:06 +02:00
Daniel Hjelseth HøyerandGitHub 49a69d5ba0 Add missing PRESSURE_BAR conversion (#54497)
* Add missing PRESSURE_BAR

* style

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* valid units

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
2021-08-12 07:30:35 +02:00
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 MuellerandGitHub 553521a76b Add mixin classes for required keys in EntityDescription (#53610) 2021-07-28 11:50:13 +02:00
Joakim SørensenandGitHub 85c1614204 Add currency to location data (#53575) 2021-07-27 21:05:16 -07:00
J. Nick KostonandGitHub 6d493a848c Ensure PyPI packages can still be installed on high latency connections (#53365) 2021-07-24 14:07:10 +02:00
Marc MuellerandGitHub a56485a8c5 Revert new unit types (#53226) 2021-07-20 14:13:51 +02:00
Marc MuellerandGitHub f6b162bc39 Add pylint CodeStyle extension (#53147) 2021-07-19 06:57:06 -07:00
Marc MuellerandGitHub 71a8ae3016 Add new unit types for better type checking (#53124)
* Add new unit types
* Update helper functions
* Update components
* Update lcn climate
2021-07-18 14:43:47 +02:00
fbad453c89 Pylint 2.9.3 (#52972)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2021-07-14 21:44:57 -07:00
Ville SkyttäandGitHub 9864f2ef8b String formatting cleanups (#52937) 2021-07-13 00:12:55 +02:00
J. Nick KostonandGitHub 1ba5c1c9fb Fix deadlock at shutdown with python 3.9 (#52613) 2021-07-07 09:23:24 +02:00
Erik MontnemeryandGitHub b645560633 Minor improvements of util.percentage typing (#52581) 2021-07-06 13:29:39 +02:00
Erik MontnemeryandGitHub 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 MontnemeryandGitHub cca5964ac0 Normalize pressure statistics to Pa (#52298) 2021-06-29 23:30:13 +02:00
Franck NijhofandGitHub 13bf5dbee4 Upgrade mypy to 0.902 (#51907) 2021-06-16 14:35:32 +02:00
Martin HjelmareandGitHub 187374c11e Set Registry name parameter to Hashable type (#51203) 2021-05-28 15:29:11 +02:00
Joakim SørensenandGitHub 7ff14b47a8 Use whoami for location lookup (#50934) 2021-05-22 20:34:48 -07:00
Erik MontnemeryandGitHub 15e2c6d7dc Fix typing for dt_util as_timestamp (#50886)
* Fix typing for dt_util::as_timestamp

* Apply suggestions from code review
2021-05-22 09:34:49 +02:00
J. Nick KostonandGitHub eddc1ab778 Handle threads exiting unexpected during shutdown (#50907)
If a thread exits right when we are trying to force an exception
to shut it down, setting the exception will fail with SystemError.
At this point in the shutdown process we want to move on as this
will cause the shutdown to abort
2021-05-21 01:06:37 +02:00