diff --git a/CODEOWNERS b/CODEOWNERS index ade3415a108eb1..9b34dc9c5e03e3 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -403,8 +403,8 @@ build.json @home-assistant/supervisor /tests/components/duke_energy/ @hunterjm /homeassistant/components/duotecno/ @cereal2nd /tests/components/duotecno/ @cereal2nd -/homeassistant/components/dwd_weather_warnings/ @runningman84 @stephan192 @andarotajo -/tests/components/dwd_weather_warnings/ @runningman84 @stephan192 @andarotajo +/homeassistant/components/dwd_weather_warnings/ @runningman84 @stephan192 +/tests/components/dwd_weather_warnings/ @runningman84 @stephan192 /homeassistant/components/dynalite/ @ziv1234 /tests/components/dynalite/ @ziv1234 /homeassistant/components/eafm/ @Jc2k diff --git a/homeassistant/components/airos/manifest.json b/homeassistant/components/airos/manifest.json index a4b09458859fa8..10d33363af2106 100644 --- a/homeassistant/components/airos/manifest.json +++ b/homeassistant/components/airos/manifest.json @@ -7,5 +7,5 @@ "integration_type": "device", "iot_class": "local_polling", "quality_scale": "silver", - "requirements": ["airos==0.6.3"] + "requirements": ["airos==0.6.4"] } diff --git a/homeassistant/components/dwd_weather_warnings/manifest.json b/homeassistant/components/dwd_weather_warnings/manifest.json index e74ea6fe8627b2..c43f4e1b5be74f 100644 --- a/homeassistant/components/dwd_weather_warnings/manifest.json +++ b/homeassistant/components/dwd_weather_warnings/manifest.json @@ -1,7 +1,7 @@ { "domain": "dwd_weather_warnings", "name": "Deutscher Wetterdienst (DWD) Weather Warnings", - "codeowners": ["@runningman84", "@stephan192", "@andarotajo"], + "codeowners": ["@runningman84", "@stephan192"], "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/dwd_weather_warnings", "integration_type": "service", diff --git a/homeassistant/components/fritzbox/manifest.json b/homeassistant/components/fritzbox/manifest.json index cfb9fbea39b856..845ae1e65e0433 100644 --- a/homeassistant/components/fritzbox/manifest.json +++ b/homeassistant/components/fritzbox/manifest.json @@ -7,7 +7,7 @@ "integration_type": "hub", "iot_class": "local_polling", "loggers": ["pyfritzhome"], - "requirements": ["pyfritzhome==0.6.19"], + "requirements": ["pyfritzhome==0.6.20"], "ssdp": [ { "st": "urn:schemas-upnp-org:device:fritzbox:1" diff --git a/homeassistant/components/litterrobot/button.py b/homeassistant/components/litterrobot/button.py index da6ac53ccec070..25e6449ae9b184 100644 --- a/homeassistant/components/litterrobot/button.py +++ b/homeassistant/components/litterrobot/button.py @@ -6,7 +6,7 @@ from dataclasses import dataclass from typing import Any, Generic -from pylitterbot import FeederRobot, LitterRobot3, LitterRobot4, Robot +from pylitterbot import FeederRobot, LitterRobot3, LitterRobot4, LitterRobot5, Robot from homeassistant.components.button import ButtonEntity, ButtonEntityDescription from homeassistant.const import EntityCategory @@ -24,20 +24,24 @@ class RobotButtonEntityDescription(ButtonEntityDescription, Generic[_WhiskerEnti press_fn: Callable[[_WhiskerEntityT], Coroutine[Any, Any, bool]] -ROBOT_BUTTON_MAP: dict[type[Robot], RobotButtonEntityDescription] = { - LitterRobot3: RobotButtonEntityDescription[LitterRobot3]( +ROBOT_BUTTON_MAP: dict[tuple[type[Robot], ...], RobotButtonEntityDescription] = { + (LitterRobot3, LitterRobot5): RobotButtonEntityDescription[ + LitterRobot3 | LitterRobot5 + ]( key="reset_waste_drawer", translation_key="reset_waste_drawer", entity_category=EntityCategory.CONFIG, press_fn=lambda robot: robot.reset_waste_drawer(), ), - LitterRobot4: RobotButtonEntityDescription[LitterRobot4]( + (LitterRobot4, LitterRobot5): RobotButtonEntityDescription[ + LitterRobot4 | LitterRobot5 + ]( key="reset", translation_key="reset", entity_category=EntityCategory.CONFIG, press_fn=lambda robot: robot.reset(), ), - FeederRobot: RobotButtonEntityDescription[FeederRobot]( + (FeederRobot,): RobotButtonEntityDescription[FeederRobot]( key="give_snack", translation_key="give_snack", press_fn=lambda robot: robot.give_snack(), diff --git a/homeassistant/components/litterrobot/select.py b/homeassistant/components/litterrobot/select.py index 9bf8691cc8a08d..4ad681e5300b07 100644 --- a/homeassistant/components/litterrobot/select.py +++ b/homeassistant/components/litterrobot/select.py @@ -6,7 +6,7 @@ from dataclasses import dataclass from typing import Any, Generic, TypeVar -from pylitterbot import FeederRobot, LitterRobot, LitterRobot4, Robot +from pylitterbot import FeederRobot, LitterRobot, LitterRobot4, LitterRobot5, Robot from pylitterbot.robot.litterrobot4 import BrightnessLevel, NightLightMode from homeassistant.components.select import SelectEntity, SelectEntityDescription @@ -32,9 +32,11 @@ class RobotSelectEntityDescription( select_fn: Callable[[_WhiskerEntityT, str], Coroutine[Any, Any, bool]] -ROBOT_SELECT_MAP: dict[type[Robot], tuple[RobotSelectEntityDescription, ...]] = { +ROBOT_SELECT_MAP: dict[ + type[Robot] | tuple[type[Robot], ...], tuple[RobotSelectEntityDescription, ...] +] = { LitterRobot: ( - RobotSelectEntityDescription[LitterRobot, int]( # type: ignore[type-abstract] # only used for isinstance check + RobotSelectEntityDescription[LitterRobot, int]( key="cycle_delay", translation_key="cycle_delay", unit_of_measurement=UnitOfTime.MINUTES, @@ -43,8 +45,8 @@ class RobotSelectEntityDescription( select_fn=lambda robot, opt: robot.set_wait_time(int(opt)), ), ), - LitterRobot4: ( - RobotSelectEntityDescription[LitterRobot4, str]( + (LitterRobot4, LitterRobot5): ( + RobotSelectEntityDescription[LitterRobot4 | LitterRobot5, str]( key="globe_brightness", translation_key="globe_brightness", current_fn=( @@ -61,7 +63,7 @@ class RobotSelectEntityDescription( ) ), ), - RobotSelectEntityDescription[LitterRobot4, str]( + RobotSelectEntityDescription[LitterRobot4 | LitterRobot5, str]( key="globe_light", translation_key="globe_light", current_fn=( @@ -78,7 +80,7 @@ class RobotSelectEntityDescription( ) ), ), - RobotSelectEntityDescription[LitterRobot4, str]( + RobotSelectEntityDescription[LitterRobot4 | LitterRobot5, str]( key="panel_brightness", translation_key="brightness_level", current_fn=( diff --git a/homeassistant/components/litterrobot/sensor.py b/homeassistant/components/litterrobot/sensor.py index 7f408a5afb6d70..7f0300babd3347 100644 --- a/homeassistant/components/litterrobot/sensor.py +++ b/homeassistant/components/litterrobot/sensor.py @@ -7,7 +7,7 @@ from datetime import datetime from typing import Any, Generic -from pylitterbot import FeederRobot, LitterRobot, LitterRobot4, Pet, Robot +from pylitterbot import FeederRobot, LitterRobot, LitterRobot4, LitterRobot5, Pet, Robot from homeassistant.components.sensor import ( SensorDeviceClass, @@ -44,8 +44,10 @@ class RobotSensorEntityDescription(SensorEntityDescription, Generic[_WhiskerEnti value_fn: Callable[[_WhiskerEntityT], float | datetime | str | None] -ROBOT_SENSOR_MAP: dict[type[Robot], list[RobotSensorEntityDescription]] = { - LitterRobot: [ # type: ignore[type-abstract] # only used for isinstance check +ROBOT_SENSOR_MAP: dict[ + type[Robot] | tuple[type[Robot], ...], list[RobotSensorEntityDescription] +] = { + LitterRobot: [ RobotSensorEntityDescription[LitterRobot]( key="waste_drawer_level", translation_key="waste_drawer", @@ -145,7 +147,9 @@ class RobotSensorEntityDescription(SensorEntityDescription, Generic[_WhiskerEnti ) ), ), - RobotSensorEntityDescription[LitterRobot4]( + ], + (LitterRobot4, LitterRobot5): [ + RobotSensorEntityDescription[LitterRobot4 | LitterRobot5]( key="litter_level", translation_key="litter_level", native_unit_of_measurement=PERCENTAGE, @@ -153,7 +157,7 @@ class RobotSensorEntityDescription(SensorEntityDescription, Generic[_WhiskerEnti state_class=SensorStateClass.MEASUREMENT, value_fn=lambda robot: robot.litter_level, ), - RobotSensorEntityDescription[LitterRobot4]( + RobotSensorEntityDescription[LitterRobot4 | LitterRobot5]( key="pet_weight", translation_key="pet_weight", native_unit_of_measurement=UnitOfMass.POUNDS, diff --git a/homeassistant/components/proxmoxve/coordinator.py b/homeassistant/components/proxmoxve/coordinator.py index f912bbabefe007..67394eb9a9e085 100644 --- a/homeassistant/components/proxmoxve/coordinator.py +++ b/homeassistant/components/proxmoxve/coordinator.py @@ -176,7 +176,7 @@ def _fetch_all_nodes( list[dict[str, Any]], list[tuple[list[dict[str, Any]], list[dict[str, Any]]]] ]: """Fetch all nodes, and then proceed to the VMs and containers.""" - nodes = self.proxmox.nodes.get() + nodes = self.proxmox.nodes.get() or [] vms_containers = [self._get_vms_containers(node) for node in nodes] return nodes, vms_containers diff --git a/homeassistant/components/renault/manifest.json b/homeassistant/components/renault/manifest.json index 23a3933cac93cd..736b8118725d9c 100644 --- a/homeassistant/components/renault/manifest.json +++ b/homeassistant/components/renault/manifest.json @@ -8,5 +8,5 @@ "iot_class": "cloud_polling", "loggers": ["renault_api"], "quality_scale": "silver", - "requirements": ["renault-api==0.5.3"] + "requirements": ["renault-api==0.5.5"] } diff --git a/homeassistant/components/telegram_bot/__init__.py b/homeassistant/components/telegram_bot/__init__.py index 83e5ae37d71efb..e058b9f5c25cc4 100644 --- a/homeassistant/components/telegram_bot/__init__.py +++ b/homeassistant/components/telegram_bot/__init__.py @@ -71,9 +71,9 @@ ATTR_KEYBOARD_INLINE, ATTR_MEDIA_TYPE, ATTR_MESSAGE, + ATTR_MESSAGE_ID, ATTR_MESSAGE_TAG, ATTR_MESSAGE_THREAD_ID, - ATTR_MESSAGEID, ATTR_ONE_TIME_KEYBOARD, ATTR_OPEN_PERIOD, ATTR_OPTIONS, @@ -264,7 +264,7 @@ vol.Optional(CONF_CONFIG_ENTRY_ID): cv.string, vol.Optional(ATTR_TITLE): cv.string, vol.Required(ATTR_MESSAGE): cv.string, - vol.Required(ATTR_MESSAGEID): vol.Any( + vol.Required(ATTR_MESSAGE_ID): vol.Any( cv.positive_int, vol.All(cv.string, "last") ), vol.Optional(ATTR_CHAT_ID): vol.Coerce(int), @@ -281,7 +281,7 @@ { vol.Optional(ATTR_ENTITY_ID): vol.All(cv.ensure_list, [cv.string]), vol.Optional(CONF_CONFIG_ENTRY_ID): cv.string, - vol.Required(ATTR_MESSAGEID): vol.Any( + vol.Required(ATTR_MESSAGE_ID): vol.Any( cv.positive_int, vol.All(cv.string, "last") ), vol.Optional(ATTR_CHAT_ID): vol.Coerce(int), @@ -311,7 +311,7 @@ { vol.Optional(ATTR_ENTITY_ID): vol.All(cv.ensure_list, [cv.string]), vol.Optional(CONF_CONFIG_ENTRY_ID): cv.string, - vol.Required(ATTR_MESSAGEID): vol.Any( + vol.Required(ATTR_MESSAGE_ID): vol.Any( cv.positive_int, vol.All(cv.string, "last") ), vol.Optional(ATTR_CHAT_ID): vol.Coerce(int), @@ -325,7 +325,7 @@ { vol.Optional(ATTR_ENTITY_ID): vol.All(cv.ensure_list, [cv.string]), vol.Optional(CONF_CONFIG_ENTRY_ID): cv.string, - vol.Required(ATTR_MESSAGEID): vol.Any( + vol.Required(ATTR_MESSAGE_ID): vol.Any( cv.positive_int, vol.All(cv.string, "last") ), vol.Optional(ATTR_CHAT_ID): vol.Coerce(int), @@ -347,7 +347,7 @@ vol.Optional(ATTR_ENTITY_ID): vol.All(cv.ensure_list, [cv.string]), vol.Optional(CONF_CONFIG_ENTRY_ID): cv.string, vol.Optional(ATTR_CHAT_ID): vol.Coerce(int), - vol.Required(ATTR_MESSAGEID): vol.Any( + vol.Required(ATTR_MESSAGE_ID): vol.Any( cv.positive_int, vol.All(cv.string, "last") ), } @@ -364,7 +364,7 @@ SERVICE_SCHEMA_SET_MESSAGE_REACTION = vol.Schema( { vol.Optional(CONF_CONFIG_ENTRY_ID): cv.string, - vol.Required(ATTR_MESSAGEID): vol.Any( + vol.Required(ATTR_MESSAGE_ID): vol.Any( cv.positive_int, vol.All(cv.string, "last") ), vol.Optional(ATTR_CHAT_ID): vol.Coerce(int), @@ -485,7 +485,7 @@ async def _async_send_telegram_message(service: ServiceCall) -> ServiceResponse: for chat_id, message_id in service_response.items(): formatted_response = { ATTR_CHAT_ID: int(chat_id), - ATTR_MESSAGEID: message_id, + ATTR_MESSAGE_ID: message_id, } if target_notify_entity_id: diff --git a/homeassistant/components/telegram_bot/bot.py b/homeassistant/components/telegram_bot/bot.py index cd6f9c825451d9..2e02841426d68a 100644 --- a/homeassistant/components/telegram_bot/bot.py +++ b/homeassistant/components/telegram_bot/bot.py @@ -73,9 +73,9 @@ ATTR_KEYBOARD, ATTR_KEYBOARD_INLINE, ATTR_MESSAGE, + ATTR_MESSAGE_ID, ATTR_MESSAGE_TAG, ATTR_MESSAGE_THREAD_ID, - ATTR_MESSAGEID, ATTR_MSG, ATTR_MSGID, ATTR_ONE_TIME_KEYBOARD, @@ -319,8 +319,8 @@ def _get_msg_ids( """ message_id: Any | None = None inline_message_id: int | None = None - if ATTR_MESSAGEID in msg_data: - message_id = msg_data[ATTR_MESSAGEID] + if ATTR_MESSAGE_ID in msg_data: + message_id = msg_data[ATTR_MESSAGE_ID] if ( isinstance(message_id, str) and (message_id == "last") @@ -491,7 +491,7 @@ async def _send_msg( event_data: dict[str, Any] = { ATTR_CHAT_ID: chat_id, - ATTR_MESSAGEID: message_id, + ATTR_MESSAGE_ID: message_id, } if message_tag is not None: event_data[ATTR_MESSAGE_TAG] = message_tag diff --git a/homeassistant/components/telegram_bot/const.py b/homeassistant/components/telegram_bot/const.py index a950c82584030d..b61554db9fe27c 100644 --- a/homeassistant/components/telegram_bot/const.py +++ b/homeassistant/components/telegram_bot/const.py @@ -102,7 +102,7 @@ ATTR_RESIZE_KEYBOARD = "resize_keyboard" ATTR_ONE_TIME_KEYBOARD = "one_time_keyboard" ATTR_KEYBOARD_INLINE = "inline_keyboard" -ATTR_MESSAGEID = "message_id" +ATTR_MESSAGE_ID = "message_id" ATTR_INLINE_MESSAGE_ID = "inline_message_id" ATTR_MEDIA_TYPE = "media_type" ATTR_MSG = "message" diff --git a/requirements_all.txt b/requirements_all.txt index 03df2842ca39a5..f5271221451396 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -464,7 +464,7 @@ airgradient==0.9.2 airly==1.1.0 # homeassistant.components.airos -airos==0.6.3 +airos==0.6.4 # homeassistant.components.airpatrol airpatrol==0.1.0 @@ -2101,7 +2101,7 @@ pyforked-daapd==0.1.14 pyfreedompro==1.1.0 # homeassistant.components.fritzbox -pyfritzhome==0.6.19 +pyfritzhome==0.6.20 # homeassistant.components.ifttt pyfttt==0.3 @@ -2787,7 +2787,7 @@ refoss-ha==1.2.5 regenmaschine==2024.03.0 # homeassistant.components.renault -renault-api==0.5.3 +renault-api==0.5.5 # homeassistant.components.renson renson-endura-delta==1.7.2 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 66106a8cae3bf9..3b9d9810f41699 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -449,7 +449,7 @@ airgradient==0.9.2 airly==1.1.0 # homeassistant.components.airos -airos==0.6.3 +airos==0.6.4 # homeassistant.components.airpatrol airpatrol==0.1.0 @@ -1793,7 +1793,7 @@ pyforked-daapd==0.1.14 pyfreedompro==1.1.0 # homeassistant.components.fritzbox -pyfritzhome==0.6.19 +pyfritzhome==0.6.20 # homeassistant.components.ifttt pyfttt==0.3 @@ -2356,7 +2356,7 @@ refoss-ha==1.2.5 regenmaschine==2024.03.0 # homeassistant.components.renault -renault-api==0.5.3 +renault-api==0.5.5 # homeassistant.components.renson renson-endura-delta==1.7.2 diff --git a/tests/components/matter/common.py b/tests/components/matter/common.py index a400970d2920c5..3956a0e61136e7 100644 --- a/tests/components/matter/common.py +++ b/tests/components/matter/common.py @@ -44,6 +44,7 @@ "heiman_motion_sensor_m1", "heiman_smoke_detector", "ikea_air_quality_monitor", + "ikea_bilresa_dual_button", "ikea_scroll_wheel", "inovelli_vtm30", "inovelli_vtm31", diff --git a/tests/components/matter/fixtures/nodes/ikea_bilresa_dual_button.json b/tests/components/matter/fixtures/nodes/ikea_bilresa_dual_button.json new file mode 100644 index 00000000000000..f93199890608bc --- /dev/null +++ b/tests/components/matter/fixtures/nodes/ikea_bilresa_dual_button.json @@ -0,0 +1,448 @@ +{ + "node_id": 137, + "date_commissioned": "2026-02-22T12:29:03.976957", + "last_interview": "2026-02-22T12:29:03.976975", + "interview_version": 6, + "available": true, + "is_bridge": false, + "attributes": { + "0/29/0": [ + { + "0": 18, + "1": 1 + }, + { + "0": 17, + "1": 1 + }, + { + "0": 22, + "1": 2 + } + ], + "0/29/1": [29, 31, 40, 42, 47, 48, 49, 51, 53, 60, 62, 63, 70], + "0/29/2": [41], + "0/29/3": [1, 2], + "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": 2 + } + ], + "0/31/1": [], + "0/31/2": 4, + "0/31/3": 3, + "0/31/4": 4, + "0/31/65532": 0, + "0/31/65533": 1, + "0/31/65528": [], + "0/31/65529": [], + "0/31/65531": [0, 1, 2, 3, 4, 65528, 65529, 65531, 65532, 65533], + "0/40/0": 17, + "0/40/1": "IKEA of Sweden", + "0/40/2": 4476, + "0/40/3": "BILRESA dual button", + "0/40/4": 32769, + "0/40/5": "", + "0/40/6": "**REDACTED**", + "0/40/7": 512, + "0/40/8": "P2.0", + "0/40/9": 17301509, + "0/40/10": "1.8.5", + "0/40/12": "E2489", + "0/40/19": { + "0": 3, + "1": 3 + }, + "0/40/21": 16973824, + "0/40/22": 1, + "0/40/65532": 0, + "0/40/65533": 3, + "0/40/65528": [], + "0/40/65529": [], + "0/40/65531": [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 19, 21, 22, 65528, 65529, 65531, + 65532, 65533 + ], + "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, 65528, 65529, 65531, 65532, 65533], + "0/47/0": 1, + "0/47/1": 0, + "0/47/2": "Primary Battery", + "0/47/11": 2820, + "0/47/12": 152, + "0/47/14": 0, + "0/47/15": false, + "0/47/16": 2, + "0/47/19": "AAA", + "0/47/20": 1, + "0/47/25": 2, + "0/47/31": [], + "0/47/65532": 10, + "0/47/65533": 2, + "0/47/65528": [], + "0/47/65529": [], + "0/47/65531": [ + 0, 1, 2, 11, 12, 14, 15, 16, 19, 20, 25, 31, 65528, 65529, 65531, 65532, + 65533 + ], + "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": 1, + "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/49/0": 1, + "0/49/1": [ + { + "0": "p0jbsOzJRNw=", + "1": true + } + ], + "0/49/2": 10, + "0/49/3": 20, + "0/49/4": true, + "0/49/5": 0, + "0/49/6": "p0jbsOzJRNw=", + "0/49/7": null, + "0/49/9": 4, + "0/49/10": 4, + "0/49/65532": 2, + "0/49/65533": 2, + "0/49/65528": [1, 5, 7], + "0/49/65529": [0, 3, 4, 6, 8], + "0/49/65531": [ + 0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 65528, 65529, 65531, 65532, 65533 + ], + "0/51/0": [ + { + "0": "MyHome", + "1": true, + "2": null, + "3": null, + "4": "dvpod07x2i8=", + "5": [], + "6": [ + "/VX8YmMnAAGdbt8e2cRiyA==", + "/QANuACgAAAAAAD//gCg/g==", + "/QANuACgAAD1TO6qdWUs7w==", + "/oAAAAAAAAB0+mh3TvHaLw==" + ], + "7": 4 + } + ], + "0/51/1": 1, + "0/51/2": 50, + "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, 8, 65528, 65529, 65531, 65532, 65533], + "0/53/0": 25, + "0/53/1": 2, + "0/53/2": "MyHome", + "0/53/3": 4660, + "0/53/4": 12054125955590472924, + "0/53/5": "QP0ADbgAoAAA", + "0/53/6": 0, + "0/53/7": [ + { + "0": 6498271992183290326, + "1": 31, + "2": 40960, + "3": 108129, + "4": 32059, + "5": 3, + "6": -9, + "7": -70, + "8": 0, + "9": 0, + "10": true, + "11": true, + "12": true, + "13": false + } + ], + "0/53/8": [ + { + "0": 6498271992183290326, + "1": 40960, + "2": 40, + "3": 0, + "4": 0, + "5": 3, + "6": 3, + "7": 31, + "8": true, + "9": true + } + ], + "0/53/9": 1775826714, + "0/53/10": 64, + "0/53/11": 207, + "0/53/12": 102, + "0/53/13": 57, + "0/53/14": 1, + "0/53/15": 1, + "0/53/16": 0, + "0/53/17": 0, + "0/53/18": 1, + "0/53/19": 1, + "0/53/20": 0, + "0/53/21": 0, + "0/53/22": 635, + "0/53/23": 618, + "0/53/24": 17, + "0/53/25": 618, + "0/53/26": 618, + "0/53/27": 17, + "0/53/28": 301, + "0/53/29": 335, + "0/53/30": 0, + "0/53/31": 0, + "0/53/32": 0, + "0/53/33": 0, + "0/53/34": 1, + "0/53/35": 0, + "0/53/36": 0, + "0/53/37": 0, + "0/53/38": 0, + "0/53/39": 126, + "0/53/40": 122, + "0/53/41": 3, + "0/53/42": 123, + "0/53/43": 0, + "0/53/44": 0, + "0/53/45": 0, + "0/53/46": 0, + "0/53/47": 0, + "0/53/48": 1, + "0/53/49": 2, + "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/59": { + "0": 672, + "1": 8335 + }, + "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, 59, + 60, 61, 62, 65528, 65529, 65531, 65532, 65533 + ], + "0/60/0": 0, + "0/60/1": null, + "0/60/2": null, + "0/60/65532": 1, + "0/60/65533": 1, + "0/60/65528": [], + "0/60/65529": [0, 1, 2], + "0/60/65531": [0, 1, 2, 65528, 65529, 65531, 65532, 65533], + "0/62/0": [ + { + "1": "FTABAQEkAgE3AyQTAhgmBIAigScmBYAlTTo3BiQVAiQRiRgkBwEkCAEwCUEEFgBzjtCW5Sd5kwGcyW1flDe1mgyBzjqEJklCSRRWhCw1RGuM8S9BldT/vgdRsTs7iEVR+AryTZlc1oP40DuD4jcKNQEoARgkAgE2AwQCBAEYMAQU/5YhC3rvJKYCTNlD7cpo6cX8TDEwBRRT9HTfU5Nds+HA8j+/MRP+0pVyIxgwC0BDdrNihDRmj5dj63c5Sv+elzAh7GnUOhssqp7gn8wDlH+RVr5Lst+L8eWVbBgIPNKINbazl6Sli28vzPR2Xx8zGA==", + "2": "FTABAQEkAgE3AyQUARgmBIAigScmBYAlTTo3BiQTAhgkBwEkCAEwCUEEyT62Yt4qMI+MorlmQ/Hxh2CpLetznVknlAbhvYAwTexpSxp9GnhR09SrcUhz3mOb0eZa2TylqcnPBhHJ2Ih2RTcKNQEpARgkAmAwBBRT9HTfU5Nds+HA8j+/MRP+0pVyIzAFFOMCO8Jk7ZCknJquFGPtPzJiNqsDGDALQI/Kc38hQyK7AkT7/pN4hiYW3LoWKT3NA43+ssMJoVpDcaZ989GXBQKIbHKbBEXzUQ1J8wfL7l2pL0Z8Lso9JwgY", + "254": 2 + } + ], + "0/62/1": [ + { + "1": "BIrruNo7r0gX6j6lq1dDi5zeK3jxcTavjt2o4adCCSCYtbxOakfb7C3GXqgV4LzulFSinbewmYkdqFBHqm5pxvU=", + "2": 4939, + "3": 2, + "4": 137, + "5": "Home", + "254": 2 + } + ], + "0/62/2": 5, + "0/62/3": 2, + "0/62/4": [ + "FTABAQAkAgE3AycUQhmZbaIbYjokFQIYJgRWZLcqJAUANwYnFEIZmW2iG2I6JBUCGCQHASQIATAJQQT2AlKGW/kOMjqayzeO0md523/fuhrhGEUU91uQpTiKo0I7wcPpKnmrwfQNPX6g0kEQl+VGaXa3e22lzfu5Tzp0Nwo1ASkBGCQCYDAEFOOMk13ScMKuT2hlaydi1yEJnhTqMAUU44yTXdJwwq5PaGVrJ2LXIQmeFOoYMAtAv2jJd1qd5miXbYesH1XrJ+vgyY0hzGuZ78N6Jw4Cb1oN1sLSpA+PNM0u7+hsEqcSvvn2eSV8EaRR+hg5YQjHDxg=", + "FTABAQEkAgE3AyQUARgmBIAigScmBYAlTTo3BiQUARgkBwEkCAEwCUEEiuu42juvSBfqPqWrV0OLnN4rePFxNq+O3ajhp0IJIJi1vE5qR9vsLcZeqBXgvO6UVKKdt7CZiR2oUEeqbmnG9TcKNQEpARgkAmAwBBTjAjvCZO2QpJyarhRj7T8yYjarAzAFFOMCO8Jk7ZCknJquFGPtPzJiNqsDGDALQE7hTxTRg92QOxwA1hK3xv8DaxvxL71r6ZHcNRzug9wNnonJ+NC84SFKvKDxwcBxHYqFdIyDiDgwJNTQIBgasmIY" + ], + "0/62/5": 2, + "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], + "0/70/0": 900, + "0/70/1": 1000, + "0/70/2": 5000, + "0/70/3": [], + "0/70/4": 2694576374, + "0/70/5": 2, + "0/70/6": 256, + "0/70/7": "Reset the application", + "0/70/8": 1, + "0/70/65532": 7, + "0/70/65533": 2, + "0/70/65528": [1, 4], + "0/70/65529": [0, 2, 3], + "0/70/65531": [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 65528, 65529, 65531, 65532, 65533 + ], + "1/3/0": 0, + "1/3/1": 0, + "1/3/65532": 0, + "1/3/65533": 4, + "1/3/65528": [], + "1/3/65529": [0], + "1/3/65531": [0, 1, 65528, 65529, 65531, 65532, 65533], + "1/29/0": [ + { + "0": 15, + "1": 3 + } + ], + "1/29/1": [3, 29, 59], + "1/29/2": [], + "1/29/3": [], + "1/29/4": [ + { + "0": null, + "1": 8, + "2": 2 + }, + { + "0": null, + "1": 67, + "2": 0 + }, + { + "0": null, + "1": 67, + "2": 3 + }, + { + "0": null, + "1": 67, + "2": 8, + "3": "button 1" + } + ], + "1/29/65532": 1, + "1/29/65533": 2, + "1/29/65528": [], + "1/29/65529": [], + "1/29/65531": [0, 1, 2, 3, 4, 65528, 65529, 65531, 65532, 65533], + "1/59/0": 2, + "1/59/1": 0, + "1/59/2": 2, + "1/59/65532": 30, + "1/59/65533": 1, + "1/59/65528": [], + "1/59/65529": [], + "1/59/65531": [0, 1, 2, 65528, 65529, 65531, 65532, 65533], + "2/3/0": 0, + "2/3/1": 0, + "2/3/65532": 0, + "2/3/65533": 4, + "2/3/65528": [], + "2/3/65529": [0], + "2/3/65531": [0, 1, 65528, 65529, 65531, 65532, 65533], + "2/29/0": [ + { + "0": 15, + "1": 3 + } + ], + "2/29/1": [3, 29, 59], + "2/29/2": [], + "2/29/3": [], + "2/29/4": [ + { + "0": null, + "1": 8, + "2": 3 + }, + { + "0": null, + "1": 67, + "2": 1 + }, + { + "0": null, + "1": 67, + "2": 4 + }, + { + "0": null, + "1": 67, + "2": 8, + "3": "button 2" + } + ], + "2/29/65532": 1, + "2/29/65533": 2, + "2/29/65528": [], + "2/29/65529": [], + "2/29/65531": [0, 1, 2, 3, 4, 65528, 65529, 65531, 65532, 65533], + "2/59/0": 2, + "2/59/1": 0, + "2/59/2": 2, + "2/59/65532": 30, + "2/59/65533": 1, + "2/59/65528": [], + "2/59/65529": [], + "2/59/65531": [0, 1, 2, 65528, 65529, 65531, 65532, 65533] + }, + "attribute_subscriptions": [] +} diff --git a/tests/components/matter/snapshots/test_event.ambr b/tests/components/matter/snapshots/test_event.ambr index 8b1cf16967c306..f1497bccf23d94 100644 --- a/tests/components/matter/snapshots/test_event.ambr +++ b/tests/components/matter/snapshots/test_event.ambr @@ -575,6 +575,134 @@ 'state': 'unknown', }) # --- +# name: test_events[ikea_bilresa_dual_button][event.bilresa_dual_button_button_1-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'event_types': list([ + 'multi_press_1', + 'multi_press_2', + 'long_press', + 'long_release', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'event', + 'entity_category': None, + 'entity_id': 'event.bilresa_dual_button_button_1', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Button (1)', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Button (1)', + 'platform': 'matter', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'button', + 'unique_id': '00000000000004D2-0000000000000089-MatterNodeDevice-1-GenericSwitch-59-1', + 'unit_of_measurement': None, + }) +# --- +# name: test_events[ikea_bilresa_dual_button][event.bilresa_dual_button_button_1-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'button', + 'event_type': None, + 'event_types': list([ + 'multi_press_1', + 'multi_press_2', + 'long_press', + 'long_release', + ]), + 'friendly_name': 'BILRESA dual button Button (1)', + }), + 'context': , + 'entity_id': 'event.bilresa_dual_button_button_1', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_events[ikea_bilresa_dual_button][event.bilresa_dual_button_button_2-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'event_types': list([ + 'multi_press_1', + 'multi_press_2', + 'long_press', + 'long_release', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'event', + 'entity_category': None, + 'entity_id': 'event.bilresa_dual_button_button_2', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Button (2)', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Button (2)', + 'platform': 'matter', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'button', + 'unique_id': '00000000000004D2-0000000000000089-MatterNodeDevice-2-GenericSwitch-59-1', + 'unit_of_measurement': None, + }) +# --- +# name: test_events[ikea_bilresa_dual_button][event.bilresa_dual_button_button_2-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'button', + 'event_type': None, + 'event_types': list([ + 'multi_press_1', + 'multi_press_2', + 'long_press', + 'long_release', + ]), + 'friendly_name': 'BILRESA dual button Button (2)', + }), + 'context': , + 'entity_id': 'event.bilresa_dual_button_button_2', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- # name: test_events[ikea_scroll_wheel][event.bilresa_scroll_wheel_button_1-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ diff --git a/tests/components/matter/snapshots/test_sensor.ambr b/tests/components/matter/snapshots/test_sensor.ambr index 33a6ae39b66cdc..211c85b3cacd3c 100644 --- a/tests/components/matter/snapshots/test_sensor.ambr +++ b/tests/components/matter/snapshots/test_sensor.ambr @@ -5776,6 +5776,273 @@ 'state': '19.71', }) # --- +# name: test_sensors[ikea_bilresa_dual_button][sensor.bilresa_dual_button_battery-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.bilresa_dual_button_battery', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Battery', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Battery', + 'platform': 'matter', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '00000000000004D2-0000000000000089-MatterNodeDevice-0-PowerSource-47-12', + 'unit_of_measurement': '%', + }) +# --- +# name: test_sensors[ikea_bilresa_dual_button][sensor.bilresa_dual_button_battery-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'battery', + 'friendly_name': 'BILRESA dual button Battery', + 'state_class': , + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.bilresa_dual_button_battery', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '76', + }) +# --- +# name: test_sensors[ikea_bilresa_dual_button][sensor.bilresa_dual_button_battery_type-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': , + 'entity_id': 'sensor.bilresa_dual_button_battery_type', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Battery type', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Battery type', + 'platform': 'matter', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'battery_replacement_description', + 'unique_id': '00000000000004D2-0000000000000089-MatterNodeDevice-0-PowerSourceBatReplacementDescription-47-19', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[ikea_bilresa_dual_button][sensor.bilresa_dual_button_battery_type-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'BILRESA dual button Battery type', + }), + 'context': , + 'entity_id': 'sensor.bilresa_dual_button_battery_type', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'AAA', + }) +# --- +# name: test_sensors[ikea_bilresa_dual_button][sensor.bilresa_dual_button_battery_voltage-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.bilresa_dual_button_battery_voltage', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Battery voltage', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + 'sensor.private': dict({ + 'suggested_unit_of_measurement': , + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Battery voltage', + 'platform': 'matter', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'battery_voltage', + 'unique_id': '00000000000004D2-0000000000000089-MatterNodeDevice-0-PowerSourceBatVoltage-47-11', + 'unit_of_measurement': , + }) +# --- +# name: test_sensors[ikea_bilresa_dual_button][sensor.bilresa_dual_button_battery_voltage-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'voltage', + 'friendly_name': 'BILRESA dual button Battery voltage', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.bilresa_dual_button_battery_voltage', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '2.82', + }) +# --- +# name: test_sensors[ikea_bilresa_dual_button][sensor.bilresa_dual_button_current_switch_position_1-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.bilresa_dual_button_current_switch_position_1', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Current switch position (1)', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Current switch position (1)', + 'platform': 'matter', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'switch_current_position', + 'unique_id': '00000000000004D2-0000000000000089-MatterNodeDevice-1-SwitchCurrentPosition-59-1', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[ikea_bilresa_dual_button][sensor.bilresa_dual_button_current_switch_position_1-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'BILRESA dual button Current switch position (1)', + 'state_class': , + }), + 'context': , + 'entity_id': 'sensor.bilresa_dual_button_current_switch_position_1', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0', + }) +# --- +# name: test_sensors[ikea_bilresa_dual_button][sensor.bilresa_dual_button_current_switch_position_2-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.bilresa_dual_button_current_switch_position_2', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Current switch position (2)', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Current switch position (2)', + 'platform': 'matter', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'switch_current_position', + 'unique_id': '00000000000004D2-0000000000000089-MatterNodeDevice-2-SwitchCurrentPosition-59-1', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[ikea_bilresa_dual_button][sensor.bilresa_dual_button_current_switch_position_2-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'BILRESA dual button Current switch position (2)', + 'state_class': , + }), + 'context': , + 'entity_id': 'sensor.bilresa_dual_button_current_switch_position_2', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0', + }) +# --- # name: test_sensors[ikea_scroll_wheel][sensor.bilresa_scroll_wheel_battery-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ diff --git a/tests/components/telegram_bot/test_telegram_bot.py b/tests/components/telegram_bot/test_telegram_bot.py index a0a149713c9973..3ddcce2bcd1745 100644 --- a/tests/components/telegram_bot/test_telegram_bot.py +++ b/tests/components/telegram_bot/test_telegram_bot.py @@ -48,9 +48,9 @@ ATTR_KEYBOARD_INLINE, ATTR_MEDIA_TYPE, ATTR_MESSAGE, + ATTR_MESSAGE_ID, ATTR_MESSAGE_TAG, ATTR_MESSAGE_THREAD_ID, - ATTR_MESSAGEID, ATTR_OPTIONS, ATTR_PARSER, ATTR_PASSWORD, @@ -209,7 +209,7 @@ async def test_send_message( "chats": [ { ATTR_CHAT_ID: 12345678, - ATTR_MESSAGEID: 12345, + ATTR_MESSAGE_ID: 12345, ATTR_ENTITY_ID: "notify.mock_title_mock_chat", } ] @@ -307,7 +307,7 @@ async def test_send_message_with_inline_keyboard( "chats": [ { ATTR_CHAT_ID: 12345678, - ATTR_MESSAGEID: 12345, + ATTR_MESSAGE_ID: 12345, ATTR_ENTITY_ID: "notify.mock_title_mock_chat", } ] @@ -566,7 +566,7 @@ async def test_send_file(hass: HomeAssistant, webhook_bot, service: str) -> None "chats": [ { ATTR_CHAT_ID: 12345678, - ATTR_MESSAGEID: 12345, + ATTR_MESSAGE_ID: 12345, ATTR_ENTITY_ID: "notify.mock_title_mock_chat", } ] @@ -1053,7 +1053,7 @@ async def test_send_message_with_config_entry( "chats": [ { ATTR_CHAT_ID: 123456, - ATTR_MESSAGEID: 12345, + ATTR_MESSAGE_ID: 12345, ATTR_ENTITY_ID: "notify.mock_title_mock_chat_1", } ] @@ -1140,7 +1140,7 @@ async def test_delete_message( await hass.services.async_call( DOMAIN, SERVICE_DELETE_MESSAGE, - {ATTR_CHAT_ID: 1, ATTR_MESSAGEID: "last"}, + {ATTR_CHAT_ID: 1, ATTR_MESSAGE_ID: "last"}, blocking=True, ) await hass.async_block_till_done() @@ -1164,7 +1164,7 @@ async def test_delete_message( "chats": [ { ATTR_CHAT_ID: 123456, - ATTR_MESSAGEID: 12345, + ATTR_MESSAGE_ID: 12345, ATTR_ENTITY_ID: "notify.mock_title_mock_chat_1", } ] @@ -1177,7 +1177,7 @@ async def test_delete_message( await hass.services.async_call( DOMAIN, SERVICE_DELETE_MESSAGE, - {ATTR_CHAT_ID: 123456, ATTR_MESSAGEID: "last"}, + {ATTR_CHAT_ID: 123456, ATTR_MESSAGE_ID: "last"}, blocking=True, ) @@ -1236,7 +1236,7 @@ async def test_edit_message_media( ATTR_CAPTION: "mock caption", ATTR_FILE: "/tmp/mock", # noqa: S108 ATTR_MEDIA_TYPE: media_type, - ATTR_MESSAGEID: 12345, + ATTR_MESSAGE_ID: 12345, ATTR_CHAT_ID: 123456, ATTR_KEYBOARD_INLINE: "/mock", ATTR_PARSER: PARSER_MD, @@ -1276,7 +1276,7 @@ async def test_edit_message( { ATTR_MESSAGE: "mock message", ATTR_CHAT_ID: 123456, - ATTR_MESSAGEID: 12345, + ATTR_MESSAGE_ID: 12345, ATTR_PARSER: PARSER_PLAIN_TEXT, }, blocking=True, @@ -1304,7 +1304,7 @@ async def test_edit_message( { ATTR_CAPTION: "mock caption", ATTR_CHAT_ID: 123456, - ATTR_MESSAGEID: 12345, + ATTR_MESSAGE_ID: 12345, ATTR_PARSER: PARSER_MD2, }, blocking=True, @@ -1328,7 +1328,7 @@ async def test_edit_message( await hass.services.async_call( DOMAIN, SERVICE_EDIT_REPLYMARKUP, - {ATTR_KEYBOARD_INLINE: [], ATTR_CHAT_ID: 123456, ATTR_MESSAGEID: 12345}, + {ATTR_KEYBOARD_INLINE: [], ATTR_CHAT_ID: 123456, ATTR_MESSAGE_ID: 12345}, blocking=True, ) @@ -1576,7 +1576,7 @@ async def test_send_video( "chats": [ { ATTR_CHAT_ID: 123456, - ATTR_MESSAGEID: 12345, + ATTR_MESSAGE_ID: 12345, ATTR_ENTITY_ID: "notify.mock_title_mock_chat_1", } ] @@ -1608,7 +1608,7 @@ async def test_send_video( "chats": [ { ATTR_CHAT_ID: 123456, - ATTR_MESSAGEID: 12345, + ATTR_MESSAGE_ID: 12345, ATTR_ENTITY_ID: "notify.mock_title_mock_chat_1", } ] @@ -1634,7 +1634,7 @@ async def test_set_message_reaction( "set_message_reaction", { ATTR_CHAT_ID: 123456, - ATTR_MESSAGEID: 54321, + ATTR_MESSAGE_ID: 54321, "reaction": "👍", "is_big": True, }, @@ -1759,7 +1759,7 @@ async def test_send_message_multi_target( "chats": [ { ATTR_CHAT_ID: 654321, - ATTR_MESSAGEID: 12345, + ATTR_MESSAGE_ID: 12345, ATTR_ENTITY_ID: "notify.mock_title_mock_chat_2", } ] @@ -1789,7 +1789,7 @@ async def test_notify_entity_send_message( "chats": [ { ATTR_CHAT_ID: 654321, - ATTR_MESSAGEID: 12345, + ATTR_MESSAGE_ID: 12345, ATTR_ENTITY_ID: "notify.mock_title_mock_chat_2", } ] @@ -1843,7 +1843,7 @@ async def test_migrate_chat_id( "chats": [ { ATTR_CHAT_ID: 654321, - ATTR_MESSAGEID: 12345, + ATTR_MESSAGE_ID: 12345, ATTR_ENTITY_ID: "notify.mock_title_mock_chat_2", } ] diff --git a/tests/components/tuya/test_event.py b/tests/components/tuya/test_event.py index 254f779040dec1..01b5a4cc4c7cec 100644 --- a/tests/components/tuya/test_event.py +++ b/tests/components/tuya/test_event.py @@ -5,11 +5,12 @@ import base64 from unittest.mock import patch +from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion from tuya_sharing import CustomerDevice, Manager -from homeassistant.const import Platform +from homeassistant.const import STATE_UNAVAILABLE, STATE_UNKNOWN, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er @@ -83,3 +84,60 @@ async def test_alarm_message_event( state = hass.states.get(entity_id) assert state.attributes == snapshot assert state.attributes["message"] + + +@pytest.mark.parametrize( + "mock_device_code", + ["wxkg_l8yaz4um5b3pwyvf"], +) +@patch("homeassistant.components.tuya.PLATFORMS", [Platform.EVENT]) +@pytest.mark.freeze_time("2024-01-01") +async def test_selective_state_update( + hass: HomeAssistant, + mock_manager: Manager, + mock_config_entry: MockConfigEntry, + mock_device: CustomerDevice, + mock_listener: MockDeviceListener, + freezer: FrozenDateTimeFactory, +) -> None: + """Ensure event is only triggered when device reports actual data.""" + entity_id = "event.bathroom_smart_switch_button_1" + await initialize_entry(hass, mock_manager, mock_config_entry, mock_device) + + # Initial state is unknown + assert hass.states.get(entity_id).state == STATE_UNKNOWN + + # Device receives a data update - event gets triggered and state gets updated + freezer.tick(10) + await mock_listener.async_send_device_update( + hass, mock_device, {"switch_mode1": "click"} + ) + assert hass.states.get(entity_id).state == "2024-01-01T00:00:10.000+00:00" + + # Device goes offline + freezer.tick(10) + mock_device.online = False + await mock_listener.async_send_device_update(hass, mock_device, None) + assert hass.states.get(entity_id).state == STATE_UNAVAILABLE + + # Device comes back online - state should go back to last known value, + # not new datetime since no new data update has come in + freezer.tick(10) + mock_device.online = True + await mock_listener.async_send_device_update(hass, mock_device, None) + assert hass.states.get(entity_id).state == "2024-01-01T00:00:10.000+00:00" + + # Device receives a new data update - event gets triggered and state gets updated + freezer.tick(10) + await mock_listener.async_send_device_update( + hass, mock_device, {"switch_mode1": "click"} + ) + assert hass.states.get(entity_id).state == "2024-01-01T00:00:40.000+00:00" + + # Device receives a data update on a different datapoint - event doesn't + # get triggered and state doesn't get updated + freezer.tick(10) + await mock_listener.async_send_device_update( + hass, mock_device, {"switch_mode2": "click"} + ) + assert hass.states.get(entity_id).state == "2024-01-01T00:00:40.000+00:00"