We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b1c0ef9 + c893272 commit 17eca14Copy full SHA for 17eca14
pyschlage/code.py
@@ -248,10 +248,8 @@ def save(self):
248
command = "updateaccesscode" if self.access_code_id else "addaccesscode"
249
resp = self._device.send_command(command, self.to_json())
250
251
- # Either `{ "accesscodeId": "XXX" }` appears to be returned on `addaccesscode`;
252
- # otherwise {} is returned when updated.
253
- # Thus, calling `self._update_with()` does now work here as it calls
254
- # `from_json()` which currently requires the presence other parameters.
+ # NOTE: We don't call self._update_with() here because the API only returns
+ # the accesscodeId field.
255
resp_json = resp.json()
256
if "accesscodeId" in resp_json:
257
self.access_code_id = resp_json["accesscodeId"]
0 commit comments