1
0
mirror of https://github.com/home-assistant/core.git synced 2025-05-24 15:57:09 +00:00

38 Commits

Author SHA1 Message Date
Marc Mueller
b4eee166aa
Add voluptuous type aliases () 2024-06-25 11:58:27 +02:00
Erik Montnemery
904b89df80
Allow importing typing helper in core files ()
* Allow importing typing helper in core files

* Really fix the circular import

* Update test
2024-06-11 13:48:12 +02:00
Marc Mueller
87bb7ced79
Use PEP 695 for simple type aliases () 2024-05-17 14:42:21 +02:00
Sid
b456d97e65
Replace pylint protected-access with Ruff SLF001 () 2024-05-06 20:33:26 +02:00
Marc Mueller
6116f11e6c
Use EventType for system events () 2024-04-08 08:25:34 -10:00
Sid
8e98ba7312
Add first batch of Ruff PYI rules ()
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-04-07 11:30:50 -10:00
Marc Mueller
8324fd5d1d
Deprecated old backports and typing aliases () 2024-04-06 13:15:30 -10:00
Marc Mueller
19ab3d6daf
Add empty line after module docstring [helpers + other] () 2024-03-08 10:36:11 -05:00
Marc Mueller
d7e7dc96cc
Make Event data generic () 2024-03-08 13:46:16 +01:00
Marc Mueller
bdd253328d
Add generic Event class () 2023-07-23 21:51:54 +02:00
Marc Mueller
9e67bccb89
Replace EventType annotations with Event () 2023-07-18 08:51:06 +02:00
Marc Mueller
da35097803
Update Optional typing (2) [Py310] () 2023-01-23 09:10:05 +01:00
epenet
6002377d4f
Convert UnitConverter protocol to a class ()
* Convert UnitConverter protocl to a class

* Remove logic change

* Use TypeVar

* Remove NORMALIZED_UNIT from pressure

* Reduce size of PR

* Reduce some more

* Once more

* Once more

* Remove DEVICE_CLASS
2022-09-22 14:15:22 +02:00
epenet
713fb874a8
Add NORMALISED_UNIT to UnitConverter ()
* Add NORMALISED_UNIT to UnitConverter

* Adjust statistics

* Rename
2022-09-22 08:50:08 +02:00
epenet
39315b7fe3
Introduce UnitConverter protocol ()
* Introduce ConversionUtility

* Use ConversionUtility in number

* Use ConversionUtility in sensor

* Use ConversionUtility in sensor recorder

* Add normalise to ConversionUtility

* Revert changes to recorder.py

* Reduce size of PR

* Adjust recorder statistics

* Rename variable

* Rename

* Apply suggestion

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Apply suggestion

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Apply suggestion

Co-authored-by: Erik Montnemery <erik@montnemery.com>

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-09-22 07:18:00 +02:00
Marc Mueller
12757a8cd2
Update typing - collections.abc (1) ()
* Update typing - collections.abc (1)

* Additional typing updates
2022-01-12 07:56:35 +01:00
Marc Mueller
d3b7bd25ef
Update typing (1) () 2022-01-11 21:26:03 +01:00
Franck Nijhof
1b5596b4c2
Remove ServiceCallType alias from codebase () 2021-05-02 00:15:27 +02:00
jan iversen
49c23bad29
Revert "Remove HomeAssistantType from typing.py as it is no...2 ()
This reverts commit 39cb22374d20ec16e163bab07ce194b6a36c34bd.

Added comment that HomeAssistantType is not to be used, but only
kept in order not to break custom components.
2021-04-24 09:10:07 -10:00
jan iversen
39cb22374d
Remove HomeAssistantType from typing.py as it is no longer used. () 2021-04-23 11:08:58 +02:00
Marc Mueller
2956eb0902
Update pylint to 2.7.3 ()
* Update pylint to 2.7.3

* Add class-const-naming-style

* Remove unused-import message

* Additional cleanup
2021-03-29 18:02:56 -10:00
Marc Mueller
16dcbf1467
Update pylint () 2021-02-28 22:09:01 -10:00
Ville Skyttä
317ed418dd
Use singleton enum for "not set" sentinels ()
* Use singleton enum for "not set" sentinel

https://www.python.org/dev/peps/pep-0484/#support-for-singleton-types-in-unions

* Remove unused variable
2020-12-19 12:46:27 +01:00
Paulus Schoutsen
aa9dff572e
Add default variables to script helper () 2020-09-10 20:41:42 +02:00
Ville Skyttä
1bf2c4d976
Upgrade pylint to 2.6.0 () 2020-08-29 07:59:24 +02:00
Ville Skyttä
802c556e82
State and service related type hint improvements ()
* Improve type hint of service_func to register

* Add named type for state values

* Narrow some unnecessarily broad state type hints
2020-08-17 15:02:43 -04:00
Ville Skyttä
05abf37046
Type hint improvements ()
* Complete helpers.entity_component type hints

* Add discovery info type
2020-03-18 19:27:25 +02:00
Bas Nijholt
67c56c860d Sort imports according to PEP8 for 'homeassistant' folder ()
Components are already done
2019-12-09 16:42:10 +01:00
Tomer Figenblat
fe8a330a45 Update requirement version and add switcher_kis services ()
* Update aioswitcher requirement to 2019.4.26.

* Removed unnecessary legacy function call.

* Fixed log message capital first letter.

* Replaced None argument with empty dict.

* Replaced guard.

* Added ServiceCallType.

* Added set_auto_off and update_device_name services to the component.

* Added test cases for service calls.

* Conditioned the component services registry with the platform discovery.

* Update homeassistant/components/switcher_kis/__init__.py

Co-Authored-By: TomerFi <tomer.figenblat@gmail.com>

* Update homeassistant/components/switcher_kis/__init__.py

Co-Authored-By: TomerFi <tomer.figenblat@gmail.com>

* Resolved change requests.

* Added ContextType.

* Addes permission verification for service calls.

* Added test cases for permision verification and more.

* Replaced POLICY_CONTROL with the more suited POLICY_EDIT.

* More appropriate function name.

* Added domain and entity_id validation for calling services.

* Removed service for setting the vendor's device name.
2019-06-14 15:48:21 -07:00
Tomer Figenblat
9d8d8afa82 Added component named switcher_kis switcher water heater integration. ()
* Added component named switcher_kis switcher water heater integration.

* Fixed conflicts.

* Updated requirements.

* Added manifest.json file and updated CODEOWNERS.

* Fixed requirements_all.txt.

* Better component tests.

* Removed unnecessary parameter from fixture function.

* Removed tests section from mypy.ini.

* Remove unused ENTITY_ID_FORMAT.

* Stop udp bridge when failed to setup the component.

* Replace DISCOVERY_ constants prefix with DATA_.

* Various change requests.

* Fixed constant name change remifications.

* Added explicit name to fixture.

* Various change requests.

* More various change requests.

* Added EventType for homeassistant.core.Event.

* Switched from event driven data distribution to dispatcher type plus clean-ups.

* Removed name and icon keys from the component configuration.

* Various change requests.

* Various change reqeusts and clean-ups.

* Removed unnecessary DEPENDENCIES constant from swith platform.

* Replaced configuration data guard with assert.

* Removed unused constants.

* Removed confusing type casting for mypy sake.

* Refactor property device_name to name.

* Removed None guard effecting mypy only.

* Removed unnecessary function from switch entity.

* Removed None guard in use by mypy only.

* Removed unused constant.

* Removed unnecessary context manager.

* Stopped messing around with mypy.ini.

* Referring to typing.TYPE_CHECKING for non-runtime imports.

* Added test requierment correctyly.

* Replaced queue.get() with queue.get_nowait() to avoid backing up intervals requests.

* Revert changes in mypy.ini.

* Changed attributes content to device properties instead of entity properties.

* Fixed typo in constant name.

* Remove unnecessary async keyword from callable.

* Waiting for tasks on event loop to end.

* Added callback decorator to callable.
2019-04-19 16:54:48 -05:00
Ville Skyttä
58bb6f2e99 Add type hints to helpers.condition () 2019-01-21 00:03:12 +01:00
Otto Winter
c1aaef28a9
MQTT Static Typing ()
* MQTT Typing

* Tiny style change

* Fixes

I should've probably really sticked to limiting myself to static typing...

* Small fix 😩

Ok, this seriously shouldn't have happened.
2018-02-28 22:59:14 +01:00
Fabian Affolter
a4f1f6e724 Update docstrings ()
* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstring

* Update docstrings

* Update docstrings

* Fix lint issues

* Update docstrings

* Revert changes in dict
2017-05-02 09:18:47 -07:00
Johann Kellerman
55d305359e Device tracker component & platform validation. No more home_range. ()
* Device tracker component & platform validation. No more home_range.

* Mock, bluetooth

* Renamed _CONFIG_SCHEMA. Raise warning for 

* test duplicates

* Fix assert

* Coverage

* Typing

* T fixes
2016-08-30 10:22:52 -06:00
Paulus Schoutsen
0b7b0e54ba Move unit system to util () 2016-08-08 20:42:25 -07:00
Fabian Heredia Montiel
0377338a81 Improvement typing ()
* Fix: Circular dependencies of internal files

* Change: dt.date for Date and dt.datetime for DateTime

* Use NewType if available

* FIX: Wrong version test

* Remove: Date and DateTime types due to error

* Change to HomeAssistantType

* General Improvement of Typing

* Improve typing config_validation

* Improve typing script

* General Typing Improvements

* Improve NewType check

* Improve typing db_migrator

* Improve util/__init__ typing

* Improve helpers/location typing

* Regroup imports and remove pylint: disable=ungrouped-imports

* General typing improvements
2016-08-07 16:26:35 -07:00
Johann Kellerman
09262a36c4 Hide NewType ImportErrors ()
* Hide NewType ImportErrors

* No more NewType
2016-08-03 08:21:30 -07:00
Johann Kellerman
e9bd5d54ad Recorder typing & ensure DB ready on query ()
* Recorder typing & wait on DB ready
2016-07-31 22:56:57 +02:00