Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document _prop and remove unused parameter #35

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading