Commit Graph

16 Commits

Author SHA1 Message Date
Robert Resch
a67045ee6c Remove deprecated home assistant const constants () 2024-11-28 12:12:37 +01:00
Michael Arthur
d8549409f7 Area units and conversion between metric and US ()
* area conversions

* start work on tests

* add number device class

* update unit conversions to utilise distance constants

* add area unit

* update test unit system

* update device condition and trigger

* update statistic unit converters

* further tests work WIP

* update test unit system

* add missing string translations

* fix websocket tests

* add deprecated notice

* add more missing strings and missing initialisation of unit system

* adjust icon and remove strings from scrape and random

* Fix acre to meters conversion

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Tidy up valid units

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* fix ordering of area

* update order alphabetically

* fix broken test

* update test_init

* Update homeassistant/const.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* remove deprecated unit and fix alphabetical order

* change deprecation and add tests, change to millimeter conversion for inches

* fix order

* re-order defs alphabetically

* add measurement as well

* update icons

* fix up Deprecation of area square meters

* Update core integrations to UnitOfArea

* update test recorder tests

* unit system tests in alphabetical

* update snapshot

* rebuild

* revert alphabetization of functions

* other revert of alphabetical order

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-11-21 16:10:44 +01:00
Manu
397a299f15 Add µV as UnitOfElectricPotential () 2024-11-19 22:38:22 +01:00
Jakob Schlyter
cd11f01ace Add support for MW/GW/TW and GWh/TWh () 2024-11-08 22:12:16 +01:00
G Johansson
cdfec7ebb4 Implement new state property for alarm_control_panel which is using an enum ()
* Alarm state from enum

* Fixes

* Set final

* Fix rebase

* Test const

* Fix breaking version

* Fix other for alarm_control_panel

* Fix integrations

* More

* More

* More

* More

* Fix zha

* Replace _attr_state

* Fix alarm_control_panel

* Fix tests

* Fixes

* Mods

* Change some

* More

* More

* More

* Tests

* Last tests

* Return enum

* Fix zha

* Remove not needed check

* Fix wording

* Fix homekit

* Mod prometheus

* Fix mypy

* Fix homekit

* Fix ifttt
2024-10-21 22:54:27 +02:00
Erik Montnemery
0956dbb578 Rename UnitOfConductivity enum members ()
* Rename UnitOfConductivity enum members

* Update test snapshots
2024-10-08 14:44:01 +02:00
G Johansson
93aade6e8e Change lock state to an enum ()
* Add new LockState enum for lock states

* Add rest

* Fix insteon tests

* Fix mqtt tests

* Fix tesla_fleet

* Revert back ST_STATE_LOCKED

* Add back constant
2024-09-24 12:30:50 +02:00
Marc Mueller
f0b9a806d1 Fix missing type[..] annotation in tests () 2024-07-20 11:11:16 +02:00
epenet
65befcf5d4 Fix import pylint warning in core tests () 2024-06-11 15:04:00 +02:00
Joost Lekkerkerker
05172d8e4d Improve loops and lists ()
* Enable PERF

* Enable PERF rule

* Enable PERF rule

* Don't enable flag yet
2024-03-14 10:22:20 +01:00
Marc Mueller
aa16a9d707 Add empty line after module docstring (3) () 2024-03-08 20:38:34 +01:00
fwestenberg
385b29bdf5 Add Beaufort to wind_speed ()
* 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
Joakim Plate
cece117c93 Flow rate unit conversions and device class ()
* 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
Erik Montnemery
c805ea7b4f Include deprecated constants in wildcard imports () 2024-01-05 11:46:45 +01:00
Robert Resch
fbcb31b103 Deprecate deprecated unit of measurement constants () 2023-12-27 09:04:25 +01:00
Robert Resch
ebdf7b9c8c Deprecate some deprecated const constants ()
* 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