New scenes for HA standalone setup on raspi

- KNX buttons
- long click custom component
This commit is contained in:
Martin Bauer
2020-04-28 18:38:45 +00:00
parent c9c9c35561
commit 250556adc2
14 changed files with 1388 additions and 25 deletions

View File

@@ -70,7 +70,7 @@ def add_knx_devices(devices, groups):
# Bells
DeviceInfo("KlingelOben", "Klingel Oben", 'first_floor'),
DeviceInfo("Klingel Innen", "Klingel Innentür", 'other'),
DeviceInfo("Klingel Aussen", "Klingen Außentür", 'other'),
DeviceInfo("Klingel Aussen", "Klingel Außentür", 'other'),
]
scene_button_names = ['ObenLinks', 'ObenRechts', 'MitteLinks', 'MitteRechts', 'UntenLinks', 'UntenRechts']
scene_button_names = [(i, e) for i, e in enumerate(scene_button_names)]
@@ -101,7 +101,7 @@ def add_knx_devices(devices, groups):
DeviceInfo("HerdP2", "Herd Phase 2", 'living_area'),
DeviceInfo("HerdP3", "Herd Phase 3", 'living_area'),
# Rest
DeviceInfo("ArbeitszimmerSteckdose", "Arbeitszimmer Steckdose", 'office_martin'),
DeviceInfo("ArbeitszimmerSteckdose", "Arbeitszimmer Steckdose", 'office'),
DeviceInfo("WohnzimmerSteckdose1", "Wohnzimmer Steckdose 1", 'living_area'),
DeviceInfo("WohnzimmerSteckdose2", "Wohnzimmer Steckdose 2", 'living_area'),
]
@@ -163,7 +163,7 @@ def add_knx_devices(devices, groups):
def add_fhem_devices(devices, groups):
fhem_yaml_path = os.path.join(script_path, 'fhem.yaml')
fhem_yaml = yaml.load(open(fhem_yaml_path))
fhem_yaml = yaml.load(open(fhem_yaml_path, encoding="utf-8"))
for device_type, device_list in fhem_yaml.items():
if device_type not in devices:
devices[device_type] = []
@@ -258,14 +258,14 @@ def recorder_config(all_devices):
def create_config(target_directory, development=False):
groups_yaml_path = os.path.join(script_path, 'groups.yaml')
manual_config_path = os.path.join(script_path, 'manual_config.yaml')
group_dict = yaml.load(open(groups_yaml_path))
manual_config_dict = yaml.load(open(manual_config_path))
group_dict = yaml.load(open(groups_yaml_path, encoding="utf-8"))
manual_config_dict = yaml.load(open(manual_config_path, encoding="utf-8"))
all_devices = {}
add_knx_devices(all_devices, group_dict)
add_fhem_devices(all_devices, group_dict)
with open(os.path.join(target_directory, 'configuration.yaml'), 'w') as output:
with open(os.path.join(target_directory, 'configuration.yaml'), 'w', encoding="utf-8") as output:
output.write("# Dont' edit manually! this is generated!\n\n")
for key in ['sensor', 'switch', 'light', 'cover', 'binary_sensor']:
if key in manual_config_dict: