Voice stuff
This commit is contained in:
@@ -13,16 +13,10 @@ def first_lower(s):
|
||||
return s[0].lower() + s[1:]
|
||||
|
||||
|
||||
extend = functools.partial(extend_general, platform='knx')
|
||||
|
||||
|
||||
def extent(result_dict, input_dict):
|
||||
for k, v in input_dict.items():
|
||||
if k not in result_dict:
|
||||
result_dict[k] = []
|
||||
for entry in v:
|
||||
if 'platform' not in entry:
|
||||
entry['platform'] = 'knx'
|
||||
result_dict[k] += v
|
||||
|
||||
|
||||
@@ -49,6 +43,7 @@ def create_power_plug(device_info: List[DeviceInfo],
|
||||
postfix_counter_reset=" BSZ Neustart"):
|
||||
result = {'switch': [],
|
||||
'sensor': []}
|
||||
template_sensors = {'sensor': []}
|
||||
for entry in device_info:
|
||||
try:
|
||||
# Switching
|
||||
@@ -87,7 +82,7 @@ def create_power_plug(device_info: List[DeviceInfo],
|
||||
'type': 'DPT-9',
|
||||
})
|
||||
name = name_to_id(entry.display_name + " Verbrauch mA", 'sensor')
|
||||
result['sensor'].append({
|
||||
template_sensors['sensor'].append({
|
||||
'platform': 'template',
|
||||
'sensors': {
|
||||
name_to_id(entry.display_name + " Verbrauch", None):
|
||||
@@ -111,7 +106,7 @@ def create_power_plug(device_info: List[DeviceInfo],
|
||||
|
||||
except KeyError as e:
|
||||
raise ValueError(f"Skipping light {entry.csv_name} - Could not find CSV File entry: {e}")
|
||||
return result
|
||||
return result, template_sensors
|
||||
|
||||
|
||||
def create_lights(device_info: List[DeviceInfo],
|
||||
|
||||
Reference in New Issue
Block a user