Support the action.devices.commands.mute intent to mute and unmute
media_players that declare support for mute/unmute.
For media players with support for volume up/down, but no support for
setting the volume to a specific number, allow use of the
action.devices.commands.relativeMute intent to control volume up/down.
This will improve support for IR blasters and other open-loop
media_player integrations.
* Make sure groups are initialized before template sensors
This way users may use the `expand` function in templates to expand
groups and have HA listen for changes to group members.
Fixes#35872
* Patch async_setup_platform instead of async_setup
* Cleanup
* Use an event to avoid sleep
* Update tests/components/template/test_sensor.py
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@koston.org>
* Don't set SUPPORT_EFFECT on DemoLight if there are no effects
This requires an update to the group test - previously the other lights
instantiated by the DemoLight component had nothing in ATTR_EFFECT_LIST, but
still had SUPPORT_EFFECT set. This appears to have resulted in the light
group test code setting an effect on the group and expecting it to apply to
all lights, but given that two of the bulbs didn't actually support any
effects (due to the empty ATTR_EFFECT_LIST) this seems like a broken
assumption and updating the test to verify only the bulb that supports
effects has had one applied seems reasonable.
* Add support for exposing light effects via Google Assistant
The LightEffects trait only supports a fixed (and small) list of lighting
effects, but we can expose them via the Modes trait - this requires saying
"Set (foo) effect to (bar)" which is a little clumsy, but at least makes it
possible.
* added device classes for electrical measurement
(cherry picked from commit 2409fe19ed43bef568a0cca826652867d3a2d71a)
* upadte power factor unit (%)
* update power factor unit (%)
* Add support for reload_on_update to _abort_if_unique_id_configured
async_update_entry now avoids firing update listeners and writing
the storage if there are no actual changes.
* Actually add the tests
* collapse branch
* Update homeassistant/config_entries.py
Co-authored-by: Franck Nijhof <git@frenck.dev>
* handle entries that lack the ability to reload
* reduce
* adjust konnected tests
* update axis tests
* fix blocking
* more mocking
* config flow tests outside of test_config_flow
* reduce
* volumio
* Update homeassistant/config_entries.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* set reload_on_update=False for integrations that implement self._abort_if_unique_id_configured(updates= and a reload listen
* get rid of copy
* revert test change
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
```
2020-08-07 22:38:10 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.3903193064] local variable 'response' referenced before assignment
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/rest_command/__init__.py", line 115, in async_service_handler
async with getattr(websession, method)(
File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 1012, in __aenter__
self._resp = await self._coro
File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 582, in _request
break
File "/usr/local/lib/python3.8/site-packages/aiohttp/helpers.py", line 586, in __exit__
raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 125, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1281, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1316, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/components/rest_command/__init__.py", line 137, in async_service_handler
_LOGGER.warning("Timeout call %s", response.url, exc_info=1)
UnboundLocalError: local variable 'response' referenced before assignment
```
* Update Tesla to use DataUpdateCoordinator
* Update Tesla to use DataUpdateCoordinator
* Fix linting errors
* Apply suggestions from code review
Co-authored-by: Chris Talkington <chris@talkingtontech.com>
* Address requested changes
* Apply suggestions from code review
Co-authored-by: Chris Talkington <chris@talkingtontech.com>
* Fix lint errors
* Remove controller from hass.data
Co-authored-by: Chris Talkington <chris@talkingtontech.com>
* Automatically switch between resume and start playing
* Fix Black issue
Weirdly when i run it i had an error `1544 files left unchanged, 3313 files failed to reformat.`
I didn't watch the commit check output afterward.
* track all settings and add service to update a setting
* sort setting types
* reduce frequency of updates due to the increase in API calls per update
* change dict call to a get in case audio settings aren't available
unlikely to occur but less error prone
* Update if statement to be more consistent
* revert changes to track all settings and store in state machine
* revert one more change
* force setting_type and setting_name to lowercase to make it easier to understand how to make service call
* make service calls even simpler by attempting to transform certain parameters as much as possible
* Support Next/Previous for InputSelector
* Update homeassistant/components/google_assistant/trait.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Adjust to match new version of _next_selected
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Fix webhook registration
* Only load camera platform with valid scope
* Add initial data handler and netatmo base class
* Update camera to use data handler
* Update init
* Parallelize API calls
* Remove cruft
* Minor tweaks
* Refactor data handler
* Update climate to use data handler
* Fix pylint error
* Fix climate update not getting fresh data
* Update climate data
* update to pyatmo 4.0.0
* Refactor for pyatmo 4.0.0
* Exclude from coverage until tests are written
* Fix typo
* Reduce parallel calls
* Add heating request attr
* Async get_entities
* Undo parallel updates
* Fix camera issue
* Introduce individual scan interval per device class
* Some cleanup
* Add basic webhook support for climate to improve responsiveness
* Replace ClimateDevice by ClimateEntity
* Add support for turning camera on/off
* Update camera state upon webhook events
* Guard data class registration with lock
* Capture errors
* Add light platform
* Add dis-/connect handling
* Fix set schedule service
* Remove extra calls
* Add service to set person(s) home/away
* Add service descriptions
* Improve service descriptions
* Use LightEntity instead of Light
* Add guard if no data is retrieved
* Make services entity based
* Only raise platform not ready if there is a NOC
* Register webhook even during runtime
* Fix turning off event
* Fix linter error
* Fix linter error
* Exclude light platform from coverage
* Change log level
* Refactor public weather sensor to use data handler
* Prevent too short coordinates
* Ignore modules without _id
* Code cleanup
* Fix test
* Exit early if no home data is retrieved
* Prevent discovery if already active
* Add services to (un-)register webhook
* Fix tests
* Not actually a coroutine
* Move methods to base class
* Address pylint comment
* Address pylint complaints
* Address comments
* Address more comments
* Add docstring
* Use single instance allowed
* Extract method
* Remove cruft
* Write state directly
* Fix test
* Add file to coverage
* Move nested function
* Move nested function
* Update docstring
* Clean up code
* Fix webhook bug
* Clean up listeners
* Use deque
* Clean up prints
* Update homeassistant/components/netatmo/sensor.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/netatmo/sensor.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/netatmo/sensor.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/netatmo/sensor.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/netatmo/sensor.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/netatmo/sensor.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/netatmo/camera.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/netatmo/camera.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/netatmo/camera.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/netatmo/camera.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/netatmo/camera.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/netatmo/camera.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Rename data_class variable
* Break when match
* Extract method
* Extract methods
* Rename variable
* Improve comment
* Some refinements
* Extra
* Extract method
* Simplify code
* Improve reability
* Code simplification
* Simplify code
* Simplify code
* Code cleanup
* Fix import
* Clean up
* Clean up magic strings
* Replace data_class_name with CAMERA_DATA_CLASS_NAME
* Replace data_class_name with CAMERA_DATA_CLASS_NAME
* Replace data_class_name with HOMEDATA_DATA_CLASS_NAME
* Replace data_class_name in public weather sensor
* Clean up
* Remove deprecated config options
* Schedule immediate update on camera reconnect
* Use UUID to clearly identify public weather areas
* Use subscription mode
* Move clean up of temporary data classes
* Delay data class removal
* Fix linter complaints
* Adjust test
* Only setup lights if webhook are registered
* Prevent crash with old config entries
* Don't cache home ids
* Remove stale code
* Fix coordinates if entered mixed up by the user
* Move nested function
* Add test case for swapped coordinates
* Only wait for discovery entries
* Only use what I need
* Bring stuff closer to where it's used
* Auto clean up setup data classes
* Code cleanup
* Remove unneccessary lock
* Update homeassistant/components/netatmo/sensor.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update tests/components/netatmo/test_config_flow.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Clean up dead code
* Fix formating
* Extend coverage
* Extend coverage
Co-authored-by: J. Nick Koston <nick@koston.org>
Fixed a rarely occuring problem (maybe a change with Fibaro HC3) where some scenes don't have a "visible" parameter, which was assumed to be mandatory in the past.
* Wait for the state of the entity to actually change before resolving PUT request
Additionally, we cache the entity's properties for up to two seconds for the successive GET state request
When Alexa issues a command to a Hue hub; it immediately queries the hub for the entity's state to confirm if the command was successful.
It expects the state to be effective immediately after the PUT request has been completed.
There may be a delay for the new state to actually be active, this is particularly obvious when using group lights.
This leads Alexa to report that the light had an error.
So we wait for the state of the entity to actually change before responding to the PUT request.
Due to rounding issue when converting the HA range (0..255) to Hue range (1..254) we now cache the state sets by Alexa and return those cached values for up to two seconds so that Alexa gets the same value as it originally set.
Fixes#38446
* Add new tests verifying emulated_hue behaviour.
* Increase code test coverage.
The remaining uncovered lines can't be tested as they mostly check that the hass framework or the http server properly work.
This commit doesn't attempt to fix exposed issues as it would be out of scope ; it merely create the tests to exercise the whole code.
* Update homeassistant/components/emulated_hue/hue_api.py
* Add test for state change wait timeout
* Preserve the cache long enough for groups to change
* Update tests/components/emulated_hue/test_hue_api.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Add config flow to HLK-SW16
* Use entry_id for unique_id
* Add options update capability
* Refactor entry_id under domain
* Remove name from config
* Set options
* Remove options flow
* remove unneccesary else block from validate_input and move domain cleanup to async_unload_entry
* Add tests and config import
* Add back config schema
* Remove config import
* Refactor unload
* Add back config import
* Update coveragerc
* Don't mock validate_input
* Test duplicate configs
* Add import test
* Use patch for timeout test
* Use mock for testing timeout
* Use MockSW16Client for tests
* Check mock_calls count
* Remove unused NameExists exception
* Remove title from strings.json
* Mock setup for import test
* Set PARALLEL_UPDATES for switch
* Move hass.data.setdefault(DOMAIN, {}) to async_setup_entry
* Bump the numato-gpio dependency
This relaxes the pyserial dependency to >=3.1.1 as requested by the
project with respect to the upcoming, stricter pip resolver.
* Update numato-gpio due to deprecation of class BinarySensorDevice
* Add new python library
* Update requirements
* Remove old libs
* config flow with client.search_places
* WIP: UI config + weather OK
* WIP: sensors
* WIP: add pressure to weather + available to sensor
* WIP: coordinator next_rain + alert
* Make import step working
* migrate to meteofrance-api v0.0.3
* Create coordinator for rain only if data available in API
* Fix avoid creation of rain sensor when not available.
* Add options flow for forecast mode
* Fix import config causing bug with UI
* Add alert sensor
* Add coastal alerts when available (#5)
* Use meteofrance-api feature branch on Github
* Update unit of next_rain sensor
* Test different type of attibutes
* Typo for attribute
* Next rain sensor device class as timestamp
* Better design for rain entity attributes
* use master branch for meteofrance-api
* time displayed in the HA server timezone.
* fix bug when next_rain_date_locale is None
* Add precipitation and cloud cover sensors
* Add variable to avoid repeating computing
* Apply suggestions from code review
Co-authored-by: Quentame <polletquentin74@me.com>
* Attributes names in const.
* Cleaning
* Cleaning: use current_forecast and today_forecast
* Write state to HA after fetch
* Refactor, Log messages and bug fix. (#6)
* Add messages in log
* Refactor using 'current_forecast'.
* Use % string format with _LOGGER
* Remove inconsistent path
* Secure timestamp value and get current day forecast
* new unique_id
* Change Log message to debug
* Log messages improvement
* Don't try to create weather alert sensor if not in covered zone.
* convert wind speed in km/h
* Better list of city in config_flow
* Manage initial CONF_MODE as None
* Review correction
* Review coorections
* unique id correction
* Migrate from previous config
* Make config name detailed
* Fix weather alert sensor unload (#7)
* Unload weather alert platform
* Revert "Unload weather alert platform"
This reverts commit 95259fdee84f30a5be915eb1fbb2e19fcddc97e4.
* second try in async_unload_entry
* Make it work
* isort modification
* remove weather alert logic in sensor.py
* Refactor to avoid too long code lines
Co-authored-by: Quentin POLLET <polletquentin74@me.com>
* Update config tests to Meteo-France (#18)
* Update meteo_france exception name
* Update MeteoFranceClient name used in tests
* Update 'test_user'
* Make test_user works
* Add test test_user_list
* Make test_import works
* Quick & Dirty fix on exception managment. WIP
* allow to catch MeteoFranceClient() exceptions
* remove test_abort_if_already_setup_district
* bump meteofrance-api version
* We do not need to test Exception in flow yet
* Remove unused data
* Change client1 fixture name
* Change client2 fixture name
* Finish cities step
* Test import with multiple choice
* refactor places
* Add option flow test
Co-authored-by: Quentin POLLET <polletquentin74@me.com>
* Fix errors due to missing data in the API (#22)
* fix case where probability_forecast it not in API
* Workaround for probabilty_forecast data null value
* Fix weather alert sensor added when shouldn't
* Add a partlycloudy and cloudy value options in condition map
* Enable snow chance entity
* fix from review
* remove summary
* Other fix from PR review
* WIP: error if no results in city search
* Add test for config_flow when no result in search
* Lint fix
* generate en.json
* Update homeassistant/components/meteo_france/__init__.py
* Update homeassistant/components/meteo_france/__init__.py
* Update homeassistant/components/meteo_france/__init__.py
* Update homeassistant/components/meteo_france/sensor.py
* Update homeassistant/components/meteo_france/__init__.py
* Update homeassistant/components/meteo_france/__init__.py
* string: city input --> city field
Co-authored-by: Quentin POLLET <polletquentin74@me.com>
* Add node neighbors to websocket api
* Update homeassistant/components/ozw/websocket_api.py
Co-authored-by: Charles Garwood <cgarwood@newdealmultimedia.com>
* Update tests/components/ozw/test_websocket_api.py
Co-authored-by: Charles Garwood <cgarwood@newdealmultimedia.com>
Co-authored-by: Charles Garwood <cgarwood@newdealmultimedia.com>
* Add zeroconf discovery for bond integration
* Add zeroconf discovery for bond integration (fix typo)
* Add zeroconf discovery for bond integration (PR feedback)
* Add zeroconf discovery for bond integration (PR feedback)
* Add zeroconf discovery for bond integration (PR feedback)
* Restore the ability to tell when a harmony activity is starting
* adjust for poweroff
* switch to activity name for activity starting
* adjust
* do not set starting on initial update
* 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.
* Don't schedule an update if the hass instance isn't instantiated
If we get a status update packet before self.hass exists, we trip a
"assert self.hass is not None" that was added in 0.112 and setup fails.
* Fix callback hander properly
The right fix is to register the callback after hass is ready for it.
* Remove unnecessary check
This is now guaranteed by the core code.
* Don't request an immediate device update and do an async connect.
* Remove unnecessary return
When speedtest starts up, it would saturate the network interface and cause other
integrations to randomly fail to setup. We now wait to do the first speed test
until after the started event is fired.
* 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
Automations or HomeKit may turn the device on multiple times
when the current activity is already active which will cause
harmony to lose state. This behavior is unexpected as turning
the device on when its already on isn't expected to reset state.
* 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
* Support multiple camera stream in HomeKit
* Update homeassistant/components/homekit/type_cameras.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Revert "Update homeassistant/components/homekit/type_cameras.py"
This reverts commit d7624c5bff.
* Update homeassistant/components/homekit/type_cameras.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/homekit/type_cameras.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* black
* bump pyhap
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
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.
Added support for new 2020 version of the Aqara D1 double wall switch (lumi.remote.b286acn02)
Confirmed that all button press events use the same codes after updating deconz rest api to add support for this switch.
A contributor of the API currently has the working version @ git clone --branch Legrand-teleruptor https://github.com/Smanar/deconz-rest-plugin.git
* Fix Xbox Live component
The API moved to a different domain, so the integration was broken.
The library upgrade contains the required fixes.
* Fix API connectivity check
* Access dict values directly
* 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.
* Add set_central_heating_ovrd service to opentherm_gw
* Use await instead of async_create_task
Use await instead of async_create_task as per review.
Co-authored-by: J. Nick Koston <nick@koston.org>
* Use boolean values for service call to opentherm_gw.set_central_heating_ovrd
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update const.py
Added device class "IPKeyBlindMulti" to const.py in order to support HomematicIP device HmIP-DRBLI4. The site package pyhomematic supports this class already in actors.py.
* Update const.py
* Refactor bond integration to centralize update state logic in single superclass
* Refactor bond integration to centralize update state logic in single superclass
* 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