* Part 1 of 2 (no breaking changes in part 1).
When integrations configured via the UI block startup or fail to start,
the webserver can remain offline which make it is impossible
to recover without manually changing files in
.storage since the UI is not available.
This change is the foundation that part 2 will build on
and enable a listener to start the webserver when the frontend
is finished loading.
Frontend Changes (home-assistant/frontend#6068)
* Address review comments
* bump timeout to 1800s, adjust comment
* bump timeout to 4h
* remove timeout failsafe
* and the test
- add Synology DSM Security binary sensor (enabled by default)
- use device name instead of id in names
- add device type to name
- show disk manufacturer, model and firmware version in devices
- some entries are disabled by default (`entity_registry_enabled_default`)
- binary sensor + sensor uses `device_class` when possible
- do not fetch a concerned API if all entries of it are disabled
- entity unique_id now uses key instead of label
- entity entity_id changes for disk and volume: example from `sensor.synology_status_sda` to `sensor.synology_drive_1_status`, or from `sensor.synology_average_disk_temp_volume_1` to `sensor.synology_volume_1_average_disk_temp`
- now binary sensor:
- disk_exceed_bad_sector_thr
- disk_below_remain_life_thr
- removed sensor:
- volume type (RAID, SHR ...)
- disk name (Drive [X])
- disk device (/dev/sd[Y])
* Re-add connections to device_info
* Fix typo in identifiers
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Support stream profile and configuring it through options flow
* Options flow test
* Allow configuration of not using a stream profile
* Shorten default stream profile string
The OpenCV image_processing component accepts a `min_size` argument in
each classifier that is then passed into the OpenCV library. The
`min_size` argument is expected to be a tuple of 2 ints, and is entered
into the platofrm schema as such. However, yaml will always produce a
list instead of a tuple, which means in practice it's impossible to use
the `min_size` argument. This changes the schema to accepts any sequence
of 2 ints that is then coerced into a tuple suitable for passing to the
OpenCV library.
* Improve configuration
* Read new properties for basic device information
Improve tests by mocking less improving stability of tests
* Clean up in device tests
* Support new port management api
* Improve initializing data
* Bump dependency to v28
It is not correct to show warning about "unexpected event type" if EVENT_STATE_CHANGED have no new_state field.
We should show this warning only if it is real unexpected event type.
Run task_done() before continue, because we should tell the queue that the processing on the task is complete
after get().
* Use CONF_CLIENT_ID & CONF_CLIENT_SECRET from homeassistant.const
* Fix pylint
* Use in tests
* Search for "client_id"
* Fix tests
* Fix test
* Fix test
* Periodicly log when intergrations are taking a while to setup
When one or more intergrations are taking a while to setup
it is hard to determine which one is the cause. We can
help narrow this down for the user with a periodic log
message about which domains are still waiting to be setup
every 30s.
* 30 -> 60 per discussion
* only log when the integration is actually doing setup
* reduce, fix race in test
* Requires 0.7.18 of elkm1 library to decode LD messages, and uses those messages to reliably set the arming/disarming user when there are more than one area. See https://github.com/home-assistant/core/issues/35310.
* Fixed typo
* Fixed off by one error -- LD command reports 1-based user-numbers which is the changed_by_id we want, but we need 0-based indices as argument to username.
* Bump required version of elkm1, remove logging message I was using for testing; prepping for PR.
* Black formatted
* Fixed bug whereby I needed to ref elements when running against released build of elkm1-lib
* Update plugwise async, config_flow and multi entity
* Update battery percentage
* Fix yamllint on services
* Fix yamllint on services
* Fix formatting for pyupgrade
* Update homeassistant/components/plugwise/__init__.py
Co-Authored-By: Robert Svensson <Kane610@users.noreply.github.com>
* Add try/except on setup
* Bump module version, battery version and valve position
* Removing sensor, switch, water_heater for later (child) PRs
* Catchup and version bump
* Remove title from strings.json
* Readd already reviewd await try/except
* Readd already reviewed config_flow
* Fix pylint
* Fix per 0.109 translations
* Remove unused import from merge
* Update plugwise async, config_flow and multi entity
* Update battery percentage
* Fix yamllint on services
* Fix yamllint on services
* Bump module version
* Bump module version, battery version and valve position
* Removing sensor, switch, water_heater for later (child) PRs
* Catchup and version bump
* Remove title from strings.json
* Fix pylint
* Fix per 0.109 translations
* Translations and config_flow, module version bump with required changes
* Translations and config_flow, module version bump with required changes
* Fix requirements
* Fix requirements
* Fix pylint
* Fix pylint
* Update homeassistant/components/plugwise/__init__.py
Improvement
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/plugwise/__init__.py
Improvement
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/plugwise/__init__.py
Improvement
Co-authored-by: J. Nick Koston <nick@koston.org>
* Include configentrynotready on import
* Update __init__.py
* DataUpdateCoordinator and comment non-PR-platforms
* Fix reqs
* Rename devices variable in favor of entities
* Rework updates with DataUpdateCoordinator
* Peer review
* Peer review second part
* Cleanup comments and redundant code
* Added required config_flow test
* Peer review third part
* Update service was replaced by DataUpdateCoordinator
* Corrected testing, version bump for InvalidAuth, move uniq_id
* Remove according to review
* Await connect (py38)
* Remove unneccesary code
* Show only when multiple
* Improve config_flow, rename consts
* Update homeassistant/components/plugwise/climate.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/plugwise/climate.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Process review comments
Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
* Add support for Insteon 2444-222 Micro Open/Close Module
* Avoid breaking changes on cover
* Update homeassistant/components/isy994/cover.py
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@koston.org>
* Proceed with startup if an integration setup blocks for more than 30m
* Fix test location
* Fix log call
* naming
* revert
* do not shield from cancelation
* Adjust test since we now cancel when we hit the timeout
* added optional argument to command service
* Fixed crash when optional argument is not provided
* Updated argument description
* fixed lint error
* Fix isort error
* switched to use dict for optional field instead of json string
* switched to use ATTR_PAYLOAD
* fixed test
* actually fixed test
* Improve history api performance
A new option "minimal_response" reduces the amount of data
sent between the first and last history states to only the
"last_changed" and "state" fields.
Calling to_native is now avoided where possible and only
done at the end for rows that will be returned in the response.
When sending the `minimal_response` option, the history
api now returns a json response similar to the following
for an entity
Testing:
History API Response time for 1 day
Average of 10 runs with minimal_response
Before: 19.89s. (content length : 3427428)
After: 8.44s (content length: 592199)
```
[{
"attributes": {--TRUNCATED--},
"context": {--TRUNCATED--},
"entity_id": "binary_sensor.powerwall_status",
"last_changed": "2020-05-18T23:20:03.213000+00:00",
"last_updated": "2020-05-18T23:20:03.213000+00:00",
"state": "on"
},
...
{
"last_changed": "2020-05-19T00:41:08Z",
"state": "unavailable"
},
...
{
"attributes": {--TRUNCATED--},
"context": {--TRUNCATED--},
"entity_id": "binary_sensor.powerwall_status",
"last_changed": "2020-05-19T00:42:08.069698+00:00",
"last_updated": "2020-05-19T00:42:08.069698+00:00",
"state": "on"
}]
```
* Remove impossible state check
* Remove another impossible state check
* Update homeassistant/components/history/__init__.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Reorder to save some indent per review
* Make query response make sense with to_native=False
* Update test for 00:00 to Z change
* Update homeassistant/components/recorder/models.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Add fan platform
* Add fan discovery schema
* Use constants for dispatcher signal
* Move fan platform to ozw
* Fix fan discovery schema
* Add previous speed to handle value 255
* Make fixture reading more robust
* Add fan tests
* Remove not needed fixture info
* Validate speed
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Decouple media lookup from play_media service
* More explicit input/search validation, cleanup, more tests
* Minor cleanup
* Normalize media_type string in lookup call
* Move key lookup, add tests via service calls
* Always allow play_media service calls
* No need to pass arguments to nested functions
* Add ability to ignore heos discovery
* Fetch player_id, update tests
* Handle failure state
* Update tests as there are two players in the mock now
* Adjust and add more tests
* Strip out player id lookup
* reverts per review
* one more revert
* Check that due date is not None
Check that due date is not None, prevents taks without due dates from breaking Calendar API
* Invert None check to reduce indentation
* Add support for Elexa Guardian water valve controllers
* Zeroconf + cleanup
* Sensors and services
* API registration
* Service bug fixes
* Fix bug in cleanup
* Tests and coverage
* Fix incorrect service description
* Bump aioguardian
* Bump aioguardian to 0.2.2
* Bump aioguardian to 0.2.3
* Proper entity inheritance
* Give device a proper name
* Code review
* add tests
* better error handling in dependency
* dont suppress errors
* add support for multiple devices
* add test for Unauthorized status
* raise error on service call failure
* add last_update_success_time and a failed update interval
* add failed update interval annd valid times to nws
* Revert "add last_update_success_time and a failed update interval"
This reverts commit 09428c9686.
* extend DataUpdateCoordinator
By default media players get a chrome cast icon, which feels
quite wrong for my old style amplifier that doesn't have any
connection to the rest of the word, except for a RS232 port.
* Working PoC
* Store
* Handle subscribing to MQTT and stopping stream when first telegram arrives
* Improve naming
* Now with test
* Better strings
* Fix Martins comments
* Improve mock device patching
* Bump dependency to v27
Add MQTT as after dependency
* Ensure a deleted intergration can be removed
* Update homeassistant/config_entries.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Add support for Velux Gates
* Comment expanded and listing sorted alphabetically.
* There are constants in the cover entity integration for the valid device classes. Import and use those here.
* Blank line deleted
* Reformate code because of "CheckFormat" error
* Import only the names we need instead of the whole module
* Reformate code because of "CheckFormat" error
* isort error
* fallback to device serial number if no mac available
* make password optional to fix#35904
* update tests to reflect new flow
* fix snake case and AsyncMock
* add comments around why weird things are being done
* Centralite specific control seq of operation
* Remove Fan safeguards
* Split hvac_action property.
* Refactor hvac_action property.
Current hvac_action logic is Zen Within thermostat specific and differs
a bit from ZCL specs. Implement it as a separate class.
* Refactor hvac_action property for default thermostat
Follow more closely ZCL specs in parsing hvac state of the thermostat.
* allow lib to create AsyncTransport
* fix transport close issue
* fix zoom only cameras without PTZ presets
* catch profiles without encoding configuration
* also catch ServerDisconnectedError for ptz
* Ensure HomeAssistant can startup if homekit fails to load
* Update homeassistant/components/logbook/manifest.json
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Initial ZHA climate implementation.
* Add retryable_request decorator.
sort helpers imports.
* Check manufacturer for Climate implementation.
* Default zha.climate.operation_list to [Off]
* Migrate to climate 1.0
* Sort imports, properties and methods.
* Handle 'PRESET_NONE' presets.
* Use pi_heating/cooling_demand for HVAC action prop.
* Implement `running_state` HVAC channel property.
For ZHA thermostats which don't support `pi_heating_demand` or
`pi_cooling_demand' attributes.
* wip fan support
* Refactor retryable request logging.
* Rebase cleanup.
* Update climate discovery.
* Fix ZHA climate restoration.
* Bulk configure attribute reports.
* Use configure_reporting_multiple command for Light
More detailed response parsing of configure_reporting_multiple.
* Use ordered list for HVAC cluster attribute reports.
* Don't mutilate HVAC mode list.
* Add fan_mode property to fan channel.
* Fix type hinting.
* Expose fan mode only.
* Implement fan mode setting.
Drop support for HVAC_FAN_ONLY mode.
* Use ClimateEntity as base class.
* Cleanup debug code.
* Update time display for Sinope.
* Don't do many retries.
* Don't use multi attr reporting configuration.
* Make tests pass.
* Drop support for setpoint change source/amount.
* Cleanups.
* Drop aux heat
* Update tests.
* Drop Sinope temperature display code.
* Update tests.
* Refactor temperature setting.
* Update tests.
* Update Fan tests.
* Lint
* Black.
* Use correct logging levels
* Add services remote_set_led_on/remote_set_led_off to control changmi_ir led
* pylint: elif => if
* Fix services.async_register => platform.async_register_entity_service
* Update homeassistant/components/xiaomi_miio/remote.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* more fixes
* async
* more fixes
* fix
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Async remove call removed too much, resulting in disabled entities coming back after a restart
* Calling super().async_remove is no longer needed, changed to self.async_remove
* Yes, they should be sets...
The database fields are timezoned via DateTime(timezone=True), so the
default value should be timezoned too. When using cockroachdb this is
fatal and results in the recorder crashing.
* Fire events on homekit TV remote key press
* Changes from code review
* black
* isort
* flake8
* Update tests/components/homekit/test_type_media_players.py
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update to garminconnect 0.1.13
This will fix body composition sensors being unavailable
* Update requirements_all to garminconnect 0.1.13
* Update requirements_test_all.txt
* Avoid a context switch in the history api
The history api was creating a job to fetch the
states and another job to convert the states to
json. This can be done in a single job which
decreases the overhead of the operation.
* Ensure there is only one sqlalchemy session created per history
query.
Most queries created three sqlalchemy sessions which was
especially slow with sqlite since it opens and closes the
database.
In testing the UI is noticeably faster at generating history
graphs for entites.
* Add additional coverage
* pass hass first to _states_to_json and _get_significant_states
* Avoid a context switch in the history api
The history api was creating a job to fetch the
states and another job to convert the states to
json. This can be done in a single job which
decreases the overhead of the operation.
* Revert to original solution to avoid function redefine each call
* add BleBox lights support
* cherry pick refactoring from #35552
* Inherit from LightEntity instead of Light
Co-authored-by: J. Nick Koston <nick@koston.org>
* import LightEntity instead of Light
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@koston.org>
* PyWeMo version bump to 0.4.43
Changes necessary to safely upgrade to pyWeMo 0.4.43. This includes catching ActionExceptions that may be thrown by pyWeMo when it is unable to interact with a physical device.
* Black formatting fix
* Fix isort issues
* Code review changes
* More code review fixes
* Linting fix
* Undo dict.get change
* Change a couple instances of dict[key] to dict.get
* Add and use ELECTRICAL_CURRENT_AMPERE constant
* Add and use ELECTRICAL_VOLTAGE_AMPERE constant
* Rename ELECTRICAL_VOLTAGE_AMPERE to ELECTRICAL_VOLT_AMPERE
* Fix imports
* Migrate to pyinsteon from insteonplm
* Rename devices entities
* Print ALDB even if not loaded
* Add relay to name map
* Change insteonplm to pyinsteon
* Update requirements_all correctly
* Code review updates
* async_set_speed receive std speed value
* default speed to std medium value
* Call async methods for fan on/off
* Comment await required in loop
* Remove emtpy and add codeowner
* Make services async and remove async_add_job call
* Remove extra logging
* New device as async task and aldb load in loop
* Place lock in context bloxk
* Limiting lock to min
* Remove .env file
* Avoid locking in the logging queue handler
We do not need a lock here as the underlying queue is already
thread safe.
* Add coverage for logging handle
* First cut of Rollease Acmeda Pulse Hub integration.
* Acmeda integration improvements:
- Moved common code into a base entity
- Battery level sensor added
- Localisation now working
* Added requirement for aiopulse now that it has been uploaded to PyPI.
* Exclude acmeda integration from coverage check as it relies on a hub being present.
* Fix Travis CI build issues.
* Remove unused constants.
* Remove unused group logic from cover.py
* Removed commented code from base.py
* Remove sensors (battery entities) on removal of hub.
* Remove unused groups from sensor.py
* Acmeda device and entity update made fully asynchronous using subscriptions to remove need for config polling.
* Updated aiopulse version dependency.
Removed non-functional battery charging indication.
* Rationalised common code to update entities into helpers.py
* Fix linting issue.
* Correct additional CI pylint errors.
* Index config_entries by entry_id.
Move entity loading and unloading to __init__.py
Add entry_id to dispatcher signal
Removed now unused polling code hub
Added config_flow unit tests
* Tweak to integration config_entry title.
* Bumped aiopulse module to 0.3.2.
Reduced verbosity of aiopulse module.
* Changed to using direct write of device state.
Removed old style async_step_init config_flow step.
* Remove superfluous battery_level and device_state_attributes from battery entity.
* Removal of unused strings.
Removal of unused create_config_flow helper.
Removal of stale comment.
* Remove use of shared container to track existing enities.
Moved removal and deregistration of entities to base class through use of dispatch helper.
* Fixed strings.json
* Fix incorrect use of remove instead of pop on dict.
* Add support for tilting covers, bump aiopulse version number.
* Bump aiopulse version to v0.3.4.
Fixed bug in cover supported_features.
* Bumped aiopulse version to 0.4.0
Update acmeda .coveragerc exclusions
* Removed already configured hub check from __init__.py async_setup_entry
Removed passing in hass reference to base entity class
Renamed entity async_reset to async_will_remove_from_hass
Changed device_info and properties
Migrated to CoveEntity from CoverDevice
Added dispatched_connect cleanup on hub removal
Removed unused entries from manifest
Removed override of battery icon
Renamed translations folder
* Reversed unintended change to .coveragerc
* Fixed config flow for multi-hub discovery.
* Acmeda enhancements as requested by MartinHjelmare
* Force import to connect to hub to retrieve id prior to creating entry
* Remove YAML configuration support.
* Tidied up config_flow and tests:
- removed unnecessary steps
- fixed typos
* Removed storage of hub in config_flow.
* add config option to set timeout for wiffi devices
Wiffi devices allow to configure the update period (=
full_loop_minutes). The integration shall respect the configured update
period and therefore need a configuration for the timeout, too.
* Move timeout from config flow to option flow
* add test for option flow
* Add support for "Window covering controller"
Some window cover devices such as Sunricher SR-ZG9080A are identified in deconz as "Window covering controller".
We need to include this device type in const.py to be integrated as type "cover" in home-assistant.
* Added Window covering controller to deconz tests
* Prevent updater from delaying startup
The updater sometimes times out as seen in
#33833 and the linked issues. The issue was
presenting again today as it appears the service
is overloaded again.
* s/hass.loop/asyncio/g
* Add config flow to gogogate2 component.
* Using a more stable gogogate api.
* Getting config flows working better by using different downstream library.
* Fixing options not getting default values.
Adding availability to cover entity.
* Simplifying return types of function.
* Address PR feedback.
* Making user config flow not abort.
* Using DataUpdateCoordinator.
* Addressing PR feedback.
* Using standard method for using hass.data
* Split auth fail test into separate tests.
* Use built in queue log handlers to avoid formatting logs in the event loop
Logging is now formatted and written in another thread to
ensure there is minimal impact on the event loop when
a log message is processed.
This change replaces the existing AsyncHandler log handler
as python 3.7+ now offers an off the shelf solution
* add a simple test
* s/async_migrate_log_handlers_to_queue/async_activate_log_queue_handler/g
* Add device triggers to support setting turn_on event
* Add turn on event
* Add unique_id based on config entry
* Adjust tests for addition of uuid
* Supported features are now always same
* Switch to player_setup fixture that actually start platform
* Update homeassistant/components/arcam_fmj/const.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* openwindow0: this is the part for the HA itself
* Update homeassistant/components/tado/sensor.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/tado/sensor.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* new version after review
Co-authored-by: J. Nick Koston <nick@koston.org>
* Provide yeelight unique_id using ssdp discovery
* Fixes
* Comment fix
* Cleanup initialization logic and add unique id to binary sensor
* Update homeassistant/components/yeelight/__init__.py
Co-authored-by: Teemu R. <tpr@iki.fi>
* Update homeassistant/components/yeelight/__init__.py
Co-authored-by: Teemu R. <tpr@iki.fi>
* Update comment
* Update comment
* Fix wrong model docstring
Co-authored-by: Teemu R. <tpr@iki.fi>
* Fix for creating the device name
Creating the devicename included a typo and was missing the custom (preferred) name set by the OZW Admin tool.
* update comments