Graph cleanup
This commit is contained in:
parent
2c80273e4e
commit
07ab4daf58
170
konijnenberg.py
170
konijnenberg.py
@ -22,129 +22,87 @@ from lights import HueBridge, HueBulb, HueSpot, SmartPlug, Tradfri
|
|||||||
from network import Modem, UniFiAP
|
from network import Modem, UniFiAP
|
||||||
from video import ProximusTV, Television, UltraWideScreen
|
from video import ProximusTV, Television, UltraWideScreen
|
||||||
|
|
||||||
GRAPH_ATTRS = {
|
with Diagram('Konijnenberg', direction='TB'):
|
||||||
'layout' : 'dot',
|
with Cluster('Bureau', direction='TB'):
|
||||||
'compound': 'True',
|
office_cpl = CPL('CPL bureau')
|
||||||
'splines' : 'spline',
|
ps4 = PlayStation4()
|
||||||
'clusterrank':'local',
|
printer = Printer()
|
||||||
'ordering':'in'}
|
rainbow = Rpi4('Rainbow')
|
||||||
|
switch = Switch('dlink')
|
||||||
|
walter = NUC('walter')
|
||||||
|
zippo = Storage('Zippo')
|
||||||
|
rpi4s = [ Rpi4('RPI4/{x}') for x in range(5) ]
|
||||||
|
|
||||||
|
switch << MyEdge('ethernet') >> [office_cpl, ps4, printer, rainbow, walter, zippo] + rpi4s
|
||||||
|
|
||||||
|
with Cluster('Salon'):
|
||||||
|
hue = HueBridge('Hue Bridge')
|
||||||
|
living_cpl = CPL('CPL salon')
|
||||||
|
malkovitch = Firewall('malkovitch')
|
||||||
|
proximus = Internet('Proximus')
|
||||||
|
proximus_router = Modem('Proximus')
|
||||||
|
proximus_tv = ProximusTV('Decodeur')
|
||||||
|
telenet = Internet('Telenet')
|
||||||
|
telenet_router = Modem('Telenet')
|
||||||
|
|
||||||
|
malkovitch << MyEdge('ethernet') >> [living_cpl, proximus_router, telenet_router]
|
||||||
|
proximus_router << MyEdge('adsl') >> proximus
|
||||||
|
proximus_router << MyEdge('ethernet') >> [ hue, proximus_tv ]
|
||||||
|
telenet_router << MyEdge('cable') >> telenet
|
||||||
|
|
||||||
|
|
||||||
with Diagram('Konijnenberg', direction='BT', graph_attr=GRAPH_ATTRS):
|
# with Cluster('Lights'):
|
||||||
|
# with Cluster('Salon'):
|
||||||
|
# lumieres_salon = [ HueBulb('Boule Salon'), HueBulb('Lustre Canapé'), HueBulb('Lustre Table'),
|
||||||
|
# SmartPlug('Vinyls'), SmartPlug('Mappemonde'),
|
||||||
|
# Tradfri('Vaisselier') ]
|
||||||
|
# with Cluster('Veranda'):
|
||||||
|
# lumieres_veranda = [ HueSpot(f'Veranda {x}') for x in range(6) ]
|
||||||
|
# with Cluster('Bureau'):
|
||||||
|
# lumieres_bureau = [ HueSpot('Plafond bureau 1'), HueSpot('Plafond bureau 2') ]
|
||||||
|
|
||||||
with Cluster('Users'):
|
# hue << MyEdge('zigbee') >> lumieres_salon
|
||||||
alistair = User('Alistair')
|
# hue << MyEdge('zigbee') >> lumieres_veranda
|
||||||
clement = User('Clément')
|
# hue << MyEdge('zigbee') >> lumieres_bureau
|
||||||
maithe = User('Maïthé')
|
|
||||||
|
|
||||||
guests = Users('Guests')
|
|
||||||
|
|
||||||
|
|
||||||
with Cluster('Mobile'):
|
with Cluster('Wireless', direction='TB'):
|
||||||
|
|
||||||
|
wifi_ap = UniFiAP('NanoHD')
|
||||||
|
|
||||||
|
with Cluster('Misc'):
|
||||||
|
with Cluster('Salon'):
|
||||||
|
boxx = Boxx()
|
||||||
|
with Cluster('Salle de bain'):
|
||||||
|
balance = Aria('Balance')
|
||||||
|
with Cluster('Garage', direction='TB'):
|
||||||
|
lessiveuse = WashingMachine('Lave linge')
|
||||||
|
with Cluster('Sound'):
|
||||||
|
with Cluster('Cuisine', direction='TB'):
|
||||||
|
flex2i = AudioStreamer('Flex 2i')
|
||||||
|
with Cluster('Salon'):
|
||||||
|
# ampli = Amplifier('Ampli') # has buletooth
|
||||||
|
hifi = AudioStreamer('HiFi')
|
||||||
|
with Cluster('Video'):
|
||||||
|
tv_salon = Television('TV Salon')
|
||||||
|
jack = Rpi4('Jack')
|
||||||
|
with Cluster('User Devices'):
|
||||||
laptop_clement = Laptop('Laptop Clément')
|
laptop_clement = Laptop('Laptop Clément')
|
||||||
laptop_maithe = Laptop('Laptop Maïthé')
|
laptop_maithe = Laptop('Laptop Maïthé')
|
||||||
nintendo_switch = NintendoSwitch('Switch Alistair')
|
nintendo_switch = NintendoSwitch('Switch Alistair')
|
||||||
tel_alistair = AndroidPhone('Téléphone Alistair')
|
tel_alistair = AndroidPhone('Téléphone Alistair')
|
||||||
tel_clement = AndroidPhone('Téléphone Clément')
|
tel_clement = AndroidPhone('Téléphone Clément')
|
||||||
tel_maithe = IPhone('Téléphone Maïthé')
|
tel_maithe = IPhone('Téléphone Maïthé')
|
||||||
|
|
||||||
wifi_devices = [ nintendo_switch, laptop_clement, laptop_maithe,
|
wifi_devices = [ nintendo_switch, laptop_clement, laptop_maithe,
|
||||||
tel_alistair, tel_maithe, tel_clement ]
|
tel_alistair, tel_maithe, tel_clement ]
|
||||||
|
|
||||||
|
|
||||||
with Cluster('Salon'):
|
wifi_ap << MyEdge('wifi') >> [ tv_salon, jack, boxx, hifi ]
|
||||||
boxx = Boxx()
|
|
||||||
hue = HueBridge('Hue Bridge')
|
|
||||||
living_cpl = CPL('CPL salon')
|
|
||||||
malkovitch = Firewall('malkovitch')
|
|
||||||
proximus = Internet('Proximus')
|
|
||||||
proximus_router = Modem('Proximus')
|
|
||||||
telenet = Internet('Telenet')
|
|
||||||
telenet_router = Modem('Telenet')
|
|
||||||
wifi_ap = UniFiAP('NanoHD')
|
|
||||||
|
|
||||||
|
|
||||||
with Cluster('Sono'):
|
|
||||||
ampli = Amplifier('Ampli')
|
|
||||||
hifi = AudioStreamer('HiFi')
|
|
||||||
preamp = TubeAmp('Preampli phono')
|
|
||||||
turntable = TurnTable('Platine')
|
|
||||||
|
|
||||||
ampli << MyEdge('audio') >> [ hifi, preamp ]
|
|
||||||
preamp << MyEdge('audio') >> turntable
|
|
||||||
|
|
||||||
|
|
||||||
with Cluster('Video'):
|
|
||||||
tv = Television('TV')
|
|
||||||
jack = Rpi4('Jack')
|
|
||||||
proximus_tv = ProximusTV('Decodeur')
|
|
||||||
|
|
||||||
tv << MyEdge('hdmi') << [ jack, proximus_tv ]
|
|
||||||
|
|
||||||
|
|
||||||
with Cluster('Lights'):
|
|
||||||
with Cluster('Salon'):
|
|
||||||
lumieres_salon = [ HueBulb('Boule Salon'), HueBulb('Lustre Canapé'), HueBulb('Lustre Table'),
|
|
||||||
SmartPlug('Vinyls'), SmartPlug('Mappemonde'),
|
|
||||||
Tradfri('Vaisselier') ]
|
|
||||||
|
|
||||||
with Cluster('Veranda'):
|
|
||||||
lumieres_veranda = [ HueSpot(f'Veranda {x}') for x in range(6) ]
|
|
||||||
|
|
||||||
|
|
||||||
wifi_ap << MyEdge('wifi') >> [ tv, jack, boxx, hifi ]
|
|
||||||
malkovitch << MyEdge('ethernet') >> [telenet_router, proximus_router, wifi_ap]
|
|
||||||
telenet_router << MyEdge('cable') >> telenet
|
|
||||||
proximus_router << MyEdge('adsl') >> proximus
|
|
||||||
malkovitch << MyEdge('ethernet') >> living_cpl
|
|
||||||
proximus_router << MyEdge('ethernet') >> [ hue, proximus_tv ]
|
|
||||||
hue << MyEdge('zigbee') >> lumieres_salon
|
|
||||||
hue << MyEdge('zigbee') >> lumieres_veranda
|
|
||||||
|
|
||||||
|
|
||||||
with Cluster('Bureau'):
|
|
||||||
tv_bureau = Television()
|
|
||||||
ecran_bureau = UltraWideScreen()
|
|
||||||
walter = NUC('walter')
|
|
||||||
switch = Switch('dlink')
|
|
||||||
office_cpl = CPL('CPL bureau')
|
|
||||||
printer = Printer()
|
|
||||||
rainbow = Rpi4('Rainbow')
|
|
||||||
rpi4_1 = Rpi4('RPI4/1')
|
|
||||||
rpi4_2 = Rpi4('RPI4/2')
|
|
||||||
rpi4_3 = Rpi4('RPI4/3')
|
|
||||||
rpi4_4 = Rpi4('RPI4/4')
|
|
||||||
rpi4_5 = Rpi4('RPI4/5')
|
|
||||||
ps4 = PlayStation4()
|
|
||||||
zippo = Storage('Zippo')
|
|
||||||
lumieres_bureau = [ HueSpot('Plafond bureau 1'), HueSpot('Plafond bureau 2') ]
|
|
||||||
|
|
||||||
ecran_bureau << MyEdge('hdmi') >> walter
|
|
||||||
tv_bureau << MyEdge('hdmi') >> [ ps4, rainbow ]
|
|
||||||
switch << MyEdge('ethernet') >> [ office_cpl, printer, walter, ps4,
|
|
||||||
rainbow, rpi4_1, rpi4_2, rpi4_3,
|
|
||||||
rpi4_4, rpi4_5, zippo ]
|
|
||||||
|
|
||||||
|
|
||||||
with Cluster('Salle de bain'):
|
|
||||||
balance = Aria('Balance')
|
|
||||||
|
|
||||||
|
|
||||||
with Cluster('Cuisine'):
|
|
||||||
flex2i = AudioStreamer('Flex 2i')
|
|
||||||
|
|
||||||
|
|
||||||
with Cluster('Garage'):
|
|
||||||
lessiveuse = WashingMachine('Lave linge')
|
|
||||||
|
|
||||||
living_cpl << MyEdge('electric') >> office_cpl
|
|
||||||
wifi_ap << MyEdge('ethernet') >> malkovitch
|
|
||||||
wifi_ap << MyEdge('wifi') >> wifi_devices
|
wifi_ap << MyEdge('wifi') >> wifi_devices
|
||||||
wifi_ap << MyEdge('wifi') >> balance
|
wifi_ap << MyEdge('wifi') >> balance
|
||||||
wifi_ap << MyEdge('wifi') >> flex2i
|
wifi_ap << MyEdge('wifi') >> flex2i
|
||||||
wifi_ap << MyEdge('wifi') >> lessiveuse
|
wifi_ap << MyEdge('wifi') >> lessiveuse
|
||||||
hue << MyEdge('zigbee') >> lumieres_bureau
|
|
||||||
|
|
||||||
alistair >> [ nintendo_switch, tel_alistair ]
|
|
||||||
maithe >> [ tel_maithe, laptop_maithe ]
|
living_cpl << MyEdge('electric') >> office_cpl
|
||||||
clement >> [ tel_clement, laptop_clement, walter ]
|
wifi_ap << MyEdge('ethernet') >> malkovitch
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user