🏡 Open source home automation that puts local control and privacy first.
Go to file
Michael Chisholm a28fd7d61b
Config-flow for DLNA-DMR integration (#55267)
* Modernize dlna_dmr component: configflow, test, types

* Support config-flow with ssdp discovery
* Add unit tests
* Enforce strict typing
* Gracefully handle network devices (dis)appearing

* Fix Aiohttp mock response headers type to match actual response class

* Fixes from code review

* Fixes from code review

* Import device config in flow if unavailable at hass start

* Support SSDP advertisements

* Ignore bad BOOTID, fix ssdp:byebye handling

* Only listen for events on interface connected to device

* Release all listeners when entities are removed

* Warn about deprecated dlna_dmr configuration

* Use sublogger for dlna_dmr.config_flow for easier filtering

* Tests for dlna_dmr.data module

* Rewrite DMR tests for HA style

* Fix DMR strings: "Digital Media *Renderer*"

* Update DMR entity state and device info when changed

* Replace deprecated async_upnp_client State with TransportState

* supported_features are dynamic, based on current device state

* Cleanup fully when subscription fails

* Log warnings when device connection fails unexpectedly

* Set PARALLEL_UPDATES to unlimited

* Fix spelling

* Fixes from code review

* Simplify has & can checks to just can, which includes has

* Treat transitioning state as playing (not idle) to reduce UI jerking

* Test if device is usable

* Handle ssdp:update messages properly

* Fix _remove_ssdp_callbacks being shared by all DlnaDmrEntity instances

* Fix tests for transitioning state

* Mock DmrDevice.is_profile_device (added to support embedded devices)

* Use ST & NT SSDP headers to find DMR devices, not deviceType

The deviceType is extracted from the device's description XML, and will not
be what we want when dealing with embedded devices.

* Use UDN from SSDP headers, not device description, as unique_id

The SSDP headers have the UDN of the embedded device that we're interested
in, whereas the device description (`ATTR_UPNP_UDN`) field will always be
for the root device.

* Fix DMR string English localization

* Test config flow with UDN from SSDP headers

* Bump async-upnp-client==0.22.1, fix flake8 error

* fix test for remapping

* DMR HA Device connections based on root and embedded UDN

* DmrDevice's UpnpDevice is now named profile_device

* Use device type from SSDP headers, not device description

* Mark dlna_dmr constants as Final

* Use embedded device UDN and type for unique ID when connected via URL

* More informative connection error messages

* Also match SSDP messages on NT headers

The NT header is to ssdp:alive messages what ST is to M-SEARCH responses.

* Bump async-upnp-client==0.22.2

* fix merge

* Bump async-upnp-client==0.22.3

Co-authored-by: Steven Looman <steven.looman@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-27 15:47:01 -05:00
.devcontainer VSCode switch to terminal.integrated.profiles (#54301) 2021-08-21 21:46:24 +02:00
.github Bump home-assistant/builder from 2021.07.0 to 2021.09.0 (#56704) 2021-09-27 08:37:54 +02:00
.vscode Add vscode task code coverage (#53783) 2021-08-05 11:46:21 +02:00
docs Drop unused ruamel (#55672) 2021-09-03 22:17:10 -07:00
homeassistant Config-flow for DLNA-DMR integration (#55267) 2021-09-27 15:47:01 -05:00
machine Add Khadas VIM3 (#53616) 2021-07-28 14:19:21 +02:00
pylint/plugins Pylint plugin to check that relative imports are used (#50937) 2021-05-22 09:15:30 +01:00
rootfs Shutdown the container on abnormal signals (#55660) 2021-09-06 14:37:33 +02:00
script Rework TPLink integration to use python-kasa (#56701) 2021-09-27 14:11:55 -05:00
tests Config-flow for DLNA-DMR integration (#55267) 2021-09-27 15:47:01 -05:00
.coveragerc Config-flow for DLNA-DMR integration (#55267) 2021-09-27 15:47:01 -05:00
.dockerignore Integrate dockerbuild (#33168) 2020-03-23 00:39:37 +01:00
.gitattributes highlight Dockerfile.dev as Dockerfile in github ui (#36933) 2020-06-22 14:45:57 +02:00
.gitignore Ignore config directory symlink in development (#56639) 2021-09-25 12:53:41 +02:00
.hadolint.yaml Add hadolint to CI (#34758) 2020-04-27 12:09:31 +02:00
.ignore
.pre-commit-config.yaml Upgrade pyupgrade to v2.27.0 (#56638) 2021-09-25 11:48:47 +02:00
.prettierignore Rename translations dir for integrations (#34494) 2020-04-21 16:11:05 -07:00
.readthedocs.yml Drop remaining Python < 3.8 support (#44743) 2021-01-04 11:47:29 +01:00
.strict-typing Config-flow for DLNA-DMR integration (#55267) 2021-09-27 15:47:01 -05:00
.yamllint Add yamllint (in pre-commit and CI) (#33676) 2020-04-05 10:33:45 +02:00
CLA.md
CODEOWNERS Config-flow for DLNA-DMR integration (#55267) 2021-09-27 15:47:01 -05:00
CODE_OF_CONDUCT.md Update Code of Conduct to 2.0 (#36142) 2020-05-25 19:40:40 -04:00
CONTRIBUTING.md Use core GitHub URL in contributing guidelines (#41083) 2020-10-02 20:42:33 +02:00
Dockerfile Downgrade sqlite-libs on docker image (#55591) 2021-09-02 18:09:30 +02:00
Dockerfile.dev Add bluez to the devcontainer (#55469) 2021-09-04 12:16:06 +02:00
LICENSE.md Update license to official GitHub template (#16470) 2018-09-07 10:11:51 +02:00
MANIFEST.in Consolidate frontend (#9915) 2017-10-24 19:36:27 -07:00
README.rst Update README.rst to avoid redirects (#44519) 2020-12-26 10:05:41 +01:00
build.json Update docker base image to 2021.09.0 (#56191) 2021-09-13 21:11:10 +02:00
codecov.yml Update Codecov.io configuration (#33783) 2020-04-07 09:01:01 -07:00
mypy.ini Config-flow for DLNA-DMR integration (#55267) 2021-09-27 15:47:01 -05:00
pyproject.toml Update pylint to 2.11.1 (#56364) 2021-09-18 13:52:59 +02:00
requirements.txt Upgrade requests to 2.26.0 (#56683) 2021-09-26 21:44:28 -05:00
requirements_all.txt Config-flow for DLNA-DMR integration (#55267) 2021-09-27 15:47:01 -05:00
requirements_docs.txt Refactor API documentation (#33217) 2020-03-25 13:21:04 -07:00
requirements_test.txt Upgrade pre-commit to 2.15.0 (#56677) 2021-09-26 14:47:47 +02:00
requirements_test_all.txt Config-flow for DLNA-DMR integration (#55267) 2021-09-27 15:47:01 -05:00
requirements_test_pre_commit.txt Upgrade pyupgrade to v2.27.0 (#56638) 2021-09-25 11:48:47 +02:00
setup.cfg Don't ignore mypy errors by default (#49270) 2021-04-26 14:23:21 +02:00
setup.py Upgrade requests to 2.26.0 (#56683) 2021-09-26 21:44:28 -05:00
tox.ini Fix local mypy workflow (#48433) 2021-03-30 17:18:29 +02:00

README.rst

Home Assistant |Chat Status|
=================================================================================

Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.

Check out `home-assistant.io <https://home-assistant.io>`__ for `a
demo <https://home-assistant.io/demo/>`__, `installation instructions <https://home-assistant.io/getting-started/>`__,
`tutorials <https://home-assistant.io/getting-started/automation/>`__ and `documentation <https://home-assistant.io/docs/>`__.

|screenshot-states|

Featured integrations
---------------------

|screenshot-components|

The system is built using a modular approach so support for other devices or actions can be implemented easily. See also the `section on architecture <https://developers.home-assistant.io/docs/architecture_index/>`__ and the `section on creating your own
components <https://developers.home-assistant.io/docs/creating_component_index/>`__.

If you run into issues while using Home Assistant or during development
of a component, check the `Home Assistant help section <https://home-assistant.io/help/>`__ of our website for further help and information.

.. |Chat Status| image:: https://img.shields.io/discord/330944238910963714.svg
   :target: https://discord.gg/c5DvZ4e
.. |screenshot-states| image:: https://raw.github.com/home-assistant/home-assistant/master/docs/screenshots.png
   :target: https://home-assistant.io/demo/
.. |screenshot-components| image:: https://raw.github.com/home-assistant/home-assistant/dev/docs/screenshot-components.png
   :target: https://home-assistant.io/integrations/