diff --git a/homeassistant/components/shelly/binary_sensor.py b/homeassistant/components/shelly/binary_sensor.py index b85baa1a630..dcaacde9ba9 100644 --- a/homeassistant/components/shelly/binary_sensor.py +++ b/homeassistant/components/shelly/binary_sensor.py @@ -5,7 +5,7 @@ from __future__ import annotations from dataclasses import dataclass from typing import Final, cast -from aioshelly.const import RPC_GENERATIONS +from aioshelly.const import MODEL_FLOOD_G4, RPC_GENERATIONS from homeassistant.components.binary_sensor import ( DOMAIN as BINARY_SENSOR_PLATFORM, @@ -335,6 +335,7 @@ RPC_SENSORS: Final = { device_class=BinarySensorDeviceClass.PROBLEM, entity_category=EntityCategory.DIAGNOSTIC, supported=lambda status: status.get("alarm") is not None, + models={MODEL_FLOOD_G4}, ), "presence_num_objects": RpcBinarySensorDescription( key="presence", diff --git a/tests/components/shelly/test_binary_sensor.py b/tests/components/shelly/test_binary_sensor.py index c79da9d5427..9ce7ecd77df 100644 --- a/tests/components/shelly/test_binary_sensor.py +++ b/tests/components/shelly/test_binary_sensor.py @@ -3,7 +3,12 @@ from copy import deepcopy from unittest.mock import Mock -from aioshelly.const import MODEL_BLU_GATEWAY_G3, MODEL_MOTION, MODEL_PLUS_SMOKE +from aioshelly.const import ( + MODEL_BLU_GATEWAY_G3, + MODEL_FLOOD_G4, + MODEL_MOTION, + MODEL_PLUS_SMOKE, +) from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion @@ -612,7 +617,7 @@ async def test_rpc_flood_entities( snapshot: SnapshotAssertion, ) -> None: """Test RPC flood sensor entities.""" - await init_integration(hass, 4) + await init_integration(hass, 4, model=MODEL_FLOOD_G4) for entity in ("flood", "mute", "cable_unplugged"): entity_id = f"{BINARY_SENSOR_DOMAIN}.test_name_kitchen_{entity}" @@ -630,7 +635,7 @@ async def test_rpc_flood_cable_unplugged( monkeypatch: pytest.MonkeyPatch, ) -> None: """Test RPC flood cable unplugged entity.""" - await init_integration(hass, 4) + await init_integration(hass, 4, model=MODEL_FLOOD_G4) entity_id = f"{BINARY_SENSOR_DOMAIN}.test_name_kitchen_cable_unplugged"