Full switch from fhem to homematic ccu + frontend cleanup
This commit is contained in:
@@ -164,19 +164,6 @@ def add_knx_devices(devices, groups):
|
||||
return template_sensors
|
||||
|
||||
|
||||
def add_fhem_devices(devices, groups):
|
||||
fhem_yaml_path = os.path.join(script_path, 'fhem.yaml')
|
||||
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] = []
|
||||
for device in device_list:
|
||||
device['platform'] = 'fhem'
|
||||
if 'groups' in device:
|
||||
add_to_group(groups, device['groups'], device['name'], device_type)
|
||||
del device['groups']
|
||||
devices[device_type].append(device)
|
||||
|
||||
|
||||
def add_meta_groups(groups):
|
||||
all_devices = set()
|
||||
@@ -278,12 +265,13 @@ def create_config(target_directory, development=False):
|
||||
|
||||
all_devices = {}
|
||||
all_devices.update(template_sensors)
|
||||
add_fhem_devices(all_devices, group_dict)
|
||||
|
||||
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:
|
||||
if key not in all_devices:
|
||||
all_devices[key] = []
|
||||
all_devices[key].extend(manual_config_dict[key])
|
||||
del manual_config_dict[key]
|
||||
yaml.dump(manual_config_dict, output)
|
||||
|
||||
Reference in New Issue
Block a user