Commit Graph

114 Commits (b3c3721a79f3e3bdf12b031f74298a00685fd227)

Author SHA1 Message Date
Paulus Schoutsen c7f5beb794
history allowed to load states with invalid entity IDs (#20399) 2019-01-24 17:53:01 -08:00
Fabian Affolter 686a856a17
Upgrade sqlalchemy to 1.2.15 (#19383) 2018-12-18 15:48:06 +01:00
Anders Melchiorsen f9c02889b2 Remove recorder purge protection (#19358) 2018-12-16 23:31:50 +01:00
Paulus Schoutsen df21dd21f2 RFC: Call services directly (#18720)
* Call services directly

* Simplify

* Type

* Lint

* Update name

* Fix tests

* Catch exceptions in HTTP view

* Lint

* Handle ServiceNotFound in API endpoints that call services

* Type

* Don't crash recorder on non-JSON serializable objects
2018-11-30 21:28:35 +01:00
Adam Mills 5c3a4e3d10 Restore states through a JSON store instead of recorder (#17270)
* Restore states through a JSON store

* Accept entity_id directly in restore state helper

* Keep states stored between runs for a limited time

* Remove warning
2018-11-28 13:16:43 +01:00
Eliseo Martelli bb37151987 fixed wording that may confuse user (#18628) 2018-11-23 01:46:22 +01:00
Aleksandr Smirnov 089a2f4e71 Logbook speedup (#18376)
* filter logbook results by entity_id prior to instantiating them

* include by default, pass pep8

* pass pylint

* use entityfilter, update tests
2018-11-19 10:36:00 +01:00
Fabian Affolter 320efdb744 Upgrade sqlalchemy to 1.2.14 (#18504) 2018-11-16 14:15:53 +01:00
Fabian Affolter a3e77bc5f3 Upgrade sqlalchemy to 1.2.13 (#18084) 2018-11-01 13:25:45 +01:00
Phil Frost af5eacf303 Fix spelling error in log output (#17963) 2018-10-29 19:40:32 +01:00
Ville Skyttä ee696643cd Isort preparations (#16555)
* Don't treat typing as an "in-between" module for import order

That was a < 3.5 era thing.

* Tighten scope of some pylint unused-import disables

To avoid isort moving a top level one around, undesirably broadening its
scope.
2018-09-11 11:21:48 +02:00
Robbie Trencheny 54c3f4f001
Fix spelling mistake in recorder migration [ci skip] 2018-08-29 14:59:48 -07:00
Fabian Affolter 0da3e73765 Upgrade sqlalchemy to 1.2.11 (#16192) 2018-08-26 12:28:44 +02:00
Paulus Schoutsen 7bb5344942
Remove homeassistant.remote (#16099)
* Remove homeassistant.remote

* Use direct import for API

* Fix docstring
2018-08-21 15:49:58 +02:00
Paulus Schoutsen 68cd65567d
Forgiving add index in migration (#16092) 2018-08-21 11:41:52 +02:00
Paulus Schoutsen 9e1fa7ef42
Column syntax fix + Add a file if migration in progress (#16061)
* Add a file if migration in progress

* Warning

* Convert message for migration to warning
2018-08-19 18:57:06 +02:00
Paulus Schoutsen 81d3161a5e Add forgiving add column (#16057)
* Add forgiving add column

* Lint
2018-08-19 17:22:09 +02:00
Paulus Schoutsen 9512bb9587
Add and restore context in recorder (#15859) 2018-08-10 18:09:01 +02:00
Fabian Affolter 4b257c3d01 Upgrade sqlalchemy to 1.2.10 (#15737) 2018-07-29 23:35:47 +02:00
Ville Skyttä b7c336a687 Pylint cleanups (#15626)
* Pylint 2 no-else-return fixes

* Remove unneeded abstract-class-not-used pylint disable
2018-07-23 10:16:05 +02:00
Fabian Affolter 4a4b9180d8 Upgrade sqlalchemy to 1.2.9 (#15250) 2018-07-01 13:01:48 -04:00
Fabian Affolter a8413249c2 Upgrade sqlalchemy to 1.2.8 (#14765) 2018-06-02 08:34:30 -04:00
Otto Winter a4bf421044 Convert more files to async/await syntax (#14142)
* Move more files to async/await syntax

* Attempt Work around pylint bug

Using lazytox :P
2018-04-28 19:26:20 -04:00
Fabian Affolter 95f2ad2299
Upgrade sqlalchemy to 1.2.7 (#14138) 2018-04-28 23:16:01 +02:00
Fabian Affolter ca3cc27e40 Upgrade sqlalchemy to 1.2.6 (#13733) 2018-04-07 10:41:35 +02:00
Fabian Affolter aec61b7c86 Upgrade sqlalchemy to 1.2.5 (#13292) 2018-03-17 17:39:24 +01:00
Paulus Schoutsen 170b8671b9
Fix logbook JSON serialize issue (#13229)
* Fix logbook JSON serialize issue

* Address flakiness

* Lint

* deflake ?

* Deflake 2
2018-03-15 10:54:22 -07:00
Anders Melchiorsen 339a839dbe Add SQL index to states.event_id (#12825) 2018-03-03 22:54:38 +01:00
Anders Melchiorsen c1c23bb4b6 Remove automatic sqlite vacuum (#12728) 2018-02-26 22:41:37 -08:00
Anders Melchiorsen 1b22f2d8b8 Move recorder query out of event loop (#12615) 2018-02-23 10:12:40 +01:00
Anders Melchiorsen 2d36d4d9f3 Set event_id foreign key in recorded states (#12580) 2018-02-21 12:51:20 -08:00
Anders Melchiorsen 0d0e0b8ba3 Avoid warnings when purging an empty database (#12494) 2018-02-18 08:06:33 -08:00
Paulus Schoutsen e8d8b75c07
Try deflaking recorder tests (#12492)
* Try deflaking recorder tests

* Remove run_coroutine_threadsafe

* Lint
2018-02-17 23:20:28 -08:00
Paulus Schoutsen 3fd61d8f45 Update voluputous (#12463)
* Update voluputous

* Fix http config

* Fix optional with default=None

* Optional, default=none

* Fix defaults in voluptuous schemas

* Fix tests

* Fix update error

* Lint
2018-02-17 10:29:14 +01:00
Anders Melchiorsen 0e2d98dbf5 Optimize recorder purge (#12448) 2018-02-15 20:22:57 -08:00
Anders Melchiorsen 247edf1b69 Purge recorder data by default (#12271) 2018-02-11 13:22:59 -08:00
Otto Winter 678f284015 Upgrade pylint to 1.8.2 (#12274)
* Upgrade pylint to 1.8.1

* Fix no-else-return

* Fix bad-whitespace

* Fix too-many-nested-blocks

* Fix raising-format-tuple

See https://github.com/PyCQA/pylint/blob/master/doc/whatsnew/1.8.rst

* Fix len-as-condition

* Fix logging-not-lazy

Not sure about that TEMP_CELSIUS though, but internally it's probably just like if you concatenated any other (variable) string

* Fix stop-iteration-return

* Fix useless-super-delegation

* Fix trailing-comma-tuple

Both of these seem to simply be bugs:
 * Nest: The value of self._humidity never seems to be used anywhere
 * Dovado: The called API method seems to expect a "normal" number

* Fix redefined-argument-from-local

* Fix consider-using-enumerate

* Fix wrong-import-order

* Fix arguments-differ

* Fix missed no-else-return

* Fix no-member and related

* Fix signatures-differ

* Revert "Upgrade pylint to 1.8.1"

This reverts commit af78aa00f125a7d34add97b9d50c14db48412211.

* Fix arguments-differ

* except for device_tracker

* Cleanup

* Fix test using positional argument

* Fix line too long

I forgot to run flake8 - shame on me... 🙃

* Fix bad-option-value for 1.6.5

* Fix arguments-differ for device_tracker

* Upgrade pylint to 1.8.2

* 👕 Fix missed no-member
2018-02-11 09:20:28 -08:00
Anders Melchiorsen 945606238c Allow zero purge_interval to disable recorder purge (#12220) 2018-02-07 22:59:09 -08:00
Anders Melchiorsen d7017f2138 Prepare for recorder purge to be active by default (#11976) 2018-01-30 12:41:33 +01:00
Ville Skyttä 384f63dd1d Typing fixes (#12015)
* .gitignore: Add .mypy_cache

* Typing fixes
2018-01-29 00:24:08 -08:00
Fabian Affolter d8fde94763 Upgrade sqlalchemy to 1.2.2 (#11956) 2018-01-27 11:58:52 -08:00
Lukas Barth 51dd9b6dde Fix recorder purge (#11802)
* Do proper largest-of query

* Fix error when event_id is NULL
2018-01-19 08:56:28 -08:00
Lukas Barth 5a26d4c039 Fix purge with MariaDB / MySQL (#11713) 2018-01-16 13:35:23 -08:00
Fabian Affolter d219f244d2 Upgrade sqlalchemy to 1.2.1 (#11666) 2018-01-15 14:24:34 -08:00
Anders Melchiorsen 8267a21bfe Lazy loading of service descriptions (#11479)
* Lazy loading of service descriptions

* Fix tests

* Load YAML in executor

* Return a copy of available services to allow mutations

* Remove lint

* Add zha/services.yaml

* Only cache descriptions for known services

* Remove lint

* Remove description loading during service registration

* Remove description parameter from async_register

* Test async_get_all_descriptions

* Remove lint

* Fix typos from multi-edit

* Remove unused arguments

* Remove unused import os

* Remove unused import os, part 2

* Remove unneeded coroutine decorator

* Only use executor for loading files

* Cleanups suggested in review

* Increase test coverage

* Fix races in existing tests
2018-01-07 14:54:16 -08:00
Lukas Barth 909f613324 Do not purge the most recent state for an entity (#11039)
* Protect states that are the most recent states of their entity

* Also protect events

* Some documentation

* Fix SQL
2018-01-01 18:43:10 -08:00
Fabian Affolter 5a4bca9780
Upgrade sqlalchemy to 1.2.0 (#11333) 2017-12-29 10:07:04 +01:00
Milan V 2f0920e4fb Fix recorder stop on SQLite vacuuming error (#10405)
* Fix recorder stop on SQLite vacuuming error

* Move import to function
2017-11-08 14:43:15 +01:00
Fabian Affolter 5be6f8ff36
Upgrade sqlalchemy to 1.1.15 (#10330) 2017-11-05 13:51:03 +01:00
Pascal Vizeli a4dec0b6d2 Fix recorder purge (#10318)
* Fix recorder purge

* Fix lint

* fix utc convert
2017-11-03 12:55:00 -07:00