From c18e4b6f9d92f65191d33fd8a32d81f4da34755a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Martin?= Date: Wed, 5 Jan 2022 14:23:20 +0100 Subject: [PATCH] Initial commit --- .gitignore | 2 + audio.py | 17 ++++++ consoles.py | 11 ++++ devices.py | 26 +++++++++ edges.py | 30 ++++++++++ electricity.py | 11 ++++ fitbit.py | 8 +++ konijnenberg.py | 150 ++++++++++++++++++++++++++++++++++++++++++++++++ lights.py | 20 +++++++ network.py | 11 ++++ video.py | 14 +++++ 11 files changed, 300 insertions(+) create mode 100644 .gitignore create mode 100755 audio.py create mode 100755 consoles.py create mode 100755 devices.py create mode 100755 edges.py create mode 100755 electricity.py create mode 100755 fitbit.py create mode 100755 konijnenberg.py create mode 100755 lights.py create mode 100755 network.py create mode 100755 video.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8e0855f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +__pycache__ +*.png diff --git a/audio.py b/audio.py new file mode 100755 index 0000000..dc0ccaf --- /dev/null +++ b/audio.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# Copyright (c) 2022 Clément Martin {edge} ({EDGES[edge]['style']})""" + _html += '>' + return Node(label=_html, shape='plaintext') diff --git a/electricity.py b/electricity.py new file mode 100755 index 0000000..72d06c2 --- /dev/null +++ b/electricity.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +# Copyright (c) 2022 Clément Martin > [ 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') >> balance + wifi_ap << MyEdge('wifi') >> flex2i + wifi_ap << MyEdge('wifi') >> lessiveuse + hue << MyEdge('zigbee') >> lumieres_bureau + + alistair >> [ nintendo_switch, tel_alistair ] + maithe >> [ tel_maithe, laptop_maithe ] + clement >> [ tel_clement, laptop_clement, walter ] diff --git a/lights.py b/lights.py new file mode 100755 index 0000000..a2e8dce --- /dev/null +++ b/lights.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# Copyright (c) 2022 Clément Martin