Disable options flow for Shelly Wall Display (#103988)
parent
cf3a2741c5
commit
c92a90e04d
|
@ -29,6 +29,7 @@ from .const import (
|
|||
CONF_SLEEP_PERIOD,
|
||||
DOMAIN,
|
||||
LOGGER,
|
||||
MODEL_WALL_DISPLAY,
|
||||
BLEScannerMode,
|
||||
)
|
||||
from .coordinator import async_reconnect_soon, get_entry_data
|
||||
|
@ -363,8 +364,10 @@ class ShellyConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
@callback
|
||||
def async_supports_options_flow(cls, config_entry: ConfigEntry) -> bool:
|
||||
"""Return options flow support for this handler."""
|
||||
return config_entry.data.get("gen") == 2 and not config_entry.data.get(
|
||||
CONF_SLEEP_PERIOD
|
||||
return (
|
||||
config_entry.data.get("gen") == 2
|
||||
and not config_entry.data.get(CONF_SLEEP_PERIOD)
|
||||
and config_entry.data.get("model") != MODEL_WALL_DISPLAY
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -187,10 +187,12 @@ OTA_ERROR = "ota_error"
|
|||
OTA_PROGRESS = "ota_progress"
|
||||
OTA_SUCCESS = "ota_success"
|
||||
|
||||
MODEL_WALL_DISPLAY = "SAWD-0A1XX10EU1"
|
||||
|
||||
GEN1_RELEASE_URL = "https://shelly-api-docs.shelly.cloud/gen1/#changelog"
|
||||
GEN2_RELEASE_URL = "https://shelly-api-docs.shelly.cloud/gen2/changelog/"
|
||||
DEVICES_WITHOUT_FIRMWARE_CHANGELOG = (
|
||||
"SAWD-0A1XX10EU1",
|
||||
MODEL_WALL_DISPLAY,
|
||||
"SHMOS-01",
|
||||
"SHMOS-02",
|
||||
"SHTRV-01",
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
"""Tests for Shelly utils."""
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.shelly.const import GEN1_RELEASE_URL, GEN2_RELEASE_URL
|
||||
from homeassistant.components.shelly.const import (
|
||||
GEN1_RELEASE_URL,
|
||||
GEN2_RELEASE_URL,
|
||||
MODEL_WALL_DISPLAY,
|
||||
)
|
||||
from homeassistant.components.shelly.utils import (
|
||||
get_block_channel_name,
|
||||
get_block_device_sleep_period,
|
||||
|
@ -234,7 +238,7 @@ async def test_get_rpc_input_triggers(mock_rpc_device, monkeypatch) -> None:
|
|||
(1, "SHMOS-01", False, None),
|
||||
(1, "SHSW-1", False, GEN1_RELEASE_URL),
|
||||
(1, "SHSW-1", True, None),
|
||||
(2, "SAWD-0A1XX10EU1", False, None),
|
||||
(2, MODEL_WALL_DISPLAY, False, None),
|
||||
(2, "SNSW-102P16EU", False, GEN2_RELEASE_URL),
|
||||
(2, "SNSW-102P16EU", True, None),
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue