diff --git a/homeassistant/components/husqvarna_automower/manifest.json b/homeassistant/components/husqvarna_automower/manifest.json index b59e5d4ccd991f..dd875bb94a4baa 100644 --- a/homeassistant/components/husqvarna_automower/manifest.json +++ b/homeassistant/components/husqvarna_automower/manifest.json @@ -9,5 +9,5 @@ "iot_class": "cloud_push", "loggers": ["aioautomower"], "quality_scale": "silver", - "requirements": ["aioautomower==2.3.1"] + "requirements": ["aioautomower==2.5.0"] } diff --git a/homeassistant/components/jewish_calendar/sensor.py b/homeassistant/components/jewish_calendar/sensor.py index 0ccbf1970d8e8e..0c63ea21161d0b 100644 --- a/homeassistant/components/jewish_calendar/sensor.py +++ b/homeassistant/components/jewish_calendar/sensor.py @@ -65,7 +65,7 @@ class JewishCalendarTimestampSensorDescription(JewishCalendarBaseSensorDescripti attr_fn=lambda info: { "hebrew_year": str(info.hdate.year), "hebrew_month_name": str(info.hdate.month), - "hebrew_month_order": str(info.hdate.month.value), + "hebrew_month_standard_order": str(info.hdate.month.value), "hebrew_month_biblical_order": str(info.hdate.month.biblical_order), "hebrew_day": str(info.hdate.day), }, diff --git a/homeassistant/components/jewish_calendar/strings.json b/homeassistant/components/jewish_calendar/strings.json index b58f144effc868..28f9186afb5478 100644 --- a/homeassistant/components/jewish_calendar/strings.json +++ b/homeassistant/components/jewish_calendar/strings.json @@ -26,9 +26,11 @@ "state_attributes": { "hebrew_year": { "name": "Hebrew year" }, "hebrew_month_name": { "name": "Hebrew month name" }, - "hebrew_month_order": { "name": "Hebrew month order" }, + "hebrew_month_standard_order": { + "name": "Hebrew month in standard order" + }, "hebrew_month_biblical_order": { - "name": "Hebrew month biblical order" + "name": "Hebrew month in biblical order" }, "hebrew_day": { "name": "Hebrew day" } } diff --git a/homeassistant/components/minecraft_server/manifest.json b/homeassistant/components/minecraft_server/manifest.json index f68586f1992047..eb35abdec40416 100644 --- a/homeassistant/components/minecraft_server/manifest.json +++ b/homeassistant/components/minecraft_server/manifest.json @@ -7,5 +7,5 @@ "iot_class": "local_polling", "loggers": ["dnspython", "mcstatus"], "quality_scale": "silver", - "requirements": ["mcstatus==12.0.1"] + "requirements": ["mcstatus==12.0.6"] } diff --git a/homeassistant/components/telegram_bot/services.yaml b/homeassistant/components/telegram_bot/services.yaml index b38bd23bb1d32c..5b146e3c4505bf 100644 --- a/homeassistant/components/telegram_bot/services.yaml +++ b/homeassistant/components/telegram_bot/services.yaml @@ -108,6 +108,30 @@ send_photo: example: "http://example.org/path/to/the/image.png" selector: text: + url_options: + collapsed: true + fields: + verify_ssl: + default: true + selector: + boolean: + authentication: + selector: + select: + options: + - "basic" + - "digest" + - "bearer_token" + translation_key: "authentication" + username: + example: myuser + selector: + text: + password: + example: myuser_pwd + selector: + text: + type: password file: example: "/path/to/the/image.png" selector: @@ -116,23 +140,6 @@ send_photo: example: "My image" selector: text: - authentication: - selector: - select: - options: - - "basic" - - "digest" - - "bearer_token" - translation_key: "authentication" - username: - example: myuser - selector: - text: - password: - example: myuser_pwd - selector: - text: - type: password target: example: "[12345, 67890] or 12345" selector: @@ -150,9 +157,6 @@ send_photo: disable_notification: selector: boolean: - verify_ssl: - selector: - boolean: timeout: selector: number: @@ -193,6 +197,30 @@ send_sticker: example: "http://example.org/path/to/the/sticker.webp" selector: text: + url_options: + collapsed: true + fields: + verify_ssl: + default: true + selector: + boolean: + authentication: + selector: + select: + options: + - "basic" + - "digest" + - "bearer_token" + translation_key: "authentication" + username: + example: myuser + selector: + text: + password: + example: myuser_pwd + selector: + text: + type: password file: example: "/path/to/the/sticker.webp" selector: @@ -201,23 +229,6 @@ send_sticker: example: CAACAgIAAxkBAAEDDldhZD-hqWclr6krLq-FWSfCrGNmOQAC9gAD9HsZAAFeYY-ltPYnrCEE selector: text: - authentication: - selector: - select: - options: - - "basic" - - "digest" - - "bearer_token" - translation_key: "authentication" - username: - example: myuser - selector: - text: - password: - example: myuser_pwd - selector: - text: - type: password target: example: "[12345, 67890] or 12345" selector: @@ -226,9 +237,6 @@ send_sticker: disable_notification: selector: boolean: - verify_ssl: - selector: - boolean: timeout: selector: number: @@ -269,6 +277,30 @@ send_animation: example: "http://example.org/path/to/the/animation.gif" selector: text: + url_options: + collapsed: true + fields: + verify_ssl: + default: true + selector: + boolean: + authentication: + selector: + select: + options: + - "basic" + - "digest" + - "bearer_token" + translation_key: "authentication" + username: + example: myuser + selector: + text: + password: + example: myuser_pwd + selector: + text: + type: password file: example: "/path/to/the/animation.gif" selector: @@ -277,23 +309,6 @@ send_animation: example: "My animation" selector: text: - authentication: - selector: - select: - options: - - "basic" - - "digest" - - "bearer_token" - translation_key: "authentication" - username: - example: myuser - selector: - text: - password: - example: myuser_pwd - selector: - text: - type: password target: example: "[12345, 67890] or 12345" selector: @@ -311,9 +326,6 @@ send_animation: disable_notification: selector: boolean: - verify_ssl: - selector: - boolean: timeout: selector: number: @@ -354,6 +366,30 @@ send_video: example: "http://example.org/path/to/the/video.mp4" selector: text: + url_options: + collapsed: true + fields: + verify_ssl: + default: true + selector: + boolean: + authentication: + selector: + select: + options: + - "basic" + - "digest" + - "bearer_token" + translation_key: "authentication" + username: + example: myuser + selector: + text: + password: + example: myuser_pwd + selector: + text: + type: password file: example: "/path/to/the/video.mp4" selector: @@ -362,23 +398,6 @@ send_video: example: "My video" selector: text: - authentication: - selector: - select: - options: - - "basic" - - "digest" - - "bearer_token" - translation_key: "authentication" - username: - example: myuser - selector: - text: - password: - example: myuser_pwd - selector: - text: - type: password target: example: "[12345, 67890] or 12345" selector: @@ -396,9 +415,6 @@ send_video: disable_notification: selector: boolean: - verify_ssl: - selector: - boolean: timeout: selector: number: @@ -439,6 +455,30 @@ send_voice: example: "http://example.org/path/to/the/voice.opus" selector: text: + url_options: + collapsed: true + fields: + verify_ssl: + default: true + selector: + boolean: + authentication: + selector: + select: + options: + - "basic" + - "digest" + - "bearer_token" + translation_key: "authentication" + username: + example: myuser + selector: + text: + password: + example: myuser_pwd + selector: + text: + type: password file: example: "/path/to/the/voice.opus" selector: @@ -447,23 +487,6 @@ send_voice: example: "My microphone recording" selector: text: - authentication: - selector: - select: - options: - - "basic" - - "digest" - - "bearer_token" - translation_key: "authentication" - username: - example: myuser - selector: - text: - password: - example: myuser_pwd - selector: - text: - type: password target: example: "[12345, 67890] or 12345" selector: @@ -472,9 +495,6 @@ send_voice: disable_notification: selector: boolean: - verify_ssl: - selector: - boolean: timeout: selector: number: @@ -515,6 +535,30 @@ send_document: example: "http://example.org/path/to/the/document.odf" selector: text: + url_options: + collapsed: true + fields: + verify_ssl: + default: true + selector: + boolean: + authentication: + selector: + select: + options: + - "basic" + - "digest" + - "bearer_token" + translation_key: "authentication" + username: + example: myuser + selector: + text: + password: + example: myuser_pwd + selector: + text: + type: password file: example: "/tmp/whatever.odf" selector: @@ -523,23 +567,6 @@ send_document: example: Document Title xy selector: text: - authentication: - selector: - select: - options: - - "basic" - - "digest" - - "bearer_token" - translation_key: "authentication" - username: - example: myuser - selector: - text: - password: - example: myuser_pwd - selector: - text: - type: password target: example: "[12345, 67890] or 12345" selector: @@ -557,9 +584,6 @@ send_document: disable_notification: selector: boolean: - verify_ssl: - selector: - boolean: timeout: selector: number: @@ -782,6 +806,30 @@ edit_message_media: example: "http://example.org/path/to/the/image.png" selector: text: + url_options: + collapsed: true + fields: + verify_ssl: + default: true + selector: + boolean: + authentication: + selector: + select: + options: + - "basic" + - "digest" + - "bearer_token" + translation_key: "authentication" + username: + example: myuser + selector: + text: + password: + example: myuser_pwd + selector: + text: + type: password file: example: "/path/to/the/image.png" selector: @@ -790,26 +838,6 @@ edit_message_media: example: Document Title xy selector: text: - authentication: - selector: - select: - options: - - "basic" - - "digest" - - "bearer_token" - translation_key: "authentication" - username: - example: myuser - selector: - text: - password: - example: myuser_pwd - selector: - text: - type: password - verify_ssl: - selector: - boolean: inline_keyboard: example: '["/button1, /button2", "/button3"] or [[["Text button1", "/button1"], diff --git a/homeassistant/components/telegram_bot/strings.json b/homeassistant/components/telegram_bot/strings.json index 0a7aa610dd6dc3..28a31809f27bec 100644 --- a/homeassistant/components/telegram_bot/strings.json +++ b/homeassistant/components/telegram_bot/strings.json @@ -317,6 +317,11 @@ "name": "[%key:component::telegram_bot::services::send_message::fields::message_thread_id::name%]", "description": "[%key:component::telegram_bot::services::send_message::fields::message_thread_id::description%]" } + }, + "sections": { + "url_options": { + "name": "URL options" + } } }, "send_sticker": { @@ -387,6 +392,11 @@ "name": "[%key:component::telegram_bot::services::send_message::fields::message_thread_id::name%]", "description": "[%key:component::telegram_bot::services::send_message::fields::message_thread_id::description%]" } + }, + "sections": { + "url_options": { + "name": "[%key:component::telegram_bot::services::send_photo::sections::url_options::name%]" + } } }, "send_animation": { @@ -461,6 +471,11 @@ "name": "[%key:component::telegram_bot::services::send_message::fields::message_thread_id::name%]", "description": "[%key:component::telegram_bot::services::send_message::fields::message_thread_id::description%]" } + }, + "sections": { + "url_options": { + "name": "[%key:component::telegram_bot::services::send_photo::sections::url_options::name%]" + } } }, "send_video": { @@ -535,6 +550,11 @@ "name": "[%key:component::telegram_bot::services::send_message::fields::message_thread_id::name%]", "description": "[%key:component::telegram_bot::services::send_message::fields::message_thread_id::description%]" } + }, + "sections": { + "url_options": { + "name": "[%key:component::telegram_bot::services::send_photo::sections::url_options::name%]" + } } }, "send_voice": { @@ -605,6 +625,11 @@ "name": "[%key:component::telegram_bot::services::send_message::fields::message_thread_id::name%]", "description": "[%key:component::telegram_bot::services::send_message::fields::message_thread_id::description%]" } + }, + "sections": { + "url_options": { + "name": "[%key:component::telegram_bot::services::send_photo::sections::url_options::name%]" + } } }, "send_document": { @@ -679,6 +704,11 @@ "name": "[%key:component::telegram_bot::services::send_message::fields::message_thread_id::name%]", "description": "[%key:component::telegram_bot::services::send_message::fields::message_thread_id::description%]" } + }, + "sections": { + "url_options": { + "name": "[%key:component::telegram_bot::services::send_photo::sections::url_options::name%]" + } } }, "send_location": { @@ -879,6 +909,11 @@ "name": "[%key:component::telegram_bot::services::send_message::fields::inline_keyboard::name%]", "description": "[%key:component::telegram_bot::services::send_message::fields::inline_keyboard::description%]" } + }, + "sections": { + "url_options": { + "name": "[%key:component::telegram_bot::services::send_photo::sections::url_options::name%]" + } } }, "edit_caption": { diff --git a/homeassistant/components/xbox/binary_sensor.py b/homeassistant/components/xbox/binary_sensor.py index 421b4219236283..e754b4d79aaeb8 100644 --- a/homeassistant/components/xbox/binary_sensor.py +++ b/homeassistant/components/xbox/binary_sensor.py @@ -27,6 +27,7 @@ class XboxBinarySensor(StrEnum): IN_PARTY = "in_party" IN_GAME = "in_game" IN_MULTIPLAYER = "in_multiplayer" + HAS_GAME_PASS = "has_game_pass" @dataclass(kw_only=True, frozen=True) @@ -79,6 +80,11 @@ def profile_pic(data: PresenceData) -> str | None: is_on_fn=lambda x: x.in_multiplayer, entity_registry_enabled_default=False, ), + XboxBinarySensorEntityDescription( + key=XboxBinarySensor.HAS_GAME_PASS, + translation_key=XboxBinarySensor.HAS_GAME_PASS, + is_on_fn=lambda x: x.has_game_pass, + ), ) diff --git a/homeassistant/components/xbox/coordinator.py b/homeassistant/components/xbox/coordinator.py index 5ef21c96672b10..17040e65464753 100644 --- a/homeassistant/components/xbox/coordinator.py +++ b/homeassistant/components/xbox/coordinator.py @@ -3,7 +3,7 @@ from __future__ import annotations from dataclasses import dataclass, field -from datetime import timedelta +from datetime import UTC, datetime, timedelta import logging from httpx import HTTPStatusError, RequestError, TimeoutException @@ -58,6 +58,10 @@ class PresenceData: gamer_score: str gold_tenure: str | None account_tier: str + last_seen: datetime | None + following_count: int + follower_count: int + has_game_pass: bool @dataclass @@ -246,4 +250,12 @@ def _build_presence_data(person: Person) -> PresenceData: gamer_score=person.gamer_score, gold_tenure=person.detail.tenure, account_tier=person.detail.account_tier, + last_seen=( + person.last_seen_date_time_utc.replace(tzinfo=UTC) + if person.last_seen_date_time_utc + else None + ), + follower_count=person.detail.follower_count, + following_count=person.detail.following_count, + has_game_pass=person.detail.has_game_pass, ) diff --git a/homeassistant/components/xbox/icons.json b/homeassistant/components/xbox/icons.json index fa847381256ab8..18fa131c59a59c 100644 --- a/homeassistant/components/xbox/icons.json +++ b/homeassistant/components/xbox/icons.json @@ -12,6 +12,15 @@ }, "gold_tenure": { "default": "mdi:microsoft-xbox" + }, + "last_online": { + "default": "mdi:account-clock" + }, + "follower": { + "default": "mdi:account-arrow-left" + }, + "following": { + "default": "mdi:account-arrow-right" } }, "binary_sensor": { @@ -26,6 +35,9 @@ }, "in_multiplayer": { "default": "mdi:account-multiple" + }, + "has_game_pass": { + "default": "mdi:microsoft-xbox" } } } diff --git a/homeassistant/components/xbox/sensor.py b/homeassistant/components/xbox/sensor.py index f00ad6302e5ec3..3b064797532584 100644 --- a/homeassistant/components/xbox/sensor.py +++ b/homeassistant/components/xbox/sensor.py @@ -4,10 +4,15 @@ from collections.abc import Callable from dataclasses import dataclass +from datetime import datetime from enum import StrEnum from functools import partial -from homeassistant.components.sensor import SensorEntity, SensorEntityDescription +from homeassistant.components.sensor import ( + SensorDeviceClass, + SensorEntity, + SensorEntityDescription, +) from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from homeassistant.helpers.typing import StateType @@ -23,13 +28,16 @@ class XboxSensor(StrEnum): GAMER_SCORE = "gamer_score" ACCOUNT_TIER = "account_tier" GOLD_TENURE = "gold_tenure" + LAST_ONLINE = "last_online" + FOLLOWING = "following" + FOLLOWER = "follower" @dataclass(kw_only=True, frozen=True) class XboxSensorEntityDescription(SensorEntityDescription): """Xbox sensor description.""" - value_fn: Callable[[PresenceData], StateType] + value_fn: Callable[[PresenceData], StateType | datetime] SENSOR_DESCRIPTIONS: tuple[XboxSensorEntityDescription, ...] = ( @@ -55,6 +63,22 @@ class XboxSensorEntityDescription(SensorEntityDescription): entity_registry_enabled_default=False, value_fn=lambda x: x.gold_tenure, ), + XboxSensorEntityDescription( + key=XboxSensor.LAST_ONLINE, + translation_key=XboxSensor.LAST_ONLINE, + value_fn=(lambda x: x.last_seen), + device_class=SensorDeviceClass.TIMESTAMP, + ), + XboxSensorEntityDescription( + key=XboxSensor.FOLLOWING, + translation_key=XboxSensor.FOLLOWING, + value_fn=lambda x: x.following_count, + ), + XboxSensorEntityDescription( + key=XboxSensor.FOLLOWER, + translation_key=XboxSensor.FOLLOWER, + value_fn=lambda x: x.follower_count, + ), ) @@ -78,7 +102,7 @@ class XboxSensorEntity(XboxBaseEntity, SensorEntity): entity_description: XboxSensorEntityDescription @property - def native_value(self) -> StateType: + def native_value(self) -> StateType | datetime: """Return the state of the requested attribute.""" return self.entity_description.value_fn(self.data) diff --git a/homeassistant/components/xbox/strings.json b/homeassistant/components/xbox/strings.json index 07cc231ea9bff4..2df1546f22cef2 100644 --- a/homeassistant/components/xbox/strings.json +++ b/homeassistant/components/xbox/strings.json @@ -38,6 +38,17 @@ }, "gold_tenure": { "name": "Gold tenure" + }, + "last_online": { + "name": "Last online" + }, + "following": { + "name": "Following", + "unit_of_measurement": "people" + }, + "follower": { + "name": "Follower", + "unit_of_measurement": "[%key:component::xbox::entity::sensor::following::unit_of_measurement%]" } }, "binary_sensor": { @@ -49,6 +60,9 @@ }, "in_multiplayer": { "name": "In multiplayer" + }, + "has_game_pass": { + "name": "Subscribed to Xbox Game Pass" } } }, diff --git a/homeassistant/components/yolink/__init__.py b/homeassistant/components/yolink/__init__.py index f33da34c1fc9d3..65ca84863f114d 100644 --- a/homeassistant/components/yolink/__init__.py +++ b/homeassistant/components/yolink/__init__.py @@ -26,7 +26,7 @@ from homeassistant.helpers.typing import ConfigType from . import api -from .const import ATTR_LORA_INFO, DOMAIN, YOLINK_EVENT +from .const import ATTR_LORA_INFO, DOMAIN, SUPPORTED_REMOTERS, YOLINK_EVENT from .coordinator import YoLinkCoordinator from .device_trigger import CONF_LONG_PRESS, CONF_SHORT_PRESS from .services import async_setup_services @@ -151,6 +151,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: device_pairing_mapping[parent_id] = device.device_id for device in yolink_home.get_devices(): + if ( + device.device_type == ATTR_DEVICE_SMART_REMOTER + and device.device_model_name not in SUPPORTED_REMOTERS + ): + continue paried_device: YoLinkDevice | None = None if ( paried_device_id := device_pairing_mapping.get(device.device_id) diff --git a/homeassistant/components/yolink/const.py b/homeassistant/components/yolink/const.py index 851b65e1a15479..09bc2e1ff01df1 100644 --- a/homeassistant/components/yolink/const.py +++ b/homeassistant/components/yolink/const.py @@ -44,3 +44,10 @@ DEV_MODEL_LEAK_STOP_YS5029 = "YS5029" DEV_MODEL_WATER_METER_YS5018_EC = "YS5018-EC" DEV_MODEL_WATER_METER_YS5018_UC = "YS5018-UC" + +SUPPORTED_REMOTERS = [ + DEV_MODEL_FLEX_FOB_YS3604_EC, + DEV_MODEL_FLEX_FOB_YS3604_UC, + DEV_MODEL_FLEX_FOB_YS3614_EC, + DEV_MODEL_FLEX_FOB_YS3614_UC, +] diff --git a/requirements_all.txt b/requirements_all.txt index b1652a2851a888..8559e9c25b4357 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -210,7 +210,7 @@ aioaseko==1.0.0 aioasuswrt==1.5.1 # homeassistant.components.husqvarna_automower -aioautomower==2.3.1 +aioautomower==2.5.0 # homeassistant.components.azure_devops aioazuredevops==2.2.2 @@ -1428,7 +1428,7 @@ mbddns==0.1.2 mcp==1.14.1 # homeassistant.components.minecraft_server -mcstatus==12.0.1 +mcstatus==12.0.6 # homeassistant.components.meater meater-python==0.0.8 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 565084fe403f83..c3a757301b5113 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -198,7 +198,7 @@ aioaseko==1.0.0 aioasuswrt==1.5.1 # homeassistant.components.husqvarna_automower -aioautomower==2.3.1 +aioautomower==2.5.0 # homeassistant.components.azure_devops aioazuredevops==2.2.2 @@ -1229,7 +1229,7 @@ mbddns==0.1.2 mcp==1.14.1 # homeassistant.components.minecraft_server -mcstatus==12.0.1 +mcstatus==12.0.6 # homeassistant.components.meater meater-python==0.0.8 diff --git a/tests/components/husqvarna_automower/fixtures/mower.json b/tests/components/husqvarna_automower/fixtures/mower.json index 73f9c5e2aaa1bb..c00f344bd8dc79 100644 --- a/tests/components/husqvarna_automower/fixtures/mower.json +++ b/tests/components/husqvarna_automower/fixtures/mower.json @@ -10,7 +10,8 @@ "serialNumber": 123 }, "battery": { - "batteryPercent": 100 + "batteryPercent": 100, + "remainingChargingTime": 309 }, "capabilities": { "canConfirmError": true, @@ -220,7 +221,8 @@ "serialNumber": 123 }, "battery": { - "batteryPercent": 50 + "batteryPercent": 50, + "remainingChargingTime": 0 }, "capabilities": { "canConfirmError": false, diff --git a/tests/components/husqvarna_automower/snapshots/test_diagnostics.ambr b/tests/components/husqvarna_automower/snapshots/test_diagnostics.ambr index 170fbe7ad82a5e..b4651af62f59fb 100644 --- a/tests/components/husqvarna_automower/snapshots/test_diagnostics.ambr +++ b/tests/components/husqvarna_automower/snapshots/test_diagnostics.ambr @@ -3,6 +3,7 @@ dict({ 'battery': dict({ 'battery_percent': 100, + 'remaining_charging_time': 309.0, }), 'calendar': dict({ 'tasks': list([ diff --git a/tests/components/jewish_calendar/test_sensor.py b/tests/components/jewish_calendar/test_sensor.py index 0f1dbdc930fa19..2d7ca34164f8fa 100644 --- a/tests/components/jewish_calendar/test_sensor.py +++ b/tests/components/jewish_calendar/test_sensor.py @@ -137,7 +137,7 @@ async def test_min_config(hass: HomeAssistant, config_entry: MockConfigEntry) -> "attr": { "hebrew_year": "5779", "hebrew_month_name": "מרחשוון", - "hebrew_month_order": "2", + "hebrew_month_standard_order": "2", "hebrew_month_biblical_order": "8", "hebrew_day": "6", "friendly_name": "Jewish Calendar Date", diff --git a/tests/components/uptimerobot/common.py b/tests/components/uptimerobot/common.py index 7a404e3d877ca1..513526da758dd3 100644 --- a/tests/components/uptimerobot/common.py +++ b/tests/components/uptimerobot/common.py @@ -47,7 +47,13 @@ "type": 1, "url": "http://example.com", } - +MOCK_UPTIMEROBOT_MONITOR_2 = { + "id": 5678, + "friendly_name": "Test monitor 2", + "status": 2, + "type": 1, + "url": "http://example2.com", +} MOCK_UPTIMEROBOT_CONFIG_ENTRY_DATA = { "domain": DOMAIN, diff --git a/tests/components/uptimerobot/test_binary_sensor.py b/tests/components/uptimerobot/test_binary_sensor.py index 13e4a556d18e38..a7b3c616dd7ce2 100644 --- a/tests/components/uptimerobot/test_binary_sensor.py +++ b/tests/components/uptimerobot/test_binary_sensor.py @@ -15,6 +15,7 @@ from .common import ( MOCK_UPTIMEROBOT_MONITOR, + MOCK_UPTIMEROBOT_MONITOR_2, UPTIMEROBOT_BINARY_SENSOR_TEST_ENTITY, mock_uptimerobot_api_response, setup_uptimerobot_integration, @@ -65,20 +66,8 @@ async def test_binary_sensor_dynamic(hass: HomeAssistant) -> None: "pyuptimerobot.UptimeRobot.async_get_monitors", return_value=mock_uptimerobot_api_response( data=[ - { - "id": 1234, - "friendly_name": "Test monitor", - "status": 2, - "type": 1, - "url": "http://example.com", - }, - { - "id": 5678, - "friendly_name": "Test monitor 2", - "status": 2, - "type": 1, - "url": "http://example2.com", - }, + MOCK_UPTIMEROBOT_MONITOR, + MOCK_UPTIMEROBOT_MONITOR_2, ] ), ): diff --git a/tests/components/uptimerobot/test_sensor.py b/tests/components/uptimerobot/test_sensor.py index 26f7432f99cf59..e5d6b12596d40b 100644 --- a/tests/components/uptimerobot/test_sensor.py +++ b/tests/components/uptimerobot/test_sensor.py @@ -12,6 +12,7 @@ from .common import ( MOCK_UPTIMEROBOT_MONITOR, + MOCK_UPTIMEROBOT_MONITOR_2, STATE_UP, UPTIMEROBOT_SENSOR_TEST_ENTITY, mock_uptimerobot_api_response, @@ -69,20 +70,8 @@ async def test_sensor_dynamic(hass: HomeAssistant) -> None: "pyuptimerobot.UptimeRobot.async_get_monitors", return_value=mock_uptimerobot_api_response( data=[ - { - "id": 1234, - "friendly_name": "Test monitor", - "status": 2, - "type": 1, - "url": "http://example.com", - }, - { - "id": 5678, - "friendly_name": "Test monitor 2", - "status": 2, - "type": 1, - "url": "http://example2.com", - }, + MOCK_UPTIMEROBOT_MONITOR, + MOCK_UPTIMEROBOT_MONITOR_2, ] ), ): diff --git a/tests/components/uptimerobot/test_switch.py b/tests/components/uptimerobot/test_switch.py index e42b46db8616c3..7dc35021064f08 100644 --- a/tests/components/uptimerobot/test_switch.py +++ b/tests/components/uptimerobot/test_switch.py @@ -21,6 +21,7 @@ from .common import ( MOCK_UPTIMEROBOT_CONFIG_ENTRY_DATA, MOCK_UPTIMEROBOT_MONITOR, + MOCK_UPTIMEROBOT_MONITOR_2, MOCK_UPTIMEROBOT_MONITOR_PAUSED, UPTIMEROBOT_SWITCH_TEST_ENTITY, MockApiResponseKey, @@ -197,20 +198,8 @@ async def test_switch_dynamic(hass: HomeAssistant) -> None: "pyuptimerobot.UptimeRobot.async_get_monitors", return_value=mock_uptimerobot_api_response( data=[ - { - "id": 1234, - "friendly_name": "Test monitor", - "status": 2, - "type": 1, - "url": "http://example.com", - }, - { - "id": 5678, - "friendly_name": "Test monitor 2", - "status": 2, - "type": 1, - "url": "http://example2.com", - }, + MOCK_UPTIMEROBOT_MONITOR, + MOCK_UPTIMEROBOT_MONITOR_2, ] ), ): diff --git a/tests/components/xbox/fixtures/people_batch.json b/tests/components/xbox/fixtures/people_batch.json index c4495e9d630ea7..b0cffc329e3cdb 100644 --- a/tests/components/xbox/fixtures/people_batch.json +++ b/tests/components/xbox/fixtures/people_batch.json @@ -67,7 +67,7 @@ "mute": false, "followerCount": 105, "followingCount": 121, - "hasGamePass": false + "hasGamePass": true }, "communityManagerTitles": null, "socialManager": null, diff --git a/tests/components/xbox/snapshots/test_binary_sensor.ambr b/tests/components/xbox/snapshots/test_binary_sensor.ambr index 04bfcba621d69f..85ff7eae16e59b 100644 --- a/tests/components/xbox/snapshots/test_binary_sensor.ambr +++ b/tests/components/xbox/snapshots/test_binary_sensor.ambr @@ -192,6 +192,54 @@ 'state': 'off', }) # --- +# name: test_binary_sensors[binary_sensor.erics273_subscribed_to_xbox_game_pass-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': None, + 'entity_id': 'binary_sensor.erics273_subscribed_to_xbox_game_pass', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Subscribed to Xbox Game Pass', + 'platform': 'xbox', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': , + 'unique_id': '2533274913657542_has_game_pass', + 'unit_of_measurement': None, + }) +# --- +# name: test_binary_sensors[binary_sensor.erics273_subscribed_to_xbox_game_pass-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'erics273 Subscribed to Xbox Game Pass', + }), + 'context': , + 'entity_id': 'binary_sensor.erics273_subscribed_to_xbox_game_pass', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_binary_sensors[binary_sensor.gsr_ae-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -385,6 +433,54 @@ 'state': 'off', }) # --- +# name: test_binary_sensors[binary_sensor.gsr_ae_subscribed_to_xbox_game_pass-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': None, + 'entity_id': 'binary_sensor.gsr_ae_subscribed_to_xbox_game_pass', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Subscribed to Xbox Game Pass', + 'platform': 'xbox', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': , + 'unique_id': '271958441785640_has_game_pass', + 'unit_of_measurement': None, + }) +# --- +# name: test_binary_sensors[binary_sensor.gsr_ae_subscribed_to_xbox_game_pass-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'GSR Ae Subscribed to Xbox Game Pass', + }), + 'context': , + 'entity_id': 'binary_sensor.gsr_ae_subscribed_to_xbox_game_pass', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- # name: test_binary_sensors[binary_sensor.ikken_hissatsuu-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -578,3 +674,51 @@ 'state': 'off', }) # --- +# name: test_binary_sensors[binary_sensor.ikken_hissatsuu_subscribed_to_xbox_game_pass-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': None, + 'entity_id': 'binary_sensor.ikken_hissatsuu_subscribed_to_xbox_game_pass', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Subscribed to Xbox Game Pass', + 'platform': 'xbox', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': , + 'unique_id': '2533274838782903_has_game_pass', + 'unit_of_measurement': None, + }) +# --- +# name: test_binary_sensors[binary_sensor.ikken_hissatsuu_subscribed_to_xbox_game_pass-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Ikken Hissatsuu Subscribed to Xbox Game Pass', + }), + 'context': , + 'entity_id': 'binary_sensor.ikken_hissatsuu_subscribed_to_xbox_game_pass', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- diff --git a/tests/components/xbox/snapshots/test_sensor.ambr b/tests/components/xbox/snapshots/test_sensor.ambr index 10958a9375a96e..eff4d3aa616215 100644 --- a/tests/components/xbox/snapshots/test_sensor.ambr +++ b/tests/components/xbox/snapshots/test_sensor.ambr @@ -47,6 +47,104 @@ 'state': 'Silver', }) # --- +# name: test_sensors[sensor.erics273_follower-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.erics273_follower', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Follower', + 'platform': 'xbox', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': , + 'unique_id': '2533274913657542_follower', + 'unit_of_measurement': 'people', + }) +# --- +# name: test_sensors[sensor.erics273_follower-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'erics273 Follower', + 'unit_of_measurement': 'people', + }), + 'context': , + 'entity_id': 'sensor.erics273_follower', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '18', + }) +# --- +# name: test_sensors[sensor.erics273_following-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.erics273_following', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Following', + 'platform': 'xbox', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': , + 'unique_id': '2533274913657542_following', + 'unit_of_measurement': 'people', + }) +# --- +# name: test_sensors[sensor.erics273_following-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'erics273 Following', + 'unit_of_measurement': 'people', + }), + 'context': , + 'entity_id': 'sensor.erics273_following', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '12', + }) +# --- # name: test_sensors[sensor.erics273_gamerscore-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -144,6 +242,55 @@ 'state': '0', }) # --- +# name: test_sensors[sensor.erics273_last_online-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.erics273_last_online', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Last online', + 'platform': 'xbox', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': , + 'unique_id': '2533274913657542_last_online', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.erics273_last_online-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': 'erics273 Last online', + }), + 'context': , + 'entity_id': 'sensor.erics273_last_online', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '2020-10-08T04:19:58+00:00', + }) +# --- # name: test_sensors[sensor.erics273_status-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -240,6 +387,104 @@ 'state': 'Gold', }) # --- +# name: test_sensors[sensor.gsr_ae_follower-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.gsr_ae_follower', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Follower', + 'platform': 'xbox', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': , + 'unique_id': '271958441785640_follower', + 'unit_of_measurement': 'people', + }) +# --- +# name: test_sensors[sensor.gsr_ae_follower-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'GSR Ae Follower', + 'unit_of_measurement': 'people', + }), + 'context': , + 'entity_id': 'sensor.gsr_ae_follower', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '105', + }) +# --- +# name: test_sensors[sensor.gsr_ae_following-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.gsr_ae_following', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Following', + 'platform': 'xbox', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': , + 'unique_id': '271958441785640_following', + 'unit_of_measurement': 'people', + }) +# --- +# name: test_sensors[sensor.gsr_ae_following-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'GSR Ae Following', + 'unit_of_measurement': 'people', + }), + 'context': , + 'entity_id': 'sensor.gsr_ae_following', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '121', + }) +# --- # name: test_sensors[sensor.gsr_ae_gamerscore-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -337,6 +582,55 @@ 'state': 'unknown', }) # --- +# name: test_sensors[sensor.gsr_ae_last_online-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.gsr_ae_last_online', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Last online', + 'platform': 'xbox', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': , + 'unique_id': '271958441785640_last_online', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.gsr_ae_last_online-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': 'GSR Ae Last online', + }), + 'context': , + 'entity_id': 'sensor.gsr_ae_last_online', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '2020-10-09T00:12:27+00:00', + }) +# --- # name: test_sensors[sensor.gsr_ae_status-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -433,6 +727,104 @@ 'state': 'Gold', }) # --- +# name: test_sensors[sensor.ikken_hissatsuu_follower-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.ikken_hissatsuu_follower', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Follower', + 'platform': 'xbox', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': , + 'unique_id': '2533274838782903_follower', + 'unit_of_measurement': 'people', + }) +# --- +# name: test_sensors[sensor.ikken_hissatsuu_follower-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Ikken Hissatsuu Follower', + 'unit_of_measurement': 'people', + }), + 'context': , + 'entity_id': 'sensor.ikken_hissatsuu_follower', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '81', + }) +# --- +# name: test_sensors[sensor.ikken_hissatsuu_following-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.ikken_hissatsuu_following', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Following', + 'platform': 'xbox', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': , + 'unique_id': '2533274838782903_following', + 'unit_of_measurement': 'people', + }) +# --- +# name: test_sensors[sensor.ikken_hissatsuu_following-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Ikken Hissatsuu Following', + 'unit_of_measurement': 'people', + }), + 'context': , + 'entity_id': 'sensor.ikken_hissatsuu_following', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '73', + }) +# --- # name: test_sensors[sensor.ikken_hissatsuu_gamerscore-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -530,6 +922,55 @@ 'state': '8', }) # --- +# name: test_sensors[sensor.ikken_hissatsuu_last_online-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.ikken_hissatsuu_last_online', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Last online', + 'platform': 'xbox', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': , + 'unique_id': '2533274838782903_last_online', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.ikken_hissatsuu_last_online-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': 'Ikken Hissatsuu Last online', + }), + 'context': , + 'entity_id': 'sensor.ikken_hissatsuu_last_online', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- # name: test_sensors[sensor.ikken_hissatsuu_status-entry] EntityRegistryEntrySnapshot({ 'aliases': set({