From b1f1528ee346c7a6c19e1812b507b4ab863f5106 Mon Sep 17 00:00:00 2001 From: Sandy Date: Tue, 21 May 2024 14:02:29 -0400 Subject: [PATCH] Fix install not including many files (#5) * Include enum in installation * rename device to init for each device --- .gitignore | 5 ++++- midealocal/backports/__init__.py | 0 midealocal/devices/__init__.py | 4 ++-- midealocal/devices/a1/{device.py => __init__.py} | 0 midealocal/devices/ac/{device.py => __init__.py} | 0 midealocal/devices/b0/{device.py => __init__.py} | 0 midealocal/devices/b1/{device.py => __init__.py} | 0 midealocal/devices/b3/{device.py => __init__.py} | 0 midealocal/devices/b4/{device.py => __init__.py} | 0 midealocal/devices/b6/{device.py => __init__.py} | 0 midealocal/devices/bf/{device.py => __init__.py} | 0 midealocal/devices/c2/{device.py => __init__.py} | 0 midealocal/devices/c3/{device.py => __init__.py} | 0 midealocal/devices/ca/{device.py => __init__.py} | 0 midealocal/devices/cc/{device.py => __init__.py} | 0 midealocal/devices/cd/{device.py => __init__.py} | 0 midealocal/devices/ce/{device.py => __init__.py} | 0 midealocal/devices/cf/{device.py => __init__.py} | 0 midealocal/devices/da/{device.py => __init__.py} | 0 midealocal/devices/db/{device.py => __init__.py} | 0 midealocal/devices/dc/{device.py => __init__.py} | 0 midealocal/devices/e1/{device.py => __init__.py} | 0 midealocal/devices/e2/{device.py => __init__.py} | 0 midealocal/devices/e3/{device.py => __init__.py} | 0 midealocal/devices/e6/{device.py => __init__.py} | 0 midealocal/devices/e8/{device.py => __init__.py} | 0 midealocal/devices/ea/{device.py => __init__.py} | 0 midealocal/devices/ec/{device.py => __init__.py} | 0 midealocal/devices/ed/{device.py => __init__.py} | 0 midealocal/devices/fa/{device.py => __init__.py} | 0 midealocal/devices/fb/{device.py => __init__.py} | 0 midealocal/devices/fc/{device.py => __init__.py} | 0 midealocal/devices/fd/{device.py => __init__.py} | 0 midealocal/devices/x13/{device.py => __init__.py} | 0 midealocal/devices/x26/{device.py => __init__.py} | 0 midealocal/devices/x34/{device.py => __init__.py} | 0 midealocal/devices/x40/{device.py => __init__.py} | 0 37 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 midealocal/backports/__init__.py rename midealocal/devices/a1/{device.py => __init__.py} (100%) rename midealocal/devices/ac/{device.py => __init__.py} (100%) rename midealocal/devices/b0/{device.py => __init__.py} (100%) rename midealocal/devices/b1/{device.py => __init__.py} (100%) rename midealocal/devices/b3/{device.py => __init__.py} (100%) rename midealocal/devices/b4/{device.py => __init__.py} (100%) rename midealocal/devices/b6/{device.py => __init__.py} (100%) rename midealocal/devices/bf/{device.py => __init__.py} (100%) rename midealocal/devices/c2/{device.py => __init__.py} (100%) rename midealocal/devices/c3/{device.py => __init__.py} (100%) rename midealocal/devices/ca/{device.py => __init__.py} (100%) rename midealocal/devices/cc/{device.py => __init__.py} (100%) rename midealocal/devices/cd/{device.py => __init__.py} (100%) rename midealocal/devices/ce/{device.py => __init__.py} (100%) rename midealocal/devices/cf/{device.py => __init__.py} (100%) rename midealocal/devices/da/{device.py => __init__.py} (100%) rename midealocal/devices/db/{device.py => __init__.py} (100%) rename midealocal/devices/dc/{device.py => __init__.py} (100%) rename midealocal/devices/e1/{device.py => __init__.py} (100%) rename midealocal/devices/e2/{device.py => __init__.py} (100%) rename midealocal/devices/e3/{device.py => __init__.py} (100%) rename midealocal/devices/e6/{device.py => __init__.py} (100%) rename midealocal/devices/e8/{device.py => __init__.py} (100%) rename midealocal/devices/ea/{device.py => __init__.py} (100%) rename midealocal/devices/ec/{device.py => __init__.py} (100%) rename midealocal/devices/ed/{device.py => __init__.py} (100%) rename midealocal/devices/fa/{device.py => __init__.py} (100%) rename midealocal/devices/fb/{device.py => __init__.py} (100%) rename midealocal/devices/fc/{device.py => __init__.py} (100%) rename midealocal/devices/fd/{device.py => __init__.py} (100%) rename midealocal/devices/x13/{device.py => __init__.py} (100%) rename midealocal/devices/x26/{device.py => __init__.py} (100%) rename midealocal/devices/x34/{device.py => __init__.py} (100%) rename midealocal/devices/x40/{device.py => __init__.py} (100%) diff --git a/.gitignore b/.gitignore index 9a7d8b2e..d3c6fa13 100644 --- a/.gitignore +++ b/.gitignore @@ -127,4 +127,7 @@ dmypy.json # Pyre type checker .pyre/ -reports/ \ No newline at end of file +reports/ + +# IDE +.idea/ \ No newline at end of file diff --git a/midealocal/backports/__init__.py b/midealocal/backports/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/midealocal/devices/__init__.py b/midealocal/devices/__init__.py index 0a7e29d8..4111e8e9 100644 --- a/midealocal/devices/__init__.py +++ b/midealocal/devices/__init__.py @@ -16,9 +16,9 @@ def device_selector( ): try: if device_type < 0xA0: - device_path = f".{'x%02x' % device_type}.device" + device_path = f".{'x%02x' % device_type}" else: - device_path = f".{'%02x' % device_type}.device" + device_path = f".{'%02x' % device_type}" module = import_module(device_path, __package__) device = module.MideaAppliance( name=name, diff --git a/midealocal/devices/a1/device.py b/midealocal/devices/a1/__init__.py similarity index 100% rename from midealocal/devices/a1/device.py rename to midealocal/devices/a1/__init__.py diff --git a/midealocal/devices/ac/device.py b/midealocal/devices/ac/__init__.py similarity index 100% rename from midealocal/devices/ac/device.py rename to midealocal/devices/ac/__init__.py diff --git a/midealocal/devices/b0/device.py b/midealocal/devices/b0/__init__.py similarity index 100% rename from midealocal/devices/b0/device.py rename to midealocal/devices/b0/__init__.py diff --git a/midealocal/devices/b1/device.py b/midealocal/devices/b1/__init__.py similarity index 100% rename from midealocal/devices/b1/device.py rename to midealocal/devices/b1/__init__.py diff --git a/midealocal/devices/b3/device.py b/midealocal/devices/b3/__init__.py similarity index 100% rename from midealocal/devices/b3/device.py rename to midealocal/devices/b3/__init__.py diff --git a/midealocal/devices/b4/device.py b/midealocal/devices/b4/__init__.py similarity index 100% rename from midealocal/devices/b4/device.py rename to midealocal/devices/b4/__init__.py diff --git a/midealocal/devices/b6/device.py b/midealocal/devices/b6/__init__.py similarity index 100% rename from midealocal/devices/b6/device.py rename to midealocal/devices/b6/__init__.py diff --git a/midealocal/devices/bf/device.py b/midealocal/devices/bf/__init__.py similarity index 100% rename from midealocal/devices/bf/device.py rename to midealocal/devices/bf/__init__.py diff --git a/midealocal/devices/c2/device.py b/midealocal/devices/c2/__init__.py similarity index 100% rename from midealocal/devices/c2/device.py rename to midealocal/devices/c2/__init__.py diff --git a/midealocal/devices/c3/device.py b/midealocal/devices/c3/__init__.py similarity index 100% rename from midealocal/devices/c3/device.py rename to midealocal/devices/c3/__init__.py diff --git a/midealocal/devices/ca/device.py b/midealocal/devices/ca/__init__.py similarity index 100% rename from midealocal/devices/ca/device.py rename to midealocal/devices/ca/__init__.py diff --git a/midealocal/devices/cc/device.py b/midealocal/devices/cc/__init__.py similarity index 100% rename from midealocal/devices/cc/device.py rename to midealocal/devices/cc/__init__.py diff --git a/midealocal/devices/cd/device.py b/midealocal/devices/cd/__init__.py similarity index 100% rename from midealocal/devices/cd/device.py rename to midealocal/devices/cd/__init__.py diff --git a/midealocal/devices/ce/device.py b/midealocal/devices/ce/__init__.py similarity index 100% rename from midealocal/devices/ce/device.py rename to midealocal/devices/ce/__init__.py diff --git a/midealocal/devices/cf/device.py b/midealocal/devices/cf/__init__.py similarity index 100% rename from midealocal/devices/cf/device.py rename to midealocal/devices/cf/__init__.py diff --git a/midealocal/devices/da/device.py b/midealocal/devices/da/__init__.py similarity index 100% rename from midealocal/devices/da/device.py rename to midealocal/devices/da/__init__.py diff --git a/midealocal/devices/db/device.py b/midealocal/devices/db/__init__.py similarity index 100% rename from midealocal/devices/db/device.py rename to midealocal/devices/db/__init__.py diff --git a/midealocal/devices/dc/device.py b/midealocal/devices/dc/__init__.py similarity index 100% rename from midealocal/devices/dc/device.py rename to midealocal/devices/dc/__init__.py diff --git a/midealocal/devices/e1/device.py b/midealocal/devices/e1/__init__.py similarity index 100% rename from midealocal/devices/e1/device.py rename to midealocal/devices/e1/__init__.py diff --git a/midealocal/devices/e2/device.py b/midealocal/devices/e2/__init__.py similarity index 100% rename from midealocal/devices/e2/device.py rename to midealocal/devices/e2/__init__.py diff --git a/midealocal/devices/e3/device.py b/midealocal/devices/e3/__init__.py similarity index 100% rename from midealocal/devices/e3/device.py rename to midealocal/devices/e3/__init__.py diff --git a/midealocal/devices/e6/device.py b/midealocal/devices/e6/__init__.py similarity index 100% rename from midealocal/devices/e6/device.py rename to midealocal/devices/e6/__init__.py diff --git a/midealocal/devices/e8/device.py b/midealocal/devices/e8/__init__.py similarity index 100% rename from midealocal/devices/e8/device.py rename to midealocal/devices/e8/__init__.py diff --git a/midealocal/devices/ea/device.py b/midealocal/devices/ea/__init__.py similarity index 100% rename from midealocal/devices/ea/device.py rename to midealocal/devices/ea/__init__.py diff --git a/midealocal/devices/ec/device.py b/midealocal/devices/ec/__init__.py similarity index 100% rename from midealocal/devices/ec/device.py rename to midealocal/devices/ec/__init__.py diff --git a/midealocal/devices/ed/device.py b/midealocal/devices/ed/__init__.py similarity index 100% rename from midealocal/devices/ed/device.py rename to midealocal/devices/ed/__init__.py diff --git a/midealocal/devices/fa/device.py b/midealocal/devices/fa/__init__.py similarity index 100% rename from midealocal/devices/fa/device.py rename to midealocal/devices/fa/__init__.py diff --git a/midealocal/devices/fb/device.py b/midealocal/devices/fb/__init__.py similarity index 100% rename from midealocal/devices/fb/device.py rename to midealocal/devices/fb/__init__.py diff --git a/midealocal/devices/fc/device.py b/midealocal/devices/fc/__init__.py similarity index 100% rename from midealocal/devices/fc/device.py rename to midealocal/devices/fc/__init__.py diff --git a/midealocal/devices/fd/device.py b/midealocal/devices/fd/__init__.py similarity index 100% rename from midealocal/devices/fd/device.py rename to midealocal/devices/fd/__init__.py diff --git a/midealocal/devices/x13/device.py b/midealocal/devices/x13/__init__.py similarity index 100% rename from midealocal/devices/x13/device.py rename to midealocal/devices/x13/__init__.py diff --git a/midealocal/devices/x26/device.py b/midealocal/devices/x26/__init__.py similarity index 100% rename from midealocal/devices/x26/device.py rename to midealocal/devices/x26/__init__.py diff --git a/midealocal/devices/x34/device.py b/midealocal/devices/x34/__init__.py similarity index 100% rename from midealocal/devices/x34/device.py rename to midealocal/devices/x34/__init__.py diff --git a/midealocal/devices/x40/device.py b/midealocal/devices/x40/__init__.py similarity index 100% rename from midealocal/devices/x40/device.py rename to midealocal/devices/x40/__init__.py