1
mirror of https://github.com/home-assistant/core synced 2024-09-15 17:29:45 +02:00
Commit Graph

214 Commits

Author SHA1 Message Date
Franck Nijhof
04e0e2bd75
Update a* tests to use device & entity registry fixtures (#103711) 2023-11-09 20:46:20 +01:00
Jan Bouwhuis
6372bc3aaa
Fix missed case alexa light attr can be None (#102612)
* Fix missed cased alexa light attr can be None

* Add test
2023-10-24 00:20:03 +02:00
Jan Bouwhuis
c2abc3dcec
Fix brightness and color_temp can be None for alexa light entities (#102554)
* Fix brightness and color_temp can be None in alexa

* Add test
2023-10-22 23:34:04 +02:00
Jan Bouwhuis
7c7456df99
Handle alexa invalid climate temp adjustment (#99740)
* Handle temp adjust when target state not set

* Update homeassistant/components/alexa/errors.py

Co-authored-by: Robert Resch <robert@resch.dev>

* black

---------

Co-authored-by: Robert Resch <robert@resch.dev>
2023-09-06 18:54:16 +02:00
Ville Skyttä
3b4774d9ed
Remove unnnecessary pylint configs from components/[a-d]* (#98911) 2023-08-24 00:54:02 +02:00
Jan Bouwhuis
fa6ffd994a
Update vacuum entity constants for Alexa tests (#98336)
* Update vacuum entity constants for Alexa tests

* Import VacuumEntityFeature
2023-08-13 15:35:00 +02:00
Jan Bouwhuis
b872d74b1f
Fix lingering test alexa (#98128) 2023-08-10 12:16:52 +02:00
Jan Bouwhuis
0614702f98
Alexa typing part 5 (smart_home) (#97918)
* smart_home

* Fix test_disabled

* Remove unused type ignore
2023-08-08 11:48:50 +02:00
Marc Mueller
cf4287cd0c
Fix alexa test RuntimeWarning (#97956) 2023-08-07 12:57:37 +02:00
Jan Bouwhuis
2e8e5aabae
Refactor alexa modules to avoid circular deps (#97618)
* Refactor alexa modules to avoid circula deps

* Add test http api auth and AlexaConfig

* Update test

* Improve test
2023-08-05 21:32:53 +02:00
Jan Bouwhuis
3183ce7608
Add doorbell event support to alexa (#97092) 2023-07-23 20:16:46 +02:00
Mike Keesey
44aa531a51
Alexa temperature adjustment handle multiple setpoint (#95821)
* Alexa temperature adjustment handle multiple setpoint

In "auto" mode with many thermostats, the thermostats expose both an
upper and lower setpoint representing a range of temperatures. When a
temperature delta is sent from Alexa (e.g. "lower by 2 degrees), we need
to handle the case where the temperature property is not set, but
instead the upper and lower setpoint properties are set. In this case,
we adjust those properties via service call instead of the singular
value.

* Updating tests to fix coverage
2023-07-18 01:12:15 +02:00
Flo
0f2caf864a
Alexa Intent: Use the 'id' field and expose nearest resolutions as variables (#86709)
* Use the 'id' field and nearest resolutions
Expose nearest Resolution (ID and Value) as Variables

* Add more specific type hints

* Change type definition of request

* Add deprecation warning and remove variables

* Remove deprecation warning & update tests

* Fix wrong value assignment

* revert future changes
2023-05-10 21:25:08 +02:00
Erik Montnemery
7d29d584fd
Fix race in Alexa async_enable_proactive_mode (#92785) 2023-05-09 19:58:00 +02:00
Erik Montnemery
0126cfa9d9
Allow exposing any entity to the default conversation agent (#92398)
* Allow exposing any entity to the default conversation agent

* Tweak

* Fix race, update tests

* Update tests
2023-05-03 09:45:54 -04:00
Erik Montnemery
4860a8d1e8
Don't use storage collection helper in ExposedEntities (#92396)
* Don't use storage collection helper in ExposedEntities

* Fix tests
2023-05-03 12:39:22 +02:00
Erik Montnemery
e3c16e634b
Allow exposing entities not in the entity registry to assistants (#92363) 2023-05-02 22:08:09 +02:00
J. Nick Koston
99b58f157e
Bump PyJWT to 2.6.0 (#90134)
* Bump PyJWT to 2.6.0

* fix time being frozen too late which makes the access token creation time in the future

* revert zha change

* fix repairs test

* fix ical test
2023-03-22 20:00:47 -04:00
Franck Nijhof
ed79265843
Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
Erik Montnemery
cc564026fa
Move EntityCategory to homeassistant.const (#87792)
* Move EntityCategory to homeassistant.const

* Fix more imports
2023-02-09 20:15:37 +01:00
epenet
07a1a0efa9
Add type hints to integration tests (part 1) (#87777) 2023-02-09 16:09:13 +01:00
epenet
2545694d41
Add type hints to integration tests (a) (#87684)
* Add type hints to accuweather tests

* Adjust a** components

* Adjust aiohttp_client

* ClientSessionGenerator/WebSocketGenerator
2023-02-08 12:16:23 +01:00
epenet
59ca7780fa
Add typing to tests with single hass argument (#87631) 2023-02-07 15:01:16 +01:00
epenet
4142f0d15d
Add return type to tests without arguments (#87613)
* Add return type to tests without arguments

* Black

* Cancel fixture amends
2023-02-07 14:20:06 +01:00
Franck Nijhof
5e81d28116
Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
Franck Nijhof
57cf11f067
Enable Ruff PT015 (#86775) 2023-01-27 11:10:29 +01:00
Franck Nijhof
fca3382d37
Migrates tests to use MediaPlayerEntityFeature enum (#86779) 2023-01-27 10:56:40 +01:00
Jan Bouwhuis
f182e314e5
Add number platform support to Alexa (#86553)
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2023-01-25 13:34:53 +01:00
epenet
30bf0634fe
Add per-file-ignore to pylint (#86289) 2023-01-22 17:26:24 +01:00
Franck Nijhof
24fdd588fd
Code styling tweaks to the tests - Part 1 (#86192) 2023-01-20 13:52:46 +01:00
Franck Nijhof
91aaca6471
Code styling tweaks to the Alexa integration (#86121) 2023-01-18 01:01:30 +02:00
Michael
2850583085
Replace the usage of unit constants by enumerations in Tests [a-e] (#85932) 2023-01-15 14:44:01 +01:00
Joakim Plate
c576a68d33
Upgrade pytest-aiohttp (#82475)
* Upgrade pytest-aiohttp

* Make sure executors, tasks and timers are closed

Some test will trigger warnings on garbage collect, these warnings
spills over into next test.

Some test trigger tasks that raise errors on shutdown, these spill
over into next test.

This is to mimic older pytest-aiohttp and it's behaviour on test
cleanup.

Discussions on similar changes for pytest-aiohttp are here:
https://github.com/pytest-dev/pytest-asyncio/pull/309

* Replace loop with event_loop

* Make sure time is frozen for tests

* Make sure the ConditionType is not async

  /home-assistant/homeassistant/helpers/template.py:2082: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
    def wrapper(*args, **kwargs):
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

* Increase litejet press tests with a factor 10

The times are simulated anyway, and we can't stop the normal
event from occuring.

* Use async handlers for aiohttp

tests/components/motioneye/test_camera.py::test_get_still_image_from_camera
tests/components/motioneye/test_camera.py::test_get_still_image_from_camera
tests/components/motioneye/test_camera.py::test_get_stream_from_camera
tests/components/motioneye/test_camera.py::test_get_stream_from_camera
tests/components/motioneye/test_camera.py::test_camera_option_stream_url_template
tests/components/motioneye/test_camera.py::test_camera_option_stream_url_template
  /Users/joakim/src/hass/home-assistant/venv/lib/python3.9/site-packages/aiohttp/web_urldispatcher.py:189: DeprecationWarning: Bare functions are deprecated, use async ones
    warnings.warn(

* Switch to freezegun in modbus tests

The tests allowed clock to tick in between steps

* Make sure skybell object are fully mocked

Old tests would trigger attempts to post to could services:

```
DEBUG:aioskybell:HTTP post https://cloud.myskybell.com/api/v3/login/ Request with headers: {'content-type': 'application/json', 'accept': '*/*', 'x-skybell-app-id': 'd2b542c7-a7e4-4e1e-b77d-2b76911c7c46', 'x-skybell-client-id': '1f36a3c0-6dee-4997-a6db-4e1c67338e57'}
```

* Fix sorting that broke after rebase
2022-11-29 22:36:36 +01:00
Jan Bouwhuis
5d4c4a1293
Add humidifier support for Alexa (#81329) 2022-11-28 09:55:22 -10:00
epenet
e84e5f134e
Use US_CUSTOMARY_SYSTEM in tests (#80658)
* Use US_CUSTOMARY_SYSTEM in tests

* Don't update test_unit_system
2022-10-20 15:42:23 +02:00
epenet
0d696b84b2
Cleanup root component imports in tests (#78893) 2022-09-21 06:57:41 -10:00
epenet
fe747601ff
Cleanup DeviceClass and StateClass in tests (#78811) 2022-09-20 10:49:11 -04:00
epenet
52a377ca9d
Adjust root-import in alexa tests (#78766) 2022-09-19 15:38:33 +02:00
Erik Montnemery
d034ed1fc2
Remove some error prone code from Alexa tests (#76917) 2022-08-17 07:54:54 -04:00
Jan Bouwhuis
e6e5b98bc7
Allow climate operation mode fan_only as custom mode in Alexa (#76148)
* Add support for FAN_ONLY mode

* Tests for fan_only as custom mode
2022-08-04 09:13:20 +02:00
Thomas Hollstegge
f0cc565f6c
Fix Alexa: Only trigger doorbell event on actual state change to "ON" (#74924)
* Alexa: Only trigger doorbell event on actual state change to "ON"

* Remove unnecessary check for new_state

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

* First check state is `on` before checking the old state

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2022-07-14 12:40:53 -07:00
Paulus Schoutsen
7573dc34aa
Treat thermostat unknown state like unavailable in alexa (#74220) 2022-06-30 10:00:10 -07:00
Mike Degatano
9392f59913
Trigger Alexa routines from toggles and buttons (#67889) 2022-06-29 13:56:02 +02:00
w35l3y
beab6e2e5f
Fix ended session when there isn't any response from the user (#72218)
* Fix end session when there isn't any response

This PR fixes #72153

* Added test case as requested

https://github.com/home-assistant/core/pull/72218#discussion_r881584812
2022-06-03 15:32:22 +02:00
J. Nick Koston
24d7a464e1
Refactor logbook to reduce overhead and complexity (#71509) 2022-05-08 21:47:26 -07:00
Erik Montnemery
1aaf78ef99
Remove entity category system in favor of hidden_by (#68550) 2022-05-02 09:33:16 -07:00
Erik Montnemery
e45d4d53dd
Correct time stamp format in Alexa responses (#70267) 2022-04-22 08:44:59 -07:00
Erik Montnemery
dc8e87a6f7
Exclude hidden entities from alexa (#68555) 2022-03-23 12:40:28 +01:00
Paulus Schoutsen
9c440d8aa6
Guard for non-string inputs in Alexa (#67348) 2022-02-27 12:59:05 -08:00
Paulus Schoutsen
bf138c4ffb
Alexa to handle brightness and catch exceptions (#65322) 2022-01-31 15:01:46 -08:00