def doorlock_fixture(): """Mock UniFi Protect Doorlock device.""" # disable pydantic validation so mocking can happen Doorlock.__config__.validate_assignment = False data = json.loads(load_fixture("sample_doorlock.json", integration=DOMAIN)) yield Doorlock.from_unifi_dict(**data) Doorlock.__config__.validate_assignment = True
def mock_doorlock(): """Mock UniFi Protect Doorlock device.""" data = json.loads(load_fixture("sample_doorlock.json", integration=DOMAIN)) return Doorlock.from_unifi_dict(**data)