New scenes for HA standalone setup on raspi
- KNX buttons - long click custom component
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user