Skip to content

Commit

Permalink
document _prop and remove unused parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mdz committed Oct 29, 2023
1 parent 6cf8142 commit 2f47a00
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
- id: trailing-whitespace
- id: check-yaml
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 23.10.1
hooks:
- id: black
args:
Expand Down
13 changes: 12 additions & 1 deletion smarttub/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,19 @@ def __init__(self, spa: Spa, **properties):
self._prop("watercare")

def _prop(
self, json_key, instance_variable_name=None, optional=True, constructor=None
self,
json_key,
instance_variable_name=None,
constructor=None,
):
"""Set an instance variable corresponding to the specified JSON property
Arguments:
json_key -- a key in the self.properties map
instance_variable_name -- the name of the variable to set
constructor -- a callable which accepts the raw value as an argument, and returns an appropriate internal representation (e.g. enum)
"""

if instance_variable_name is None:
instance_variable_name = underscore(json_key)
if json_key in self.properties:
Expand Down

0 comments on commit 2f47a00

Please sign in to comment.