Exemple #1
0
def light_fixture():
    """Mock UniFi Protect Light device."""

    # disable pydantic validation so mocking can happen
    Light.__config__.validate_assignment = False

    data = json.loads(load_fixture("sample_light.json", integration=DOMAIN))
    yield Light.from_unifi_dict(**data)

    Light.__config__.validate_assignment = True
def mock_light():
    """Mock UniFi Protect Light device."""

    data = json.loads(load_fixture("sample_light.json", integration=DOMAIN))
    return Light.from_unifi_dict(**data)