71803418e5
Shelly device management app with mDNS/subnet discovery, inventory, configuration, and mass operations for Gen1/Gen2+ devices. Includes .gitignore excluding runtime data (device DB, user config), AI conversation history, build artifacts, and common Python/OS patterns.
46 lines
1.2 KiB
Python
46 lines
1.2 KiB
Python
"""Mass config metadata registry."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from shelly_manager.core.mass_config import (
|
|
get_mass_operation,
|
|
get_settings_preset,
|
|
get_status_preset,
|
|
)
|
|
|
|
|
|
def test_ble_disable_operation_registered() -> None:
|
|
op = get_mass_operation("ble_disable")
|
|
assert op is not None
|
|
assert op.kind == "rpc_config"
|
|
assert 2 in op.supported_generations
|
|
assert op.suggested_preset_id == "ble_enabled"
|
|
|
|
|
|
def test_reboot_operation_registered() -> None:
|
|
op = get_mass_operation("reboot")
|
|
assert op is not None
|
|
assert op.kind == "reboot"
|
|
assert op.suggested_status_preset_id == "g2_needs_reboot"
|
|
|
|
|
|
def test_g2_needs_reboot_status_preset() -> None:
|
|
p = get_status_preset("g2_needs_reboot")
|
|
assert p is not None
|
|
assert "restart" in p.status_path.lower()
|
|
|
|
|
|
def test_ble_enabled_preset() -> None:
|
|
p = get_settings_preset("ble_enabled")
|
|
assert p is not None
|
|
assert p.settings_path == "ble.enable"
|
|
assert p.settings_match == "truthy"
|
|
|
|
|
|
def test_status_preset_gen2_switch() -> None:
|
|
from shelly_manager.core.mass_config import get_status_preset
|
|
|
|
p = get_status_preset("g2_sw0_on")
|
|
assert p is not None
|
|
assert "switch:0" in p.status_path
|