mirror of
https://github.com/home-assistant/core.git
synced 2025-10-23 02:29:32 +00:00
Compare commits
24 Commits
epenet-pat
...
llm_device
Author | SHA1 | Date | |
---|---|---|---|
![]() |
61b06c5cee | ||
![]() |
effc33d0d2 | ||
![]() |
7af4c337c6 | ||
![]() |
4f222d7adf | ||
![]() |
00f16812e4 | ||
![]() |
0efaf7efe8 | ||
![]() |
55643f0632 | ||
![]() |
36f4723f6e | ||
![]() |
03bc698936 | ||
![]() |
0c1dc73422 | ||
![]() |
c31537081b | ||
![]() |
d13067abb3 | ||
![]() |
64da32b5f9 | ||
![]() |
3990fc6ab2 | ||
![]() |
e4071bd305 | ||
![]() |
8dda26c227 | ||
![]() |
d599524880 | ||
![]() |
7c6c6ff7ff | ||
![]() |
4b343c10a5 | ||
![]() |
5532570dae | ||
![]() |
5bd912c730 | ||
![]() |
ad9efd6429 | ||
![]() |
3b59a03dfa | ||
![]() |
78bf54de42 |
@@ -53,9 +53,6 @@ __all__ = [
|
||||
"GenImageTaskResult",
|
||||
"async_generate_data",
|
||||
"async_generate_image",
|
||||
"async_setup",
|
||||
"async_setup_entry",
|
||||
"async_unload_entry",
|
||||
]
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
@@ -65,7 +65,6 @@ __all__ = (
|
||||
"async_create_default_pipeline",
|
||||
"async_get_pipelines",
|
||||
"async_pipeline_from_audio_stream",
|
||||
"async_setup",
|
||||
"async_update_pipeline",
|
||||
)
|
||||
|
||||
|
@@ -19,7 +19,14 @@ import wave
|
||||
import hass_nabucasa
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components import conversation, stt, tts, wake_word, websocket_api
|
||||
from homeassistant.components import (
|
||||
conversation,
|
||||
media_player,
|
||||
stt,
|
||||
tts,
|
||||
wake_word,
|
||||
websocket_api,
|
||||
)
|
||||
from homeassistant.const import ATTR_SUPPORTED_FEATURES, MATCH_ALL
|
||||
from homeassistant.core import Context, HomeAssistant, callback
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
@@ -130,7 +137,10 @@ SAVE_DELAY = 10
|
||||
@callback
|
||||
def _async_local_fallback_intent_filter(result: RecognizeResult) -> bool:
|
||||
"""Filter out intents that are not local fallback."""
|
||||
return result.intent.name in (intent.INTENT_GET_STATE)
|
||||
return result.intent.name in (
|
||||
intent.INTENT_GET_STATE,
|
||||
media_player.INTENT_MEDIA_SEARCH_AND_PLAY,
|
||||
)
|
||||
|
||||
|
||||
@callback
|
||||
|
@@ -72,7 +72,16 @@ class WrtDevice(NamedTuple):
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
type _FuncType[_T] = Callable[[_T], Awaitable[list[Any] | tuple[Any] | dict[str, Any]]]
|
||||
type _FuncType[_T] = Callable[
|
||||
[_T],
|
||||
Awaitable[
|
||||
list[str]
|
||||
| tuple[float | None, float | None]
|
||||
| list[float]
|
||||
| dict[str, float | str | None]
|
||||
| dict[str, float]
|
||||
],
|
||||
]
|
||||
type _ReturnFuncType[_T] = Callable[[_T], Coroutine[Any, Any, dict[str, Any]]]
|
||||
|
||||
|
||||
@@ -87,7 +96,9 @@ def handle_errors_and_zip[_AsusWrtBridgeT: AsusWrtBridge](
|
||||
"""Run library methods and zip results or manage exceptions."""
|
||||
|
||||
@functools.wraps(func)
|
||||
async def _wrapper(self: _AsusWrtBridgeT) -> dict[str, str]:
|
||||
async def _wrapper(
|
||||
self: _AsusWrtBridgeT,
|
||||
) -> dict[str, float | str | None] | dict[str, float]:
|
||||
try:
|
||||
data = await func(self)
|
||||
except exceptions as exc:
|
||||
@@ -114,7 +125,9 @@ class AsusWrtBridge(ABC):
|
||||
|
||||
@staticmethod
|
||||
def get_bridge(
|
||||
hass: HomeAssistant, conf: dict[str, Any], options: dict[str, Any] | None = None
|
||||
hass: HomeAssistant,
|
||||
conf: dict[str, str | int],
|
||||
options: dict[str, str | bool | int] | None = None,
|
||||
) -> AsusWrtBridge:
|
||||
"""Get Bridge instance."""
|
||||
if conf[CONF_PROTOCOL] in (PROTOCOL_HTTPS, PROTOCOL_HTTP):
|
||||
@@ -313,22 +326,22 @@ class AsusWrtLegacyBridge(AsusWrtBridge):
|
||||
return [SENSORS_TEMPERATURES_LEGACY[i] for i in range(3) if availability[i]]
|
||||
|
||||
@handle_errors_and_zip((IndexError, OSError, ValueError), SENSORS_BYTES)
|
||||
async def _get_bytes(self) -> Any:
|
||||
async def _get_bytes(self) -> tuple[float | None, float | None]:
|
||||
"""Fetch byte information from the router."""
|
||||
return await self._api.async_get_bytes_total()
|
||||
|
||||
@handle_errors_and_zip((IndexError, OSError, ValueError), SENSORS_RATES)
|
||||
async def _get_rates(self) -> Any:
|
||||
async def _get_rates(self) -> tuple[float, float]:
|
||||
"""Fetch rates information from the router."""
|
||||
return await self._api.async_get_current_transfer_rates()
|
||||
|
||||
@handle_errors_and_zip((IndexError, OSError, ValueError), SENSORS_LOAD_AVG)
|
||||
async def _get_load_avg(self) -> Any:
|
||||
async def _get_load_avg(self) -> list[float]:
|
||||
"""Fetch load average information from the router."""
|
||||
return await self._api.async_get_loadavg()
|
||||
|
||||
@handle_errors_and_zip((OSError, ValueError), None)
|
||||
async def _get_temperatures(self) -> Any:
|
||||
async def _get_temperatures(self) -> dict[str, float]:
|
||||
"""Fetch temperatures information from the router."""
|
||||
return await self._api.async_get_temperature()
|
||||
|
||||
|
@@ -175,12 +175,12 @@ class AsusWrtFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
)
|
||||
|
||||
async def _async_check_connection(
|
||||
self, user_input: dict[str, Any]
|
||||
self, user_input: dict[str, str | int]
|
||||
) -> tuple[str, str | None]:
|
||||
"""Attempt to connect the AsusWrt router."""
|
||||
|
||||
api: AsusWrtBridge
|
||||
host: str = user_input[CONF_HOST]
|
||||
host = user_input[CONF_HOST]
|
||||
protocol = user_input[CONF_PROTOCOL]
|
||||
error: str | None = None
|
||||
|
||||
|
@@ -176,7 +176,7 @@ class AsusWrtRouter:
|
||||
|
||||
self._on_close: list[Callable] = []
|
||||
|
||||
self._options: dict[str, Any] = {
|
||||
self._options: dict[str, str | bool | int] = {
|
||||
CONF_DNSMASQ: DEFAULT_DNSMASQ,
|
||||
CONF_INTERFACE: DEFAULT_INTERFACE,
|
||||
CONF_REQUIRE_IP: True,
|
||||
@@ -299,12 +299,10 @@ class AsusWrtRouter:
|
||||
_LOGGER.warning("Reconnected to ASUS router %s", self.host)
|
||||
|
||||
self._connected_devices = len(wrt_devices)
|
||||
consider_home: int = self._options.get(
|
||||
CONF_CONSIDER_HOME, DEFAULT_CONSIDER_HOME.total_seconds()
|
||||
)
|
||||
track_unknown: bool = self._options.get(
|
||||
CONF_TRACK_UNKNOWN, DEFAULT_TRACK_UNKNOWN
|
||||
consider_home = int(
|
||||
self._options.get(CONF_CONSIDER_HOME, DEFAULT_CONSIDER_HOME.total_seconds())
|
||||
)
|
||||
track_unknown = self._options.get(CONF_TRACK_UNKNOWN, DEFAULT_TRACK_UNKNOWN)
|
||||
|
||||
for device_mac, device in self._devices.items():
|
||||
dev_info = wrt_devices.pop(device_mac, None)
|
||||
|
@@ -87,7 +87,6 @@ __all__ = [
|
||||
"async_get_chat_log",
|
||||
"async_get_result_from_chat_log",
|
||||
"async_set_agent",
|
||||
"async_setup",
|
||||
"async_unset_agent",
|
||||
]
|
||||
|
||||
|
@@ -2,12 +2,12 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.const import STATE_HOME
|
||||
from homeassistant.const import ATTR_GPS_ACCURACY, STATE_HOME # noqa: F401
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
from homeassistant.loader import bind_hass
|
||||
|
||||
from .config_entry import (
|
||||
from .config_entry import ( # noqa: F401
|
||||
ScannerEntity,
|
||||
ScannerEntityDescription,
|
||||
TrackerEntity,
|
||||
@@ -15,7 +15,7 @@ from .config_entry import (
|
||||
async_setup_entry,
|
||||
async_unload_entry,
|
||||
)
|
||||
from .const import (
|
||||
from .const import ( # noqa: F401
|
||||
ATTR_ATTRIBUTES,
|
||||
ATTR_BATTERY,
|
||||
ATTR_DEV_ID,
|
||||
@@ -37,7 +37,7 @@ from .const import (
|
||||
SCAN_INTERVAL,
|
||||
SourceType,
|
||||
)
|
||||
from .legacy import (
|
||||
from .legacy import ( # noqa: F401
|
||||
PLATFORM_SCHEMA,
|
||||
PLATFORM_SCHEMA_BASE,
|
||||
SERVICE_SEE,
|
||||
@@ -61,44 +61,3 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
"""Set up the device tracker."""
|
||||
async_setup_legacy_integration(hass, config)
|
||||
return True
|
||||
|
||||
|
||||
__all__ = (
|
||||
"ATTR_ATTRIBUTES",
|
||||
"ATTR_BATTERY",
|
||||
"ATTR_DEV_ID",
|
||||
"ATTR_GPS",
|
||||
"ATTR_HOST_NAME",
|
||||
"ATTR_IP",
|
||||
"ATTR_LOCATION_NAME",
|
||||
"ATTR_MAC",
|
||||
"ATTR_SOURCE_TYPE",
|
||||
"CONF_CONSIDER_HOME",
|
||||
"CONF_NEW_DEVICE_DEFAULTS",
|
||||
"CONF_SCAN_INTERVAL",
|
||||
"CONF_TRACK_NEW",
|
||||
"CONNECTED_DEVICE_REGISTERED",
|
||||
"DEFAULT_CONSIDER_HOME",
|
||||
"DEFAULT_TRACK_NEW",
|
||||
"DOMAIN",
|
||||
"ENTITY_ID_FORMAT",
|
||||
"PLATFORM_SCHEMA",
|
||||
"PLATFORM_SCHEMA_BASE",
|
||||
"SCAN_INTERVAL",
|
||||
"SERVICE_SEE",
|
||||
"SERVICE_SEE_PAYLOAD_SCHEMA",
|
||||
"SOURCE_TYPES",
|
||||
"AsyncSeeCallback",
|
||||
"DeviceScanner",
|
||||
"ScannerEntity",
|
||||
"ScannerEntityDescription",
|
||||
"SeeCallback",
|
||||
"SourceType",
|
||||
"TrackerEntity",
|
||||
"TrackerEntityDescription",
|
||||
"async_setup",
|
||||
"async_setup_entry",
|
||||
"async_unload_entry",
|
||||
"is_on",
|
||||
"see",
|
||||
)
|
||||
|
@@ -62,6 +62,14 @@ def _is_supported(discovery_info: BluetoothServiceInfo):
|
||||
LOGGER.debug("Unsupported device: %s (%s)", manufacturer_data, discovery_info)
|
||||
return False
|
||||
|
||||
if not manufacturer_data.pairable:
|
||||
LOGGER.error(
|
||||
"The mower does not appear to be pairable. "
|
||||
"Ensure the mower is in pairing mode before continuing. "
|
||||
"If the mower isn't pariable you will receive authentication "
|
||||
"errors and be unable to connect"
|
||||
)
|
||||
|
||||
LOGGER.debug("Supported device: %s", manufacturer_data)
|
||||
return True
|
||||
|
||||
|
@@ -12,5 +12,5 @@
|
||||
"dependencies": ["bluetooth_adapters"],
|
||||
"documentation": "https://www.home-assistant.io/integrations/husqvarna_automower_ble",
|
||||
"iot_class": "local_polling",
|
||||
"requirements": ["automower-ble==0.2.7", "gardena-bluetooth==1.6.0"]
|
||||
"requirements": ["automower-ble==0.2.8", "gardena-bluetooth==1.6.0"]
|
||||
}
|
||||
|
@@ -16,8 +16,6 @@ from .types import ModelContextProtocolConfigEntry
|
||||
|
||||
__all__ = [
|
||||
"DOMAIN",
|
||||
"async_setup_entry",
|
||||
"async_unload_entry",
|
||||
]
|
||||
|
||||
API_PROMPT = "The following tools are available from a remote server named {name}."
|
||||
|
@@ -14,9 +14,6 @@ from .types import MCPServerConfigEntry
|
||||
__all__ = [
|
||||
"CONFIG_SCHEMA",
|
||||
"DOMAIN",
|
||||
"async_setup",
|
||||
"async_setup_entry",
|
||||
"async_unload_entry",
|
||||
]
|
||||
|
||||
CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
|
||||
|
@@ -104,6 +104,7 @@ from .const import ( # noqa: F401
|
||||
ATTR_SOUND_MODE_LIST,
|
||||
CONTENT_AUTH_EXPIRY_TIME,
|
||||
DOMAIN,
|
||||
INTENT_MEDIA_SEARCH_AND_PLAY,
|
||||
REPEAT_MODES,
|
||||
SERVICE_BROWSE_MEDIA,
|
||||
SERVICE_CLEAR_PLAYLIST,
|
||||
|
@@ -43,6 +43,16 @@ ATTR_SOUND_MODE_LIST = "sound_mode_list"
|
||||
|
||||
DOMAIN = "media_player"
|
||||
|
||||
INTENT_MEDIA_PAUSE = "HassMediaPause"
|
||||
INTENT_MEDIA_UNPAUSE = "HassMediaUnpause"
|
||||
INTENT_MEDIA_NEXT = "HassMediaNext"
|
||||
INTENT_MEDIA_PREVIOUS = "HassMediaPrevious"
|
||||
INTENT_PLAYER_MUTE = "HassMediaPlayerMute"
|
||||
INTENT_PLAYER_UNMUTE = "HassMediaPlayerUnmute"
|
||||
INTENT_SET_VOLUME = "HassSetVolume"
|
||||
INTENT_SET_VOLUME_RELATIVE = "HassSetVolumeRelative"
|
||||
INTENT_MEDIA_SEARCH_AND_PLAY = "HassMediaSearchAndPlay"
|
||||
|
||||
|
||||
class MediaPlayerState(
|
||||
StrEnum,
|
||||
|
@@ -30,6 +30,15 @@ from .const import (
|
||||
ATTR_MEDIA_VOLUME_LEVEL,
|
||||
ATTR_MEDIA_VOLUME_MUTED,
|
||||
DOMAIN,
|
||||
INTENT_MEDIA_NEXT,
|
||||
INTENT_MEDIA_PAUSE,
|
||||
INTENT_MEDIA_PREVIOUS,
|
||||
INTENT_MEDIA_SEARCH_AND_PLAY,
|
||||
INTENT_MEDIA_UNPAUSE,
|
||||
INTENT_PLAYER_MUTE,
|
||||
INTENT_PLAYER_UNMUTE,
|
||||
INTENT_SET_VOLUME,
|
||||
INTENT_SET_VOLUME_RELATIVE,
|
||||
SERVICE_PLAY_MEDIA,
|
||||
SERVICE_SEARCH_MEDIA,
|
||||
MediaClass,
|
||||
@@ -37,16 +46,6 @@ from .const import (
|
||||
MediaPlayerState,
|
||||
)
|
||||
|
||||
INTENT_MEDIA_PAUSE = "HassMediaPause"
|
||||
INTENT_MEDIA_UNPAUSE = "HassMediaUnpause"
|
||||
INTENT_MEDIA_NEXT = "HassMediaNext"
|
||||
INTENT_MEDIA_PREVIOUS = "HassMediaPrevious"
|
||||
INTENT_PLAYER_MUTE = "HassMediaPlayerMute"
|
||||
INTENT_PLAYER_UNMUTE = "HassMediaPlayerUnmute"
|
||||
INTENT_SET_VOLUME = "HassSetVolume"
|
||||
INTENT_SET_VOLUME_RELATIVE = "HassSetVolumeRelative"
|
||||
INTENT_MEDIA_SEARCH_AND_PLAY = "HassMediaSearchAndPlay"
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@@ -166,12 +166,9 @@ __all__ = [
|
||||
"async_prepare_subscribe_topics",
|
||||
"async_publish",
|
||||
"async_remove_config_entry_device",
|
||||
"async_setup",
|
||||
"async_setup_entry",
|
||||
"async_subscribe",
|
||||
"async_subscribe_connection_status",
|
||||
"async_subscribe_topics",
|
||||
"async_unload_entry",
|
||||
"async_unsubscribe_topics",
|
||||
"async_wait_for_mqtt_client",
|
||||
"convert_outgoing_mqtt_payload",
|
||||
|
@@ -68,7 +68,7 @@ class OpenUvCoordinator(DataUpdateCoordinator[dict[str, Any]]):
|
||||
|
||||
|
||||
class OpenUvProtectionWindowCoordinator(OpenUvCoordinator):
|
||||
"""Define an OpenUV data coordinator for the protetction window."""
|
||||
"""Define an OpenUV data coordinator for the protection window."""
|
||||
|
||||
_reprocess_listener: CALLBACK_TYPE | None = None
|
||||
|
||||
@@ -76,10 +76,18 @@ class OpenUvProtectionWindowCoordinator(OpenUvCoordinator):
|
||||
data = await super()._async_update_data()
|
||||
|
||||
for key in ("from_time", "to_time", "from_uv", "to_uv"):
|
||||
if not data.get(key):
|
||||
msg = "Skipping update due to missing data: {key}"
|
||||
# a key missing from the data is an error.
|
||||
if key not in data:
|
||||
msg = f"Update failed due to missing data: {key}"
|
||||
raise UpdateFailed(msg)
|
||||
|
||||
# check for null or zero value in the data & skip further processing
|
||||
# of this update if one is found. this is a normal condition
|
||||
# indicating that there is no protection window.
|
||||
if not data[key]:
|
||||
LOGGER.warning("Skipping update due to missing data: %s", key)
|
||||
return {}
|
||||
|
||||
data = self._parse_data(data)
|
||||
data = self._process_data(data)
|
||||
|
||||
|
@@ -9,8 +9,13 @@ import uuid
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.rest import create_rest_data_from_config
|
||||
from homeassistant.components.rest.data import DEFAULT_TIMEOUT
|
||||
from homeassistant.components.rest.schema import DEFAULT_METHOD, METHODS
|
||||
from homeassistant.components.rest.data import ( # pylint: disable=hass-component-root-import
|
||||
DEFAULT_TIMEOUT,
|
||||
)
|
||||
from homeassistant.components.rest.schema import ( # pylint: disable=hass-component-root-import
|
||||
DEFAULT_METHOD,
|
||||
METHODS,
|
||||
)
|
||||
from homeassistant.components.sensor import (
|
||||
CONF_STATE_CLASS,
|
||||
DOMAIN as SENSOR_DOMAIN,
|
||||
|
@@ -8,8 +8,7 @@ from typing import Any
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from homeassistant.components.rest import RestData
|
||||
from homeassistant.components.rest.const import CONF_PAYLOAD_TEMPLATE
|
||||
from homeassistant.components.rest import CONF_PAYLOAD_TEMPLATE, RestData
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_RESOURCE_TEMPLATE
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@@ -47,6 +47,10 @@ class TautulliConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
step_id="user",
|
||||
data_schema=vol.Schema(data_schema),
|
||||
errors=errors or {},
|
||||
description_placeholders={
|
||||
"sample_url": "http://192.168.0.10:8181",
|
||||
"sample_port": "8181",
|
||||
},
|
||||
)
|
||||
|
||||
async def async_step_reauth(
|
||||
|
@@ -2,7 +2,7 @@
|
||||
"config": {
|
||||
"step": {
|
||||
"user": {
|
||||
"description": "To find your API key, open the Tautulli webpage and navigate to Settings and then to Web interface. The API key will be at the bottom of that page.\n\nExample of the URL: ```http://192.168.0.10:8181``` with 8181 being the default port.",
|
||||
"description": "To find your API key, open the Tautulli webpage and navigate to Settings and then to Web interface. The API key will be at the bottom of that page.\n\nExample of the URL: ```{sample_url}``` with {sample_port} being the default port.",
|
||||
"data": {
|
||||
"api_key": "[%key:common::config_flow::data::api_key%]",
|
||||
"url": "[%key:common::config_flow::data::url%]",
|
||||
|
@@ -254,11 +254,10 @@ class TuyaCoverEntity(TuyaEntity, CoverEntity):
|
||||
def _is_position_reversed(self) -> bool:
|
||||
"""Check if the cover position and direction should be reversed."""
|
||||
# The default is True
|
||||
# Having motor_reverse_mode == "forward" cancels the inversion
|
||||
# Having motor_reverse_mode == "back" cancels the inversion
|
||||
return not (
|
||||
self._motor_reverse_mode_enum
|
||||
and self.device.status.get(self._motor_reverse_mode_enum.dpcode)
|
||||
== "forward"
|
||||
and self.device.status.get(self._motor_reverse_mode_enum.dpcode) == "back"
|
||||
)
|
||||
|
||||
@property
|
||||
|
@@ -40,7 +40,7 @@
|
||||
"integration_type": "hub",
|
||||
"iot_class": "local_push",
|
||||
"loggers": ["uiprotect", "unifi_discovery"],
|
||||
"requirements": ["uiprotect==7.22.0", "unifi-discovery==1.2.0"],
|
||||
"requirements": ["uiprotect==7.23.0", "unifi-discovery==1.2.0"],
|
||||
"ssdp": [
|
||||
{
|
||||
"manufacturer": "Ubiquiti Networks",
|
||||
|
@@ -32,9 +32,6 @@ SATELLITE_PLATFORMS = [
|
||||
__all__ = [
|
||||
"ATTR_SPEAKER",
|
||||
"DOMAIN",
|
||||
"async_setup",
|
||||
"async_setup_entry",
|
||||
"async_unload_entry",
|
||||
]
|
||||
|
||||
|
||||
|
@@ -660,19 +660,27 @@ def _get_exposed_entities(
|
||||
|
||||
entity_entry = entity_registry.async_get(state.entity_id)
|
||||
names = [state.name]
|
||||
device_name = None
|
||||
area_names = []
|
||||
|
||||
if entity_entry is not None:
|
||||
names.extend(entity_entry.aliases)
|
||||
device = (
|
||||
device_registry.async_get(entity_entry.device_id)
|
||||
if entity_entry.device_id
|
||||
else None
|
||||
)
|
||||
|
||||
if device:
|
||||
device_name = device.name_by_user or device.name
|
||||
|
||||
if entity_entry.area_id and (
|
||||
area := area_registry.async_get_area(entity_entry.area_id)
|
||||
):
|
||||
# Entity is in area
|
||||
area_names.append(area.name)
|
||||
area_names.extend(area.aliases)
|
||||
elif entity_entry.device_id and (
|
||||
device := device_registry.async_get(entity_entry.device_id)
|
||||
):
|
||||
elif device:
|
||||
# Check device area
|
||||
if device.area_id and (
|
||||
area := area_registry.async_get_area(device.area_id)
|
||||
@@ -693,6 +701,9 @@ def _get_exposed_entities(
|
||||
if (parsed_utc := dt_util.parse_datetime(state.state)) is not None:
|
||||
info["state"] = dt_util.as_local(parsed_utc).isoformat()
|
||||
|
||||
if device_name and not state.name.lower().startswith(device_name.lower()):
|
||||
info["device"] = device_name
|
||||
|
||||
if area_names:
|
||||
info["areas"] = ", ".join(area_names)
|
||||
|
||||
|
@@ -132,7 +132,6 @@ _IGNORE_ROOT_IMPORT = (
|
||||
"homeassistant_hardware",
|
||||
"http",
|
||||
"recorder",
|
||||
"rest",
|
||||
)
|
||||
|
||||
|
||||
|
4
requirements_all.txt
generated
4
requirements_all.txt
generated
@@ -575,7 +575,7 @@ aurorapy==0.2.7
|
||||
autarco==3.2.0
|
||||
|
||||
# homeassistant.components.husqvarna_automower_ble
|
||||
automower-ble==0.2.7
|
||||
automower-ble==0.2.8
|
||||
|
||||
# homeassistant.components.generic
|
||||
# homeassistant.components.stream
|
||||
@@ -3060,7 +3060,7 @@ typedmonarchmoney==0.4.4
|
||||
uasiren==0.0.1
|
||||
|
||||
# homeassistant.components.unifiprotect
|
||||
uiprotect==7.22.0
|
||||
uiprotect==7.23.0
|
||||
|
||||
# homeassistant.components.landisgyr_heat_meter
|
||||
ultraheat-api==0.5.7
|
||||
|
4
requirements_test_all.txt
generated
4
requirements_test_all.txt
generated
@@ -530,7 +530,7 @@ aurorapy==0.2.7
|
||||
autarco==3.2.0
|
||||
|
||||
# homeassistant.components.husqvarna_automower_ble
|
||||
automower-ble==0.2.7
|
||||
automower-ble==0.2.8
|
||||
|
||||
# homeassistant.components.generic
|
||||
# homeassistant.components.stream
|
||||
@@ -2537,7 +2537,7 @@ typedmonarchmoney==0.4.4
|
||||
uasiren==0.0.1
|
||||
|
||||
# homeassistant.components.unifiprotect
|
||||
uiprotect==7.22.0
|
||||
uiprotect==7.23.0
|
||||
|
||||
# homeassistant.components.landisgyr_heat_meter
|
||||
ultraheat-api==0.5.7
|
||||
|
@@ -12,6 +12,7 @@ import voluptuous as vol
|
||||
from homeassistant.components import (
|
||||
assist_pipeline,
|
||||
conversation,
|
||||
media_player,
|
||||
media_source,
|
||||
stt,
|
||||
tts,
|
||||
@@ -682,6 +683,17 @@ def test_fallback_intent_filter() -> None:
|
||||
)
|
||||
is True
|
||||
)
|
||||
assert (
|
||||
_async_local_fallback_intent_filter(
|
||||
RecognizeResult(
|
||||
intent=Intent(media_player.INTENT_MEDIA_SEARCH_AND_PLAY),
|
||||
intent_data=IntentData([]),
|
||||
entities={},
|
||||
entities_list=[],
|
||||
)
|
||||
)
|
||||
is True
|
||||
)
|
||||
assert (
|
||||
_async_local_fallback_intent_filter(
|
||||
RecognizeResult(
|
||||
|
@@ -119,11 +119,13 @@ async def integration_fixture(
|
||||
"silabs_dishwasher",
|
||||
"silabs_evse_charging",
|
||||
"silabs_laundrywasher",
|
||||
"silabs_light_switch",
|
||||
"silabs_refrigerator",
|
||||
"silabs_water_heater",
|
||||
"smoke_detector",
|
||||
"solar_inverter",
|
||||
"speaker",
|
||||
"switchbot_k11_plus",
|
||||
"switch_unit",
|
||||
"tado_smart_radiator_thermostat_x",
|
||||
"temperature_sensor",
|
||||
|
559
tests/components/matter/fixtures/nodes/silabs_light_switch.json
Normal file
559
tests/components/matter/fixtures/nodes/silabs_light_switch.json
Normal file
@@ -0,0 +1,559 @@
|
||||
{
|
||||
"node_id": 142,
|
||||
"date_commissioned": "2025-10-17T16:35:23.863825",
|
||||
"last_interview": "2025-10-17T16:35:23.863850",
|
||||
"interview_version": 6,
|
||||
"available": true,
|
||||
"is_bridge": false,
|
||||
"attributes": {
|
||||
"0/60/0": 0,
|
||||
"0/60/1": null,
|
||||
"0/60/2": null,
|
||||
"0/60/65533": 1,
|
||||
"0/60/65532": 0,
|
||||
"0/60/65531": [0, 1, 2, 65533, 65532, 65531, 65529, 65528],
|
||||
"0/60/65529": [0, 2],
|
||||
"0/60/65528": [],
|
||||
"0/52/0": [
|
||||
{
|
||||
"0": 10,
|
||||
"1": "Bluetoot",
|
||||
"3": 1304
|
||||
},
|
||||
{
|
||||
"0": 9,
|
||||
"1": "Bluetoot",
|
||||
"3": 576
|
||||
},
|
||||
{
|
||||
"0": 8,
|
||||
"1": "Bluetoot",
|
||||
"3": 208
|
||||
},
|
||||
{
|
||||
"0": 7,
|
||||
"1": "Tmr Svc",
|
||||
"3": 3880
|
||||
},
|
||||
{
|
||||
"0": 6,
|
||||
"1": "shell",
|
||||
"3": 1332
|
||||
},
|
||||
{
|
||||
"0": 5,
|
||||
"1": "Light-Sw",
|
||||
"3": 3084
|
||||
},
|
||||
{
|
||||
"0": 4,
|
||||
"1": "OT Seria",
|
||||
"3": 2896
|
||||
},
|
||||
{
|
||||
"0": 3,
|
||||
"1": "IDLE",
|
||||
"3": 1068
|
||||
},
|
||||
{
|
||||
"0": 2,
|
||||
"1": "UART",
|
||||
"3": 508
|
||||
},
|
||||
{
|
||||
"0": 1,
|
||||
"1": "OT Stack",
|
||||
"3": 2880
|
||||
},
|
||||
{
|
||||
"0": 0,
|
||||
"1": "CHIP",
|
||||
"3": 1016
|
||||
}
|
||||
],
|
||||
"0/52/1": 74936,
|
||||
"0/52/2": 25800,
|
||||
"0/52/3": 35544,
|
||||
"0/52/65533": 1,
|
||||
"0/52/65532": 1,
|
||||
"0/52/65531": [0, 1, 2, 3, 65533, 65532, 65531, 65529, 65528],
|
||||
"0/52/65529": [0],
|
||||
"0/52/65528": [],
|
||||
"0/49/0": 1,
|
||||
"0/49/1": [
|
||||
{
|
||||
"0": "p0jbsOzJRNw=",
|
||||
"1": true
|
||||
}
|
||||
],
|
||||
"0/49/4": true,
|
||||
"0/49/5": 0,
|
||||
"0/49/6": "p0jbsOzJRNw=",
|
||||
"0/49/7": null,
|
||||
"0/49/2": 10,
|
||||
"0/49/3": 20,
|
||||
"0/49/9": 4,
|
||||
"0/49/10": 5,
|
||||
"0/49/65533": 2,
|
||||
"0/49/65532": 2,
|
||||
"0/49/65531": [
|
||||
0, 1, 4, 5, 6, 7, 2, 3, 9, 10, 65533, 65532, 65531, 65529, 65528
|
||||
],
|
||||
"0/49/65529": [0, 3, 4, 6, 8],
|
||||
"0/49/65528": [1, 5, 7],
|
||||
"0/29/0": [
|
||||
{
|
||||
"0": 18,
|
||||
"1": 1
|
||||
},
|
||||
{
|
||||
"0": 22,
|
||||
"1": 3
|
||||
}
|
||||
],
|
||||
"0/29/1": [
|
||||
60, 52, 49, 29, 30, 31, 40, 42, 43, 48, 50, 51, 53, 54, 55, 56, 62, 63,
|
||||
65, 70
|
||||
],
|
||||
"0/29/2": [41],
|
||||
"0/29/3": [1, 2],
|
||||
"0/29/65532": 0,
|
||||
"0/29/65533": 3,
|
||||
"0/29/65528": [],
|
||||
"0/29/65529": [],
|
||||
"0/29/65531": [0, 1, 2, 3, 65532, 65533, 65528, 65529, 65531],
|
||||
"0/30/0": [],
|
||||
"0/30/65532": 0,
|
||||
"0/30/65533": 1,
|
||||
"0/30/65528": [],
|
||||
"0/30/65529": [],
|
||||
"0/30/65531": [0, 65532, 65533, 65528, 65529, 65531],
|
||||
"0/31/0": [
|
||||
{
|
||||
"1": 5,
|
||||
"2": 2,
|
||||
"3": [112233],
|
||||
"4": null,
|
||||
"254": 3
|
||||
}
|
||||
],
|
||||
"0/31/2": 4,
|
||||
"0/31/3": 3,
|
||||
"0/31/4": 4,
|
||||
"0/31/65532": 0,
|
||||
"0/31/65533": 2,
|
||||
"0/31/65528": [],
|
||||
"0/31/65529": [],
|
||||
"0/31/65531": [0, 2, 3, 4, 65532, 65533, 65528, 65529, 65531],
|
||||
"0/40/0": 19,
|
||||
"0/40/1": "Silabs",
|
||||
"0/40/2": 65521,
|
||||
"0/40/3": "Light switch example",
|
||||
"0/40/4": 32772,
|
||||
"0/40/5": "",
|
||||
"0/40/6": "**REDACTED**",
|
||||
"0/40/7": 1,
|
||||
"0/40/8": "TEST_VERSION",
|
||||
"0/40/9": 1,
|
||||
"0/40/10": "1",
|
||||
"0/40/11": "20200101",
|
||||
"0/40/12": "",
|
||||
"0/40/13": "",
|
||||
"0/40/14": "",
|
||||
"0/40/15": "",
|
||||
"0/40/16": false,
|
||||
"0/40/18": "123456789",
|
||||
"0/40/19": {
|
||||
"0": 3,
|
||||
"1": 3
|
||||
},
|
||||
"0/40/21": 17039872,
|
||||
"0/40/22": 1,
|
||||
"0/40/24": 1,
|
||||
"0/40/65532": 0,
|
||||
"0/40/65533": 5,
|
||||
"0/40/65528": [],
|
||||
"0/40/65529": [],
|
||||
"0/40/65531": [
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 21, 22,
|
||||
24, 65532, 65533, 65528, 65529, 65531
|
||||
],
|
||||
"0/42/0": [],
|
||||
"0/42/1": true,
|
||||
"0/42/2": 1,
|
||||
"0/42/3": null,
|
||||
"0/42/65532": 0,
|
||||
"0/42/65533": 1,
|
||||
"0/42/65528": [],
|
||||
"0/42/65529": [0],
|
||||
"0/42/65531": [0, 1, 2, 3, 65532, 65533, 65528, 65529, 65531],
|
||||
"0/43/0": "",
|
||||
"0/43/1": ["en-US"],
|
||||
"0/43/65532": 0,
|
||||
"0/43/65533": 1,
|
||||
"0/43/65528": [],
|
||||
"0/43/65529": [],
|
||||
"0/43/65531": [0, 1, 65532, 65533, 65528, 65529, 65531],
|
||||
"0/48/0": 0,
|
||||
"0/48/1": {
|
||||
"0": 60,
|
||||
"1": 900
|
||||
},
|
||||
"0/48/2": 0,
|
||||
"0/48/3": 0,
|
||||
"0/48/4": true,
|
||||
"0/48/65532": 0,
|
||||
"0/48/65533": 2,
|
||||
"0/48/65528": [1, 3, 5],
|
||||
"0/48/65529": [0, 2, 4],
|
||||
"0/48/65531": [0, 1, 2, 3, 4, 65532, 65533, 65528, 65529, 65531],
|
||||
"0/50/65532": 0,
|
||||
"0/50/65533": 1,
|
||||
"0/50/65528": [1],
|
||||
"0/50/65529": [0],
|
||||
"0/50/65531": [65532, 65533, 65528, 65529, 65531],
|
||||
"0/51/0": [
|
||||
{
|
||||
"0": "*****",
|
||||
"1": true,
|
||||
"2": null,
|
||||
"3": null,
|
||||
"4": "rp6BZ1MxzrE=",
|
||||
"5": [],
|
||||
"6": [
|
||||
"/QANuACgAAAAAAD//gBsCw==",
|
||||
"/VX8YmMnAAHoPuekbwlgBQ==",
|
||||
"/QANuACgAADH6l06b4E7kA==",
|
||||
"/oAAAAAAAACsnoFnUzHOsQ=="
|
||||
],
|
||||
"7": 4
|
||||
}
|
||||
],
|
||||
"0/51/1": 1,
|
||||
"0/51/2": 195,
|
||||
"0/51/3": 0,
|
||||
"0/51/4": 6,
|
||||
"0/51/8": true,
|
||||
"0/51/65532": 0,
|
||||
"0/51/65533": 2,
|
||||
"0/51/65528": [2],
|
||||
"0/51/65529": [0, 1],
|
||||
"0/51/65531": [0, 1, 2, 3, 4, 8, 65532, 65533, 65528, 65529, 65531],
|
||||
"0/53/0": 25,
|
||||
"0/53/1": 2,
|
||||
"0/53/2": "*****",
|
||||
"0/53/3": 4660,
|
||||
"0/53/4": 12054125955590472924,
|
||||
"0/53/5": "QP0ADbgAoAAA",
|
||||
"0/53/6": 0,
|
||||
"0/53/7": [
|
||||
{
|
||||
"0": 14318601490803184919,
|
||||
"1": 10,
|
||||
"2": 27648,
|
||||
"3": 842170,
|
||||
"4": 45707,
|
||||
"5": 3,
|
||||
"6": -57,
|
||||
"7": -57,
|
||||
"8": 26,
|
||||
"9": 0,
|
||||
"10": true,
|
||||
"11": true,
|
||||
"12": true,
|
||||
"13": false
|
||||
}
|
||||
],
|
||||
"0/53/8": [
|
||||
{
|
||||
"0": 14318601490803184919,
|
||||
"1": 27648,
|
||||
"2": 27,
|
||||
"3": 0,
|
||||
"4": 0,
|
||||
"5": 3,
|
||||
"6": 3,
|
||||
"7": 10,
|
||||
"8": true,
|
||||
"9": true
|
||||
}
|
||||
],
|
||||
"0/53/9": 1881575314,
|
||||
"0/53/10": 68,
|
||||
"0/53/11": 135,
|
||||
"0/53/12": 75,
|
||||
"0/53/13": 11,
|
||||
"0/53/14": 2,
|
||||
"0/53/15": 2,
|
||||
"0/53/16": 0,
|
||||
"0/53/17": 0,
|
||||
"0/53/18": 2,
|
||||
"0/53/19": 1,
|
||||
"0/53/20": 0,
|
||||
"0/53/21": 1,
|
||||
"0/53/22": 1095,
|
||||
"0/53/23": 1093,
|
||||
"0/53/24": 2,
|
||||
"0/53/25": 1093,
|
||||
"0/53/26": 1087,
|
||||
"0/53/27": 2,
|
||||
"0/53/28": 742,
|
||||
"0/53/29": 354,
|
||||
"0/53/30": 0,
|
||||
"0/53/31": 0,
|
||||
"0/53/32": 0,
|
||||
"0/53/33": 360,
|
||||
"0/53/34": 1,
|
||||
"0/53/35": 0,
|
||||
"0/53/36": 6,
|
||||
"0/53/37": 0,
|
||||
"0/53/38": 0,
|
||||
"0/53/39": 311,
|
||||
"0/53/40": 289,
|
||||
"0/53/41": 0,
|
||||
"0/53/42": 276,
|
||||
"0/53/43": 0,
|
||||
"0/53/44": 0,
|
||||
"0/53/45": 0,
|
||||
"0/53/46": 0,
|
||||
"0/53/47": 0,
|
||||
"0/53/48": 22,
|
||||
"0/53/49": 13,
|
||||
"0/53/50": 0,
|
||||
"0/53/51": 0,
|
||||
"0/53/52": 0,
|
||||
"0/53/53": 0,
|
||||
"0/53/54": 0,
|
||||
"0/53/55": 0,
|
||||
"0/53/56": 65536,
|
||||
"0/53/57": 0,
|
||||
"0/53/58": 0,
|
||||
"0/53/59": {
|
||||
"0": 672,
|
||||
"1": 143
|
||||
},
|
||||
"0/53/60": "AB//4A==",
|
||||
"0/53/61": {
|
||||
"0": true,
|
||||
"1": false,
|
||||
"2": true,
|
||||
"3": true,
|
||||
"4": true,
|
||||
"5": true,
|
||||
"6": false,
|
||||
"7": true,
|
||||
"8": true,
|
||||
"9": true,
|
||||
"10": true,
|
||||
"11": true
|
||||
},
|
||||
"0/53/62": [],
|
||||
"0/53/65532": 15,
|
||||
"0/53/65533": 2,
|
||||
"0/53/65528": [],
|
||||
"0/53/65529": [0],
|
||||
"0/53/65531": [
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
||||
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
|
||||
39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
|
||||
57, 58, 59, 60, 61, 62, 65532, 65533, 65528, 65529, 65531
|
||||
],
|
||||
"0/54/0": null,
|
||||
"0/54/1": null,
|
||||
"0/54/2": null,
|
||||
"0/54/3": null,
|
||||
"0/54/4": null,
|
||||
"0/54/5": null,
|
||||
"0/54/6": null,
|
||||
"0/54/7": null,
|
||||
"0/54/8": null,
|
||||
"0/54/9": null,
|
||||
"0/54/10": null,
|
||||
"0/54/11": null,
|
||||
"0/54/12": null,
|
||||
"0/54/65532": 3,
|
||||
"0/54/65533": 1,
|
||||
"0/54/65528": [],
|
||||
"0/54/65529": [0],
|
||||
"0/54/65531": [
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 65532, 65533, 65528, 65529,
|
||||
65531
|
||||
],
|
||||
"0/55/0": null,
|
||||
"0/55/1": null,
|
||||
"0/55/2": 0,
|
||||
"0/55/3": 0,
|
||||
"0/55/4": 0,
|
||||
"0/55/5": 0,
|
||||
"0/55/6": 0,
|
||||
"0/55/7": null,
|
||||
"0/55/8": 0,
|
||||
"0/55/65532": 3,
|
||||
"0/55/65533": 1,
|
||||
"0/55/65528": [],
|
||||
"0/55/65529": [0],
|
||||
"0/55/65531": [
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 65532, 65533, 65528, 65529, 65531
|
||||
],
|
||||
"0/56/0": null,
|
||||
"0/56/1": 2,
|
||||
"0/56/2": 2,
|
||||
"0/56/3": null,
|
||||
"0/56/4": null,
|
||||
"0/56/5": [
|
||||
{
|
||||
"0": 3600,
|
||||
"1": 0,
|
||||
"2": "Europe/Paris"
|
||||
}
|
||||
],
|
||||
"0/56/6": [
|
||||
{
|
||||
"0": 3600,
|
||||
"1": 0,
|
||||
"2": 814755600000000
|
||||
},
|
||||
{
|
||||
"0": 0,
|
||||
"1": 814755600000000,
|
||||
"2": 828061200000000
|
||||
}
|
||||
],
|
||||
"0/56/7": null,
|
||||
"0/56/8": 0,
|
||||
"0/56/10": 2,
|
||||
"0/56/11": 2,
|
||||
"0/56/12": false,
|
||||
"0/56/65532": 11,
|
||||
"0/56/65533": 2,
|
||||
"0/56/65528": [3],
|
||||
"0/56/65529": [0, 1, 2, 4, 5],
|
||||
"0/56/65531": [
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 65532, 65533, 65528, 65529, 65531
|
||||
],
|
||||
"0/62/0": [
|
||||
{
|
||||
"1": "FTABAQEkAgE3AyQTAhgmBIAigScmBYAlTTo3BiQVAiQRjhgkBwEkCAEwCUEEN9y8sVVxRfz6t8zBkrXcA7mKfPdJ32/ICCsYVFZbR/eDgVArNYYRU4ERh1vFe3lwKPEzWyqeOK2zLh/o5mJiQzcKNQEoARgkAgE2AwQCBAEYMAQUcpCun15nymIR4Afgn01spuN9/yEwBRS5+zzv8ZPGnI9mC3wH9vq10JnwlhgwC0DMWBwQ/zsQ1Ze3AI48BczPYGH5TGSvKorkxqoDiIVLXi/FwXGujDyjPhj+XBPb2wyjy+pbpk6WCqu7T1cCj/3LGA==",
|
||||
"2": "FTABAQEkAgE3AyQUARgmBIAigScmBYAlTTo3BiQTAhgkBwEkCAEwCUEE/DujEcdTsX19xbxX+KuKKWiMaA5D9u99P/pVxIOmscd2BA2PadEMNnjvtPOpf+WE2Zxar4rby1IfAClGUUuQrTcKNQEpARgkAmAwBBS5+zzv8ZPGnI9mC3wH9vq10JnwljAFFPT6p93JKGcb7g+rTWnA6evF2EdGGDALQGkPpvsbkAFEbfPN6H3Kf23R0zzmW/gpAA3kgaL6wKB2Ofm+Tmylw22qM536Kj8mOMwaV0EL1dCCGcuxF98aL6gY",
|
||||
"254": 3
|
||||
}
|
||||
],
|
||||
"0/62/1": [
|
||||
{
|
||||
"1": "BBmX+KwLR5HGlVNbvlC+dO8Jv9fPthHiTfGpUzi2JJADX5az6GxBAFn02QKHwLcZHyh+lh9faf6rf38/nPYF7/M=",
|
||||
"2": 4939,
|
||||
"3": 2,
|
||||
"4": 142,
|
||||
"5": "ha-freebox",
|
||||
"254": 3
|
||||
}
|
||||
],
|
||||
"0/62/2": 5,
|
||||
"0/62/3": 3,
|
||||
"0/62/4": [
|
||||
"FTABAQAkAgE3AyYUyakYCSYVj6gLsxgmBDsshTAkBQA3BiYUyakYCSYVj6gLsxgkBwEkCAEwCUEEgYwxrTB+tyiEGfrRwjlXTG34MiQtJXbg5Qqd0ohdRW7MfwYY7vZiX/0h9hI8MqUralFaVPcnghAP0MSJm1YrqTcKNQEpARgkAmAwBBS3BS9aJzt+p6i28Nj+trB2Uu+vdzAFFLcFL1onO36nqLbw2P62sHZS7693GDALQOGY5b6w9IoAsWre5kJ0I1VvDKNwhG6sRcDKk53ZIeJY54p0TFr68mpGbjiD9wliZhM7lcVJqbZafKD89ABWazgY",
|
||||
"FTABAQAkAgE3AycUQhmZbaIbYjokFQIYJgRWZLcqJAUANwYnFEIZmW2iG2I6JBUCGCQHASQIATAJQQT2AlKGW/kOMjqayzeO0md523/fuhrhGEUU91uQpTiKo0I7wcPpKnmrwfQNPX6g0kEQl+VGaXa3e22lzfu5Tzp0Nwo1ASkBGCQCYDAEFOOMk13ScMKuT2hlaydi1yEJnhTqMAUU44yTXdJwwq5PaGVrJ2LXIQmeFOoYMAtAv2jJd1qd5miXbYesH1XrJ+vgyY0hzGuZ78N6Jw4Cb1oN1sLSpA+PNM0u7+hsEqcSvvn2eSV8EaRR+hg5YQjHDxg=",
|
||||
"FTABAQEkAgE3AyQUARgmBIAigScmBYAlTTo3BiQUARgkBwEkCAEwCUEEGZf4rAtHkcaVU1u+UL507wm/18+2EeJN8alTOLYkkANflrPobEEAWfTZAofAtxkfKH6WH19p/qt/fz+c9gXv8zcKNQEpARgkAmAwBBT0+qfdyShnG+4Pq01pwOnrxdhHRjAFFPT6p93JKGcb7g+rTWnA6evF2EdGGDALQPVrsFnfFplsQGV5m5EUua+rmo9hAr+OP1bvaifdLqiEIn3uXLTLoKmVUkPImRL2Fb+xcMEAqR2p7RM6ZlFCR20Y"
|
||||
],
|
||||
"0/62/5": 3,
|
||||
"0/62/65532": 0,
|
||||
"0/62/65533": 2,
|
||||
"0/62/65528": [1, 3, 5, 8, 14],
|
||||
"0/62/65529": [0, 2, 4, 6, 7, 9, 10, 11, 12, 13],
|
||||
"0/62/65531": [0, 1, 2, 3, 4, 5, 65532, 65533, 65528, 65529, 65531],
|
||||
"0/63/0": [],
|
||||
"0/63/1": [],
|
||||
"0/63/2": 4,
|
||||
"0/63/3": 3,
|
||||
"0/63/65532": 0,
|
||||
"0/63/65533": 2,
|
||||
"0/63/65528": [2, 5],
|
||||
"0/63/65529": [0, 1, 3, 4],
|
||||
"0/63/65531": [0, 1, 2, 3, 65532, 65533, 65528, 65529, 65531],
|
||||
"0/65/0": [],
|
||||
"0/65/65532": 0,
|
||||
"0/65/65533": 1,
|
||||
"0/65/65528": [],
|
||||
"0/65/65529": [],
|
||||
"0/65/65531": [0, 65532, 65533, 65528, 65529, 65531],
|
||||
"0/70/0": 600,
|
||||
"0/70/1": 0,
|
||||
"0/70/2": 5000,
|
||||
"0/70/3": [],
|
||||
"0/70/4": 3937783811,
|
||||
"0/70/5": 2,
|
||||
"0/70/6": 4373,
|
||||
"0/70/7": "Power Cycle",
|
||||
"0/70/8": 0,
|
||||
"0/70/9": 600,
|
||||
"0/70/65532": 15,
|
||||
"0/70/65533": 3,
|
||||
"0/70/65528": [1, 4],
|
||||
"0/70/65529": [0, 2, 3],
|
||||
"0/70/65531": [
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 65532, 65533, 65528, 65529, 65531
|
||||
],
|
||||
"1/3/0": 0,
|
||||
"1/3/1": 2,
|
||||
"1/3/65532": 0,
|
||||
"1/3/65533": 5,
|
||||
"1/3/65528": [],
|
||||
"1/3/65529": [0, 64],
|
||||
"1/3/65531": [0, 1, 65532, 65533, 65528, 65529, 65531],
|
||||
"1/4/0": 128,
|
||||
"1/4/65532": 1,
|
||||
"1/4/65533": 4,
|
||||
"1/4/65528": [0, 1, 2, 3],
|
||||
"1/4/65529": [0, 1, 2, 3, 4, 5],
|
||||
"1/4/65531": [0, 65532, 65533, 65528, 65529, 65531],
|
||||
"1/29/0": [
|
||||
{
|
||||
"0": 259,
|
||||
"1": 1
|
||||
}
|
||||
],
|
||||
"1/29/1": [3, 4, 29, 30],
|
||||
"1/29/2": [3, 6, 98, 768],
|
||||
"1/29/3": [],
|
||||
"1/29/65532": 0,
|
||||
"1/29/65533": 3,
|
||||
"1/29/65528": [],
|
||||
"1/29/65529": [],
|
||||
"1/29/65531": [0, 1, 2, 3, 65532, 65533, 65528, 65529, 65531],
|
||||
"1/30/0": [],
|
||||
"1/30/65532": 0,
|
||||
"1/30/65533": 1,
|
||||
"1/30/65528": [],
|
||||
"1/30/65529": [],
|
||||
"1/30/65531": [0, 65532, 65533, 65528, 65529, 65531],
|
||||
"2/3/0": 0,
|
||||
"2/3/1": 0,
|
||||
"2/3/65532": 0,
|
||||
"2/3/65533": 5,
|
||||
"2/3/65528": [],
|
||||
"2/3/65529": [0, 64],
|
||||
"2/3/65531": [0, 1, 65532, 65533, 65528, 65529, 65531],
|
||||
"2/29/0": [
|
||||
{
|
||||
"0": 15,
|
||||
"1": 1
|
||||
}
|
||||
],
|
||||
"2/29/1": [3, 29, 59],
|
||||
"2/29/2": [],
|
||||
"2/29/3": [],
|
||||
"2/29/65532": 0,
|
||||
"2/29/65533": 3,
|
||||
"2/29/65528": [],
|
||||
"2/29/65529": [],
|
||||
"2/29/65531": [0, 1, 2, 3, 65532, 65533, 65528, 65529, 65531],
|
||||
"2/59/0": 2,
|
||||
"2/59/1": 0,
|
||||
"2/59/65532": 6,
|
||||
"2/59/65533": 2,
|
||||
"2/59/65528": [],
|
||||
"2/59/65529": [],
|
||||
"2/59/65531": [0, 1, 65532, 65533, 65528, 65529, 65531]
|
||||
},
|
||||
"attribute_subscriptions": []
|
||||
}
|
440
tests/components/matter/fixtures/nodes/switchbot_k11_plus.json
Normal file
440
tests/components/matter/fixtures/nodes/switchbot_k11_plus.json
Normal file
@@ -0,0 +1,440 @@
|
||||
{
|
||||
"node_id": 97,
|
||||
"date_commissioned": "2025-08-21T16:38:31.165712",
|
||||
"last_interview": "2025-08-21T16:38:31.165730",
|
||||
"interview_version": 6,
|
||||
"available": true,
|
||||
"is_bridge": false,
|
||||
"attributes": {
|
||||
"0/29/0": [
|
||||
{
|
||||
"0": 22,
|
||||
"1": 1
|
||||
}
|
||||
],
|
||||
"0/29/1": [29, 31, 40, 48, 51, 60, 62, 63],
|
||||
"0/29/2": [],
|
||||
"0/29/3": [1],
|
||||
"0/29/65532": 0,
|
||||
"0/29/65533": 2,
|
||||
"0/29/65528": [],
|
||||
"0/29/65529": [],
|
||||
"0/29/65531": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533],
|
||||
"0/31/0": [
|
||||
{
|
||||
"1": 5,
|
||||
"2": 2,
|
||||
"3": [112233],
|
||||
"4": null,
|
||||
"254": 3
|
||||
}
|
||||
],
|
||||
"0/31/1": [],
|
||||
"0/31/2": 4,
|
||||
"0/31/3": 3,
|
||||
"0/31/4": 4,
|
||||
"0/31/65532": 1,
|
||||
"0/31/65533": 2,
|
||||
"0/31/65528": [],
|
||||
"0/31/65529": [],
|
||||
"0/31/65531": [0, 1, 2, 3, 4, 65528, 65529, 65531, 65532, 65533],
|
||||
"0/40/0": 18,
|
||||
"0/40/1": "SwitchBot",
|
||||
"0/40/2": 5015,
|
||||
"0/40/3": "K11+",
|
||||
"0/40/4": 2043,
|
||||
"0/40/5": "",
|
||||
"0/40/6": "**REDACTED**",
|
||||
"0/40/7": 8,
|
||||
"0/40/8": "8",
|
||||
"0/40/9": 2,
|
||||
"0/40/10": "2.0",
|
||||
"0/40/11": "20200101",
|
||||
"0/40/15": "*****************",
|
||||
"0/40/16": false,
|
||||
"0/40/18": "*****************",
|
||||
"0/40/19": {
|
||||
"0": 3,
|
||||
"1": 65535
|
||||
},
|
||||
"0/40/21": 17039616,
|
||||
"0/40/22": 1,
|
||||
"0/40/65532": 0,
|
||||
"0/40/65533": 4,
|
||||
"0/40/65528": [],
|
||||
"0/40/65529": [],
|
||||
"0/40/65531": [
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 18, 19, 21, 22, 65528,
|
||||
65529, 65531, 65532, 65533
|
||||
],
|
||||
"0/48/0": 0,
|
||||
"0/48/1": {
|
||||
"0": 60,
|
||||
"1": 900
|
||||
},
|
||||
"0/48/2": 0,
|
||||
"0/48/3": 2,
|
||||
"0/48/4": true,
|
||||
"0/48/65532": 0,
|
||||
"0/48/65533": 2,
|
||||
"0/48/65528": [1, 3, 5],
|
||||
"0/48/65529": [0, 2, 4],
|
||||
"0/48/65531": [0, 1, 2, 3, 4, 65528, 65529, 65531, 65532, 65533],
|
||||
"0/51/0": [
|
||||
{
|
||||
"0": "wlan0",
|
||||
"1": true,
|
||||
"2": null,
|
||||
"3": null,
|
||||
"4": "sOn+hWUk",
|
||||
"5": ["wKgBow=="],
|
||||
"6": ["KgEOCgKzOZBGmN+UianfsA==", "/oAAAAAAAACEb4xWVmm9jw=="],
|
||||
"7": 1
|
||||
},
|
||||
{
|
||||
"0": "lo",
|
||||
"1": true,
|
||||
"2": null,
|
||||
"3": null,
|
||||
"4": "AAAAAAAA",
|
||||
"5": ["fwAAAQ=="],
|
||||
"6": ["AAAAAAAAAAAAAAAAAAAAAQ=="],
|
||||
"7": 0
|
||||
}
|
||||
],
|
||||
"0/51/1": 8,
|
||||
"0/51/2": 0,
|
||||
"0/51/4": 0,
|
||||
"0/51/5": [],
|
||||
"0/51/6": [],
|
||||
"0/51/7": [],
|
||||
"0/51/8": false,
|
||||
"0/51/65532": 0,
|
||||
"0/51/65533": 2,
|
||||
"0/51/65528": [2],
|
||||
"0/51/65529": [0, 1],
|
||||
"0/51/65531": [0, 1, 2, 4, 5, 6, 7, 8, 65528, 65529, 65531, 65532, 65533],
|
||||
"0/60/0": 0,
|
||||
"0/60/1": null,
|
||||
"0/60/2": null,
|
||||
"0/60/65532": 0,
|
||||
"0/60/65533": 1,
|
||||
"0/60/65528": [],
|
||||
"0/60/65529": [0, 2],
|
||||
"0/60/65531": [0, 1, 2, 65528, 65529, 65531, 65532, 65533],
|
||||
"0/62/0": [
|
||||
{
|
||||
"1": "FTABAQEkAgE3AyQTAhgmBIAigScmBYAlTTo3BiQVAiQRYRgkBwEkCAEwCUEED3gG83T4fgQ8mJi4UtxYHdce62io4H76mdpHCQluYUJ3zb4ahgxgT9tz7eNDwOooSPo985+iv5hDEEYsuVUu1TcKNQEoARgkAgE2AwQCBAEYMAQUGDYBbm6GdsqVhw7HwYXe2fWNMXIwBRS5+zzv8ZPGnI9mC3wH9vq10JnwlhgwC0DuruGO/yh7HLCuMeBxe6kBbjeStJ+VJAdWHiXBEyE1x2LZPcgX1LXpIwjshY5ACCNFRTuwtIH9GwSt9iVKZc7/GA==",
|
||||
"2": "FTABAQEkAgE3AyQUARgmBIAigScmBYAlTTo3BiQTAhgkBwEkCAEwCUEE/DujEcdTsX19xbxX+KuKKWiMaA5D9u99P/pVxIOmscd2BA2PadEMNnjvtPOpf+WE2Zxar4rby1IfAClGUUuQrTcKNQEpARgkAmAwBBS5+zzv8ZPGnI9mC3wH9vq10JnwljAFFPT6p93JKGcb7g+rTWnA6evF2EdGGDALQGkPpvsbkAFEbfPN6H3Kf23R0zzmW/gpAA3kgaL6wKB2Ofm+Tmylw22qM536Kj8mOMwaV0EL1dCCGcuxF98aL6gY",
|
||||
"254": 3
|
||||
}
|
||||
],
|
||||
"0/62/1": [
|
||||
{
|
||||
"1": "***********",
|
||||
"2": 4939,
|
||||
"3": 2,
|
||||
"4": 97,
|
||||
"5": "SSID",
|
||||
"254": 3
|
||||
}
|
||||
],
|
||||
"0/62/2": 16,
|
||||
"0/62/3": 5,
|
||||
"0/62/4": ["***********"],
|
||||
"0/62/5": 3,
|
||||
"0/62/65532": 0,
|
||||
"0/62/65533": 1,
|
||||
"0/62/65528": [1, 3, 5, 8],
|
||||
"0/62/65529": [0, 2, 4, 6, 7, 9, 10, 11],
|
||||
"0/62/65531": [0, 1, 2, 3, 4, 5, 65528, 65529, 65531, 65532, 65533],
|
||||
"0/63/0": [],
|
||||
"0/63/1": [],
|
||||
"0/63/2": 4,
|
||||
"0/63/3": 3,
|
||||
"0/63/65532": 0,
|
||||
"0/63/65533": 2,
|
||||
"0/63/65528": [2, 5],
|
||||
"0/63/65529": [0, 1, 3, 4],
|
||||
"0/63/65531": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533],
|
||||
"1/3/0": 0,
|
||||
"1/3/1": 0,
|
||||
"1/3/65532": 0,
|
||||
"1/3/65533": 5,
|
||||
"1/3/65528": [],
|
||||
"1/3/65529": [0],
|
||||
"1/3/65531": [0, 1, 65528, 65529, 65531, 65532, 65533],
|
||||
"1/29/0": [
|
||||
{
|
||||
"0": 116,
|
||||
"1": 1
|
||||
}
|
||||
],
|
||||
"1/29/1": [3, 29, 84, 85, 97, 336],
|
||||
"1/29/2": [],
|
||||
"1/29/3": [],
|
||||
"1/29/65532": 0,
|
||||
"1/29/65533": 2,
|
||||
"1/29/65528": [],
|
||||
"1/29/65529": [],
|
||||
"1/29/65531": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533],
|
||||
"1/84/0": [
|
||||
{
|
||||
"0": "Idle",
|
||||
"1": 0,
|
||||
"2": [
|
||||
{
|
||||
"1": 16384
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"0": "Cleaning",
|
||||
"1": 1,
|
||||
"2": [
|
||||
{
|
||||
"1": 16385
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"0": "Mapping",
|
||||
"1": 2,
|
||||
"2": [
|
||||
{
|
||||
"1": 16386
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"0": "Pause",
|
||||
"1": 3,
|
||||
"2": [
|
||||
{
|
||||
"1": 32769
|
||||
},
|
||||
{
|
||||
"1": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"0": "Resume",
|
||||
"1": 4,
|
||||
"2": [
|
||||
{
|
||||
"1": 32770
|
||||
},
|
||||
{
|
||||
"1": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"0": "Docking",
|
||||
"1": 5,
|
||||
"2": [
|
||||
{
|
||||
"1": 32771
|
||||
},
|
||||
{
|
||||
"1": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"1/84/1": 0,
|
||||
"1/84/65532": 0,
|
||||
"1/84/65533": 3,
|
||||
"1/84/65528": [1],
|
||||
"1/84/65529": [0],
|
||||
"1/84/65531": [0, 1, 65528, 65529, 65531, 65532, 65533],
|
||||
"1/85/0": [
|
||||
{
|
||||
"0": "Quick",
|
||||
"1": 0,
|
||||
"2": [
|
||||
{
|
||||
"1": 16385
|
||||
},
|
||||
{
|
||||
"1": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"0": "Auto",
|
||||
"1": 1,
|
||||
"2": [
|
||||
{
|
||||
"1": 16385
|
||||
},
|
||||
{
|
||||
"1": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"0": "Deep Clean",
|
||||
"1": 2,
|
||||
"2": [
|
||||
{
|
||||
"1": 16385
|
||||
},
|
||||
{
|
||||
"1": 16384
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"0": "Quiet",
|
||||
"1": 3,
|
||||
"2": [
|
||||
{
|
||||
"1": 16385
|
||||
},
|
||||
{
|
||||
"1": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"0": "Max Vac",
|
||||
"1": 4,
|
||||
"2": [
|
||||
{
|
||||
"1": 16385
|
||||
},
|
||||
{
|
||||
"1": 7
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"1/85/1": 0,
|
||||
"1/85/65532": 0,
|
||||
"1/85/65533": 3,
|
||||
"1/85/65528": [1],
|
||||
"1/85/65529": [0],
|
||||
"1/85/65531": [0, 1, 65528, 65529, 65531, 65532, 65533],
|
||||
"1/97/0": null,
|
||||
"1/97/1": null,
|
||||
"1/97/3": [
|
||||
{
|
||||
"0": 0
|
||||
},
|
||||
{
|
||||
"0": 1
|
||||
},
|
||||
{
|
||||
"0": 2
|
||||
},
|
||||
{
|
||||
"0": 3
|
||||
},
|
||||
{
|
||||
"0": 64
|
||||
},
|
||||
{
|
||||
"0": 65
|
||||
},
|
||||
{
|
||||
"0": 66
|
||||
}
|
||||
],
|
||||
"1/97/4": 0,
|
||||
"1/97/5": {
|
||||
"0": 0
|
||||
},
|
||||
"1/97/65532": 0,
|
||||
"1/97/65533": 2,
|
||||
"1/97/65528": [4],
|
||||
"1/97/65529": [0, 3, 128],
|
||||
"1/97/65531": [0, 1, 3, 4, 5, 65528, 65529, 65531, 65532, 65533],
|
||||
"1/336/0": [
|
||||
{
|
||||
"0": 1,
|
||||
"1": null,
|
||||
"2": {
|
||||
"0": {
|
||||
"0": "Bedroom #3",
|
||||
"1": null,
|
||||
"2": null
|
||||
},
|
||||
"1": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"0": 2,
|
||||
"1": null,
|
||||
"2": {
|
||||
"0": {
|
||||
"0": "Stairs",
|
||||
"1": null,
|
||||
"2": null
|
||||
},
|
||||
"1": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"0": 3,
|
||||
"1": null,
|
||||
"2": {
|
||||
"0": {
|
||||
"0": "Bedroom #1",
|
||||
"1": null,
|
||||
"2": null
|
||||
},
|
||||
"1": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"0": 4,
|
||||
"1": null,
|
||||
"2": {
|
||||
"0": {
|
||||
"0": "Bedroom #2",
|
||||
"1": null,
|
||||
"2": null
|
||||
},
|
||||
"1": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"0": 5,
|
||||
"1": null,
|
||||
"2": {
|
||||
"0": {
|
||||
"0": "Corridor",
|
||||
"1": null,
|
||||
"2": null
|
||||
},
|
||||
"1": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"0": 6,
|
||||
"1": null,
|
||||
"2": {
|
||||
"0": {
|
||||
"0": "Bathroom",
|
||||
"1": null,
|
||||
"2": null
|
||||
},
|
||||
"1": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"1/336/1": [],
|
||||
"1/336/2": [4, 3],
|
||||
"1/336/3": null,
|
||||
"1/336/4": null,
|
||||
"1/336/5": [],
|
||||
"1/336/65532": 6,
|
||||
"1/336/65533": 1,
|
||||
"1/336/65528": [1, 3],
|
||||
"1/336/65529": [0, 2],
|
||||
"1/336/65531": [0, 1, 2, 3, 4, 5, 65528, 65529, 65531, 65532, 65533]
|
||||
},
|
||||
"attribute_subscriptions": []
|
||||
}
|
@@ -2283,6 +2283,55 @@
|
||||
'state': 'unknown',
|
||||
})
|
||||
# ---
|
||||
# name: test_buttons[silabs_light_switch][button.light_switch_example_identify_1-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'button',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'button.light_switch_example_identify_1',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <ButtonDeviceClass.IDENTIFY: 'identify'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Identify (1)',
|
||||
'platform': 'matter',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '00000000000004D2-000000000000008E-MatterNodeDevice-1-IdentifyButton-3-1',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_buttons[silabs_light_switch][button.light_switch_example_identify_1-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'identify',
|
||||
'friendly_name': 'Light switch example Identify (1)',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'button.light_switch_example_identify_1',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unknown',
|
||||
})
|
||||
# ---
|
||||
# name: test_buttons[silabs_refrigerator][button.refrigerator_identify-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
@@ -606,3 +606,62 @@
|
||||
'state': 'unknown',
|
||||
})
|
||||
# ---
|
||||
# name: test_events[silabs_light_switch][event.light_switch_example_button-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'event_types': list([
|
||||
'initial_press',
|
||||
'short_release',
|
||||
]),
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'event',
|
||||
'entity_category': None,
|
||||
'entity_id': 'event.light_switch_example_button',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <EventDeviceClass.BUTTON: 'button'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Button',
|
||||
'platform': 'matter',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'button',
|
||||
'unique_id': '00000000000004D2-000000000000008E-MatterNodeDevice-2-GenericSwitch-59-1',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_events[silabs_light_switch][event.light_switch_example_button-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'button',
|
||||
'event_type': None,
|
||||
'event_types': list([
|
||||
'initial_press',
|
||||
'short_release',
|
||||
]),
|
||||
'friendly_name': 'Light switch example Button',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'event.light_switch_example_button',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unknown',
|
||||
})
|
||||
# ---
|
||||
|
@@ -3470,6 +3470,69 @@
|
||||
'state': 'previous',
|
||||
})
|
||||
# ---
|
||||
# name: test_selects[switchbot_k11_plus][select.k11_clean_mode-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'options': list([
|
||||
'Quick',
|
||||
'Auto',
|
||||
'Deep Clean',
|
||||
'Quiet',
|
||||
'Max Vac',
|
||||
]),
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'select',
|
||||
'entity_category': None,
|
||||
'entity_id': 'select.k11_clean_mode',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Clean mode',
|
||||
'platform': 'matter',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'clean_mode',
|
||||
'unique_id': '00000000000004D2-0000000000000061-MatterNodeDevice-1-MatterRvcCleanMode-85-1',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_selects[switchbot_k11_plus][select.k11_clean_mode-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'K11+ Clean mode',
|
||||
'options': list([
|
||||
'Quick',
|
||||
'Auto',
|
||||
'Deep Clean',
|
||||
'Quiet',
|
||||
'Max Vac',
|
||||
]),
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'select.k11_clean_mode',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'Quick',
|
||||
})
|
||||
# ---
|
||||
# name: test_selects[thermostat][select.longan_link_hvac_temperature_display_mode-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
@@ -6759,6 +6759,57 @@
|
||||
'state': '0.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[silabs_light_switch][sensor.light_switch_example_current_switch_position-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
|
||||
'entity_id': 'sensor.light_switch_example_current_switch_position',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Current switch position',
|
||||
'platform': 'matter',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'switch_current_position',
|
||||
'unique_id': '00000000000004D2-000000000000008E-MatterNodeDevice-2-SwitchCurrentPosition-59-1',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[silabs_light_switch][sensor.light_switch_example_current_switch_position-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Light switch example Current switch position',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.light_switch_example_current_switch_position',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '0',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[silabs_water_heater][sensor.water_heater_active_current-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
@@ -7625,6 +7676,74 @@
|
||||
'state': '234.899',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[switchbot_k11_plus][sensor.k11_operational_state-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'options': list([
|
||||
'stopped',
|
||||
'running',
|
||||
'paused',
|
||||
'error',
|
||||
'seeking_charger',
|
||||
'charging',
|
||||
'docked',
|
||||
]),
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.k11_operational_state',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Operational state',
|
||||
'platform': 'matter',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'operational_state',
|
||||
'unique_id': '00000000000004D2-0000000000000061-MatterNodeDevice-1-RvcOperationalState-97-4',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[switchbot_k11_plus][sensor.k11_operational_state-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'enum',
|
||||
'friendly_name': 'K11+ Operational state',
|
||||
'options': list([
|
||||
'stopped',
|
||||
'running',
|
||||
'paused',
|
||||
'error',
|
||||
'seeking_charger',
|
||||
'charging',
|
||||
'docked',
|
||||
]),
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.k11_operational_state',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'stopped',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[tado_smart_radiator_thermostat_x][sensor.smart_radiator_thermostat_x_humidity-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
@@ -1,4 +1,53 @@
|
||||
# serializer version: 1
|
||||
# name: test_vacuum[switchbot_k11_plus][vacuum.k11-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'vacuum',
|
||||
'entity_category': None,
|
||||
'entity_id': 'vacuum.k11',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': None,
|
||||
'platform': 'matter',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': <VacuumEntityFeature: 12316>,
|
||||
'translation_key': None,
|
||||
'unique_id': '00000000000004D2-0000000000000061-MatterNodeDevice-1-MatterVacuumCleaner-84-1',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_vacuum[switchbot_k11_plus][vacuum.k11-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'K11+',
|
||||
'supported_features': <VacuumEntityFeature: 12316>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'vacuum.k11',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'idle',
|
||||
})
|
||||
# ---
|
||||
# name: test_vacuum[vacuum_cleaner][vacuum.mock_vacuum-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
@@ -9,8 +9,13 @@ import uuid
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.rest.data import DEFAULT_TIMEOUT
|
||||
from homeassistant.components.rest.schema import DEFAULT_METHOD, DEFAULT_VERIFY_SSL
|
||||
from homeassistant.components.rest.data import ( # pylint: disable=hass-component-root-import
|
||||
DEFAULT_TIMEOUT,
|
||||
)
|
||||
from homeassistant.components.rest.schema import ( # pylint: disable=hass-component-root-import
|
||||
DEFAULT_METHOD,
|
||||
DEFAULT_VERIFY_SSL,
|
||||
)
|
||||
from homeassistant.components.scrape.const import (
|
||||
CONF_ENCODING,
|
||||
CONF_INDEX,
|
||||
|
@@ -6,8 +6,12 @@ from unittest.mock import AsyncMock, patch
|
||||
import uuid
|
||||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.components.rest.data import DEFAULT_TIMEOUT
|
||||
from homeassistant.components.rest.schema import DEFAULT_METHOD
|
||||
from homeassistant.components.rest.data import ( # pylint: disable=hass-component-root-import
|
||||
DEFAULT_TIMEOUT,
|
||||
)
|
||||
from homeassistant.components.rest.schema import ( # pylint: disable=hass-component-root-import
|
||||
DEFAULT_METHOD,
|
||||
)
|
||||
from homeassistant.components.scrape import DOMAIN
|
||||
from homeassistant.components.scrape.const import (
|
||||
CONF_ENCODING,
|
||||
|
113
tests/components/xbox/conftest.py
Normal file
113
tests/components/xbox/conftest.py
Normal file
@@ -0,0 +1,113 @@
|
||||
"""Common fixtures for the Xbox tests."""
|
||||
|
||||
from collections.abc import Generator
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
from xbox.webapi.api.provider.catalog.models import CatalogResponse
|
||||
from xbox.webapi.api.provider.people.models import PeopleResponse
|
||||
from xbox.webapi.api.provider.smartglass.models import (
|
||||
SmartglassConsoleList,
|
||||
SmartglassConsoleStatus,
|
||||
)
|
||||
|
||||
from homeassistant.components.application_credentials import (
|
||||
ClientCredential,
|
||||
async_import_client_credential,
|
||||
)
|
||||
from homeassistant.components.xbox.const import DOMAIN
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import MockConfigEntry, load_json_object_fixture
|
||||
|
||||
CLIENT_ID = "1234"
|
||||
CLIENT_SECRET = "5678"
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
async def setup_credentials(hass: HomeAssistant) -> None:
|
||||
"""Fixture to setup credentials."""
|
||||
assert await async_setup_component(hass, "application_credentials", {})
|
||||
await async_import_client_credential(
|
||||
hass, DOMAIN, ClientCredential(CLIENT_ID, CLIENT_SECRET), "imported-cred"
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_oauth2_implementation() -> Generator[AsyncMock]:
|
||||
"""Mock config entry oauth2 implementation."""
|
||||
with patch(
|
||||
"homeassistant.components.xbox.config_entry_oauth2_flow.async_get_config_entry_implementation",
|
||||
return_value=AsyncMock(),
|
||||
) as mock_client:
|
||||
client = mock_client.return_value
|
||||
|
||||
yield client
|
||||
|
||||
|
||||
@pytest.fixture(name="config_entry")
|
||||
def mock_config_entry() -> MockConfigEntry:
|
||||
"""Mock Xbox configuration entry."""
|
||||
return MockConfigEntry(
|
||||
domain=DOMAIN,
|
||||
title="Home Assistant Cloud",
|
||||
data={
|
||||
"auth_implementation": "cloud",
|
||||
"token": {
|
||||
"access_token": "1234567890",
|
||||
"expires_at": 1760697327.7298331,
|
||||
"expires_in": 3600,
|
||||
"refresh_token": "0987654321",
|
||||
"scope": "XboxLive.signin XboxLive.offline_access",
|
||||
"service": "xbox",
|
||||
"token_type": "bearer",
|
||||
"user_id": "AAAAAAAAAAAAAAAAAAAAA",
|
||||
},
|
||||
},
|
||||
unique_id="xbox",
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(name="signed_session")
|
||||
def mock_signed_session() -> Generator[AsyncMock]:
|
||||
"""Mock xbox-webapi SignedSession."""
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.xbox.SignedSession", autospec=True
|
||||
) as mock_client:
|
||||
client = mock_client.return_value
|
||||
|
||||
yield client
|
||||
|
||||
|
||||
@pytest.fixture(name="xbox_live_client")
|
||||
def mock_xbox_live_client(signed_session) -> Generator[AsyncMock]:
|
||||
"""Mock xbox-webapi XboxLiveClient."""
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.xbox.XboxLiveClient", autospec=True
|
||||
) as mock_client:
|
||||
client = mock_client.return_value
|
||||
|
||||
client.smartglass = AsyncMock()
|
||||
client.smartglass.get_console_list.return_value = SmartglassConsoleList(
|
||||
**load_json_object_fixture("smartglass_console_list.json", DOMAIN)
|
||||
)
|
||||
client.smartglass.get_console_status.return_value = SmartglassConsoleStatus(
|
||||
**load_json_object_fixture("smartglass_console_status.json", DOMAIN)
|
||||
)
|
||||
|
||||
client.catalog = AsyncMock()
|
||||
client.catalog.get_product_from_alternate_id.return_value = CatalogResponse(
|
||||
**load_json_object_fixture("catalog_product_lookup.json", DOMAIN)
|
||||
)
|
||||
|
||||
client.people = AsyncMock()
|
||||
client.people.get_friends_own_batch.return_value = PeopleResponse(
|
||||
**load_json_object_fixture("people_batch.json", DOMAIN)
|
||||
)
|
||||
client.people.get_friends_own.return_value = PeopleResponse(
|
||||
**load_json_object_fixture("people_friends_own.json", DOMAIN)
|
||||
)
|
||||
yield client
|
4163
tests/components/xbox/fixtures/catalog_product_lookup.json
Normal file
4163
tests/components/xbox/fixtures/catalog_product_lookup.json
Normal file
File diff suppressed because it is too large
Load Diff
255
tests/components/xbox/fixtures/people_batch.json
Normal file
255
tests/components/xbox/fixtures/people_batch.json
Normal file
@@ -0,0 +1,255 @@
|
||||
{
|
||||
"people": [
|
||||
{
|
||||
"xuid": "271958441785640",
|
||||
"isFavorite": false,
|
||||
"isFollowingCaller": false,
|
||||
"isFollowedByCaller": false,
|
||||
"isIdentityShared": false,
|
||||
"addedDateTimeUtc": null,
|
||||
"displayName": null,
|
||||
"realName": "Test Test",
|
||||
"displayPicRaw": "https://images-eds-ssl.xboxlive.com/image?url=wHwbXKif8cus8csoZ03RW_ES.ojiJijNBGRVUbTnZKsoCCCkjlsEJrrMqDkYqs3M0aLOK2kxE9mbLm9M2.R0stAQYoDsGCDJxqDzG9WF3oa4rOCjEK7DbZXdBmBWnMrfErA3M_Q4y_mUTEQLqSAEeYFGlGeCXYsccnQMvEecxRg-&format=png",
|
||||
"showUserAsAvatar": "0",
|
||||
"gamertag": "GSR Ae",
|
||||
"gamerScore": "27750",
|
||||
"modernGamertag": "GSR Ae",
|
||||
"modernGamertagSuffix": "",
|
||||
"uniqueModernGamertag": "GSR Ae",
|
||||
"xboxOneRep": "GoodPlayer",
|
||||
"presenceState": "Offline",
|
||||
"presenceText": "Last seen 49m ago: Xbox App",
|
||||
"presenceDevices": null,
|
||||
"isBroadcasting": false,
|
||||
"isCloaked": false,
|
||||
"isQuarantined": false,
|
||||
"isXbox360Gamerpic": false,
|
||||
"lastSeenDateTimeUtc": "2020-10-09T00:12:27.8684906Z",
|
||||
"suggestion": null,
|
||||
"recommendation": null,
|
||||
"search": null,
|
||||
"titleHistory": null,
|
||||
"multiplayerSummary": {
|
||||
"InMultiplayerSession": 0,
|
||||
"InParty": 0
|
||||
},
|
||||
"recentPlayer": null,
|
||||
"follower": null,
|
||||
"preferredColor": {
|
||||
"primaryColor": "193e91",
|
||||
"secondaryColor": "101836",
|
||||
"tertiaryColor": "102c69"
|
||||
},
|
||||
"presenceDetails": [
|
||||
{
|
||||
"IsBroadcasting": false,
|
||||
"Device": "iOS",
|
||||
"PresenceText": "Last seen 49m ago: Xbox App",
|
||||
"State": "LastSeen",
|
||||
"TitleId": "328178078",
|
||||
"TitleType": null,
|
||||
"IsPrimary": true,
|
||||
"IsGame": false,
|
||||
"RichPresenceText": null
|
||||
}
|
||||
],
|
||||
"titlePresence": null,
|
||||
"titleSummaries": null,
|
||||
"presenceTitleIds": null,
|
||||
"detail": {
|
||||
"accountTier": "Gold",
|
||||
"bio": null,
|
||||
"isVerified": false,
|
||||
"location": null,
|
||||
"tenure": null,
|
||||
"watermarks": [],
|
||||
"blocked": false,
|
||||
"mute": false,
|
||||
"followerCount": 105,
|
||||
"followingCount": 121,
|
||||
"hasGamePass": false
|
||||
},
|
||||
"communityManagerTitles": null,
|
||||
"socialManager": null,
|
||||
"broadcast": null,
|
||||
"tournamentSummary": null,
|
||||
"avatar": null,
|
||||
"linkedAccounts": [],
|
||||
"colorTheme": "gamerpicblur",
|
||||
"preferredFlag": "",
|
||||
"preferredPlatforms": []
|
||||
},
|
||||
{
|
||||
"xuid": "277923030577271",
|
||||
"isFavorite": false,
|
||||
"isFollowingCaller": true,
|
||||
"isFollowedByCaller": true,
|
||||
"isIdentityShared": false,
|
||||
"addedDateTimeUtc": null,
|
||||
"displayName": null,
|
||||
"realName": "Test Test",
|
||||
"displayPicRaw": "https://images-eds-ssl.xboxlive.com/image?url=z951ykn43p4FqWbbFvR2Ec.8vbDhj8G2Xe7JngaTToBrrCmIEEXHC9UNrdJ6P7KIwuPiuIs6TLDV4WsQAGzSwgbaLlf_CiIdb0jJCiBao9CB40sjycuA5l0Jf.hfuP8l&format=png",
|
||||
"showUserAsAvatar": "2",
|
||||
"gamertag": "Iqnavs",
|
||||
"gamerScore": "48336",
|
||||
"modernGamertag": "Iqnavs",
|
||||
"modernGamertagSuffix": "",
|
||||
"uniqueModernGamertag": "Iqnavs",
|
||||
"xboxOneRep": "GoodPlayer",
|
||||
"presenceState": "Online",
|
||||
"presenceText": "Online",
|
||||
"presenceDevices": null,
|
||||
"isBroadcasting": false,
|
||||
"isCloaked": null,
|
||||
"isQuarantined": false,
|
||||
"isXbox360Gamerpic": false,
|
||||
"lastSeenDateTimeUtc": null,
|
||||
"suggestion": null,
|
||||
"recommendation": null,
|
||||
"search": null,
|
||||
"titleHistory": null,
|
||||
"multiplayerSummary": {
|
||||
"InMultiplayerSession": 0,
|
||||
"InParty": 0
|
||||
},
|
||||
"recentPlayer": null,
|
||||
"follower": null,
|
||||
"preferredColor": {
|
||||
"primaryColor": "193e91",
|
||||
"secondaryColor": "101836",
|
||||
"tertiaryColor": "102c69"
|
||||
},
|
||||
"presenceDetails": [
|
||||
{
|
||||
"IsBroadcasting": false,
|
||||
"Device": "WindowsOneCore",
|
||||
"PresenceText": "Online",
|
||||
"State": "Active",
|
||||
"TitleId": "1022622766",
|
||||
"TitleType": null,
|
||||
"IsPrimary": true,
|
||||
"IsGame": false,
|
||||
"RichPresenceText": null
|
||||
}
|
||||
],
|
||||
"titlePresence": null,
|
||||
"titleSummaries": null,
|
||||
"presenceTitleIds": null,
|
||||
"detail": {
|
||||
"accountTier": "Gold",
|
||||
"bio": null,
|
||||
"isVerified": false,
|
||||
"location": null,
|
||||
"tenure": null,
|
||||
"watermarks": [],
|
||||
"blocked": false,
|
||||
"mute": false,
|
||||
"followerCount": 78,
|
||||
"followingCount": 83,
|
||||
"hasGamePass": false
|
||||
},
|
||||
"communityManagerTitles": null,
|
||||
"socialManager": null,
|
||||
"broadcast": null,
|
||||
"tournamentSummary": null,
|
||||
"avatar": null,
|
||||
"linkedAccounts": [],
|
||||
"colorTheme": "gamerpicblur",
|
||||
"preferredFlag": "",
|
||||
"preferredPlatforms": []
|
||||
},
|
||||
{
|
||||
"xuid": "266932102913935",
|
||||
"isFavorite": false,
|
||||
"isFollowingCaller": false,
|
||||
"isFollowedByCaller": false,
|
||||
"isIdentityShared": false,
|
||||
"addedDateTimeUtc": null,
|
||||
"displayName": null,
|
||||
"realName": "Test Test",
|
||||
"displayPicRaw": "https://images-eds-ssl.xboxlive.com/image?url=z951ykn43p4FqWbbFvR2Ec.8vbDhj8G2Xe7JngaTToBrrCmIEEXHC9UNrdJ6P7KIl_5PaIHeJ592LG1L.uCOWneEDBhHctvuC06CzW38LKNYiVGTXqxcsQqYGIrr8hFz&format=png",
|
||||
"showUserAsAvatar": "2",
|
||||
"gamertag": "e",
|
||||
"gamerScore": "98096",
|
||||
"modernGamertag": "e",
|
||||
"modernGamertagSuffix": "",
|
||||
"uniqueModernGamertag": "e",
|
||||
"xboxOneRep": "Superstar",
|
||||
"presenceState": "Online",
|
||||
"presenceText": "Amazon Instant Video",
|
||||
"presenceDevices": null,
|
||||
"isBroadcasting": false,
|
||||
"isCloaked": null,
|
||||
"isQuarantined": false,
|
||||
"isXbox360Gamerpic": false,
|
||||
"lastSeenDateTimeUtc": null,
|
||||
"suggestion": null,
|
||||
"recommendation": null,
|
||||
"search": null,
|
||||
"titleHistory": null,
|
||||
"multiplayerSummary": {
|
||||
"InMultiplayerSession": 0,
|
||||
"InParty": 0
|
||||
},
|
||||
"recentPlayer": null,
|
||||
"follower": null,
|
||||
"preferredColor": {
|
||||
"primaryColor": "107c10",
|
||||
"secondaryColor": "102b14",
|
||||
"tertiaryColor": "155715"
|
||||
},
|
||||
"presenceDetails": [
|
||||
{
|
||||
"IsBroadcasting": false,
|
||||
"Device": "XboxOne",
|
||||
"PresenceText": "Home",
|
||||
"State": "Active",
|
||||
"TitleId": "750323071",
|
||||
"TitleType": null,
|
||||
"IsPrimary": false,
|
||||
"IsGame": false,
|
||||
"RichPresenceText": null
|
||||
},
|
||||
{
|
||||
"IsBroadcasting": false,
|
||||
"Device": "XboxOne",
|
||||
"PresenceText": "Amazon Instant Video",
|
||||
"State": "Active",
|
||||
"TitleId": "874889576",
|
||||
"TitleType": null,
|
||||
"IsPrimary": true,
|
||||
"IsGame": false,
|
||||
"RichPresenceText": null
|
||||
}
|
||||
],
|
||||
"titlePresence": null,
|
||||
"titleSummaries": null,
|
||||
"presenceTitleIds": null,
|
||||
"detail": {
|
||||
"accountTier": "Gold",
|
||||
"bio": null,
|
||||
"isVerified": false,
|
||||
"location": null,
|
||||
"tenure": null,
|
||||
"watermarks": [],
|
||||
"blocked": false,
|
||||
"mute": false,
|
||||
"followerCount": 27659,
|
||||
"followingCount": 0,
|
||||
"hasGamePass": false
|
||||
},
|
||||
"communityManagerTitles": null,
|
||||
"socialManager": null,
|
||||
"broadcast": null,
|
||||
"tournamentSummary": null,
|
||||
"avatar": null,
|
||||
"linkedAccounts": [],
|
||||
"colorTheme": "gamerpicblur",
|
||||
"preferredFlag": "",
|
||||
"preferredPlatforms": []
|
||||
}
|
||||
],
|
||||
"recommendationSummary": null,
|
||||
"friendFinderState": null,
|
||||
"accountLinkDetails": null
|
||||
}
|
197
tests/components/xbox/fixtures/people_friends_own.json
Normal file
197
tests/components/xbox/fixtures/people_friends_own.json
Normal file
@@ -0,0 +1,197 @@
|
||||
{
|
||||
"people": [
|
||||
{
|
||||
"xuid": "2533274838782903",
|
||||
"isFavorite": true,
|
||||
"isFollowingCaller": true,
|
||||
"isFollowedByCaller": true,
|
||||
"isIdentityShared": true,
|
||||
"addedDateTimeUtc": "2016-06-29T20:59:22.5050886Z",
|
||||
"displayName": "Ikken Hissatsuu",
|
||||
"realName": "",
|
||||
"displayPicRaw": "https://images-eds-ssl.xboxlive.com/image?url=7OTVnZUMVj4OV2zUUGecWvn3U00nQQLfK7_kwpANogj9vJpb.t4ZQMMLIWOuBZBBZs5MjD7okwh5Zwnit1SAtO3OAsFXxJc1ALIbaVoRo7gsiun9FdcaTpzkM60nqzT8ip1659eQpB1SLyupscP.ec_wAGvXwkhCcTKCNHQMrxg-&format=png",
|
||||
"showUserAsAvatar": "1",
|
||||
"gamertag": "Ikken Hissatsuu",
|
||||
"gamerScore": "27210",
|
||||
"modernGamertag": "Ikken Hissatsuu",
|
||||
"modernGamertagSuffix": "",
|
||||
"uniqueModernGamertag": "Ikken Hissatsuu",
|
||||
"xboxOneRep": "GoodPlayer",
|
||||
"presenceState": "Offline",
|
||||
"presenceText": "Offline",
|
||||
"presenceDevices": null,
|
||||
"isBroadcasting": false,
|
||||
"isCloaked": null,
|
||||
"isQuarantined": false,
|
||||
"isXbox360Gamerpic": false,
|
||||
"lastSeenDateTimeUtc": null,
|
||||
"suggestion": {
|
||||
"Type": null,
|
||||
"Priority": 0,
|
||||
"Reasons": null,
|
||||
"TitleId": null
|
||||
},
|
||||
"recommendation": null,
|
||||
"search": null,
|
||||
"titleHistory": null,
|
||||
"multiplayerSummary": {
|
||||
"InMultiplayerSession": 0,
|
||||
"InParty": 0
|
||||
},
|
||||
"recentPlayer": {
|
||||
"titles": [],
|
||||
"text": null
|
||||
},
|
||||
"follower": {
|
||||
"text": null,
|
||||
"followedDateTime": "0001-01-01T00:00:00"
|
||||
},
|
||||
"preferredColor": {
|
||||
"primaryColor": "744DA9",
|
||||
"secondaryColor": "24153B",
|
||||
"tertiaryColor": "4c208a"
|
||||
},
|
||||
"presenceDetails": [],
|
||||
"titlePresence": {
|
||||
"IsCurrentlyPlaying": false,
|
||||
"PresenceText": null,
|
||||
"TitleName": null,
|
||||
"TitleId": null
|
||||
},
|
||||
"titleSummaries": null,
|
||||
"presenceTitleIds": [],
|
||||
"detail": {
|
||||
"accountTier": "Gold",
|
||||
"bio": "Bio",
|
||||
"isVerified": false,
|
||||
"location": "Rock Hill",
|
||||
"tenure": "8",
|
||||
"watermarks": [],
|
||||
"blocked": false,
|
||||
"mute": false,
|
||||
"followerCount": 81,
|
||||
"followingCount": 73,
|
||||
"hasGamePass": false
|
||||
},
|
||||
"communityManagerTitles": null,
|
||||
"socialManager": {
|
||||
"titleIds": [],
|
||||
"pages": []
|
||||
},
|
||||
"broadcast": [],
|
||||
"tournamentSummary": null,
|
||||
"avatar": {
|
||||
"updateTimeOffset": "0001-01-01T00:00:00+00:00",
|
||||
"spritesheetMetadata": null
|
||||
},
|
||||
"linkedAccounts": [],
|
||||
"colorTheme": "gamerpicblur",
|
||||
"preferredFlag": "",
|
||||
"preferredPlatforms": []
|
||||
},
|
||||
{
|
||||
"xuid": "2533274913657542",
|
||||
"isFavorite": true,
|
||||
"isFollowingCaller": true,
|
||||
"isFollowedByCaller": true,
|
||||
"isIdentityShared": false,
|
||||
"addedDateTimeUtc": "2012-12-14T03:41:43.177Z",
|
||||
"displayName": "erics273",
|
||||
"realName": "",
|
||||
"displayPicRaw": "http://images-eds.xboxlive.com/image?url=rwljod2fPqLqGP3DBV9F_yK9iuxAt3_MH6tcOnQXTc8LY1LO8JeulzCEFHaqqItKdg9oJ84qjO.VNwvUWuq_iR5iTyx1gQsqHSvWLbqIrRI-&background=0xababab&mode=Padding&format=png",
|
||||
"showUserAsAvatar": "2",
|
||||
"gamertag": "erics273",
|
||||
"gamerScore": "3802",
|
||||
"modernGamertag": "erics273",
|
||||
"modernGamertagSuffix": "",
|
||||
"uniqueModernGamertag": "erics273",
|
||||
"xboxOneRep": "GoodPlayer",
|
||||
"presenceState": "Offline",
|
||||
"presenceText": "Last seen 17h ago: Home",
|
||||
"presenceDevices": null,
|
||||
"isBroadcasting": false,
|
||||
"isCloaked": null,
|
||||
"isQuarantined": false,
|
||||
"isXbox360Gamerpic": true,
|
||||
"lastSeenDateTimeUtc": "2020-10-08T04:19:58.3208237Z",
|
||||
"suggestion": {
|
||||
"Type": null,
|
||||
"Priority": 0,
|
||||
"Reasons": null,
|
||||
"TitleId": null
|
||||
},
|
||||
"recommendation": null,
|
||||
"search": null,
|
||||
"titleHistory": null,
|
||||
"multiplayerSummary": {
|
||||
"InMultiplayerSession": 0,
|
||||
"InParty": 0
|
||||
},
|
||||
"recentPlayer": {
|
||||
"titles": [],
|
||||
"text": null
|
||||
},
|
||||
"follower": {
|
||||
"text": null,
|
||||
"followedDateTime": "0001-01-01T00:00:00"
|
||||
},
|
||||
"preferredColor": {
|
||||
"primaryColor": "107c10",
|
||||
"secondaryColor": "102b14",
|
||||
"tertiaryColor": "155715"
|
||||
},
|
||||
"presenceDetails": [
|
||||
{
|
||||
"IsBroadcasting": false,
|
||||
"Device": "XboxOne",
|
||||
"PresenceText": "Last seen 17h ago: Home",
|
||||
"State": "LastSeen",
|
||||
"TitleId": "750323071",
|
||||
"TitleType": null,
|
||||
"IsPrimary": true,
|
||||
"IsGame": false,
|
||||
"RichPresenceText": null
|
||||
}
|
||||
],
|
||||
"titlePresence": {
|
||||
"IsCurrentlyPlaying": false,
|
||||
"PresenceText": null,
|
||||
"TitleName": null,
|
||||
"TitleId": null
|
||||
},
|
||||
"titleSummaries": null,
|
||||
"presenceTitleIds": ["750323071"],
|
||||
"detail": {
|
||||
"accountTier": "Silver",
|
||||
"bio": "",
|
||||
"isVerified": false,
|
||||
"location": "home",
|
||||
"tenure": "0",
|
||||
"watermarks": [],
|
||||
"blocked": false,
|
||||
"mute": false,
|
||||
"followerCount": 18,
|
||||
"followingCount": 12,
|
||||
"hasGamePass": false
|
||||
},
|
||||
"communityManagerTitles": null,
|
||||
"socialManager": {
|
||||
"titleIds": [],
|
||||
"pages": []
|
||||
},
|
||||
"broadcast": [],
|
||||
"tournamentSummary": null,
|
||||
"avatar": {
|
||||
"updateTimeOffset": "0001-01-01T00:00:00+00:00",
|
||||
"spritesheetMetadata": null
|
||||
},
|
||||
"linkedAccounts": [],
|
||||
"colorTheme": "gamerpicblur",
|
||||
"preferredFlag": "",
|
||||
"preferredPlatforms": []
|
||||
}
|
||||
],
|
||||
"recommendationSummary": null,
|
||||
"friendFinderState": null,
|
||||
"accountLinkDetails": null
|
||||
}
|
54
tests/components/xbox/fixtures/smartglass_console_list.json
Normal file
54
tests/components/xbox/fixtures/smartglass_console_list.json
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"status": {
|
||||
"errorCode": "OK",
|
||||
"errorMessage": null
|
||||
},
|
||||
"result": [
|
||||
{
|
||||
"id": "ABCDEFG",
|
||||
"name": "XONEX",
|
||||
"locale": "en-US",
|
||||
"consoleType": "XboxOneX",
|
||||
"powerState": "ConnectedStandby",
|
||||
"digitalAssistantRemoteControlEnabled": true,
|
||||
"remoteManagementEnabled": true,
|
||||
"consoleStreamingEnabled": false,
|
||||
"storageDevices": [
|
||||
{
|
||||
"storageDeviceId": "1",
|
||||
"storageDeviceName": "Internal",
|
||||
"isDefault": true,
|
||||
"freeSpaceBytes": 236267835392.0,
|
||||
"totalSpaceBytes": 838592360448.0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "HIJKLMN",
|
||||
"name": "XONE",
|
||||
"locale": "en-US",
|
||||
"consoleType": "XboxOne",
|
||||
"powerState": "ConnectedStandby",
|
||||
"digitalAssistantRemoteControlEnabled": true,
|
||||
"remoteManagementEnabled": true,
|
||||
"consoleStreamingEnabled": false,
|
||||
"storageDevices": [
|
||||
{
|
||||
"storageDeviceId": "2",
|
||||
"storageDeviceName": "Internal",
|
||||
"isDefault": false,
|
||||
"freeSpaceBytes": 147163541504.0,
|
||||
"totalSpaceBytes": 391915761664.0
|
||||
},
|
||||
{
|
||||
"storageDeviceId": "3",
|
||||
"storageDeviceName": "External",
|
||||
"isDefault": true,
|
||||
"freeSpaceBytes": 3200714067968.0,
|
||||
"totalSpaceBytes": 4000787029504.0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"agentUserId": null
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"status": {
|
||||
"errorCode": "OK",
|
||||
"errorMessage": null
|
||||
},
|
||||
"powerState": "ConnectedStandby",
|
||||
"playbackState": "Stopped",
|
||||
"loginState": null,
|
||||
"focusAppAumid": "4DF9E0F8.Netflix_mcm4njqhnhss8!App",
|
||||
"isTvConfigured": true,
|
||||
"digitalAssistantRemoteControlEnabled": true,
|
||||
"consoleStreamingEnabled": false,
|
||||
"remoteManagementEnabled": true
|
||||
}
|
589
tests/components/xbox/snapshots/test_binary_sensor.ambr
Normal file
589
tests/components/xbox/snapshots/test_binary_sensor.ambr
Normal file
@@ -0,0 +1,589 @@
|
||||
# serializer version: 1
|
||||
# name: test_binary_sensors[binary_sensor.erics273-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'binary_sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'binary_sensor.erics273',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'erics273',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2533274913657542_online',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.erics273-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=rwljod2fPqLqGP3DBV9F_yK9iuxAt3_MH6tcOnQXTc8LY1LO8JeulzCEFHaqqItKdg9oJ84qjO.VNwvUWuq_iR5iTyx1gQsqHSvWLbqIrRI-&background=0xababab&format=png',
|
||||
'friendly_name': 'erics273',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.erics273',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.erics273_in_game-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'binary_sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'binary_sensor.erics273_in_game',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'erics273 In Game',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2533274913657542_in_game',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.erics273_in_game-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=rwljod2fPqLqGP3DBV9F_yK9iuxAt3_MH6tcOnQXTc8LY1LO8JeulzCEFHaqqItKdg9oJ84qjO.VNwvUWuq_iR5iTyx1gQsqHSvWLbqIrRI-&background=0xababab&format=png',
|
||||
'friendly_name': 'erics273 In Game',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.erics273_in_game',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.erics273_in_multiplayer-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'binary_sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'binary_sensor.erics273_in_multiplayer',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'erics273 In Multiplayer',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2533274913657542_in_multiplayer',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.erics273_in_multiplayer-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=rwljod2fPqLqGP3DBV9F_yK9iuxAt3_MH6tcOnQXTc8LY1LO8JeulzCEFHaqqItKdg9oJ84qjO.VNwvUWuq_iR5iTyx1gQsqHSvWLbqIrRI-&background=0xababab&format=png',
|
||||
'friendly_name': 'erics273 In Multiplayer',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.erics273_in_multiplayer',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.erics273_in_party-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'binary_sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'binary_sensor.erics273_in_party',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'erics273 In Party',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2533274913657542_in_party',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.erics273_in_party-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=rwljod2fPqLqGP3DBV9F_yK9iuxAt3_MH6tcOnQXTc8LY1LO8JeulzCEFHaqqItKdg9oJ84qjO.VNwvUWuq_iR5iTyx1gQsqHSvWLbqIrRI-&background=0xababab&format=png',
|
||||
'friendly_name': 'erics273 In Party',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.erics273_in_party',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.gsr_ae-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'binary_sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'binary_sensor.gsr_ae',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'GSR Ae',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '271958441785640_online',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.gsr_ae-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=wHwbXKif8cus8csoZ03RW_ES.ojiJijNBGRVUbTnZKsoCCCkjlsEJrrMqDkYqs3M0aLOK2kxE9mbLm9M2.R0stAQYoDsGCDJxqDzG9WF3oa4rOCjEK7DbZXdBmBWnMrfErA3M_Q4y_mUTEQLqSAEeYFGlGeCXYsccnQMvEecxRg-&format=png',
|
||||
'friendly_name': 'GSR Ae',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.gsr_ae',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.gsr_ae_in_game-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'binary_sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'binary_sensor.gsr_ae_in_game',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'GSR Ae In Game',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '271958441785640_in_game',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.gsr_ae_in_game-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=wHwbXKif8cus8csoZ03RW_ES.ojiJijNBGRVUbTnZKsoCCCkjlsEJrrMqDkYqs3M0aLOK2kxE9mbLm9M2.R0stAQYoDsGCDJxqDzG9WF3oa4rOCjEK7DbZXdBmBWnMrfErA3M_Q4y_mUTEQLqSAEeYFGlGeCXYsccnQMvEecxRg-&format=png',
|
||||
'friendly_name': 'GSR Ae In Game',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.gsr_ae_in_game',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.gsr_ae_in_multiplayer-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'binary_sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'binary_sensor.gsr_ae_in_multiplayer',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'GSR Ae In Multiplayer',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '271958441785640_in_multiplayer',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.gsr_ae_in_multiplayer-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=wHwbXKif8cus8csoZ03RW_ES.ojiJijNBGRVUbTnZKsoCCCkjlsEJrrMqDkYqs3M0aLOK2kxE9mbLm9M2.R0stAQYoDsGCDJxqDzG9WF3oa4rOCjEK7DbZXdBmBWnMrfErA3M_Q4y_mUTEQLqSAEeYFGlGeCXYsccnQMvEecxRg-&format=png',
|
||||
'friendly_name': 'GSR Ae In Multiplayer',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.gsr_ae_in_multiplayer',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.gsr_ae_in_party-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'binary_sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'binary_sensor.gsr_ae_in_party',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'GSR Ae In Party',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '271958441785640_in_party',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.gsr_ae_in_party-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=wHwbXKif8cus8csoZ03RW_ES.ojiJijNBGRVUbTnZKsoCCCkjlsEJrrMqDkYqs3M0aLOK2kxE9mbLm9M2.R0stAQYoDsGCDJxqDzG9WF3oa4rOCjEK7DbZXdBmBWnMrfErA3M_Q4y_mUTEQLqSAEeYFGlGeCXYsccnQMvEecxRg-&format=png',
|
||||
'friendly_name': 'GSR Ae In Party',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.gsr_ae_in_party',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.ikken_hissatsuu-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'binary_sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'binary_sensor.ikken_hissatsuu',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Ikken Hissatsuu',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2533274838782903_online',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.ikken_hissatsuu-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=7OTVnZUMVj4OV2zUUGecWvn3U00nQQLfK7_kwpANogj9vJpb.t4ZQMMLIWOuBZBBZs5MjD7okwh5Zwnit1SAtO3OAsFXxJc1ALIbaVoRo7gsiun9FdcaTpzkM60nqzT8ip1659eQpB1SLyupscP.ec_wAGvXwkhCcTKCNHQMrxg-&format=png',
|
||||
'friendly_name': 'Ikken Hissatsuu',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.ikken_hissatsuu',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.ikken_hissatsuu_in_game-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'binary_sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'binary_sensor.ikken_hissatsuu_in_game',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Ikken Hissatsuu In Game',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2533274838782903_in_game',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.ikken_hissatsuu_in_game-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=7OTVnZUMVj4OV2zUUGecWvn3U00nQQLfK7_kwpANogj9vJpb.t4ZQMMLIWOuBZBBZs5MjD7okwh5Zwnit1SAtO3OAsFXxJc1ALIbaVoRo7gsiun9FdcaTpzkM60nqzT8ip1659eQpB1SLyupscP.ec_wAGvXwkhCcTKCNHQMrxg-&format=png',
|
||||
'friendly_name': 'Ikken Hissatsuu In Game',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.ikken_hissatsuu_in_game',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.ikken_hissatsuu_in_multiplayer-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'binary_sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'binary_sensor.ikken_hissatsuu_in_multiplayer',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Ikken Hissatsuu In Multiplayer',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2533274838782903_in_multiplayer',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.ikken_hissatsuu_in_multiplayer-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=7OTVnZUMVj4OV2zUUGecWvn3U00nQQLfK7_kwpANogj9vJpb.t4ZQMMLIWOuBZBBZs5MjD7okwh5Zwnit1SAtO3OAsFXxJc1ALIbaVoRo7gsiun9FdcaTpzkM60nqzT8ip1659eQpB1SLyupscP.ec_wAGvXwkhCcTKCNHQMrxg-&format=png',
|
||||
'friendly_name': 'Ikken Hissatsuu In Multiplayer',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.ikken_hissatsuu_in_multiplayer',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.ikken_hissatsuu_in_party-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'binary_sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'binary_sensor.ikken_hissatsuu_in_party',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Ikken Hissatsuu In Party',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2533274838782903_in_party',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_binary_sensors[binary_sensor.ikken_hissatsuu_in_party-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=7OTVnZUMVj4OV2zUUGecWvn3U00nQQLfK7_kwpANogj9vJpb.t4ZQMMLIWOuBZBBZs5MjD7okwh5Zwnit1SAtO3OAsFXxJc1ALIbaVoRo7gsiun9FdcaTpzkM60nqzT8ip1659eQpB1SLyupscP.ec_wAGvXwkhCcTKCNHQMrxg-&format=png',
|
||||
'friendly_name': 'Ikken Hissatsuu In Party',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.ikken_hissatsuu_in_party',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
589
tests/components/xbox/snapshots/test_sensor.ambr
Normal file
589
tests/components/xbox/snapshots/test_sensor.ambr
Normal file
@@ -0,0 +1,589 @@
|
||||
# serializer version: 1
|
||||
# name: test_sensors[sensor.erics273_account_tier-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.erics273_account_tier',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'erics273 Account Tier',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2533274913657542_account_tier',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.erics273_account_tier-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=rwljod2fPqLqGP3DBV9F_yK9iuxAt3_MH6tcOnQXTc8LY1LO8JeulzCEFHaqqItKdg9oJ84qjO.VNwvUWuq_iR5iTyx1gQsqHSvWLbqIrRI-&background=0xababab&format=png',
|
||||
'friendly_name': 'erics273 Account Tier',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.erics273_account_tier',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'Silver',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.erics273_gamer_score-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.erics273_gamer_score',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'erics273 Gamer Score',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2533274913657542_gamer_score',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.erics273_gamer_score-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=rwljod2fPqLqGP3DBV9F_yK9iuxAt3_MH6tcOnQXTc8LY1LO8JeulzCEFHaqqItKdg9oJ84qjO.VNwvUWuq_iR5iTyx1gQsqHSvWLbqIrRI-&background=0xababab&format=png',
|
||||
'friendly_name': 'erics273 Gamer Score',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.erics273_gamer_score',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '3802',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.erics273_gold_tenure-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.erics273_gold_tenure',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'erics273 Gold Tenure',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2533274913657542_gold_tenure',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.erics273_gold_tenure-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=rwljod2fPqLqGP3DBV9F_yK9iuxAt3_MH6tcOnQXTc8LY1LO8JeulzCEFHaqqItKdg9oJ84qjO.VNwvUWuq_iR5iTyx1gQsqHSvWLbqIrRI-&background=0xababab&format=png',
|
||||
'friendly_name': 'erics273 Gold Tenure',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.erics273_gold_tenure',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '0',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.erics273_status-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.erics273_status',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'erics273 Status',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2533274913657542_status',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.erics273_status-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=rwljod2fPqLqGP3DBV9F_yK9iuxAt3_MH6tcOnQXTc8LY1LO8JeulzCEFHaqqItKdg9oJ84qjO.VNwvUWuq_iR5iTyx1gQsqHSvWLbqIrRI-&background=0xababab&format=png',
|
||||
'friendly_name': 'erics273 Status',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.erics273_status',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'Last seen 17h ago: Home',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.gsr_ae_account_tier-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.gsr_ae_account_tier',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'GSR Ae Account Tier',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '271958441785640_account_tier',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.gsr_ae_account_tier-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=wHwbXKif8cus8csoZ03RW_ES.ojiJijNBGRVUbTnZKsoCCCkjlsEJrrMqDkYqs3M0aLOK2kxE9mbLm9M2.R0stAQYoDsGCDJxqDzG9WF3oa4rOCjEK7DbZXdBmBWnMrfErA3M_Q4y_mUTEQLqSAEeYFGlGeCXYsccnQMvEecxRg-&format=png',
|
||||
'friendly_name': 'GSR Ae Account Tier',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.gsr_ae_account_tier',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'Gold',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.gsr_ae_gamer_score-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.gsr_ae_gamer_score',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'GSR Ae Gamer Score',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '271958441785640_gamer_score',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.gsr_ae_gamer_score-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=wHwbXKif8cus8csoZ03RW_ES.ojiJijNBGRVUbTnZKsoCCCkjlsEJrrMqDkYqs3M0aLOK2kxE9mbLm9M2.R0stAQYoDsGCDJxqDzG9WF3oa4rOCjEK7DbZXdBmBWnMrfErA3M_Q4y_mUTEQLqSAEeYFGlGeCXYsccnQMvEecxRg-&format=png',
|
||||
'friendly_name': 'GSR Ae Gamer Score',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.gsr_ae_gamer_score',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '27750',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.gsr_ae_gold_tenure-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.gsr_ae_gold_tenure',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'GSR Ae Gold Tenure',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '271958441785640_gold_tenure',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.gsr_ae_gold_tenure-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=wHwbXKif8cus8csoZ03RW_ES.ojiJijNBGRVUbTnZKsoCCCkjlsEJrrMqDkYqs3M0aLOK2kxE9mbLm9M2.R0stAQYoDsGCDJxqDzG9WF3oa4rOCjEK7DbZXdBmBWnMrfErA3M_Q4y_mUTEQLqSAEeYFGlGeCXYsccnQMvEecxRg-&format=png',
|
||||
'friendly_name': 'GSR Ae Gold Tenure',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.gsr_ae_gold_tenure',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unknown',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.gsr_ae_status-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.gsr_ae_status',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'GSR Ae Status',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '271958441785640_status',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.gsr_ae_status-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=wHwbXKif8cus8csoZ03RW_ES.ojiJijNBGRVUbTnZKsoCCCkjlsEJrrMqDkYqs3M0aLOK2kxE9mbLm9M2.R0stAQYoDsGCDJxqDzG9WF3oa4rOCjEK7DbZXdBmBWnMrfErA3M_Q4y_mUTEQLqSAEeYFGlGeCXYsccnQMvEecxRg-&format=png',
|
||||
'friendly_name': 'GSR Ae Status',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.gsr_ae_status',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'Last seen 49m ago: Xbox App',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.ikken_hissatsuu_account_tier-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.ikken_hissatsuu_account_tier',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Ikken Hissatsuu Account Tier',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2533274838782903_account_tier',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.ikken_hissatsuu_account_tier-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=7OTVnZUMVj4OV2zUUGecWvn3U00nQQLfK7_kwpANogj9vJpb.t4ZQMMLIWOuBZBBZs5MjD7okwh5Zwnit1SAtO3OAsFXxJc1ALIbaVoRo7gsiun9FdcaTpzkM60nqzT8ip1659eQpB1SLyupscP.ec_wAGvXwkhCcTKCNHQMrxg-&format=png',
|
||||
'friendly_name': 'Ikken Hissatsuu Account Tier',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.ikken_hissatsuu_account_tier',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'Gold',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.ikken_hissatsuu_gamer_score-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.ikken_hissatsuu_gamer_score',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Ikken Hissatsuu Gamer Score',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2533274838782903_gamer_score',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.ikken_hissatsuu_gamer_score-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=7OTVnZUMVj4OV2zUUGecWvn3U00nQQLfK7_kwpANogj9vJpb.t4ZQMMLIWOuBZBBZs5MjD7okwh5Zwnit1SAtO3OAsFXxJc1ALIbaVoRo7gsiun9FdcaTpzkM60nqzT8ip1659eQpB1SLyupscP.ec_wAGvXwkhCcTKCNHQMrxg-&format=png',
|
||||
'friendly_name': 'Ikken Hissatsuu Gamer Score',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.ikken_hissatsuu_gamer_score',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '27210',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.ikken_hissatsuu_gold_tenure-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.ikken_hissatsuu_gold_tenure',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Ikken Hissatsuu Gold Tenure',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2533274838782903_gold_tenure',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.ikken_hissatsuu_gold_tenure-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=7OTVnZUMVj4OV2zUUGecWvn3U00nQQLfK7_kwpANogj9vJpb.t4ZQMMLIWOuBZBBZs5MjD7okwh5Zwnit1SAtO3OAsFXxJc1ALIbaVoRo7gsiun9FdcaTpzkM60nqzT8ip1659eQpB1SLyupscP.ec_wAGvXwkhCcTKCNHQMrxg-&format=png',
|
||||
'friendly_name': 'Ikken Hissatsuu Gold Tenure',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.ikken_hissatsuu_gold_tenure',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '8',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.ikken_hissatsuu_status-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.ikken_hissatsuu_status',
|
||||
'has_entity_name': False,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Ikken Hissatsuu Status',
|
||||
'platform': 'xbox',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '2533274838782903_status',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.ikken_hissatsuu_status-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'entity_picture': 'https://images-eds-ssl.xboxlive.com/image?url=7OTVnZUMVj4OV2zUUGecWvn3U00nQQLfK7_kwpANogj9vJpb.t4ZQMMLIWOuBZBBZs5MjD7okwh5Zwnit1SAtO3OAsFXxJc1ALIbaVoRo7gsiun9FdcaTpzkM60nqzT8ip1659eQpB1SLyupscP.ec_wAGvXwkhCcTKCNHQMrxg-&format=png',
|
||||
'friendly_name': 'Ikken Hissatsuu Status',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.ikken_hissatsuu_status',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'Offline',
|
||||
})
|
||||
# ---
|
42
tests/components/xbox/test_binary_sensor.py
Normal file
42
tests/components/xbox/test_binary_sensor.py
Normal file
@@ -0,0 +1,42 @@
|
||||
"""Test the Xbox binary_sensor platform."""
|
||||
|
||||
from collections.abc import Generator
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from syrupy.assertion import SnapshotAssertion
|
||||
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
||||
from tests.common import MockConfigEntry, snapshot_platform
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def binary_sensor_only() -> Generator[None]:
|
||||
"""Enable only the binary_sensor platform."""
|
||||
with patch(
|
||||
"homeassistant.components.xbox.PLATFORMS",
|
||||
[Platform.BINARY_SENSOR],
|
||||
):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("xbox_live_client", "entity_registry_enabled_by_default")
|
||||
async def test_binary_sensors(
|
||||
hass: HomeAssistant,
|
||||
config_entry: MockConfigEntry,
|
||||
snapshot: SnapshotAssertion,
|
||||
entity_registry: er.EntityRegistry,
|
||||
) -> None:
|
||||
"""Test setup of the Xbox binary_sensor platform."""
|
||||
|
||||
config_entry.add_to_hass(hass)
|
||||
await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert config_entry.state is ConfigEntryState.LOADED
|
||||
|
||||
await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id)
|
@@ -5,23 +5,18 @@ from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant import config_entries, setup
|
||||
from homeassistant.components.application_credentials import (
|
||||
ClientCredential,
|
||||
async_import_client_credential,
|
||||
)
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.components.xbox.const import DOMAIN, OAUTH2_AUTHORIZE, OAUTH2_TOKEN
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.data_entry_flow import FlowResultType
|
||||
from homeassistant.helpers import config_entry_oauth2_flow
|
||||
|
||||
from .conftest import CLIENT_ID
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||
from tests.typing import ClientSessionGenerator
|
||||
|
||||
CLIENT_ID = "1234"
|
||||
CLIENT_SECRET = "5678"
|
||||
|
||||
|
||||
async def test_abort_if_existing_entry(hass: HomeAssistant) -> None:
|
||||
"""Check flow abort when an entry already exist."""
|
||||
@@ -41,10 +36,6 @@ async def test_full_flow(
|
||||
aioclient_mock: AiohttpClientMocker,
|
||||
) -> None:
|
||||
"""Check full flow."""
|
||||
assert await setup.async_setup_component(hass, "application_credentials", {})
|
||||
await async_import_client_credential(
|
||||
hass, DOMAIN, ClientCredential(CLIENT_ID, CLIENT_SECRET), "imported-cred"
|
||||
)
|
||||
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
"xbox", context={"source": config_entries.SOURCE_USER}
|
||||
|
42
tests/components/xbox/test_sensor.py
Normal file
42
tests/components/xbox/test_sensor.py
Normal file
@@ -0,0 +1,42 @@
|
||||
"""Test the Xbox sensor platform."""
|
||||
|
||||
from collections.abc import Generator
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from syrupy.assertion import SnapshotAssertion
|
||||
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
||||
from tests.common import MockConfigEntry, snapshot_platform
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def sensor_only() -> Generator[None]:
|
||||
"""Enable only the sensor platform."""
|
||||
with patch(
|
||||
"homeassistant.components.xbox.PLATFORMS",
|
||||
[Platform.SENSOR],
|
||||
):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("xbox_live_client", "entity_registry_enabled_by_default")
|
||||
async def test_sensors(
|
||||
hass: HomeAssistant,
|
||||
config_entry: MockConfigEntry,
|
||||
snapshot: SnapshotAssertion,
|
||||
entity_registry: er.EntityRegistry,
|
||||
) -> None:
|
||||
"""Test setup of the Xbox sensor platform."""
|
||||
|
||||
config_entry.add_to_hass(hass)
|
||||
await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert config_entry.state is ConfigEntryState.LOADED
|
||||
|
||||
await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id)
|
@@ -458,6 +458,7 @@ async def test_assist_api_prompt(
|
||||
connections={("test", "1234")},
|
||||
suggested_area="Test Area",
|
||||
)
|
||||
device_registry.async_update_device(device.id, name_by_user="Friendly Device")
|
||||
area = area_registry.async_get_area_by_name("Test Area")
|
||||
area_registry.async_update(area.id, aliases=["Alternative name"])
|
||||
entry1 = entity_registry.async_get_or_create(
|
||||
@@ -575,9 +576,9 @@ async def test_assist_api_prompt(
|
||||
device_registry.async_get_or_create(
|
||||
config_entry_id=entry.entry_id,
|
||||
connections={("test", "9876-integer-values")},
|
||||
name=1,
|
||||
manufacturer=2,
|
||||
model=3,
|
||||
name="1",
|
||||
manufacturer="2",
|
||||
model="3",
|
||||
suggested_area="Test Area 2",
|
||||
)
|
||||
)
|
||||
@@ -595,10 +596,12 @@ async def test_assist_api_prompt(
|
||||
- names: Living Room
|
||||
domain: light
|
||||
state: 'on'
|
||||
device: Friendly Device
|
||||
areas: Test Area, Alternative name
|
||||
- names: Test Device, my test light
|
||||
domain: light
|
||||
state: unavailable
|
||||
device: Friendly Device
|
||||
areas: Test Area, Alternative name
|
||||
- names: Test Device 2
|
||||
domain: light
|
||||
@@ -637,9 +640,11 @@ async def test_assist_api_prompt(
|
||||
domain: light
|
||||
- names: Living Room
|
||||
domain: light
|
||||
device: Friendly Device
|
||||
areas: Test Area, Alternative name
|
||||
- names: Test Device, my test light
|
||||
domain: light
|
||||
device: Friendly Device
|
||||
areas: Test Area, Alternative name
|
||||
- names: Test Device 2
|
||||
domain: light
|
||||
|
Reference in New Issue
Block a user