* Ensure legacy event foreign key is removed from the states table
If the system ran out of disk space removing the FK, it would
fail. #121938 fixed that to try again, however that PR was made
ineffective by #122069 since it will never reach the check.
To solve this, the migration version is incremented to 2, and
the migration is no longer marked as done unless the rebuild
/fk removal is successful.
* fix logic for mysql
* fix test
* asserts
* coverage
* coverage
* narrow test
* fixes
* split tests
* should have skipped
* fixture must be used
* Add unit tests for SNMP Switches (integer only)
* Add unit test for SNMP switches (integer unknown)
* log a warning when SNMP response is not a recognised payload
* Use a single configuration for all test_integer_switch tests
* Tweak unknown SNMP response warning
* Apply suggestions from code review
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
* import STATE_ consts
* rename tests/components/snmp/test_integer_switch.py to test_switch.py
* check that a warning is logged if the SNMP response payload is unknown
---------
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
* Improve alignment of live logbook and historical logbook models
- Make EventAsRow as NamedType which is better aligned with
sqlalchemy Row
- Use getitem to fetch results for both Row and EventAsRow
since its an order of magnitude faster fetching sqlalchemy
Row object values.
* final
* fix
* unused
* fix more tests
* cleanup
* reduce
* tweak
* test storage save and load
* fix bug exposed by test
* refactor test
* add JSON for test account/location
* create helpers to load JSON
* refactor test
* baseline refactor
* tweak
* update requiremenst
* rationalise code
* remove conditional in test
* refactor test
* mypy fix
* tweak tests
* working test
* working test 4
* working test 5
* add typed dicts
* working dtms
* lint
* fix dtm asserts
* doc strings
* list
* tweak conditional
* tweak test data sets to extend coverage
* leverage conftest.py for subsequent tests
* revert test storage
* revert part two
* rename symbols
* remove anachronism
* stop unwanted DNS lookup
* Clean up type ignores
* Format
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Add support for Todoist sections
* ServiceValidationError & section name tweaks from PR comments
* Remove whitespace
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* More natural error message
Co-authored-by: Erik Montnemery <erik@montnemery.com>
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>