Commit graph

44 commits

Author SHA1 Message Date
Matthias Alphart
713689491b
Remove KNX yaml config from hass.data (#124050)
* Remove KNX yaml config from `hass.data`

* Use HassKey
2024-09-09 09:01:21 +02:00
epenet
0bb8c4832d
Enable raise-within-try (TRY301) rule in ruff (#123351) 2024-08-12 09:16:33 +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
Marc Mueller
ca55986057
Import Generator from collections.abc (1) (#120914) 2024-07-01 11:51:51 +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
Marc Mueller
fe21e2b8ba
Import Generator from typing_extensions (1) (#118986) 2024-06-06 17:02:13 +02: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
59a6035d3f
Add empty line after module docstring [j-m] (#112700) 2024-03-08 09:01:29 -05:00
Erik Montnemery
52e7912caf
Migrate integrations i-m to generic flowhandler (#111863) 2024-02-29 20:08:46 +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
Erik Montnemery
e6895b5738
Fix menu in knx config flow (#102168)
* Fix menu in knx config flow

* Update tests

* Fix strings.json

* Rename new menu steps for readabiltiy

---------

Co-authored-by: Matthias Alphart <farmio@alphart.net>
2023-10-17 22:25:35 +02:00
Matthias Alphart
0f5d423d1e
Move KNX keyring validation and storage to helper module (#97931)
* Move KNX keyfile validation and store to helper module

* Rename module and fix tests
2023-08-07 23:30:14 +02:00
Matthias Alphart
b10e73e2d4
Configurable KNX Telegram history size (#93248)
* Configurable KNX Telegram history size

* Add maximum value to description
2023-05-22 18:09:59 +02:00
Matthias Alphart
95d44e100b
Update xknx to 2.9.0 (#91282)
* Update xknx to 2.8.0

* add tests for validators

* Update strings.json

* Update xknx to 2.9.0
2023-04-22 18:25:14 +02:00
Matthias Alphart
e849878a48
Fix KNX Keyfile upload (#89029)
* Fix KNX Keyfile upload

* use shutil.move instead
2023-03-02 10:13:02 -05:00
Matthias Alphart
6a0ea09f29
Upload KNX Keyfile from Config/Options Flow directly (#88097)
* Manage KNX Keyfile from UI

* migrate config entry to use new keyfile

* Revert "migrate config entry to use new keyfile"

use same config style as before instead of entry version migration

* clean up uploaded file when integration is removed

* change default filename

* revert to previous step name

* remove empty directory on unload
2023-02-20 14:48:56 +01:00
Marc Mueller
d7dda6bee5
Update python version used for pylint [Py310] (#86414)
* Update python version used for pylint linting [Py310]

* Import Callable from collections.abc [Py310]

* Use builtin anext [Py310]
2023-01-23 07:56:15 +01:00
Matthias Alphart
0c7eb431e6
KNX ConfigFlow: add selection of secure tunnel endpoint (#84651) 2022-12-28 11:43:03 +01:00
Matthias Alphart
a752232de8
KNX ConfigFlow: Validate contents of knxkeys file (#84411) 2022-12-27 21:00:19 +01:00
Franck Nijhof
baef267f33
String formatting and max line length - Part 3 (#84394) 2022-12-22 13:35:47 +01:00
Matthias Alphart
6e5d4b592d
Fix KNX ConfigFlow for manual secure tunnel keys (#84155) 2022-12-18 00:06:14 +01:00
Matthias Alphart
6cef37641c
KNX Config/OptionsFlow: Test connection to manually configured tunnel (#82872) 2022-12-03 12:53:12 +01:00
Marc Mueller
490aec0b11
Update pylint to 2.15.7 (#82977) 2022-11-30 12:20:18 +01:00
Matthias Alphart
e738df502b
Fix KNX secure config switching from manual to keyfile (#82724) 2022-11-28 10:18:45 +01:00
Matthias Alphart
cb06f8b668
KNX Config/OptionsFlow: minimize wait time for interface discovery (#81982)
* Minimize wait time for interface discovery

* fix OptionsFlow when connection failed

there is no `self.hass.data["KNX"]` when we are in retry mode after failed integration setup

* review changes

* fix new tests
2022-11-28 07:03:51 +01:00
Matthias Alphart
4517af509c
Add support for KNX IP-Secure routing (#82765)
* always use instance variable for new entry data

- change `self._tunneling_config` to non-optional `self.new_entry_data`
- always use self.new_entry_data in `finish_flow()`

* support secure routing

* amend current tests

* use sync latency tolerance

* test secure routing config flow

* diagnostics redact backbone_key

* test xknx library setup

* check length of backbone_key

* better readable key validation
2022-11-27 23:33:12 +01:00
Matthias Alphart
daf56e92a0
Update xknx to 2.0.0 (#82709) 2022-11-26 06:49:11 +01:00
Matthias Alphart
ee9231363f
Refactor KNX Config and Options flows (#80641) 2022-11-10 14:25:41 +01:00
Raman Gupta
b325c112b4
Add SelectorType enum and TypedDicts for each selector's data (#68399)
* rebase off current

* rearrange

* Overload selector function

* Update/fix all selector references

* better typing?

* remove extra option

* move things around

* Switch to Sequence type to avoid ignoring mypy error

* Get rid of ...'s

* Improve typing to reduce number of ignores

* Remove all typing ignores

* Make config optional for selectors that don't need a config

* add missing unit prefixes

* Rename TypedDicts

* Update homeassistant/helpers/selector.py

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

* review feedback

* remove peta from integration integration

* Fix min_max

* Revert change to selector function

* Fix logic

* Add typing for selector classes

* Update selector.py

* Fix indent

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-04-11 09:20:56 +02:00
Matthias Alphart
b3d1574a71
Refactor KNX config flow and validate user input (#69698)
* validate config flow user input

* test flow for invalid user input

* validate multicast address blocks

* Update homeassistant/components/knx/config_flow.py

Co-authored-by: Marvin Wichmann <me@marvin-wichmann.de>

Co-authored-by: Marvin Wichmann <me@marvin-wichmann.de>
2022-04-10 15:56:45 +02:00
Matthias Alphart
2733600755
coerce number selector values to int (#69059) 2022-04-01 11:07:13 +03:00
Matthias Alphart
46a457a638
Update KNX flow strings to use "data_description" and remove invalid options (#68935)
* use `data_description`

* use selectors so `data_description` shows

* remove unused config option

`individual_address` has no effect for tunneling. The address is always assigned by the tunnelling server.

* remove unsupported option for tunneling V1 devices
2022-04-01 00:15:53 +02:00
Marvin Wichmann
9b05a1264a
Add support for IP secure to KNX config flow (#68906)
* Add support for TCP Secure in KNX config flow

* Add support for TCP Secure in KNX config flow

* Fix typing

* Fix import

* Move assert up to cover all possible cases
2022-03-30 21:10:47 +02:00
Marvin Wichmann
cec3a08b95
Cleanup KNX integration (#68820)
* Cleanup KNX integration

* Cleanup KNX integration

* Update homeassistant/components/knx/__init__.py

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

Co-authored-by: Matthias Alphart <farmio@alphart.net>
2022-03-29 16:46:02 +02:00
Marc Mueller
d7170f43c3
Add type ignore error codes [A-L] (#66778) 2022-02-18 09:38:15 +01:00
Marvin Wichmann
072f7d5611
Add support for TCP tunneling connections to KNX (#64928) 2022-01-26 06:36:07 +01:00
Matthias Alphart
456d403303
Fix KNX onboarding when there is no yaml config defined yet (#64216) 2022-01-16 20:44:21 -08:00
Marvin Wichmann
b9247f3952
Fix local_ip handling in KNX options flow (#62969) 2021-12-30 01:13:58 +01:00
Marvin Wichmann
cefbc2c428
Allow setting local_ip for knx routing connections (#61836) 2021-12-15 13:15:56 +01:00
Marvin Wichmann
affa3a6ada
Add missing local_ip to KNX config flow and options flow (#61018)
* Add missing local_ip to KNX config flow and options flow

* Update strings
2021-12-04 23:07:28 +01:00
Marvin Wichmann
e5c33474e3
Add config and options flow to KNX integration (#59377) 2021-11-20 11:30:41 +01:00