Commit graph

167 commits

Author SHA1 Message Date
dougiteixeira
74c2f000d8
Add missing translations for device class in SQL (#120892) 2024-07-01 07:44:59 +02:00
G Johansson
9b341f5b67
Don't record attributes in sql (#120170) 2024-06-22 19:42:55 +02:00
J. Nick Koston
a642454e6f
Bump sqlalchemy to 2.0.31 (#119951) 2024-06-19 08:09:04 +02:00
Sid
c2b3bf3fb9
Enable Ruff RET502 (#115139) 2024-05-21 22:19:33 +02:00
J. Nick Koston
fd52588565
Bump SQLAlchemy to 2.0.30 (#116964) 2024-05-07 10:42:13 +02:00
J. Nick Koston
7e35fcf11a
Bump sqlparse to 0.5.0 (#115681)
fixes https://github.com/home-assistant/core/security/dependabot/54
fixes https://github.com/home-assistant/core/security/dependabot/55
2024-04-16 08:30:51 +02:00
J. Nick Koston
345fa75562
Bump SQLAlchemy to 2.0.29 (#114208) 2024-03-25 14:39:16 -10:00
Marc Mueller
2c06d4fcb9
Add empty line after module docstring (2) [components] (#112736) 2024-03-08 19:15:59 +01:00
Marc Mueller
930a396712
Add empty line after module docstring [s] (#112704) 2024-03-08 14:33:51 +01:00
J. Nick Koston
235771aaa2
Bump SQLAlchemy to 2.0.28 (#112314) 2024-03-05 12:14:30 -10:00
Erik Montnemery
b0ed8c4961
Migrate integrations s-t to generic flowhandler (#111865) 2024-02-29 22:16:14 +01:00
G Johansson
5073842514
Fix sql integration no recorder (#111263) 2024-02-24 22:40:49 +01:00
J. Nick Koston
eee6a119d5
Bump SQLAlchemy to 2.0.27 (#110517) 2024-02-14 10:32:05 +01:00
J. Nick Koston
5e5a9d9c59
Bump SQLAlchemy to 2.0.26 (#110358) 2024-02-12 19:57:53 +01:00
J. Nick Koston
710e55fb09
Bump SQLAlchemy to 2.0.25 (#106931)
* Bump SQLAlchemy to 2.0.25

changelog: https://docs.sqlalchemy.org/en/20/changelog/changelog_20.html#change-2.0.25

* drop unused ignore now that upstream is fixed
2024-01-03 09:12:35 +01:00
J. Nick Koston
6e98f72f8b
Bump SQLAlchemy to 2.0.24 (#106672) 2023-12-29 10:19:06 -10:00
dougiteixeira
65c21438a6
Add query type validation independent of declaration position for SQL (#105921)
* Add query type validation independent of declaration position

* Restore close sess

* Separates invalid query and non-read-only query tests

* Add more tests

* Use the SQLParseError exception for queries that are not read-only

* Add handling for multiple SQL queries.

* Fix test

* Clean ';' at the beginning of the SQL query

* Clean ';' at the beginning of the SQL query - init

* Query cleaning before storing

* Query cleaning before setup sesensor plataform - YAML

* Exception when the SQL query type is not detected

* Cleaning

* Cleaning

* Fix typing in tests

* Fix typing in tests

* Add test for query = ';;'

* Update homeassistant/components/sql/__init__.py

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

* Update homeassistant/components/sql/__init__.py

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

* Update __init__.py

* Update config_flow.py

* Clean query before storing

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2023-12-27 17:58:35 +01:00
G Johansson
99cf4a6b2d
Add rollback on exception that needs rollback in SQL (#104948) 2023-12-08 21:13:37 +01:00
J. Nick Koston
fd8caaf846
Bump SQLAlchemy to 2.0.23 (#103313) 2023-11-03 11:10:08 -05:00
Robert Resch
bb90c1f168
Fix multilevel reference translations (#102338) 2023-10-20 08:12:53 +02:00
J. Nick Koston
e427fc511b
Bump SQLAlchemy to 2.0.22 (#102033) 2023-10-15 06:14:51 -10:00
Robert Resch
952a17532f
Remove NONE_SENTINEL in favor of optional select in sql (#101309) 2023-10-11 17:38:29 +02:00
J. Nick Koston
6f8734167f
Bump SQLAlchemy to 2.0.21 (#99745) 2023-09-20 16:19:53 +02:00
G Johansson
b8f35fb577
Fix missing unique id in SQL (#99641) 2023-09-04 22:31:53 +02:00
G Johansson
61c17291fb
Move TemplateEntity to template (#98957)
* Move TemplateEntity to template

* Rename template_entity in helpers
2023-08-24 15:37:04 +02:00
Joost Lekkerkerker
87dd18cc2e
Remove obsolete yaml check in SQL (#98950)
* Remove unique id check from SQL

* Remove unique id check from SQL
2023-08-24 12:35:11 +02:00
G Johansson
268e5244f0
Cleanup ManualTriggerSensorEntity (#98629)
* Cleanup ManualTriggerSensorEntity

* ConfigType
2023-08-18 20:19:17 +02:00
Erik Montnemery
045c327928
Move DeviceInfo from entity to device registry (#98149)
* Move DeviceInfo from entity to device registry

* Update integrations
2023-08-10 22:04:26 -04:00
G Johansson
1f11ce63fc
Manual trigger entity fix name influence entity_id (#97398) 2023-07-30 18:47:34 +02:00
G Johansson
f610a9b1c9
Fix sql entities not loading (#97316) 2023-07-27 09:24:32 +02:00
Miguel Camba
38111141f9
Add new device class: PH (potential hydrogen) (#95928) 2023-07-23 18:49:10 +02:00
G Johansson
4e2b00a443
Refactor SQL with ManualTriggerEntity (#95116)
* First go

* Finalize sensor

* Add tests

* Remove not need _attr_name

* device_class

* _process_manual_data allow Any as value
2023-07-20 11:35:08 +02:00
dougiteixeira
4b1d096e6b
Add device_class and state_class in config flow for SQL (#95020)
* Add device_class and state_class in config flow for SQL

* Update when selected NONE_SENTINEL

* Add tests

* Use SensorDeviceClass and SensorStateClass in tests

* Add volatile_organic_compounds_parts in strings selector

* Add test_attributes_from_entry_config

* Remove test_attributes_from_entry_config and complement test_device_state_class

* Add test_attributes_from_entry_config in test_sensor.py
2023-07-08 21:00:22 +02:00
J. Nick Koston
7995d3777a
Fix package names to match pypi index metadata (#93883)
* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* uses _

* uses -

* fix metadata
2023-05-31 21:12:53 -04:00
J. Nick Koston
cbee514c2a
Bump sqlalchemy to 2.0.15 (#93293) 2023-05-20 14:26:33 -05:00
J. Nick Koston
809f394ff5
Bump sqlalchemy to 2.0.13 (#92936) 2023-05-12 04:37:16 +09:00
G Johansson
2c5cad4ca0
Clean config flow for SQL (#92332) 2023-05-07 01:42:37 +02:00
G Johansson
9795699669
Fix db_url issue in SQL (#92324)
* db_url fix

* Add test

* assert entry.options
2023-05-01 16:17:01 +02:00
J. Nick Koston
32f6dd4a82
Bump sqlalchemy to 2.0.12 (#92315)
changelog: https://docs.sqlalchemy.org/en/20/changelog/changelog_20.html#change-2.0.12
2023-04-30 23:11:29 -04:00
Diogo Gomes
a48a07bd8d
Removing self from SQL sensor CODEOWNERS (#92250) 2023-04-29 18:27:39 +02:00
J. Nick Koston
47b289b632
Bump sqlalchemy to 2.0.11 to fix a critical regression with postgresql (#92126) 2023-04-27 18:52:43 +02:00
J. Nick Koston
e7e7990b60
Bump sqlalchemy to 2.0.10 (#91982) 2023-04-25 09:45:49 -05:00
G Johansson
c3e22cfa63
SQL strings update db_url (#91537) 2023-04-17 13:37:27 +02:00
dougiteixeira
dc03a5c81e
Fix error for when column does not exist in query to SQL (#91166)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-04-15 12:54:56 -10:00
J. Nick Koston
4366f83ac8
Restore use of local timezone for MariaDB/MySQL in SQL integration (#91313)
* Use local timezone for recorder connection

The fix in #90335 had an unexpected side effect of
using UTC for the timezone since all recorder operations
use UTC. Since only sqlite much use the database executor
we can use a seperate connection pool which uses local time

This also ensures that the engines are disposed of
when Home Assistant is shutdown as previously we
did not cleanly disconnect

* coverage

* fix unclean shutdown in config flow

* tweaks
2023-04-12 20:24:55 -04:00
dougiteixeira
1ef6391e9c
Preserves config flow information in case of error for SQL (#91142) 2023-04-12 09:03:14 -10:00
J. Nick Koston
bd0378a961
Bump sqlalchemy to 2.0.9 (#91151)
changes: https://docs.sqlalchemy.org/en/20/changelog/changelog_20.html#change-2.0.9
2023-04-10 10:01:49 -04:00
J. Nick Koston
6e9fcbfec1
Fix false positive in SQL sensor full table scan check (#91134) 2023-04-09 19:45:08 -10:00
J. Nick Koston
53d7e33607
Raise an issue for legacy SQL queries that will cause full table scans (#90971)
* Raise an issue for SQL queries that will cause full table scans

* Raise an issue for SQL queries that will cause full table scans

* Raise an issue for SQL queries that will cause full table scans

* Raise an issue for SQL queries that will cause full table scans

* Update homeassistant/components/sql/sensor.py

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* coverage

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-04-07 22:32:36 -04:00
J. Nick Koston
b66a99fe8a
Bump sqlalchemy to 2.0.8 (#90756) 2023-04-04 12:47:54 +02:00