diff --git a/.github/workflows/main.yml b/haco/v0/.github/workflows/main.yml similarity index 100% rename from .github/workflows/main.yml rename to haco/v0/.github/workflows/main.yml diff --git a/Dockerfile b/haco/v0/Dockerfile similarity index 100% rename from Dockerfile rename to haco/v0/Dockerfile diff --git a/README.md b/haco/v0/README.md similarity index 100% rename from README.md rename to haco/v0/README.md diff --git a/assets/air_fryer_cookbook.png b/haco/v0/assets/air_fryer_cookbook.png similarity index 100% rename from assets/air_fryer_cookbook.png rename to haco/v0/assets/air_fryer_cookbook.png diff --git a/assets/greeter_select.png b/haco/v0/assets/greeter_select.png similarity index 100% rename from assets/greeter_select.png rename to haco/v0/assets/greeter_select.png diff --git a/assets/memory_sensor.png b/haco/v0/assets/memory_sensor.png similarity index 100% rename from assets/memory_sensor.png rename to haco/v0/assets/memory_sensor.png diff --git a/assets/restart_button.png b/haco/v0/assets/restart_button.png similarity index 100% rename from assets/restart_button.png rename to haco/v0/assets/restart_button.png diff --git a/assets/weblog_select.png b/haco/v0/assets/weblog_select.png similarity index 100% rename from assets/weblog_select.png rename to haco/v0/assets/weblog_select.png diff --git a/berry/haco.be b/haco/v0/berry/haco.be similarity index 100% rename from berry/haco.be rename to haco/v0/berry/haco.be diff --git a/berry/haco_autoexec.be b/haco/v0/berry/haco_autoexec.be similarity index 100% rename from berry/haco_autoexec.be rename to haco/v0/berry/haco_autoexec.be diff --git a/berry/haco_version.be b/haco/v0/berry/haco_version.be similarity index 100% rename from berry/haco_version.be rename to haco/v0/berry/haco_version.be diff --git a/berry/manifest.yaml b/haco/v0/berry/manifest.yaml similarity index 100% rename from berry/manifest.yaml rename to haco/v0/berry/manifest.yaml diff --git a/docker-compose.yml b/haco/v0/docker-compose.yml similarity index 100% rename from docker-compose.yml rename to haco/v0/docker-compose.yml diff --git a/ha/addon/CHANGELOG.md b/haco/v0/ha/addon/CHANGELOG.md similarity index 100% rename from ha/addon/CHANGELOG.md rename to haco/v0/ha/addon/CHANGELOG.md diff --git a/ha/addon/DOCS.md b/haco/v0/ha/addon/DOCS.md similarity index 100% rename from ha/addon/DOCS.md rename to haco/v0/ha/addon/DOCS.md diff --git a/ha/addon/Dockerfile b/haco/v0/ha/addon/Dockerfile similarity index 100% rename from ha/addon/Dockerfile rename to haco/v0/ha/addon/Dockerfile diff --git a/ha/addon/README.md b/haco/v0/ha/addon/README.md similarity index 100% rename from ha/addon/README.md rename to haco/v0/ha/addon/README.md diff --git a/ha/addon/config.yaml b/haco/v0/ha/addon/config.yaml similarity index 100% rename from ha/addon/config.yaml rename to haco/v0/ha/addon/config.yaml diff --git a/ha/addon/icon.png b/haco/v0/ha/addon/icon.png similarity index 100% rename from ha/addon/icon.png rename to haco/v0/ha/addon/icon.png diff --git a/ha/addon/logo.png b/haco/v0/ha/addon/logo.png similarity index 100% rename from ha/addon/logo.png rename to haco/v0/ha/addon/logo.png diff --git a/ha/addon/run.sh b/haco/v0/ha/addon/run.sh similarity index 100% rename from ha/addon/run.sh rename to haco/v0/ha/addon/run.sh diff --git a/haco/__init__.py b/haco/v0/haco/__init__.py similarity index 100% rename from haco/__init__.py rename to haco/v0/haco/__init__.py diff --git a/haco/berry.py b/haco/v0/haco/berry.py similarity index 100% rename from haco/berry.py rename to haco/v0/haco/berry.py diff --git a/haco/binary_sensor.py b/haco/v0/haco/binary_sensor.py similarity index 100% rename from haco/binary_sensor.py rename to haco/v0/haco/binary_sensor.py diff --git a/haco/button.py b/haco/v0/haco/button.py similarity index 99% rename from haco/button.py rename to haco/v0/haco/button.py index d1b1fbb..4004dd8 100644 --- a/haco/button.py +++ b/haco/v0/haco/button.py @@ -1,6 +1,7 @@ -from haco import schema from haco.control import Control +from haco import schema + class Button(Control): NAME = 'button' diff --git a/haco/callback.py b/haco/v0/haco/callback.py similarity index 100% rename from haco/callback.py rename to haco/v0/haco/callback.py index dab8018..6728c83 100644 --- a/haco/callback.py +++ b/haco/v0/haco/callback.py @@ -1,12 +1,12 @@ -from collections import namedtuple - import inspect import typing +from collections import namedtuple from typing import _AnnotatedAlias -from haco import berry, schema from haco.trigger import Trigger, Rule +from haco import berry, schema + Signature = namedtuple('Signature', ['type', 'expression']) diff --git a/haco/climate.py b/haco/v0/haco/climate.py similarity index 100% rename from haco/climate.py rename to haco/v0/haco/climate.py diff --git a/haco/constants.py b/haco/v0/haco/constants.py similarity index 100% rename from haco/constants.py rename to haco/v0/haco/constants.py diff --git a/haco/control.py b/haco/v0/haco/control.py similarity index 99% rename from haco/control.py rename to haco/v0/haco/control.py index b946d99..16ce18c 100644 --- a/haco/control.py +++ b/haco/v0/haco/control.py @@ -2,11 +2,12 @@ import logging from functools import partial import haco.constants -from haco import tools, constants from haco.callback import Callback from haco.schema import Schema, Platform, Tasmota, HomeAssistant, AnnounceTopic, Capability from haco.tools import log_publish +from haco import tools, constants + class Control: NAME = None diff --git a/haco/debugging.py b/haco/v0/haco/debugging.py similarity index 99% rename from haco/debugging.py rename to haco/v0/haco/debugging.py index 8ebd201..2a7a8e2 100644 --- a/haco/debugging.py +++ b/haco/v0/haco/debugging.py @@ -1,11 +1,12 @@ import random from typing import Any -from haco import trigger, Update, Response from haco.sensor import Sensor from haco.tasmota import Tasmota from haco.tools import get_latest +from haco import trigger, Update, Response + def get_memory_sensor(): memory_sensor = Sensor('Memory Free', uom='kB', uom_type='DATA_SIZE', data_type=int) diff --git a/haco/device.py b/haco/v0/haco/device.py similarity index 99% rename from haco/device.py rename to haco/v0/haco/device.py index 08f18dc..3583e32 100644 --- a/haco/device.py +++ b/haco/v0/haco/device.py @@ -2,11 +2,12 @@ import json from pathlib import Path from typing import List -from haco import tools, constants from haco.control import Control from haco.device_data import DeviceData from haco.tools import log_publish, split_into_chunks, log_subscribe +from haco import tools, constants + class Device: diff --git a/haco/device_data.py b/haco/v0/haco/device_data.py similarity index 100% rename from haco/device_data.py rename to haco/v0/haco/device_data.py diff --git a/haco/fan.py b/haco/v0/haco/fan.py similarity index 99% rename from haco/fan.py rename to haco/v0/haco/fan.py index 11ecc22..c6472d7 100644 --- a/haco/fan.py +++ b/haco/v0/haco/fan.py @@ -1,8 +1,9 @@ -from haco import constants from haco.control import Control from haco.schema import Schema, Capability, AnnounceTopic, Tasmota, ControlType, HomeAssistant from haco.tools import get_range_pair, invert_bool +from haco import constants + class Fan(Control): NAME = 'fan' diff --git a/haco/load_configs.py b/haco/v0/haco/load_configs.py similarity index 100% rename from haco/load_configs.py rename to haco/v0/haco/load_configs.py index c49967b..ff1128d 100644 --- a/haco/load_configs.py +++ b/haco/v0/haco/load_configs.py @@ -1,14 +1,14 @@ -from importlib import reload - import importlib.util import json +from importlib import reload from pathlib import Path -from haco import tools from haco.constants import CONFIGS_PATH, OPTIONS_PATH from haco.control import Control from haco.device import Device +from haco import tools + def load_json(file_path): with open(file_path, 'r') as json_file: diff --git a/haco/mqtt.py b/haco/v0/haco/mqtt.py similarity index 100% rename from haco/mqtt.py rename to haco/v0/haco/mqtt.py index 8fb7e40..f1f3c1c 100644 --- a/haco/mqtt.py +++ b/haco/v0/haco/mqtt.py @@ -3,14 +3,14 @@ import json from pathlib import Path import aiomqtt - -from haco import constants, tools from haco.constants import MQTT_PASSWORD, MQTT_HOST, MQTT_PORT, MQTT_USERNAME from haco.device import Device from haco.device_data import DeviceData from haco.load_configs import load_devices from haco.tools import log_received, logger +from haco import constants, tools + async def listen(client, devices): TOPIC_ANNOUNCE = f"haco/{constants.BRANCH}/+/announce" diff --git a/haco/number.py b/haco/v0/haco/number.py similarity index 100% rename from haco/number.py rename to haco/v0/haco/number.py index 9da7c87..53524d5 100644 --- a/haco/number.py +++ b/haco/v0/haco/number.py @@ -1,8 +1,8 @@ from haco.control import Control -from haco.data.uom import Uom - from haco.tools import get_range_pair +from haco.data.uom import Uom + class Number(Control): NAME = 'number' diff --git a/haco/pulldown.py b/haco/v0/haco/pulldown.py similarity index 100% rename from haco/pulldown.py rename to haco/v0/haco/pulldown.py diff --git a/haco/schema.py b/haco/v0/haco/schema.py similarity index 100% rename from haco/schema.py rename to haco/v0/haco/schema.py diff --git a/haco/sensor.py b/haco/v0/haco/sensor.py similarity index 100% rename from haco/sensor.py rename to haco/v0/haco/sensor.py index 2a1c26e..425ee0f 100644 --- a/haco/sensor.py +++ b/haco/v0/haco/sensor.py @@ -1,7 +1,7 @@ -from haco import schema from haco.control import Control -from haco.data.type_sensor import DeviceClassSensor +from haco import schema +from haco.data.type_sensor import DeviceClassSensor from haco.data.uom import Uom diff --git a/haco/start.py b/haco/v0/haco/start.py similarity index 100% rename from haco/start.py rename to haco/v0/haco/start.py diff --git a/haco/switch.py b/haco/v0/haco/switch.py similarity index 100% rename from haco/switch.py rename to haco/v0/haco/switch.py diff --git a/haco/tasmota.py b/haco/v0/haco/tasmota.py similarity index 100% rename from haco/tasmota.py rename to haco/v0/haco/tasmota.py diff --git a/haco/text.py b/haco/v0/haco/text.py similarity index 100% rename from haco/text.py rename to haco/v0/haco/text.py diff --git a/haco/tools.py b/haco/v0/haco/tools.py similarity index 99% rename from haco/tools.py rename to haco/v0/haco/tools.py index a2b3c73..674c8b4 100644 --- a/haco/tools.py +++ b/haco/v0/haco/tools.py @@ -1,9 +1,10 @@ import hashlib import logging -from haco import constants, tuya from haco.tasmota import Tasmota +from haco import constants, tuya + logging.basicConfig(level=constants.LOG_LEVEL, format='%(asctime)s %(levelname)-8s %(message)s', datefmt='%Y-%m-%d %H:%M:%S') logger = logging.getLogger(__name__) diff --git a/haco/trigger.py b/haco/v0/haco/trigger.py similarity index 100% rename from haco/trigger.py rename to haco/v0/haco/trigger.py diff --git a/haco/tuya.py b/haco/v0/haco/tuya.py similarity index 100% rename from haco/tuya.py rename to haco/v0/haco/tuya.py diff --git a/haco/update.py b/haco/v0/haco/update.py similarity index 100% rename from haco/update.py rename to haco/v0/haco/update.py diff --git a/update_version.py b/haco/v0/update_version.py similarity index 99% rename from update_version.py rename to haco/v0/update_version.py index 167cbe2..91c2eb1 100644 --- a/update_version.py +++ b/haco/v0/update_version.py @@ -1,6 +1,5 @@ -import sys - import re +import sys from pathlib import Path PATH_ROOT = Path(__file__).parent.absolute()