Voice stuff

This commit is contained in:
Martin Bauer
2020-10-04 20:57:16 +00:00
parent 2e8508a625
commit 5aaabec3b1
25 changed files with 7946 additions and 6067 deletions

View File

@@ -154,11 +154,14 @@ def add_knx_devices(devices, groups):
knx.extent(devices, knx.create_lights(lights, imported_csv))
knx.extent(devices, knx.create_shutters(shutters, imported_csv))
knx.extent(devices, knx.create_switches(switches, imported_csv))
knx.extent(devices, knx.create_power_plug(power_plugs, imported_csv))
power_plugs, template_sensors = knx.create_power_plug(power_plugs, imported_csv)
knx.extent(devices, power_plugs)
for device_type, devices in [('light', lights), ('cover', shutters), ('switch', switches)]:
for device in devices:
add_to_group(groups, device.groups, device.display_name, device_type)
return template_sensors
def add_fhem_devices(devices, groups):
@@ -246,8 +249,11 @@ def recorder_config(all_devices):
exclude_list = ['sun.sun']
exclude_list.extend(sensor_exclude_list)
exclude_list.extend(make_sensor_exclude_list(all_devices, recorder_excludes))
return {
'recorder': {
'db_url': 'mysql://homeassistant:Vc9JpSh0VQqKF1zgwdJG@core-mariadb/homeassistant?charset=utf8',
'purge_keep_days': 60,
'exclude': {
'entities': exclude_list,
}
@@ -261,8 +267,17 @@ def create_config(target_directory, development=False):
group_dict = yaml.load(open(groups_yaml_path, encoding="utf-8"))
manual_config_dict = yaml.load(open(manual_config_path, encoding="utf-8"))
knx_conf = {
'rate_limit': 20,
'tunneling': {
'host': '192.168.178.65',
'port': 3671
}
}
template_sensors = add_knx_devices(knx_conf, group_dict)
all_devices = {}
add_knx_devices(all_devices, group_dict)
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:
@@ -279,6 +294,10 @@ def create_config(target_directory, development=False):
add_meta_groups(group_dict)
with open(os.path.join(target_directory, 'knx_conf.yaml'), 'w') as output:
output.write("# Dont' edit manually! this is generated!\n\n")
yaml.dump(knx_conf, output)
with open(os.path.join(target_directory, 'groups.yaml'), 'w') as output:
output.write("# Dont' edit manually! this is generated!\n\n")
yaml.dump(group_dict, output)