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

Mark device_classes inside devicegroupmeta as private #1129

Merged
merged 3 commits into from
Sep 2, 2021
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 miio/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def cli(ctx, debug: int, output: str):
ctx.obj = GlobalContextObject(debug=debug, output=output_func)


for device_class in DeviceGroupMeta.device_classes:
for device_class in DeviceGroupMeta._device_classes:
cli.add_command(device_class.get_device_group())


Expand Down
4 changes: 2 additions & 2 deletions miio/click_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def __init__(self, debug: int = 0, output: Callable = None):

class DeviceGroupMeta(type):

device_classes: Set[Type] = set()
_device_classes: Set[Type] = set()

def __new__(mcs, name, bases, namespace):
commands = {}
Expand Down Expand Up @@ -150,7 +150,7 @@ def get_device_group(dcls):
namespace["get_device_group"] = classmethod(get_device_group)

cls = super().__new__(mcs, name, bases, namespace)
mcs.device_classes.add(cls)
mcs._device_classes.add(cls)
return cls


Expand Down