Skip to content

Commit 17eca14

Browse files
authored
Merge pull request #208 from dknowles2/comment
Clarify a comment
2 parents b1c0ef9 + c893272 commit 17eca14

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pyschlage/code.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,8 @@ def save(self):
248248
command = "updateaccesscode" if self.access_code_id else "addaccesscode"
249249
resp = self._device.send_command(command, self.to_json())
250250

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.
251+
# NOTE: We don't call self._update_with() here because the API only returns
252+
# the accesscodeId field.
255253
resp_json = resp.json()
256254
if "accesscodeId" in resp_json:
257255
self.access_code_id = resp_json["accesscodeId"]

0 commit comments

Comments
 (0)