Restructured bridges
This commit is contained in:
parent
2b17367313
commit
1a3bcb88f0
28 changed files with 30 additions and 13 deletions
|
@ -1,7 +1,7 @@
|
||||||
from fastapi import FastAPI, APIRouter
|
from fastapi import FastAPI, APIRouter
|
||||||
|
|
||||||
from hue.hue_adapter import HueAdapter
|
from hue.hue_adapter import HueAdapter
|
||||||
from ..mash.feature import Feature
|
from ..mash.core.feature import Feature
|
||||||
from fastapi import APIRouter
|
from fastapi import APIRouter
|
||||||
from fastapi.responses import HTMLResponse
|
from fastapi.responses import HTMLResponse
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from mash.bridges.fritzbox import FritzBoxBridge, FritzDeviceState
|
from mash.bridges.fritzbox.fritzbox_bridge import FritzBoxBridge, FritzDeviceState
|
||||||
from time import sleep
|
from time import sleep
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from fastapi import FastAPI, APIRouter
|
from fastapi import FastAPI, APIRouter
|
||||||
|
|
||||||
from hue.hue_adapter import HueAdapter
|
from hue.hue_adapter import HueAdapter
|
||||||
from ..mash.feature import Feature
|
from ..mash.core.feature import Feature
|
||||||
from fastapi import APIRouter
|
from fastapi import APIRouter
|
||||||
from fastapi.responses import HTMLResponse
|
from fastapi.responses import HTMLResponse
|
||||||
|
|
||||||
|
|
1
src/mash/__init__.py
Normal file
1
src/mash/__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
from .mash import MaSH
|
1
src/mash/bridges/fritzbox/__init__.py
Normal file
1
src/mash/bridges/fritzbox/__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
from .fritzbox_bridge import FritzBoxBridge
|
|
@ -1,7 +1,7 @@
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import logging
|
import logging
|
||||||
from typing import Coroutine, Optional
|
from typing import Coroutine, Optional
|
||||||
from mash.bridges.bridge import Bridge
|
from mash.core.bridge import Bridge
|
||||||
from fritzconnection import FritzConnection
|
from fritzconnection import FritzConnection
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
1
src/mash/bridges/hue/__init__.py
Normal file
1
src/mash/bridges/hue/__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
from .hue_bridge import HueBridge
|
|
@ -1,5 +1,5 @@
|
||||||
import logging
|
import logging
|
||||||
from mash.bridges.bridge import Bridge
|
from mash.core.bridge import Bridge
|
||||||
from phue import Bridge as phueBridge
|
from phue import Bridge as phueBridge
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
1
src/mash/bridges/matrixclock/__init__.py
Normal file
1
src/mash/bridges/matrixclock/__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
from .matrixclock_entity import MatrixClockEntity
|
|
@ -1,4 +1,4 @@
|
||||||
from mash.entities.entity import Entity
|
from mash.core.entity import Entity
|
||||||
import requests as r
|
import requests as r
|
||||||
|
|
||||||
|
|
1
src/mash/bridges/restapi/__init__.py
Normal file
1
src/mash/bridges/restapi/__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
from .restapi_bridge import RestApiBridge
|
6
src/mash/bridges/restapi/restapi_bridge.py
Normal file
6
src/mash/bridges/restapi/restapi_bridge.py
Normal 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")
|
1
src/mash/bridges/zigbee2mqtt/__init__.py
Normal file
1
src/mash/bridges/zigbee2mqtt/__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
from .zigbee2mqtt_bridge import Z2mBridge
|
|
@ -1,6 +1,6 @@
|
||||||
import logging
|
import logging
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
from mash.bridges.bridge import Bridge
|
from mash.core.bridge import Bridge
|
||||||
import paho.mqtt.client as mqtt
|
import paho.mqtt.client as mqtt
|
||||||
import json
|
import json
|
||||||
|
|
5
src/mash/core/__init__.py
Normal file
5
src/mash/core/__init__.py
Normal 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
|
|
@ -1,4 +1,4 @@
|
||||||
from mash.entities.entity import Entity
|
from mash.core.entity import Entity
|
||||||
from fnmatch import fnmatch
|
from fnmatch import fnmatch
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from mash.entities.entity import Entity
|
from mash.core.entity import Entity
|
||||||
from mash.entities.group import Group
|
from mash.core.group import Group
|
||||||
|
|
||||||
|
|
||||||
class Home(Group):
|
class Home(Group):
|
|
@ -1,7 +1,7 @@
|
||||||
import yaml
|
import yaml
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
|
|
||||||
from mash.feature import Feature
|
from mash.core.feature import Feature
|
||||||
|
|
||||||
|
|
||||||
class MaSH:
|
class MaSH:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from mash.feature import Feature
|
from mash.core.feature import Feature
|
||||||
|
|
||||||
|
|
||||||
class MatrixClockIntegration(Feature):
|
class MatrixClockIntegration(Feature):
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from time import sleep
|
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")
|
z2m = Z2mBridge(id="z2m", ip="192.168.178.115")
|
||||||
|
|
Loading…
Reference in a new issue