diff --git a/config_creation/main.py b/config_creation/main.py index 7c3349c..d50c8b7 100644 --- a/config_creation/main.py +++ b/config_creation/main.py @@ -9,7 +9,7 @@ yaml = YAML() yaml.preserve_quotes = True -sensors_to_ignore_in_logbook = [ +sensor_exclude_list = [ 'sensor.fritz_box_7490_bytes_received', 'sensor.fritz_box_7490_bytes_sent', #'sensor.fritz_box_7490_kbyte_sec_received', @@ -190,13 +190,15 @@ def make_sensor_exclude_list(all_devices, name_fragments): exclude_list.append(name_to_id(name, 'sensor')) for sensor_device in all_devices['sensor']: + if 'platform' in sensor_device and sensor_device['platform'] == 'time_date': + continue if 'platform' in sensor_device and sensor_device['platform'] == 'template': for nested_sensor_dev in sensor_device['sensors'].values(): handle_sensor(nested_sensor_dev) elif 'name' in sensor_device: handle_sensor(sensor_device) else: - raise NotImplementedError() + raise NotImplementedError(f"Sensor {sensor_device}") return exclude_list @@ -204,7 +206,7 @@ def logbook_config(all_devices): sensor_excludes = ['Helligkeit', 'Betriebsstunden', 'Verbrauch', 'Bewegungsmelder'] exclude_list = [] - exclude_list.extend(sensors_to_ignore_in_logbook) + exclude_list.extend(sensor_exclude_list) exclude_list.extend(make_sensor_exclude_list(all_devices, sensor_excludes)) return { 'logbook': { @@ -219,7 +221,7 @@ def logbook_config(all_devices): def recorder_config(all_devices): recorder_excludes = ['Betriebsstunden', 'Verbrauch mA'] exclude_list = ['sun.sun'] - exclude_list.extend(sensors_to_ignore_in_logbook) + exclude_list.extend(sensor_exclude_list) exclude_list.extend(make_sensor_exclude_list(all_devices, recorder_excludes)) return { 'recorder': {