Commit graph

3508 commits

Author SHA1 Message Date
J. Nick Koston
242aae514e
Small cleanups to list_statistic_ids (#124451) 2024-08-25 18:32:32 +02:00
dontinelli
d94b1e6e8a
Add icons for conductivity (#124576) 2024-08-25 18:14:38 +02:00
Christian Neumeier
3e53cc175f
Change POWER_VOLT_AMPERE_REACTIVE to UnitOfReactivePower (#117153)
* Refactoring: exchange POWER_VOLT_AMPERE_REACTIVE with UnitOfReactivePower

* updated iotawatt and mysensors from VOLT_AMPERE_REACTIVE to UnitOfReactivePower.VOLT_AMPERE_REACTIVE

* deprecation period for POWER_VOLT_AMPERE_REACTIVE changed to one year.

* POWER_VOLT_AMPERE_REACTIVE changed to UnitOfReactivePower in blebox integration

* Update homeassistant/const.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-08-21 15:36:45 +02:00
Sid
3142f52a79
Add Ruff refurb rules (#121701) 2024-07-10 21:47:40 +02:00
Richard Kroegel
865190f0b0
Get suggested_unit_of_measurement via unit converter's UNIT_CLASS (#119196)
Co-authored-by: Richard <rikroe@users.noreply.github.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-07-10 17:45:07 +02:00
epenet
f65d91f6d2
Refactor PLATFORM_SCHEMA imports in platforms (#120564) 2024-06-26 15:44:59 +02:00
G Johansson
b59e7ede9a
Raise on incorrect suggested unit for sensor (#120180) 2024-06-22 22:05:45 +02:00
dontinelli
0dd5391cd7
Add Siemes and Millisiemens as additional units of conductivity and enable conversion between conductivity units (#118728) 2024-06-21 11:10:15 +02:00
Jan Bouwhuis
66faeb28d7
Fix late group platform registration (#119789)
* Fix late group platform registration

* use a callback instead

* Run thread safe

* Not working domain filter

* Also update if a group has nested group's

* Only update if the siingle state type key could change

* Avoid redundant regisister hooks

* Use set, add comment

* Revert changes

* Keep callback cleanup const

* Cleanup after dependencies

* Preimport and cleanup excluded domains

* Revert test changes as we assume early set up now

* Migrate alarm_control_panel

* Migrate climate

* Migrate cover

* Migrate device_tracker

* Migrate lock

* Migrate media_player

* Migrate person

* Migrate plant

* Migrate vacuum

* Migrate water_heater

* Remove water_heater group_pre_import

* Use Platform enum if possible

* Also use platform enum for excluded domains

* Set registry to self._registry

* move deregistering call back hook to async_added_to_hass

* Add comment

* Do no pass mutable reference to EXCLUDED_DOMAINS

* Remove unneeded type hint
2024-06-18 20:01:16 +02:00
J. Nick Koston
9082dc2a79
Reduce recorder overhead when entity filter is empty (#119631) 2024-06-14 08:43:51 +02:00
Matthias Alphart
171707e8b7
Translation support for device automation extra fields (#115892)
* Translation support for device trigger extra fields

* Move extra_fields translations to backend
2024-06-12 14:10:02 +02:00
J. Nick Koston
dff8c06166
Fix unnecessary calls to update entity display_precision (#118159) 2024-05-26 13:32:59 +02:00
Marc Mueller
bc2ee96cae
Remove quotes surrounding annotations (#117817) 2024-05-20 22:06:58 +02:00
J. Nick Koston
2401580b6f
Make a copy of capability_attributes instead of making a new dict (#116477) 2024-04-30 17:54:33 -05:00
Jan Bouwhuis
986df70fe3
Refactor group setup (#116317)
* Refactor group setup

* Add @callback decorator and remove commented out code

* Keep set, add default on state
2024-04-28 16:32:17 +02:00
Phil Bruckner
169b9b0bfe
Fix removing suggested_display_precision from entity registry (#110671)
* Fix removing suggested_display_precision from entity registry

* Fix tests

* Update homeassistant/components/sensor/__init__.py

---------

Co-authored-by: Erik <erik@montnemery.com>
2024-04-24 16:47:03 +02:00
Richard Kroegel
474a1a3d94
Use display_precision if suggested_display_precision is None (#110270)
Co-authored-by: Richard <rikroe@users.noreply.github.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-04-24 09:46:55 +02:00
Sid
3799d20d43
Enable Ruff B905 (#114197) 2024-04-14 00:14:26 -05:00
Marc Mueller
2decf6c023
Use dict instead of MutableMapping [recorder] (#115318) 2024-04-09 15:08:31 -10:00
Sid
9cbed10372
Enable Ruff PYI041 (#115229) 2024-04-08 09:29:05 -10:00
Marc Mueller
816ce116bf
Remove unnecessary functools.cached_property backport (#114239) 2024-04-04 11:24:26 +02:00
Franck Nijhof
2388e2dda9
Drop Python 3.11 support (#114220) 2024-03-26 12:51:14 +01:00
Joost Lekkerkerker
6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
J. Nick Koston
b26928878f
Remove group integration platforms that use the default states (#113562)
Remove group integration platforms that use the default

There is no need to register platforms that use the defaults
as the group code already uses STATE_ON/STATE_OFF when there
are no on/off states in the GroupIntegrationRegistry
2024-03-15 20:51:21 -04:00
J. Nick Koston
c3b5e819c5
Fix group loading too late resulting in incorrect state (#113262) 2024-03-13 19:18:15 -10:00
Marc Mueller
aa16a9d707
Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
Marc Mueller
2c06d4fcb9
Add empty line after module docstring (2) [components] (#112736) 2024-03-08 19:15:59 +01:00
Marc Mueller
930a396712
Add empty line after module docstring [s] (#112704) 2024-03-08 14:33:51 +01:00
fwestenberg
385b29bdf5
Add Beaufort to wind_speed (#105795)
* Add Beaufort to wind_speed

* Add Bft to UnitOfSpeed

* Update tests with Bft

* Remove check for unit

* Fix test_deprecated_constants

* Test depricated constant Beaufort

* Fix test_unit_system.py for Beaufort

* Remove _DEPRECATED_SPEED_FEET_BEAUFORT

* Remove maxsize from lru_cache

* Update test_deprecated_constants

* Update comment

* Add missing docstring

* Apply suggestions from code review

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-03-05 14:55:59 +01:00
Marc Mueller
5f8ef37f2d
Update pylint to 3.0.4 (#111229)
* Update pylint to 3.0.4

* Use yield from

* Remove unnecessary pylint disable comments
2024-02-23 23:46:00 +01:00
Maciej Bieniek
e81a9947e0
Fix typo in sensor icons configuration (#110133)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-09 20:05:01 +01:00
Marc Mueller
545b888034
Update ruff to 0.2.1 (#109796)
* Update ruff to 0.2.1

* Rename config sections

* Update remapped error codes

* Add ignores
2024-02-06 15:41:34 +01:00
Jan Bouwhuis
5dfffb0818
Allow weight to be used as total_increasing state_class for sensors (#108505)
* Allow weight to be used as total_increasing state_class for sensors

* Add SensorStateClass.TOTAL
2024-02-05 18:01:06 +01:00
J. Nick Koston
3db0331378
Avoid converting to same units when compiling stats (#109531) 2024-02-04 15:21:05 +01:00
Joakim Plate
eefc6cd50a
Correct flow rate conversion review after merge (#109501) 2024-02-04 15:01:06 +01:00
J. Nick Koston
7d9935d24b
Reduce overhead to convert history to float states (#109526) 2024-02-04 11:37:14 +01:00
Marc Mueller
d2dee9e327
Update ruff to 0.1.15 (#109303) 2024-02-01 13:29:01 +01:00
Robert Resch
b409933d19
Add DurationConverter (#108865)
* Add DurationConverter

* Update withings snapshots

* Add sensor test

* Fix tests

* Update snapshots after #108902 was merged
2024-01-30 23:08:12 +01:00
karwosts
ef4e72f218
Fix precipitation typo in icons (#109156) 2024-01-30 10:32:53 -10:00
Robert Resch
7d2c6a1bb6
Add check for valid initial_suggested_unit (#108902)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-01-30 18:55:59 +01:00
Joakim Plate
cece117c93
Flow rate unit conversions and device class (#106077)
* Add volume flow rate conversions

* Add missing translations

* Adjust liter unit and add gallons per minute

* Adjust to min instead of m for minutes

* Add matching class for number

* Add some tests for number and sensor platform

* Add deprecated constants

* Add explicit list of flow rate for check

This reverts commit 105171af31.
2024-01-30 15:01:08 +01:00
Jan-Philipp Benecke
80bfd4cef7
Raise ValueError when last_reset set and not total state class (#108391)
* Raise ValueError when last_reset set and not total state class

* Fix test

* Break long string into smaller ones
2024-01-29 20:21:35 +01:00
Franck Nijhof
206e6dfd62
Add sensor icon translations (#108450)
* Add sensor icon translations

* Add missing moisture
2024-01-20 11:05:16 +01:00
J. Nick Koston
50edc334de
Refactor sensor recorder _get_sensor_states to check for state class first (#107046)
The state class check is cheap and the entity filter check is much
more expensive, so do the state class check first
2024-01-07 22:36:03 -05:00
Erik Montnemery
c805ea7b4f
Include deprecated constants in wildcard imports (#107114) 2024-01-05 11:46:45 +01:00
Erik Montnemery
c1f1b5c50b
Ensure it's safe to call Entity.__repr__ on non added entity (#106032) 2023-12-31 18:54:34 +01:00
J. Nick Koston
178e4f9e25
Use converter factory in sensor platform (#106508)
This is a bit faster than calling .covert
2023-12-28 00:06:36 +01:00
J. Nick Koston
1c96cf33b8
Avoid recreating a set each time sensor unit_of_measurement is called (#106401) 2023-12-25 21:11:48 -10:00
J. Nick Koston
50f64e053e
Use identity checks for sensor device class enums (#106383) 2023-12-25 08:35:44 -10:00
Robert Resch
ebdf7b9c8c
Deprecate some deprecated const constants (#106230)
* Deprecate some deprecated const constants

* Improve code

* fix typing

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-12-23 20:18:51 +01:00