Commit Graph

60 Commits

Author SHA1 Message Date
epenet
7da8e24e21 Remove unnecessary DOMAIN alias in tests (a-d) (#145817) 2025-05-28 21:00:38 +03:00
Josef Zweck
bf69d4e0a8 Add search to media_player (#140321)
* Add search to media_player

* rename attr

* Add searchable property

* add pagination parameters

* Add suggested changes

* Apply suggestions

* Fix cast tests

* Fix first set of components

* update snapshot

* More tests

* more test fixes

* Rename attr

* first own test

* Add to google test

* Add service test

* Rename search query arg

* Add required feature to search service

* remove kwarg

* Update homeassistant/components/media_player/__init__.py

Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>

* fix hue test

---------

Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2025-04-16 23:09:16 +02:00
epenet
af40b6524e Use new ServiceInfo location in component tests (part 3) (#136064) 2025-01-20 13:16:59 +01:00
Erik Montnemery
2ded9d551a Remove unignore flow from dlna_dmr (#126647) 2024-09-24 16:42:01 +02:00
Marc Mueller
2f8dfb424b Use Generator as return type for fixtures (#122183) 2024-07-19 14:55:23 +02:00
Steven Looman
55a2645e78 Bump async_upnp_client to 0.39.0 (#120250) 2024-06-23 14:21:56 -05:00
epenet
fb1b0058ee Fix consider-using-tuple pylint warnings in component tests (#119464)
* Fix consider-using-tuple pylint warnings in component tests

* Apply su

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>

---------

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
2024-06-12 15:50:27 +02:00
epenet
c896458fcf Fix namespace-import pylint warning in components (#119299) 2024-06-10 15:55:08 +02:00
epenet
94720fd015 Fix root-import pylint warning in dlna_dmr tests (#119286) 2024-06-10 13:31:29 +02:00
epenet
c6e0e93680 Cleanup mock_get_source_ip from tests (#118459) 2024-05-30 09:37:01 +02:00
Marc Mueller
dc47792ff2 Update codespell to 2.3.0 (#118001) 2024-05-24 08:22:29 +02:00
Sid
0d66d298ec Enable Ruff RET504 (#114528)
* Enable Ruff RET504

* fix test

* Use noqa instead of cast

* fix sonos RET504

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-04-06 11:07:37 +02:00
Joost Lekkerkerker
9b41e3d124 Use is in enum comparison in config flow tests A-E (#114669) 2024-04-02 11:22:05 -10:00
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
417b491b78 Reduce overhead to write dlna_dmr state (#113776)
* Reduce overhead to write dlna_dmr state

- Only update supported_features once per state write cycle
- Use a dict lookup for state

* useless dispatch

* fix tests

* remove unreachable code
2024-03-19 21:13:34 -04:00
Sid
00ec7f11f0 Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-19 09:01:07 +01:00
J. Nick Koston
93497dde8b Run registry cleanup listeners immediately (#113646) 2024-03-17 08:15:55 -10:00
J. Nick Koston
2b0b3c238a Make SSDP tasks background HassJob to avoid delaying startup (#112668) 2024-03-08 23:11:00 -10:00
Marc Mueller
38adfbf1a3 Add empty line after module docstring [tests a-e] (#112708) 2024-03-08 08:50:25 -05:00
J. Nick Koston
1d4e82bd3d Fix race in dlna_dmr test (#111428)
The entity was removed before the entity registry could update it

```
Traceback (most recent call last):
  File "/Users/bdraco/home-assistant/homeassistant/helpers/entity.py", line 1482, in _async_process_registry_update_or_remove
    assert registry_entry is not None
AssertionError

```
2024-02-26 17:11:50 +01:00
J. Nick Koston
067645520a Ensure dlna_dmr tests add config entry before updating it (#110418) 2024-02-12 22:59:44 +01:00
J. Nick Koston
d1f098c11f Use async_update_entry to update dlna_dmr options in tests (#110117)
needed for #110023
2024-02-10 07:57:58 +01:00
J. Nick Koston
8e4714c563 Avoid delaying startup in dlna_dmr (#109836)
* Avoid delaying startup in dlna_dmr

fixes #109834

* make sure device info is linked up at startup

* fixes

* update tests

* startup only

* override device info if we have it

* fixes

* make sure its set right away when adding the device

* revert test changes

* coverage

* coverage

* coverage

* coverage

* adjust

* fixes

* more fixes

* coverage

* coverage

* coverage

* tweaks

* tweaks

* Revert "revert test changes"

This reverts commit 014d29297d.

* coverage

* coverage
2024-02-09 09:05:27 -05:00
Erik Montnemery
524e20536d Improve dlna_dmr tests (#102905) 2023-10-28 14:53:34 +02:00
Meow
a4b2ded503 Refactor deprecated RESULT_TYPE_* (#97367) 2023-07-30 19:27:30 +02:00
J. Nick Koston
d4cdb0453f Guard expensive debug formatting with calls with isEnabledFor (#97073) 2023-07-23 10:54:25 +02:00
Erik Montnemery
8440f14a08 Correct dlna_dmr device info (#96480) 2023-07-13 12:15:46 -04:00
J. Nick Koston
3d1556a4a2 Switch back to using call_later for the slow entity update warning (#91067)
* Switch back to using call_later for the slow entity update warning

I had originally changed this to create a task and wait
in #41184 but that does not make sense anymore with newer
cpython as the profile now shows the original method is cheaper
(or I did it wrong the first time)

* fix missing block till done since there is no longer a task being created which would run the event loop once
2023-04-08 22:22:56 -04:00
epenet
853bd52a22 Adjust entity registry access in tests (1) (#88950) 2023-03-01 09:11:14 +01:00
epenet
728f62b1ec Add type hints to integration tests (part 5) (#87850) 2023-02-12 19:39:48 +01:00
Franck Nijhof
5e81d28116 Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
Franck Nijhof
24fdd588fd Code styling tweaks to the tests - Part 1 (#86192) 2023-01-20 13:52:46 +01:00
Michael Chisholm
fbab7413a5 Match config entries for dlna_dmr based on device MAC, in addition to UDN (#74619)
* Factor out _is_dmr_device function

* Use DMR device's MAC to match existing config entries

Some DMR devices change their every time they boot, against the DMR specs.
Try to match such devices to existing config entries by using their MAC
addresses.

* Add DMR device's MAC as a device_registry connection

* Use doc-only IPs (RFC5737) for dlna_dmr tests
2022-12-11 13:40:35 -05:00
Steven Looman
731f618028 Make home assistant discoverable via UPnP/SSDP (#79820) 2022-10-15 14:00:46 -04:00
epenet
8b3ce8c58c Use new constants in dlna_dmr media player (#78045) 2022-09-09 09:03:59 +02:00
Franck Nijhof
7cd68381f1 Search/replace RESULT_TYPE_* by FlowResultType enum (#74642) 2022-07-07 19:57:36 +03:00
Michael Chisholm
eebf3acb93 Relax dlna_dmr filtering when browsing media (#69576)
* Fix incorrect types of test data structures

* Loosen MIME-type filtering for async_browse_media

* Add option to not filter results when browsing media

Some devices do not report all that they support, and in this case
filtering will hide media that's actually playable. Most devices are OK,
though, and it's better to hide what they can't play. Add an option, off by
default, to show all media.

* Fix linting issues
2022-05-04 22:22:15 -07:00
Michael Chisholm
4e57b1b118 Fix config_flow error from dlna_dmr for UPnP discovery info containing a single service (#69977) 2022-04-13 19:04:03 +02:00
Steven Looman
f006cffac6 Bump async-upnp-client to 0.27.0 (#68310) 2022-03-17 12:32:46 -10:00
Paulus Schoutsen
d68ada74cc Restore children media class (#67409) 2022-03-01 15:14:14 -08:00
Steven Looman
dbbb5655e5 Bump async-upnp-client to 0.25.0 (#66414)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-02-27 08:29:29 -10:00
Paulus Schoutsen
459e6c273b Track hidden items in media source (#67096) 2022-02-23 09:51:01 +01:00
Michael Chisholm
3d5790aaad Avoid accessing hass.data in test_play_media_didl_metadata (#66939) 2022-02-20 14:14:53 +01:00
Michael Chisholm
3c15fe8587 Add media browser support to dlna_dmr (#66425) 2022-02-19 21:07:38 -08:00
Michael Chisholm
c9e495607e Ignore further ssdp:alive message if connection fails in dlna_dmr (#59891) 2022-01-20 11:23:23 -10:00
Robert Hillis
e689afc0b3 Remove deprecated yaml config from dlna_dmr (#62344) 2021-12-20 13:56:45 +01:00
Diego Elio Pettenò
6ce99bfc80 Bump async-upnp-client to 0.23.0 (#62223) 2021-12-17 16:57:02 -06:00
epenet
e95914cf60 Use dataclass properties in dlna_dmr discovery (#60693)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-01 08:59:12 -10:00
epenet
f292691b7b Use SsdpServiceInfo for ssdp tests (part 3) (#60334)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-25 11:46:20 -06:00
Michael Chisholm
9fa6daf47a dlna_dmr: Ignore philips tv (#60204) 2021-11-23 23:22:34 +01:00