* Add support for HomeKit doorbell
* Update homeassistant/components/homekit/type_cameras.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/homekit/type_cameras.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* add speaker service for doorbells
* fixed test as doorbell char requires null value
* removed null value for doorbell presses. and removed broken override of default values
Co-authored-by: J. Nick Koston <nick@koston.org>
* Add support for dimmable lights
* Fix formatting
* Add supported features test on Bond Light
* Add more tests to bond light and fixes comments
* Fix rebase conflict resolution
* Apply suggestions from code review
Co-authored-by: Chris Talkington <chris@talkingtontech.com>
* Add support for multiple time triggers in automations
* Attach with single callback
* Patch time in tests
* Improve test coverage
* Adjusting my facepalm moment
Through some testing with the samsungtvws library, it was determined
that the issue is related to the short read timeout (1s). Increasing
the timeout to 10s should solve the issue.
* Dimming duration fix
Fixes#38068 - allows dimming duration to 7620 (default of 7621)
* Forgot to commit my test updates
* Added backwards compatibility with pre-150+ builds
Added tests for backwards compatibility
* Upped the build number cut off
* Add check for major.minor version as well
* Fix major.minor detection
* Adjust variable name
* Adjust version checking logic
* Math is hard
* Rename files, adjust test names
* Update doc string
* Add Abode camera controls
* Add tests for camera turn on and off service
* Bump abodepy version
* Bump abodepy version and updates to reflect changes
* Update manifest
* Refactor bond unit tests to reduce boilerplate
* Refactor bond unit tests to reduce boilerplate (PR feedback)
* Refactor bond unit tests to reduce boilerplate (PR feedback, nullcontext)
We would connect to the hub via discovery and via setup
around the same time. This put additional load on the hub
which can increase the risk of timeouts.
* Add binary sensor support to motion sensors and smoke detectors
* Add support for new sensor events as binary sensors
Adds a default device_class for motion sensors and smoke detector
* Use device type instead of event to set class
* Add some additional binary values
* Fix SimpliSafe to work with new MFA
* Code review (part 1)
* Input needed from Martin
* Code review
* Code review
* Restore YAML
* Tests
* Code review
* Remove JSON patching in tests
* Add reauth test
* One more reauth test
* Don't abuse the word "conf"
* Update homeassistant/components/simplisafe/config_flow.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Test coverage
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
for scenarios of enabling/disabling (~ creating/removing) entities,
so it does not trigger in removal if a `to: xxx` is defined, and also
does not trigger in creation if a `from: xxx` is present.
* Ensure we do not start discovered flows until after the start event has fired
This change makes zeroconf and ssdp match discovery behavior of not
creating config flows until the start event has been fired. This
prevents config flow creation/dependency installs for discovered
config flows from competing for cpu time during startup.
* Start discovery/service browser/ssdp when EVENT_HOMEASSISTANT_STARTED is fired instead of EVENT_HOMEASSISTANT_START
* Implement unload entry
* Change async_remove to remove
* Pop data from hass.data
* Change sequence order in unload
* Dont unload internal when unload platforms fail
* Use event loop scheduling for tracking time patterns
* make patching of time targetable
* patch time tests since time can tick to match during the test
* fix more tests
* time can only move forward
* time can only move forward
* back to 100% coverage
* simplify since the event loop time cannot move backwards
* simplify some more
* revert simplify
* Revert "revert simplify"
This reverts commit bd42f232f6.
* Revert "simplify some more"
This reverts commit 2a6c57d514.
* Revert "simplify since the event loop time cannot move backwards"
This reverts commit 3b13714ef4.
* Attempt another simplify
* time does not move backwards in the last two
* remove next_time <= now check
* fix previous merge error
* Fix color temp math
* Ran black --fast
* Update test_light.py
* tweaking mireds
* updating comments
* fixing test_light to match standards
* fixing comments, need coffee
* WOLF Smart-set integration
* Removed translations. Changed device class of timestamp. Added new test for unknown exception
* Remove unit_of_measurement from hours sensor
* Code cleanup. Pull Request comments fixes
* ConnectError import change. Removed DEVICE_CLASS_TIMESTAMP
* Add unique id guard with tests. Use common translations. Move device_id resolution to config_flow.
* Remove debug print
This issue has been corrected and then reverted multiple times.
It seems that the core issue was a casing one (On/off vs On/Off) ; for better
matching with a real Hue hub, also add the productname.
Tested to work with echo 2 and echo 5.
* Close the ADB connection on HA stop
* Get the test to pass
* Remove unnecessary test code
* Register the callback sooner
* '_async_stop' -> 'async_close'
* 'async_close' method -> '_async_close' function
* Refactor cached ZHA channel reads.
If doing a cached ZCL attribute read, do "only_from_cache" read for
battery operated devices only. Mains operated devices will do a network
read in case of a cache miss.
* Use cached attributes for ZHA electrical measurement
* Bump up ZHA zigpy dependency.
* Remove support for legacy logbook events created before 0.112
Reduce the complexity of the logbook code. This
should also have a small performance boost.
* None is the default
Most of the the template platforms would check for
extract_entities failing to extract entities and avoid
setting up a state change listner for MATCH_ALL after
extract_entities had warned that it could not extract
the entities and updates would need to be done manually.
This protection has been extended to all template platforms.
Alter the behavior of extract_entities to return the
successfully extracted entities if one or more templates
fail extraction instead of returning MATCH_ALL
* Switch async_track_state_change to the faster async_track_state_change_event part 4
Calling async_track_state_change_event directly is faster than async_track_state_change (see #37251) since async_track_state_change is a wrapper around async_track_state_change_event now
* pylint
Calling async_track_state_change_event directly is faster than async_track_state_change (see #37251) since async_track_state_change is a wrapper around async_track_state_change_event now
* Switch to config flow setup
* Add minimal test for config flow
* Add myself as codeowner and address some review concerns
* Address some further review comments
* Switch to integration level config
* Switch to per device config rather than per entity type
* All roller shutters should be added as covers
(there are non lighting types)
* Fixup tests that used invalid packets for platforms
* Avoid variable re-use
* Allow control events on sensors too
That way we get signal level sensors for these too
* Lint correction
* Don't filter sensors from config
Disable sensors from GUI if the entities are not wanted
* Correct usage of ATTR_ instead of CONF_
* Make sure the logging when a new entity is added includes the event
* Introduce Bond Hub concept
* Read Hub version information when setting up entry
* Link entities to Hub using via_device
* Add test to verify created Hub device properties
* Refactor Bond integration to remove duplication in Entity code and unit tests
* Refactor Bond integration to remove duplication in Entity code and unit tests (PR feedback)
* Support Fan domain in Bond integration
* Support Fan domain in Bond integration
* Support Fan domain in Bond integration (apply PR feedback)
* Support Fan domain in Bond integration (apply PR feedback)
* Declare Bond covers as having assumed state, setup local polling for state updates
* Declare Bond covers as having assumed state, setup local polling for state updates (apply feedback from PR review)
* Declare Bond covers as having assumed state, setup local polling for state updates (apply feedback from PR review)
* Declare Bond covers as having assumed state, setup local polling for state updates (apply feedback from PR review)
* Detect lingering threads after tests
* Make sure cast is setup before checking state
* Make sure we ask executors of old hass to shutdown
We are not waiting here, just hoping for the best
* Make sure all instances of hass and executors is stopped.
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Also apply hass stopping to scripts
* Adjust to changes how we set up executor
* Add new CoreState.stopped
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Add public weather sensors back in
* Remove stale code
* Cleanup after before adding entities
* Fix pylint complaint
* Add test for options flow
* Change mode to listbox
* Update .coveragerc
* Address comments
* Don't process empty list
* Address comment
* Fix mistake
* Make signal unique
* Make string more unique
* Fix merge conflict
* First step of an EnOcean integration refactoring, including code reorganisation and support of a setup config flow
* Moved title to root of strings file
* Fixed pre-commit checks failures
* Fixed linter errors
* Updated formatted string format in logs
* Removed leftover comment
* Multiple changes after PR change requests.
Using an import flow for yaml config, removed unnecessary logs, added proper unload in __init__ and EnOceanDongle
Replaced config state machine by several flows.
Serial port validity check done in the EnOceanDongle class asynchronously, removed unique ID from config flow
Multiple cosmetic changes
* Multiple changes after PR change requests
* Added variable to store default value, as setdefault was caught returning None when the empty dict literal was passed as an argument
* Literal used directly
* Added tests for EnOcean config flows, changed static methods to bundle methods for bundle
* Updated variable name
* Added missing mock to test, replaced repeated magic strings by constants
* Changed imports to avoid an unused import warning from pylint on DOMAIN
* Adding pylint exception for unused import
* Added proper propagation of setup and unload to platforms, removed dead code, some syntax changes
* Removed setup_entry forwarding as the entities can only be configured using yaml
* Removed forwarding of unload
* Enabled code coverage for config flow only
* Clean up coveragerc
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* make ip check hostname aware
* add executor job for sync function doing IO and remove errant comma
* revert change to update new_data explicitly for options keys since it is already done later
* empty commit to retrigger CI
* Add support for set_config_parameter service
* Adjusted elif to if
* More if/else cleanup
* More if/else cleanup
* Less nesting
* End loop properly
* Added byte type
* Convert break to return
* fix presets and mode conversion
* fix mapping issues in ozw climate
* build mapping table in advance
* Copying a dict to a list copies the keys by default
* Make devices and activities visibile as harmony attributes
* Allow restoring previous activity, add tests
* fix test
* Kill activity_notify with fire
* remove trailing ,
* Switch homekit to use async_track_state_change_event
Calling async_track_state_change_event directly
is faster than async_track_state_change and has
slightly lower latency triggering state updates
in homekit
* check for deleted entities
* Update additional tests for linked sensor removals
* Ensure removing entities does not result in an exception
* Switch to dispatcher
* Adjust tests for dispatcher
* Store device in sensor
* Move state application into binary sensor entity class
* Move more specifics into per platform classes
* Should not apply event in init of sensor
* Switch to call_later
* Make apply_event public
* No point in slugifying debug logs
* Adjust error in off delay and event
* Make sure we match with masked id
* Switch tests to use hass objects instead of direct
* Make sure sensor update state
* Add some initial binary sensor tests
* Add initial binary sensor tests
* Add tests for pt2262
* Add test for off delay
* Convert Android TV integration to async
* pylint
* Remove unused test code
* Require async versions of androidtv and adb-shell
* Cleanup
* Remove commented out code
* Use constants SHELL_RESPONSE_OFF and SHELL_RESPONSE_STANDBY
* Prebake common history queries
The python overhead of to construct
the queries exceeded the database overhead. We now
prebake the queries that get frequently polled.
This reduces the time it takes to update history_stats
sensors and can make quite a difference if there
are a lot of them.
When using the mini-graph-card card, all the entities
on the card being graphed are queried every few seconds
for new states. Previously this would tie up the database if there
are lot of these graphs in the UI.
* Update homeassistant/components/history/__init__.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/history/__init__.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* cache entity_filter in the lambda
* switch to yield
* Revert "switch to yield"
This reverts commit f8386f4940.
* get_states always returns a list
* query wasnt actually reusable so revert part of the breakout
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Support multiple MQTT availability topics
* Make availability list and availability_topic exclusive
* Make availability list and availability_topic exclusive
* Add missing abbreviation
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Tom Scholten <tom@sue.nl>
Co-authored-by: Tom <CoMPaTech@users.noreply.github.com>
* add more unit tests for plum_lightpad
* add more unit tests for plum_lightpad
* add more unit tests for plum_lightpad
* add more unit tests for plum_lightpad
* Update tests/components/plum_lightpad/test_init.py
apply suggested way to invoke async_setup_entry
Co-authored-by: Chris Talkington <chris@talkingtontech.com>
* Update tests/components/plum_lightpad/test_init.py
apply suggested way to invoke async_setup_entry
Co-authored-by: Chris Talkington <chris@talkingtontech.com>
* Update tests/components/plum_lightpad/test_init.py
apply suggested way to invoke async_setup_entry
Co-authored-by: Chris Talkington <chris@talkingtontech.com>
* Update tests/components/plum_lightpad/test_init.py
remove now unused import
Co-authored-by: Chris Talkington <chris@talkingtontech.com>
* Update tests/components/plum_lightpad/test_init.py
import Mock from tests.async_mock as suggested
Co-authored-by: Chris Talkington <chris@talkingtontech.com>
* Update tests/components/plum_lightpad/test_init.py
remove now unused import
Co-authored-by: Chris Talkington <chris@talkingtontech.com>
* Update tests/components/plum_lightpad/test_init.py
Co-authored-by: Chris Talkington <chris@talkingtontech.com>
* fix unit tests that were failing after suggested changes
Co-authored-by: Chris Talkington <chris@talkingtontech.com>
* Rework and re-enable rfxtrx tests
* Add missed change to _signal_event
* Fixup the dummy serial that causes max cpu
* Make sure we cleanup thread here too
* Make sure we always wait for tasks before we check state
* Some more places we need to wait before checking
* Add humidifier support to homekit
* spell
* dependencies
* lint
* add linked humidity sensor for humidifiers
* Apply suggestions from code review
Co-authored-by: J. Nick Koston <nick@koston.org>
* apply suggestions from code review
* pylint
* Fix tests
* Update homeassistant/components/homekit/type_humidifiers.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update tests/components/homekit/test_homekit.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Apply suggestions from code review
Co-authored-by: J. Nick Koston <nick@koston.org>
* apply suggestions from code review
* lint
* pylint
* push
* test for unavailable linker sensor
* black
* valid values key case
* black
* Update homeassistant/components/homekit/type_humidifiers.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* black
* coverage
* Set current humidity to 0 if linked sensor removed or unavailable
* use last known humidity instead
Co-authored-by: J. Nick Koston <nick@koston.org>
* Initial commit for Dexcom integration
* Dexcom config flow testing
* Clarify errors during setup
* Resolve minor test issues
* Update sensor availability, resolve linting issues
* Add sensor tests
* Remove title due to 0.109, add abort
* >94.97% codecov/patch
* Move .translations/ to translations/
* Add constants for servers and unit of measurements
* Bump pydexcom version
* Updated domain schema, Dexcom creation
* Support for different units of measurement
* Update tests
* Remove empty items from manifest
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Raise UpdateFailed if fetching new session fails
* Switch everything over to required
* Simplify state information
* Simplify async_on_remove
* Pydexcom package now handles fetching new session
* Only allow config flow
* Remove ternary operator
* Bump version, pydexcom handling session refresh
* Using common strings
* Import from test.async_mock
* Shorten variable names
* Resolve tests after removing yaml support
* Return false if credentials are invalid
* Available seems to handle if data is empty
* Now using option flow, remove handling import
* Add fixture for JSON returned from API
* Overhaul testing
* Revise update options
* Bump pydexcom version
* Combat listener repetition
* Undo update listener using callback
* Change sensor availability to use last_update_success
* Update sensor availability and tests
* Rename test
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Since we now base all of exposure checks on data that
will not change, we can cache the result instead
of calculating it every loop.
This change complements the work done in #32718
* refactoring to share logic and sensor startup error test
* Added handling for V1 InfluxDBServerError to start-up and runtime and test for it
* Added InfluxDBServerError test to sensor setup tests
* Raising PlatformNotReady exception from sensor for setup failure
* Proper testing of PlatformNotReady error
* add first unit test to config flow for Plum Lightpad
* add first unit test to config flow for Plum Lightpad (add changed requirements_test_all.txt)
* add first unit test to config flow for Plum Lightpad
* add first unit test to config flow for Plum Lightpad (bring coverage to 100%)
* add first unit test to config flow for Plum Lightpad
* add first unit test to config flow for Plum Lightpad (updated patch path as suggested)
* add first unit test to config flow for Plum Lightpad (add unit test for abort)
* Move logbook continuous domain filtering to sql
sensors tend to generate a significant amount of states
that are filtered out by logbook. In testing 75% of
states can be filtered away in sql to avoid the
sqlalchemy ORM overhead of creating objects that will
be discarded.
* remove un-needed nesting
* Added GLOB capability to entityfilter and every place that uses it. All existing tests are passing
* added tests for components affected by glob change
* fixed flake8 error
* mocking the correct listener
* mocking correct bus method in azure test
* tests passing in 3.7 and 3.8
* fixed formatting issue from rebase/conflict
* Checking against glob patterns in more performant way
* perf improvments and reverted unnecessarily adjusted tests
* added new benchmark test around filters
* no longer using get with default in entityfilter
* changed filter name and removed logbook from filter benchmark
* simplified benchmark tests from feedback
* fixed apache tests and returned include exclude schemas to normal
* fixed azure event hub tests to properly go through component logic
* fixed azure test and clean up for other tests
* renaming test files to match standard
* merged mqtt statestream test changes with base
* removed dependency on recorder filter schema from history
* fixed recorder tests after merge and a bunch of lint errors
Cleanup indexes as >50% of the db size was indexes,
many of them unused in any current query
Logbook search was having to filter event_types without
an index:
Created ix_events_event_type_time_fired
Dropped ix_events_event_type
States had a redundant keys on composite index:
Dropped ix_states_entity_id
Its unused since we have ix_states_entity_id_last_updated
De-duplicate storage of context in states as
its always stored in events and can be found
by joining the state on the event_id.
Dropped ix_states_context_id
Dropped ix_states_context_parent_id
Dropped ix_states_context_user_id
After schema v9:
STATES............................................ 10186 40.9%
EVENTS............................................ 5502 22.1%
IX_STATES_ENTITY_ID_LAST_UPDATED.................. 2177 8.7%
IX_EVENTS_EVENT_TYPE_TIME_FIRED................... 1910 7.7%
IX_EVENTS_CONTEXT_ID.............................. 1592 6.4%
IX_EVENTS_TIME_FIRED.............................. 1383 5.6%
IX_STATES_LAST_UPDATED............................ 1079 4.3%
IX_STATES_EVENT_ID................................ 375 1.5%
IX_EVENTS_CONTEXT_PARENT_ID....................... 347 1.4%
IX_EVENTS_CONTEXT_USER_ID......................... 346 1.4%
IX_RECORDER_RUNS_START_END........................ 1 0.004%
RECORDER_RUNS..................................... 1 0.004%
SCHEMA_CHANGES.................................... 1 0.004%
SQLITE_MASTER..................................... 1 0.004%
* adj
* time_fired_isoformat
* remove unused code
* tests for processing timestamps
* restore missing import lost in merge conflict
* test for None case
* Squeezebox add config flow and player discovery
* Fixes to config flow
* Unavailable player detection and recovery
* Improved error message for auth failure
* Testing for squeezebox config flow
* Import configuration.yaml
* Support for discovery integration
* Internal server discovery
* Fix bug restoring previously detected squeezebox player
* Tests for user and edit steps in config flow
* Tests for import config flow
* Additional config flow tests and fixes
* Linter fixes
* Check that players are found before iterating them
* Remove noisy logger message
* Update requirements_all after rebase
* Use asyncio.Event in discovery task
* Use common keys in strings.json
* Bump pysqueezebox to v0.2.2 for fixed server discovery using python3.7
* Bump pysqueezebox version to v0.2.3
* Don't trap AbortFlow exception
Co-authored-by: J. Nick Koston <nick@koston.org>
* Refactor validate_input
* Update squeezebox tests
* Build data flow schema using function
* Fix linter error
* Updated en.json
* Update homeassistant/components/squeezebox/media_player.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/squeezebox/media_player.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/squeezebox/media_player.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/squeezebox/media_player.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update .coveragerc for squeezebox config flow test
* Mock TIMEOUT for faster testing
* More schema de-duplication and testing improvements
* Apply suggestions from code review
Co-authored-by: J. Nick Koston <nick@koston.org>
* Testing and config flow improvements
* Remove unused exceptions
* Remove deprecated logger message
* Update homeassistant/components/squeezebox/media_player.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Implement suggestions from code review
* Add async_unload_entry
* Use MockConfigEntry in squeezebox tests
* Remove unnecessary config schema
* Stop server discovery task when last config entry unloaded
* Improvements to async_unload_entry
* Fix bug in _discovery arguments
* Do not await server discovery in async_setup_entry
* Do not await start server discovery in async_setup
* Do not start server discovery from async_setup_entry until homeassistant running
* Re-detect players when server removed and re-added without restart
* Use entry.entry_id instead of unique_id
* Update unittests to avoid patching homeassistant code
Co-authored-by: J. Nick Koston <nick@koston.org>