mirror of
https://github.com/home-assistant/core.git
synced 2026-08-20 13:19:54 +01:00
Fix TypeError for unconfigured accounts in Steam integration (#179443)
This commit is contained in:
@@ -26,7 +26,7 @@ class PlayerData:
|
||||
|
||||
steamid: str
|
||||
communityvisibilitystate: int
|
||||
profilestate: int
|
||||
profilestate: int | None = None
|
||||
personaname: str
|
||||
commentpermission: int | None = None
|
||||
profileurl: str
|
||||
@@ -34,7 +34,7 @@ class PlayerData:
|
||||
avatarmedium: str
|
||||
avatarfull: str
|
||||
avatarhash: str
|
||||
lastlogoff: int
|
||||
lastlogoff: int | None = None
|
||||
personastate: int
|
||||
realname: str | None = None
|
||||
primaryclanid: str | None = None
|
||||
@@ -47,6 +47,7 @@ class PlayerData:
|
||||
gameid: str | None = None
|
||||
lobbysteamid: str | None = None
|
||||
gameserverip: str | None = None
|
||||
gameserversteamid: str | None = None
|
||||
level: int | None = None
|
||||
|
||||
|
||||
|
||||
@@ -86,14 +86,24 @@ SENSOR_DESCRIPTIONS: tuple[SteamSensorEntityDescription, ...] = (
|
||||
if x.gameid is not None and (info := icons.get(x.gameid)) is not None
|
||||
else None
|
||||
),
|
||||
"last_online": dt_util.utc_from_timestamp(x.lastlogoff),
|
||||
"last_online": (
|
||||
dt_util.utc_from_timestamp(x.lastlogoff)
|
||||
if x.lastlogoff is not None
|
||||
else None
|
||||
),
|
||||
"level": x.level,
|
||||
},
|
||||
),
|
||||
SteamSensorEntityDescription(
|
||||
key=SteamSensor.LAST_ONLINE,
|
||||
translation_key=SteamSensor.LAST_ONLINE,
|
||||
value_fn=(lambda x: dt_util.utc_from_timestamp(x.lastlogoff)),
|
||||
value_fn=(
|
||||
lambda x: (
|
||||
dt_util.utc_from_timestamp(x.lastlogoff)
|
||||
if x.lastlogoff is not None
|
||||
else None
|
||||
)
|
||||
),
|
||||
device_class=SensorDeviceClass.TIMESTAMP,
|
||||
),
|
||||
SteamSensorEntityDescription(
|
||||
|
||||
@@ -27,6 +27,12 @@ def mock_config_entry() -> MockConfigEntry:
|
||||
title=ACCOUNT_NAME_2,
|
||||
unique_id=ACCOUNT_2,
|
||||
),
|
||||
ConfigSubentryData(
|
||||
data={},
|
||||
subentry_type=SUBENTRY_TYPE_FRIEND,
|
||||
title="unconfigured_account",
|
||||
unique_id="1234567890",
|
||||
),
|
||||
],
|
||||
version=3,
|
||||
)
|
||||
|
||||
@@ -37,6 +37,20 @@
|
||||
"personastate": 2,
|
||||
"timecreated": 1303243041,
|
||||
"personastateflags": 0
|
||||
},
|
||||
{
|
||||
"steamid": "1234567890",
|
||||
"communityvisibilitystate": 3,
|
||||
"personaname": "unconfigured_account",
|
||||
"profileurl": "https://steamcommunity.com/profiles/1234567890/",
|
||||
"avatar": "https://avatars.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb.jpg",
|
||||
"avatarmedium": "https://avatars.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_medium.jpg",
|
||||
"avatarfull": "https://avatars.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg",
|
||||
"avatarhash": "fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb",
|
||||
"personastate": 0,
|
||||
"primaryclanid": "1234567890",
|
||||
"timecreated": 1786993711,
|
||||
"personastateflags": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1030,3 +1030,514 @@
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_app_icon-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'image',
|
||||
'entity_category': None,
|
||||
'entity_id': 'image.unconfigured_account_app_icon',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'App icon',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'App icon',
|
||||
'platform': 'steam_online',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': <SteamImage.APP_ICON: 'app_icon'>,
|
||||
'unique_id': '1234567890_app_icon',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_app_icon-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.ENTITY_PICTURE: 'entity_picture'>: '/api/image_proxy/image.unconfigured_account_app_icon?token=520',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'unconfigured_account App icon',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'image.unconfigured_account_app_icon',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_avatar-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'image',
|
||||
'entity_category': None,
|
||||
'entity_id': 'image.unconfigured_account_avatar',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'Avatar',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Avatar',
|
||||
'platform': 'steam_online',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': <SteamImage.AVATAR: 'avatar'>,
|
||||
'unique_id': '1234567890_avatar',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_avatar-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<ImageEntityStateAttribute.ACCESS_TOKEN: 'access_token'>: '520',
|
||||
<EntityStateAttribute.ENTITY_PICTURE: 'entity_picture'>: '/api/image_proxy/image.unconfigured_account_avatar?token=520',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'unconfigured_account Avatar',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'image.unconfigured_account_avatar',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '2013-12-13T12:13:12+00:00',
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_header_capsule-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'image',
|
||||
'entity_category': None,
|
||||
'entity_id': 'image.unconfigured_account_header_capsule',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'Header capsule',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Header capsule',
|
||||
'platform': 'steam_online',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': <SteamImage.HEADER_CAPSULE: 'header_capsule'>,
|
||||
'unique_id': '1234567890_header_capsule',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_header_capsule-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.ENTITY_PICTURE: 'entity_picture'>: '/api/image_proxy/image.unconfigured_account_header_capsule?token=520',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'unconfigured_account Header capsule',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'image.unconfigured_account_header_capsule',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_library_capsule-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'image',
|
||||
'entity_category': None,
|
||||
'entity_id': 'image.unconfigured_account_library_capsule',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'Library capsule',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Library capsule',
|
||||
'platform': 'steam_online',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': <SteamImage.LIBRARY_CAPSULE: 'library_capsule'>,
|
||||
'unique_id': '1234567890_library_capsule',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_library_capsule-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.ENTITY_PICTURE: 'entity_picture'>: '/api/image_proxy/image.unconfigured_account_library_capsule?token=520',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'unconfigured_account Library capsule',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'image.unconfigured_account_library_capsule',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_library_hero_capsule-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'image',
|
||||
'entity_category': None,
|
||||
'entity_id': 'image.unconfigured_account_library_hero_capsule',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'Library hero capsule',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Library hero capsule',
|
||||
'platform': 'steam_online',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': <SteamImage.LIBRARY_HERO: 'library_hero'>,
|
||||
'unique_id': '1234567890_library_hero',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_library_hero_capsule-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.ENTITY_PICTURE: 'entity_picture'>: '/api/image_proxy/image.unconfigured_account_library_hero_capsule?token=520',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'unconfigured_account Library hero capsule',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'image.unconfigured_account_library_hero_capsule',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_library_logo-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'image',
|
||||
'entity_category': None,
|
||||
'entity_id': 'image.unconfigured_account_library_logo',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'Library logo',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Library logo',
|
||||
'platform': 'steam_online',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': <SteamImage.LIBRARY_LOGO: 'library_logo'>,
|
||||
'unique_id': '1234567890_library_logo',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_library_logo-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.ENTITY_PICTURE: 'entity_picture'>: '/api/image_proxy/image.unconfigured_account_library_logo?token=520',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'unconfigured_account Library logo',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'image.unconfigured_account_library_logo',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_main_capsule-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'image',
|
||||
'entity_category': None,
|
||||
'entity_id': 'image.unconfigured_account_main_capsule',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'Main capsule',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Main capsule',
|
||||
'platform': 'steam_online',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': <SteamImage.MAIN_CAPSULE: 'main_capsule'>,
|
||||
'unique_id': '1234567890_main_capsule',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_main_capsule-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.ENTITY_PICTURE: 'entity_picture'>: '/api/image_proxy/image.unconfigured_account_main_capsule?token=520',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'unconfigured_account Main capsule',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'image.unconfigured_account_main_capsule',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_page_background-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'image',
|
||||
'entity_category': None,
|
||||
'entity_id': 'image.unconfigured_account_page_background',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'Page background',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Page background',
|
||||
'platform': 'steam_online',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': <SteamImage.PAGE_BACKGROUND: 'page_background'>,
|
||||
'unique_id': '1234567890_page_background',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_page_background-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.ENTITY_PICTURE: 'entity_picture'>: '/api/image_proxy/image.unconfigured_account_page_background?token=520',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'unconfigured_account Page background',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'image.unconfigured_account_page_background',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_small_capsule-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'image',
|
||||
'entity_category': None,
|
||||
'entity_id': 'image.unconfigured_account_small_capsule',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'Small capsule',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Small capsule',
|
||||
'platform': 'steam_online',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': <SteamImage.SMALL_CAPSULE: 'small_capsule'>,
|
||||
'unique_id': '1234567890_small_capsule',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_small_capsule-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.ENTITY_PICTURE: 'entity_picture'>: '/api/image_proxy/image.unconfigured_account_small_capsule?token=520',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'unconfigured_account Small capsule',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'image.unconfigured_account_small_capsule',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_vertical_capsule-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'image',
|
||||
'entity_category': None,
|
||||
'entity_id': 'image.unconfigured_account_vertical_capsule',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'Vertical capsule',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Vertical capsule',
|
||||
'platform': 'steam_online',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': <SteamImage.VERTICAL_CAPSULE: 'vertical_capsule'>,
|
||||
'unique_id': '1234567890_vertical_capsule',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_images[image.unconfigured_account_vertical_capsule-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.ENTITY_PICTURE: 'entity_picture'>: '/api/image_proxy/image.unconfigured_account_vertical_capsule?token=520',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'unconfigured_account Vertical capsule',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'image.unconfigured_account_vertical_capsule',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
|
||||
@@ -470,3 +470,238 @@
|
||||
'state': 'unknown',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.unconfigured_account-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
<SensorEntityCapabilityAttribute.OPTIONS: 'options'>: list([
|
||||
'offline',
|
||||
'online',
|
||||
'busy',
|
||||
'away',
|
||||
'snooze',
|
||||
'looking_to_trade',
|
||||
'looking_to_play',
|
||||
]),
|
||||
}),
|
||||
'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.unconfigured_account',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
|
||||
'original_icon': None,
|
||||
'original_name': None,
|
||||
'platform': 'steam_online',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': <SteamSensor.ACCOUNT: 'account'>,
|
||||
'unique_id': '1234567890_account',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.unconfigured_account-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'created': datetime.datetime(2026, 8, 17, 12, 8, 31, tzinfo=zoneinfo.ZoneInfo(key='US/Pacific')),
|
||||
<EntityStateAttribute.DEVICE_CLASS: 'device_class'>: 'enum',
|
||||
<EntityStateAttribute.ENTITY_PICTURE: 'entity_picture'>: 'https://avatars.steamstatic.com/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'unconfigured_account',
|
||||
'game': None,
|
||||
'game_icon': None,
|
||||
'game_id': None,
|
||||
'game_image_header': None,
|
||||
'game_image_main': None,
|
||||
'last_online': None,
|
||||
'level': 10,
|
||||
<SensorEntityCapabilityAttribute.OPTIONS: 'options'>: list([
|
||||
'offline',
|
||||
'online',
|
||||
'busy',
|
||||
'away',
|
||||
'snooze',
|
||||
'looking_to_trade',
|
||||
'looking_to_play',
|
||||
]),
|
||||
'real_name': None,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.unconfigured_account',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'offline',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.unconfigured_account_last_online-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'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.unconfigured_account_last_online',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'Last online',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.TIMESTAMP: 'timestamp'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Last online',
|
||||
'platform': 'steam_online',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': <SteamSensor.LAST_ONLINE: 'last_online'>,
|
||||
'unique_id': '1234567890_last_online',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.unconfigured_account_last_online-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.DEVICE_CLASS: 'device_class'>: 'timestamp',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'unconfigured_account Last online',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.unconfigured_account_last_online',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unknown',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.unconfigured_account_level-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
<SensorEntityCapabilityAttribute.STATE_CLASS: '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': None,
|
||||
'entity_id': 'sensor.unconfigured_account_level',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'Level',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Level',
|
||||
'platform': 'steam_online',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': <SteamSensor.LEVEL: 'level'>,
|
||||
'unique_id': '1234567890_level',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.unconfigured_account_level-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'unconfigured_account Level',
|
||||
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.unconfigured_account_level',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '10',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.unconfigured_account_now_playing-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'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.unconfigured_account_now_playing',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'Now playing',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Now playing',
|
||||
'platform': 'steam_online',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': <SteamSensor.NOW_PLAYING: 'now_playing'>,
|
||||
'unique_id': '1234567890_now_playing',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.unconfigured_account_now_playing-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'app_id': None,
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'unconfigured_account Now playing',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.unconfigured_account_now_playing',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unknown',
|
||||
})
|
||||
# ---
|
||||
|
||||
Reference in New Issue
Block a user