Fix Shelly button type in roller mode (#57429)

This commit is contained in:
Shay Levy 2021-10-10 22:39:57 +03:00 committed by GitHub
parent ee80ccf7a6
commit 6820faf5a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -133,6 +133,10 @@ def is_block_momentary_input(settings: dict[str, Any], block: Block) -> bool:
if settings["device"]["type"] in SHBTN_MODELS:
return True
if settings.get("mode") == "roller":
button_type = settings["rollers"][0]["button_type"]
return button_type in ["momentary", "momentary_on_release"]
button = settings.get("relays") or settings.get("lights") or settings.get("inputs")
if button is None:
return False