Commit graph

520 commits

Author SHA1 Message Date
Matthias Alphart
d7b0d1a50e
Use dispatcher for KNX GroupMonitor instead of custom HassJob (#122384) 2024-07-23 17:47:45 +02:00
Matthias Alphart
34e72ea16a
Add support for KNX UI to create light entities (#122342)
* Add light to KNX UI-createable entity platforms

* review from switch

* Add a test
2024-07-22 09:35:29 +02:00
Matthias Alphart
d418a40856
Create, update and delete KNX entities from UI / WS-commands (#104079)
* knx entity CRUD - initial commit - switch

* platform dependent schema

* coerce empty GA-lists to None

* read entity configuration from WS

* use entity_id instead of unique_id for lookup

* Add device support

* Rename KNXEntityStore to KNXConfigStore

* fix test after rename

* Send schema options for creating / editing entities

* Return entity_id after entity creation

* remove device_class config in favour of more-info-dialog settings

* refactor group address schema for custom selector

* Rename GA keys and remove invalid keys from schema

* fix rebase

* Fix deleting devices and their entities

* Validate entity schema in extra step - return validation infos

* Use exception to signal validation error; return validated data

* Forward validation result when editing entities

* Get proper validation error message for optional GAs

* Add entity validation only WS command

* use ulid instead of uuid

* Fix error handling for edit unknown entity

* Remove unused optional group address sets from validated schema

* Add optional dpt field for ga_schema

* Move knx config things to sub-key

* Add light platform

* async_forward_entry_setups only once

* Test crate and remove devices

* Test removing entities of a removed device

* Test entity creation and storage

* Test deleting entities

* Test unsuccessful entity creation

* Test updating entity data

* Test get entity config

* Test validate entity

* Update entity data by entity_id instead of unique_id

* Remove unnecessary uid unique check

* remove schema_options

* test fixture for entity creation

* clean up group address schema

class can be used to add custom serializer later

* Revert: Add light platfrom

* remove unused optional_ga_schema

* Test GASelector

* lint tests

* Review

* group entities before adding

* fix / ignore mypy

* always has_entity_name

* Entity name: check for empty string when no device

* use constants instead of strings in schema

* Fix mypy errors for voluptuous schemas

---------

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2024-07-21 20:01:48 +02:00
G Johansson
ca4c617d4b
Add TURN_OFF/TURN_ON feature flags for fan (#121447) 2024-07-19 11:35:24 +02:00
Marc Mueller
ca55986057
Import Generator from collections.abc (1) (#120914) 2024-07-01 11:51:51 +02:00
Marc Mueller
49df0c4366
Improve schema typing (2) (#120475) 2024-06-26 02:25:30 +02:00
Marc Mueller
bcd1243686
Use VolDictType to improve schema typing (#120417) 2024-06-25 15:15:59 +02:00
Marc Mueller
be6dfc7a70
Typing improvements (#120297) 2024-06-24 11:07:22 +02:00
J. Nick Koston
faa55de538
Fix blocking I/O in the event loop when registering static paths (#119629) 2024-06-18 08:18:31 +02:00
Matthias Alphart
c8e9a3a8f4
Device automation extra fields translation for KNX (#119518) 2024-06-15 11:31:10 +02:00
epenet
960d1289ef
Avoid references to websocket_api.const in core and other components (#119285) 2024-06-10 13:49:44 +02:00
Matthias Alphart
fff5715a06
Require KNX boolean service descriptor selectors (#118597) 2024-06-08 11:09:52 +02:00
Matthias Alphart
a7429e5f50
Fix KNX climate.set_hvac_mode not turning on (#119012) 2024-06-06 22:40:04 +02:00
Marc Mueller
fe21e2b8ba
Import Generator from typing_extensions (1) (#118986) 2024-06-06 17:02:13 +02:00
Jan Bouwhuis
066cd6dbef
Improve repair issue when notify service is still being used (#118855)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-06-05 15:41:22 +02:00
J. Nick Koston
ed0568c655
Ensure config entries are not unloaded while their platforms are setting up (#118767)
* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* run with error on to find them

* cert_exp, hold lock

* cert_exp, hold lock

* shelly async_late_forward_entry_setups

* compact

* compact

* found another

* patch up mobileapp

* patch up hue tests

* patch up smartthings

* fix mqtt

* fix esphome

* zwave_js

* mqtt

* rework

* fixes

* fix mocking

* fix mocking

* do not call async_forward_entry_setup directly

* docstrings

* docstrings

* docstrings

* add comments

* doc strings

* fixed all in core, turn off strict

* coverage

* coverage

* missing

* coverage
2024-06-04 21:34:39 -04:00
Matthias Alphart
70cf176d93
Add value_template option to KNX expose (#117732)
* Add value_template option to KNX expose

* template exception handling
2024-05-22 00:09:42 +02:00
Matthias Alphart
622d1e4c50
Add data point type option to knx.telegram trigger (#117463)
* Add data point type (dpt) option to `knx.telegram` trigger

* Rename from `dpt` to `type` to match services

* Add test for GroupValueRead telegrams

* Fix device trigger schema inheritance

* Typesafe dispatcher signal

* readability

* Avoid re-decoding with same transcoder
2024-05-22 00:03:54 +02:00
Matthias Alphart
b94735a445
Add async_turn_on/off methods for KNX climate entities (#117882)
Add async_turn_on/off methods for KNX climate entities
2024-05-21 23:54:43 +02:00
J. Nick Koston
5a609c34bb
Fix blocking I/O in the event loop when loading timezones (#117721) 2024-05-20 11:06:03 +02:00
Marc Mueller
87bb7ced79
Use PEP 695 for simple type aliases (#117633) 2024-05-17 14:42:21 +02:00
Matthias Alphart
bca277a027
Add knx.telegram integration specific trigger; update KNX Interface device trigger (#107592)
* Add `knx.telegram` integration specific trigger

* Move implementation to trigger.py, use it from device_trigger

* test device_trigger

* test trigger.py

* Add "incoming" and "outgoing" and handle legacy device triggers

* work with mixed group address styles

* improve coverage

* Add no-op option

* apply changed linting rules

* Don't distinguish legacy device triggers from new ones

that's now supported since frontend has fixed default values of extra_fields

* review suggestion: reuse trigger schema for device trigger extra fields

* cleanup for readability

* Remove no-op option
2024-05-14 14:45:49 +02:00
Jan Bouwhuis
7eb8f265fe
Add shared notify service migration repair helper (#117213)
* Add shared notifiy service migration repair helper

* Delete ecobee repairs.py

* Update dependency

* Fix file test

* Fix homematic tests

* Improve tests for file  and homematic
2024-05-11 21:13:44 +02:00
Sid
b456d97e65
Replace pylint protected-access with Ruff SLF001 (#115735) 2024-05-06 20:33:26 +02:00
Jan Bouwhuis
84308c9e53
Add title feature to notify entity platform (#116426)
* Add title feature to notify entity platform

* Add overload variants

* Remove overloads, update signatures

* Improve test coverage

* Apply suggestions from code review

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

* Do not use const

* fix typo

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-05-03 11:17:28 +02:00
Matthias Alphart
8eb1970721
Fix inheritance order for KNX notify (#116600) 2024-05-02 11:44:32 +02:00
Matthias Alphart
f115525137
Migrate KNX notify service to entity platform (#115665) 2024-04-24 07:51:02 +02:00
Sid
376aafc83e
Enable Ruff INP001 (#115082) 2024-04-08 15:43:58 +02:00
Matthias Alphart
2290362dfb
Update xknxproject to 3.7.1 (#115053) 2024-04-06 23:18:52 +02:00
Marc Mueller
0f03079065
Update import for EventStateChangedData [i-z] (#114900) 2024-04-04 11:48:29 -10:00
Sid
6587ee20db
Enable Ruff TRY300 (#114437)
* Enable Ruff TRY300

* Update validation.py

* Address review comments
2024-03-30 10:37:59 +01:00
Matthias Alphart
7bcfa94b12
Use single_config_entry in KNX manifest (#112526) 2024-03-15 12:20:32 +01:00
Joost Lekkerkerker
7e0aac3feb
Improve lists in integrations [I-K] (#113221) 2024-03-13 16:56:33 +01:00
Marc Mueller
8f1e2f1a7b
Replace EventType with Event [h-i] (#112740) 2024-03-08 19:35:47 +01:00
Marc Mueller
2c06d4fcb9
Add empty line after module docstring (2) [components] (#112736) 2024-03-08 19:15:59 +01:00
Marc Mueller
59a6035d3f
Add empty line after module docstring [j-m] (#112700) 2024-03-08 09:01:29 -05:00
Matthias Alphart
862d04c035
Update xknx to 2.12.2 - Fix thread leak on unsuccessful connections (#112450)
Update xknx to 2.12.2
2024-03-05 23:35:22 +01:00
Erik Montnemery
52e7912caf
Migrate integrations i-m to generic flowhandler (#111863) 2024-02-29 20:08:46 +01:00
Joost Lekkerkerker
cac2c46a42
Add icon translations to KNX (#111852)
* Add icon translations to KNX

* Update homeassistant/components/knx/icons.json

Co-authored-by: Matthias Alphart <farmio@alphart.net>

* Update homeassistant/components/knx/icons.json

Co-authored-by: Matthias Alphart <farmio@alphart.net>

* Update homeassistant/components/knx/icons.json

Co-authored-by: Matthias Alphart <farmio@alphart.net>

* Update homeassistant/components/knx/icons.json

Co-authored-by: Matthias Alphart <farmio@alphart.net>

* Update homeassistant/components/knx/icons.json

Co-authored-by: Matthias Alphart <farmio@alphart.net>

---------

Co-authored-by: Matthias Alphart <farmio@alphart.net>
2024-02-29 19:12:05 +01:00
Matthias Alphart
673a95227b
Update xknx to 2.12.1 and xknxproject to 3.7.0 (#111460) 2024-02-26 18:52:51 +01:00
Matthias Alphart
e984bdaf98
Fix KNX cover schema for voluptuous 0.14.2 (#111427) 2024-02-26 00:26:32 +01:00
Joost Lekkerkerker
730d805876
Enable SIM114 ruff rule (#111125) 2024-02-23 13:21:59 +01:00
Matthias Alphart
3028ad8ac2
KNX: Group address validators use more detailed error messages (#110875)
* GA validators use xknx exception message

* move validation functions to own module

* use type name
2024-02-21 22:09:27 +01:00
Matthias Alphart
8f2f869f46
Update xknxproject to 3.6.0 (#110282) 2024-02-11 20:01:16 +01:00
Matthias Alphart
78f21ecc58
Update xknx to 2.12.0 and xknxproject to 3.5.0 (#109787) 2024-02-06 14:30:53 +01:00
G Johansson
e3f1997b6f
Add TURN_ON/OFF ClimateEntityFeature for KNX (#109138) 2024-02-02 09:48:01 +01:00
Matthias Alphart
aa6d058c10
Update knx-frontend to 2024.1.20.105944 (#108511) 2024-01-20 20:12:15 +01:00
Matthias Alphart
f53109f513
Move KNX service registration to async_setup (#106635) 2024-01-07 23:26:46 +01:00
Matthias Alphart
a9b51f0255
Fix KNX telegram device trigger not firing after integration reload (#107388) 2024-01-07 20:32:17 +01:00
Erik Montnemery
0c2485bc03
Freeze integration entity descriptions (#105984)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-12-18 16:28:13 -10:00