Commit Graph

52 Commits (6423501498cedc6a11bed9e9a07fde0d3426379b)

Author SHA1 Message Date
Joost Lekkerkerker 6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
J. Nick Koston 4f18f0d902
Fix setup timings when config entry platform loads are not awaited (#113959)
* Move setup time logging into the context manager

We were fetching the time twice but since the context
manager already has the timing, move it there

* remove log setup assertions from integration test

* tweak logging to give us better data for tracking issues

* redundant

* adjust

* preen

* fixes

* adjust

* make api change internal so nobody uses it

* coverage

* fix test

* fix more tests

* coverage

* more tests assuming internal calls

* fix more

* adjust

* adjust

* fix axis tests

* fix broadlink -- it does not call async_forward_entry_setup

* missed some

* remove useless patch

* rename, detect it both ways

* clear

* debug

* try to fix

* handle phase finishing out while paused

* where its set does not need to know its late as that is an implemenation detail of setup

* where its set does not need to know its late as that is an implemenation detail of setup

* tweak

* simplify

* reduce complexity

* revert order change as it makes review harder

* revert naming changes as it makes review harder

* improve comment

* improve debug

* late dispatch test

* test the other way as well

* Update setup.py

* Update setup.py

* Update setup.py

* simplify

* reduce
2024-03-23 15:26:38 -04:00
Marc Mueller 32f3f46542
Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Marc Mueller c88b337600
Add empty line after module docstring [tests f-k] (#112709) 2024-03-08 14:50:04 +01:00
Jan-Philipp Benecke eda475fe25
Update h* tests to use entity & device registry fixtures (#103866)
* Update h* tests to use entity & device registry fixtures

* Add missed lines
2023-11-12 13:52:32 -05:00
Erik Montnemery 7539cf25be
Don't require passing identifiers to DeviceRegistry.async_get_device (#96479)
* Require keyword arguments to DeviceRegistry.async_get_device

* Update tests

* Update tests

* Don't enforce keyword arguments
2023-07-13 13:39:25 -04:00
epenet 03710e58b5
Add type hints to integration tests (part 9) (#87983) 2023-02-13 12:06:51 +01:00
epenet 37a2040d7b
Add type hints to integration tests (h-i) (#87703) 2023-02-08 18:12:56 +01:00
Franck Nijhof 8f74bff354
Enable Ruff PLC0414 (#86799) 2023-01-27 16:32:04 +01:00
epenet 0d696b84b2
Cleanup root component imports in tests (#78893) 2022-09-21 06:57:41 -10:00
epenet 0ac581a0b1
Cleanup EntityFeature in tests (#78859) 2022-09-21 10:48:55 +02:00
epenet 41d2ac3943
Cleanup MediaClass and MediaType in tests (#78817)
Cleanup MediaClass/MediaType in tests
2022-09-20 17:55:13 +02:00
Franck Nijhof 7cd68381f1
Search/replace RESULT_TYPE_* by FlowResultType enum (#74642) 2022-07-07 19:57:36 +03:00
Franck Nijhof 15cffbe496
Clean up async_dispatcher_connect helper usage (#68613) 2022-03-24 13:19:11 +01:00
Marc Mueller d057850971
Update typing - collections.abc (3) (#63947) 2022-01-12 08:04:17 +01:00
epenet 9eed18f121
Use SsdpServiceInfo for ssdp tests (part 1) (#60320)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-25 14:35:19 +01:00
Dan Klaffenbach 56e93ff0ec
Add support for HEOS groups (#32568)
* Add support for grouping HEOS media players

* Update homeassistant/components/heos/media_player.py

Co-authored-by: Andrew Sayre (he/his/him) <6730289+andrewsayre@users.noreply.github.com>

* Update homeassistant/components/heos/media_player.py

Co-authored-by: Andrew Sayre (he/his/him) <6730289+andrewsayre@users.noreply.github.com>

* Update homeassistant/components/heos/media_player.py

Co-authored-by: Andrew Sayre (he/his/him) <6730289+andrewsayre@users.noreply.github.com>

* Update homeassistant/components/heos/media_player.py

Co-authored-by: Andrew Sayre (he/his/him) <6730289+andrewsayre@users.noreply.github.com>

* Update homeassistant/components/heos/media_player.py

Co-authored-by: Andrew Sayre (he/his/him) <6730289+andrewsayre@users.noreply.github.com>

* Update homeassistant/components/heos/media_player.py

Co-authored-by: Andrew Sayre (he/his/him) <6730289+andrewsayre@users.noreply.github.com>

* Handle groups at controller level, refine tests.

Co-authored-by: Andrew Sayre (he/his/him) <6730289+andrewsayre@users.noreply.github.com>

* Fix linting issues

* Update homeassistant/components/heos/media_player.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/heos/media_player.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Rename variables and improve resolving of entity_ids

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Don't patch internal methods

Use the pytest fixtures which have already been defined for this.

* Fix linting issues

* Remove unused property

* Ignore groups with unknown leader

This makes sure that the group_members attribute won't contain a `None`
value as a leader entity_id.

* Don't call force_update_groups() from tests

* Don't pass `None` player ids to HEOS API

* Use signal for group manager communication

* Use imports for async_dispatcher_send/async_dispatcher_connect

* Raise exception when leader/player could not be resolved

* Disconnect signal handlers, avoid calling async_update_groups too early

* Update homeassistant/components/heos/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Andrew Sayre (he/his/him) <6730289+andrewsayre@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-11-21 12:57:31 +01:00
Ville Skyttä 153d6e891e
Use config_entries.SOURCE_* constants (#49631) 2021-04-25 11:27:40 +02:00
Marc Mueller 54d1e9985f
Update typing 15 (#48079) 2021-03-18 15:13:22 +01:00
Erik Montnemery 87e7cebd36
Update tests c-h to use registry async_get (#47652) 2021-03-09 14:31:17 +01:00
Paulus Schoutsen 9e07910ab0
Mark entities as unavailable when they are removed but are still registered (#45528)
* Mark entities as unavailable when they are removed but are still registered

* Add sync_entity_lifecycle to collection helper

* Remove debug print

* Lint

* Fix tests

* Fix tests

* Update zha

* Update zone

* Fix tests

* Update hyperion

* Update rfxtrx

* Fix tests

* Pass force_remove=True from integrations

Co-authored-by: Erik <erik@montnemery.com>
2021-02-08 10:45:46 +01:00
Ville Skyttä 2fb3be50ab
Make DeviceRegistry.async_get_device connections arg optional (#44897)
* Make async_get_device connections Optional, default None

* Remove unnecessary async_get_device connections arg usages

Some of these were using an incorrect collection type, which didn't
cause issues mostly just due to luck.
2021-01-07 13:49:45 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Pigotka 7eaa304fc3
Use of reference strings in Heos config flow (#41282) 2020-10-05 12:22:02 -05:00
J. Nick Koston f50976a0b3
Switch to asyncio.wait for slow update warning implementation (#41184) 2020-10-05 15:28:15 +02:00
Bas Nijholt 0427d87ba4
Bump codespell from v1.16.0 to v1.17.1 and fix new spelling errors (#38663) 2020-08-08 14:41:02 +02:00
avocadio 2196bd66c7
Add TTS support to Heos (#35386)
* TTS seems unsupported on heos media player #32862 

TTS seems unsupported on heos media player #32862 

The type media_type music which is required by TTS was not covered.

* Update homeassistant/components/heos/media_player.py

Co-authored-by: Andrew Sayre <6730289+andrewsayre@users.noreply.github.com>

* Update to test_media_player.py

Test for TTS support to Heos #35386

* Update test

Add TTS support to Heos #35386

* Update to test_play_media_music

assert set to "Unable to play music: Failure (1)" seems to cause an issue.

* test_play_media_music

syntax

Co-authored-by: Andrew Sayre <6730289+andrewsayre@users.noreply.github.com>
2020-06-20 09:54:44 +02:00
J. Nick Koston 9a53240759
Add ability to ignore heos discovery (#34653)
* 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
2020-05-26 10:51:50 -05:00
Paulus Schoutsen ec47216388
Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
Yuki Ueda 0eb5ca67cd
Make heos and transmission config flow tests more robust (#31783)
* async_step_user to async_configure

* fix for lint

* fix for pylint

* fix isort and black

* fix miss-fixed black

* fixing for the python37 coverage

* fix transmission definition

* fix for Black formatting

* fix type to abort

* clean up

* clean up for the test

* fix for the test

* refactor

* split test_flow_works to three tests

* revert the assert

* remove whitespaces for flake8

* apply patch function

* fix for the patch

* fix for the black

* remove mock_coro

* fix for the black

* hue to heos

* try to fix import

* fix for the black

* revert try to fix import

* Add a pytest fixture

* fix for the black
2020-02-27 12:19:54 +01:00
Christian Clauss df7d2b3aeb
Fix typos found by codespell (#31243)
* Fix typos found by codespell

* Fix typos found by codespell

* codespell: Furture  ==> Future

* Update test_config_flow.py

* Update __init__.py

* Spellcheck: successfull  ==> successful

* Codespell: unsuccesful  ==> unsuccessful

* Codespell: cant  ==> can't

* Codespell: firware ==> firmware

* Codespell: mimick  ==> mimic
2020-01-31 08:33:00 -08:00
Franck Nijhof fb35d382e1
Remove all empty *_setup_platform() from integrations (#31025)
* Remove all empty *_setup_platform() from integrations

* Fix tests for smartthings

* Fix tests for heos
2020-01-21 12:38:38 +01:00
Ville Skyttä d236a19139
Include all SSDP data in discovery info (#28197)
* Include all SSDP data in discovery info

* Use UPnP device description as discovery info, inject some SSDP attrs

* Clean up attribute names

* Adapt existing SSDP flows to changed attribute names

* Prefix all SSDP UPnP attribute name constants with ATTR_UPNP, tweak a bit
2019-12-19 19:28:03 +02:00
Andrew Sayre 955bed8df4
Clean up HEOS strings (#26242)
* Clean up strings

* Shorten lines to ~ 88
2019-08-29 14:23:42 -05:00
Andrew Sayre 7bfb365f62 Update pyheos to 0.6.0 (#26191) 2019-08-25 20:57:43 +02:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Paulus Schoutsen f54ad26630
Migrate HEOS discovery to manifest (#24508)
* Migrate HEOS discovery to manifest

* Fix tests
2019-06-12 16:08:08 -07:00
Andrew Sayre 0194905e97 Move imports to top (#24108) 2019-05-26 13:47:11 +02:00
Andrew Sayre 02d8731a61 Add HEOS sign-in/out services (#23729)
* Add HEOS sign-in/out services

* Fix typo in comment
2019-05-07 09:39:42 -07:00
Andrew Sayre bf649e373c Update IDs after firmware upgrade in HEOS (#23641)
* Initial work

* Update tests
2019-05-06 17:53:11 +02:00
Andrew Sayre b30afde8ab
Extend play_media support (#23580) 2019-05-02 19:54:36 -05:00
Andrew Sayre f3925b7ede Bump pyheos (#23616) 2019-05-01 22:39:59 -07:00
Andrew Sayre e3e7fb5ff6 Bump pyheos to 0.4.1 (#23360)
* Bump pyheos==0.4.1

* Refresh player after reconnection
2019-04-24 21:31:31 -07:00
Andrew Sayre 8daba68dc1 Add support to play url (#23273) 2019-04-22 12:10:55 -07:00
Andrew Sayre b697bb7a26 Update pyheos and log service errors in HEOS integration (#23222)
* Update pyheos and command error handling

* Correct comment and remove unnecessary autospec
2019-04-19 22:22:40 -04:00
Andrew Sayre 8c89e260df
HEOS confirm discovered devices before adding (#23063)
* Add host selection step to discovery

* Review feedback

* Fix failing test
2019-04-13 16:44:45 -05:00
Andrew Sayre 4110bd0acf Add support for when device is not logged in to HEOS (#22913) 2019-04-09 18:21:00 +02:00
Andrew Sayre 38f063a158
Fix HEOS discovery could result in multiple config entries (#22903)
* Prevent duplicate entries from discovery

* Update reqs files

* Prevent duplicate entries from discovery
2019-04-08 21:24:40 -05:00
Andrew Sayre 5651db4b5c
Add discovery support to HEOS component (#22652)
* Add discovery entry point

* Fix test

* Correct test call method

* Update netdisco to 2.6.0
2019-04-02 15:22:49 -05:00
Andrew Sayre 9f2c5b7231
Add source selection to Heos component (#22592)
* Add select source support

* Review feedback changes

* Removed unused import

* Ignore 'umused' import used in typing

* Only include trace back on useful errors

* Remove return from play_source
2019-04-01 11:58:52 -05:00