Restructured bridges

This commit is contained in:
Maximilian Giller 2024-08-07 03:26:47 +02:00
parent 2b17367313
commit 1a3bcb88f0
28 changed files with 30 additions and 13 deletions

View file

@ -1,7 +1,7 @@
from fastapi import FastAPI, APIRouter
from hue.hue_adapter import HueAdapter
from ..mash.feature import Feature
from ..mash.core.feature import Feature
from fastapi import APIRouter
from fastapi.responses import HTMLResponse

View file

@ -1,4 +1,4 @@
from mash.bridges.fritzbox import FritzBoxBridge, FritzDeviceState
from mash.bridges.fritzbox.fritzbox_bridge import FritzBoxBridge, FritzDeviceState
from time import sleep
import logging

View file

@ -1,7 +1,7 @@
from fastapi import FastAPI, APIRouter
from hue.hue_adapter import HueAdapter
from ..mash.feature import Feature
from ..mash.core.feature import Feature
from fastapi import APIRouter
from fastapi.responses import HTMLResponse

1
src/mash/__init__.py Normal file
View file

@ -0,0 +1 @@
from .mash import MaSH

View file

@ -0,0 +1 @@
from .fritzbox_bridge import FritzBoxBridge

View file

@ -1,7 +1,7 @@
from datetime import datetime
import logging
from typing import Coroutine, Optional
from mash.bridges.bridge import Bridge
from mash.core.bridge import Bridge
from fritzconnection import FritzConnection
import asyncio

View file

@ -0,0 +1 @@
from .hue_bridge import HueBridge

View file

@ -1,5 +1,5 @@
import logging
from mash.bridges.bridge import Bridge
from mash.core.bridge import Bridge
from phue import Bridge as phueBridge
from time import sleep

View file

@ -0,0 +1 @@
from .matrixclock_entity import MatrixClockEntity

View file

@ -1,4 +1,4 @@
from mash.entities.entity import Entity
from mash.core.entity import Entity
import requests as r

View file

@ -0,0 +1 @@
from .restapi_bridge import RestApiBridge

View file

@ -0,0 +1,6 @@
from mash.core.bridge import Bridge
class RestApiBridge(Bridge):
def __init__(self, *, id: str) -> None:
super().__init__(id=id, type="restapi")

View file

@ -0,0 +1 @@
from .zigbee2mqtt_bridge import Z2mBridge

View file

@ -1,6 +1,6 @@
import logging
from typing import Optional
from mash.bridges.bridge import Bridge
from mash.core.bridge import Bridge
import paho.mqtt.client as mqtt
import json

View file

@ -0,0 +1,5 @@
from .bridge import Bridge, BridgeException
from .entity import Entity
from .group import Group
from .home import Home
from .feature import Feature

View file

@ -1,4 +1,4 @@
from mash.entities.entity import Entity
from mash.core.entity import Entity
from fnmatch import fnmatch

View file

@ -1,5 +1,5 @@
from mash.entities.entity import Entity
from mash.entities.group import Group
from mash.core.entity import Entity
from mash.core.group import Group
class Home(Group):

View file

@ -1,7 +1,7 @@
import yaml
from fastapi import FastAPI
from mash.feature import Feature
from mash.core.feature import Feature
class MaSH:

View file

@ -1,4 +1,4 @@
from mash.feature import Feature
from mash.core.feature import Feature
class MatrixClockIntegration(Feature):

View file

@ -1,5 +1,5 @@
from time import sleep
from mash.bridges.zigbee2mqtt import Z2mBridge
from mash.bridges.zigbee2mqtt.zigbee2mqtt_bridge import Z2mBridge
z2m = Z2mBridge(id="z2m", ip="192.168.178.115")