mirror of
https://github.com/home-assistant/core.git
synced 2026-03-03 00:00:58 +00:00
* Add bangolufsen integration
* add untested files to .coveragerc
* Simplify integration to media_player platform
* Remove missing files from .coveragerc
* Add beolink_set_relative_volume custom service
Tweaks
* Remove custom services
Remove grouping as it was dependent on custom services
* Update API to 3.2.1.150.0
Reduce and optimize code with feedback from joostlek
Tweaks
* Updated testing
* Remove unused options schema
* Fix bugfix setting wrong state
* Fix wrong initial state
* Bump API
* Fix Beosound Level not reconnecting properly
* Remove unused constant
* Fix wrong variable checked to determine source
* Update integration with feedback from emontnemery
* Update integration with feedback from emontnemery
* Remove unused code
* Move API client into dataclass
Fix not all config_flow exceptions caught
Tweaks
* Add Bang & Olufsen brand
* Revert "Add Bang & Olufsen brand"
This reverts commit 57b2722078.
* Remove volume options from setup
Simplify device checks
rename integration to bang_olufsen
update tests to pass
Update API
* Remove _device from base
Add _device to websocket
* Move SW version device update to websocket
Sort websocket variables
* Add WebSocket connection test
* Remove unused constants
* Remove confirmation form
Make discovered devices get added to Home Assistant immediately
Fix device not being available on mdns discovery
Change config flow aborts to forms with error
* Update tests for new config_flow
Add missing api_exception test
* Restrict manual and discovered IP addresses to IPv4
* Re-add confirmation step for zeroconf discovery
Improve error messages
Move exception mapping dict to module level
* Enable remote control WebSocket listener
* Update tests
22 lines
609 B
Python
22 lines
609 B
Python
"""Various utilities for the Bang & Olufsen integration."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from homeassistant.core import HomeAssistant
|
|
from homeassistant.helpers import device_registry as dr
|
|
from homeassistant.helpers.device_registry import DeviceEntry
|
|
|
|
from .const import DOMAIN
|
|
|
|
|
|
def get_device(hass: HomeAssistant | None, unique_id: str) -> DeviceEntry | None:
|
|
"""Get the device."""
|
|
if not isinstance(hass, HomeAssistant):
|
|
return None
|
|
|
|
device_registry = dr.async_get(hass)
|
|
device = device_registry.async_get_device({(DOMAIN, unique_id)})
|
|
assert device
|
|
|
|
return device
|