From 2535603d122e1af0a5566446f3591aa21a92caed Mon Sep 17 00:00:00 2001
From: Julian Leucker <leuckerj@gmail.com>
Date: Mon, 3 Aug 2020 17:50:57 +0200
Subject: [PATCH] Work on YAML stuff

---
 fpga_device_manager/Config.py                  | 12 +++++++++++-
 fpga_device_manager/res/data/device_types.json |  3 ++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/fpga_device_manager/Config.py b/fpga_device_manager/Config.py
index 5f4fd73..71f9167 100644
--- a/fpga_device_manager/Config.py
+++ b/fpga_device_manager/Config.py
@@ -13,6 +13,7 @@ from fpga_device_manager.Devices import Output
 from fpga_device_manager.Inputs import Input
 from fpga_device_manager.device_manager import DeviceManager
 from fpga_device_manager.exceptions import DeviceInvalidError, InvalidConfigError
+from fpga_device_manager.hass import Action, Automation
 
 _output_mgr = DeviceManager(device_class=Output)
 _input_mgr = DeviceManager(device_class=Input)
@@ -207,7 +208,16 @@ def export_yaml(out_file_path: str) -> None:
                 {'condition': 'time', 'after': '16:00:00', 'before': '23:00:00'}
             ],
             'action': {'service': 'homeassistant.turn_on', 'entity_id': 'group.living_room'}
-        },
+        }
+    output_devices = list(_output_mgr.all_devices())
+    input_devices = list(_input_mgr.all_devices())
+
+    for device in input_devices:
+        input_ = device.dev_id
+        target = device.associated_device.dev_id
+
+        if device.type is None:
+            pass
 
     # for filename, text in exports.items():
     #     filepath = os.file_path.join(out_file_path, filename)
diff --git a/fpga_device_manager/res/data/device_types.json b/fpga_device_manager/res/data/device_types.json
index 3083245..e2c09c0 100755
--- a/fpga_device_manager/res/data/device_types.json
+++ b/fpga_device_manager/res/data/device_types.json
@@ -7,7 +7,8 @@
     "pins": {
       "signal": {
         "requires_pwm": false,
-        "active_low": false
+        "active_low": false,
+        "action":
       }
     }
   },
-- 
GitLab