Commit Graph

491 Commits (4ac85829c80cdccac5978af20ca957bb87058793)

Author SHA1 Message Date
epenet 9514a38320
Fix implicit-return rule in zha tests (#122772) 2024-07-29 15:22:08 +02:00
J. Nick Koston 1879db9f8f
Revert to using call_soon for event triggers and state changed event trackers (#122735) 2024-07-29 11:45:39 +02:00
David F. Mulcahey 342e6a503a
Fix group operations in ZHA websocket API (#121881) 2024-07-14 03:25:15 +02:00
puddly 020961d2d8
Fix ZHA select platform state restoration (#121646)
* Ensure `select` entities do not restore state if they were unavailable

* Add a unit test
2024-07-10 10:55:27 -04:00
epenet b0837dd98f
Use service_calls fixture in zha tests (#120996) 2024-07-10 15:06:49 +02:00
David F. Mulcahey 0aa6a17da8
Prevent entity creation errors from causing all entities for a platform from loading in ZHA (#121631) 2024-07-10 08:31:24 +02:00
puddly b754f03c11
ZHA as an external library (#120190)
Co-authored-by: David Mulcahey <david.mulcahey@icloud.com>
Co-authored-by: David Mulcahey <david.mulcahey@me.com>
2024-07-08 20:18:30 +02:00
Marc Mueller f11b316dac
Import Generator from collections.abc (4) (#120917) 2024-07-01 11:54:42 +02:00
epenet 3e9d25f81d
Add missing argument type hints to component tests (#119671) 2024-06-14 09:26:46 +02:00
epenet 315e5f1d95
Fix import-outside-toplevel pylint warnings in zha tests (#119451) 2024-06-13 11:55:56 +02:00
epenet 669569ca49
Fix dangerous-default-value in zha tests (#119560) 2024-06-13 08:35:05 +02:00
epenet f7326d3baf
Ignore too-many-nested-blocks warning in zha tests (#119479) 2024-06-12 22:33:40 +02:00
Caius-Bonus 7f7128adbf
Add Danfoss Ally thermostat and derivatives to ZHA (#86907)
* zha integration: Add danfoss specific clusters and attributes; add thermostat.pi_heating_demand and thermostat_ui.keypad_lockout

* zha integration: fix Danfoss thermostat viewing direction not working because of use of bitmap8 instead of enum8

* ZHA Integration: add missing ThermostatChannelSensor

* ZHA integration: format using black

* zha integration: fix flake8 issues

* ZHA danfoss: Add MinHeatSetpointLimit, MaxHeatSetpointLimit, add reporting and read config for danfoss and keypad_lockout.

* ZHA danfoss: fix mypy complaining about type of _attr_entity_category

* ZHA danfoss: ruff fix

* fix tests

* pylint: disable-next=hass-invalid-inheritance

* fix pylint tests

* refactoring

* remove scheduled setpoint

* remove scheduled setpoint in manufacturer specific

* refactor

* fix tests

* change cluster ids

* remove custom clusters

* code quality

* match clusters in manufacturerspecific on quirk class

* fix comment

* fix match on quirk in manufacturerspecific.py

* correctly extend cluster handlers in manufacturerspecific.py and remove workaround for illegal use of attribute updated signals in climate.py

* fix style

* allow non-danfoss thermostats to work in manufacturerspecific.py

* correct order of init of parent and subclasses in manufacturerspecific.py

* improve entity names

* fix pylint

* explicitly state changing size of tuple

* ignore tuple size change error

* really ignore error

* initial

* fix tests

* match on specific name and quirk name

* don't restructure file as it is out of scope

* move back

* remove unnecessary change

* fix tests

* fix tests

* remove code duplication

* reduce code duplication

* empty line

* remove unused variable

* end file on newline

* comply with recent PRs

* correctly initialize all attributes

* comply with recent PRs

* make class variables private

* forgot one reference

* swap 2 lines for consistency

* reorder 2 lines

* fix tests

* align with recent PR

* store cluster handlers in only one place

* edit tests

* use correct device for quirk id

* change quirk id

* fix tests

* even if there is a quirk id, it doesn't have to have a specific cluster handler

* add tests

* use quirk id for manufacturer specific cluster handlers

* use quirk_ids instead of quirks_classes

* rename quirk_id

* rename quirk_id

* forgot to rename here

* rename id

* add tests

* fix tests

* fix tests

* use quirk ids from zha_quirks

* use quirk id from zha_quirks

* wrong translation

* sync changes with ZCL branch

* sync

* style

* merge error

* move bitmapSensor

* merge error

* merge error

* watch the capitals

* fix entity categories

* more decapitalization

* translate BitmapSensor

* translate all enums

* translate all enums

* don't convert camelcase to snakecase

* don't change enums at all

* remove comments

* fix bitmaps and add enum for algorithm scale factor

* improve readability if bitmapsensor

* fix capitals

* better setpoint response time

* feedback

* lowercase every enum to adhere to the translation_key standard

* remove enum state translations and use enums from quirks

* correctly capitalize OrientationEnum

* bump zha dependencies; this will have to be done in a separate PR, but this aids review

* accidentally removed enum

* tests

* comment

* Migrate reporting and ZCL attribute config out of `__init__`

* hvac.py shouldn't be changed in this pull request

* change wording comment

* I forgot I changed the size of the tuple.

---------

Co-authored-by: puddly <32534428+puddly@users.noreply.github.com>
2024-06-12 12:48:37 -04:00
epenet 44901bdcd1
Fix deprecated-typing-alias pylint warnings in zha tests (#119453) 2024-06-12 17:57:27 +02:00
epenet cb39d2d16b
Ignore existing fixme pylint warnings in tests (#119500)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-06-12 16:40:26 +02:00
epenet fb1b0058ee
Fix consider-using-tuple pylint warnings in component tests (#119464)
* Fix consider-using-tuple pylint warnings in component tests

* Apply su

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>

---------

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
2024-06-12 15:50:27 +02:00
epenet d69e62c096
Ignore undefined-loop-variable pylint warnings in zha tests (#119476) 2024-06-12 12:24:16 +02:00
epenet 50356aa877
Drop use of deprecated constant in zha tests (#119397) 2024-06-11 16:09:53 +02:00
epenet a3ac0af56d
Ignore some pylint errors in component tests (#119352) 2024-06-11 08:01:52 +02:00
epenet c896458fcf
Fix namespace-import pylint warning in components (#119299) 2024-06-10 15:55:08 +02:00
epenet fbaba3753b
Fix root-import pylint warning in components (#119294)
* Fix root-import pylint warning in components

* Adjust

* Adjust
2024-06-10 15:14:49 +02:00
epenet 2e3c3789d3
Use relative imports in tests [s-z] (#119283) 2024-06-10 13:33:15 +02:00
Sid 721b2c2ca8
Enable Ruff PT012 (#113957) 2024-06-08 17:59:08 +02:00
Marc Mueller 59e178df3b
Import Generator from typing_extensions (5) (#118993) 2024-06-06 17:33:27 +02:00
epenet c7cc465e5c
Add return type hints in tests (k-z) (#118942) 2024-06-06 10:11:29 +02:00
J. Nick Koston 475c20d529
Always do thread safety check when writing state (#118886)
* Always do thread safety check when writing state

Refactor the 3 most common places where the thread safety check
for the event loop to be inline to make the check fast enough
that we can keep it long term. While code review catches most
of the thread safety issues in core, some of them still make
it through, and new ones keep getting added. Its not possible
to catch them all with manual code review, so its worth the
tiny overhead to check each time.

Previously the check was limited to custom components
because they were the most common source of thread
safety issues.

* Always do thread safety check when writing state

Refactor the 3 most common places where the thread safety check
for the event loop to be inline to make the check fast enough
that we can keep it long term. While code review catches most
of the thread safety issues in core, some of them still make
it through, and new ones keep getting added. Its not possible
to catch them all with manual code review, so its worth the
tiny overhead to check each time.

Previously the check was limited to custom components
because they were the most common source of thread
safety issues.

* async_fire is more common than expected with ccs

* fix mock

* fix hass mocking
2024-06-05 23:41:55 -04:00
epenet b54a68750b
Add type hints for FixtureRequest in tests (#118779) 2024-06-04 10:37:54 +02:00
puddly 746939c8cd
Bump ZHA dependencies (#118658)
* Bump bellows to 0.39.0

* Do not create a backup if there is no active ZHA gateway object

* Bump universal-silabs-flasher as well
2024-06-02 16:55:48 -04:00
epenet 1317837986
Improve type hints in tests (q-z) (#118381) 2024-05-30 08:48:02 +02:00
epenet 166c588cac
Add LogCaptureFixture type hints in tests (#118372) 2024-05-29 14:10:00 +02:00
epenet 98d24dd276
Improve typing for `calls` fixture in tests (m-z) (#118350)
* Improve typing for `calls` fixture in tests (m-z)

* More

* More
2024-05-29 09:30:41 +02:00
epenet 0b2aac8f4c
Use registry fixtures in tests (z) (#118300) 2024-05-28 18:25:49 +02:00
epenet 44f715bd02
Use issue_registry fixture in component tests (#118041) 2024-05-24 15:54:20 +02:00
J. Nick Koston 481de8cdc9
Ensure config entry operations are always holding the lock (#117214)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-12 08:20:08 +09:00
Sid ac54cdcdb4
Enable Ruff RUF010 (#115371)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-08 23:54:49 +02:00
J. Nick Koston 3f0c0a72db
Prevent setup retry from delaying shutdown (#116328) 2024-04-28 08:13:51 -05:00
Erik Montnemery a25b2168a3
Reduce scope of ZHA test fixtures (#116208) 2024-04-26 09:08:58 -05:00
puddly 380f192c93
Expose the SkyConnect integration with a firmware config/options flow (#115363)
Co-authored-by: Stefan Agner <stefan@agner.ch>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Erik <erik@montnemery.com>
2024-04-24 17:06:24 +02:00
Sid 3799d20d43
Enable Ruff B905 (#114197) 2024-04-14 00:14:26 -05:00
Jan Bouwhuis be8adf9d29
Fix zha test by tweaking the log level (#115368) 2024-04-10 13:10:46 -10:00
Sid 0d66d298ec
Enable Ruff RET504 (#114528)
* Enable Ruff RET504

* fix test

* Use noqa instead of cast

* fix sonos RET504

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-04-06 11:07:37 +02:00
epenet 9204ccfa17
Use is in ConfigEntryState enum comparison in tests (N-Z) (#114926) 2024-04-05 17:37:00 +02:00
Joost Lekkerkerker f3ba713289
Use FlowResultType enum in config flow tests N-Z (#114682)
Use FlowResultType enum in config flow tests
2024-04-03 09:53:20 +02:00
Joost Lekkerkerker 2ef0521d3d
Use is in enum comparison in config flow tests U-Z (#114677)
* Use right enum expression U-Z

* Fix
2024-04-02 23:09:56 +02:00
Sid d5f883fbf0
Unignore Ruff PLR in tests (#114470)
* Unignore Ruff PLR in tests

* Address review comments

* review comments

* fix import

* Update test_api.py

* Update test_api.py

* Update test_api.py
2024-04-01 11:11:59 +02:00
Sid d846676e84
Enable first batch of Ruff RET rules (#114480)
* Enable first batch of Ruff RET rules

* disable pylint rules
2024-03-31 11:30:59 +02:00
TheJulianJES b0a1450a2b
Fix ZHA websocket API test (#114495)
* Fix result overwriting expected config

* Use `BASE_CUSTOM_CONFIGURATION` for initial/expected config
2024-03-31 00:17:09 +01:00
Marc Mueller a29dc86f62
Fix ruff error (#114364) 2024-03-28 10:31:42 +01:00
puddly fc34453caa
Support the Home Assistant Connect ZBT-1 (#114213) 2024-03-27 18:20:48 +01:00
David F. Mulcahey c518acfef3
Defensively validate ZHA quirks v2 supplied entity metadata (#112643) 2024-03-27 17:48:43 +01:00