Restructure v0 in v0 sub package

This commit is contained in:
Edward Brown 2025-11-14 12:10:48 +00:00 • committed by Edward Brown
parent e6ea78ab49
commit 995cb81253
48 changed files with 25 additions and 20 deletions

View file

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before After
Before After

View file

@ -1,6 +1,7 @@
from haco import schema
from haco.control import Control
from haco import schema
class Button(Control):
NAME = 'button'

View file

@ -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'])

View file

@ -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

View file

@ -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)

View file

@ -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:

View file

@ -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'

View file

@ -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:

View file

@ -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"

View file

@ -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'

View file

@ -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

View file

@ -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__)

View file

@ -1,6 +1,5 @@
import sys
import re
import sys
from pathlib import Path
PATH_ROOT = Path(__file__).parent.absolute()