|
14 | 14 |
|
15 | 15 | ATTR_TEXT_COMMAND = "text_command" |
16 | 16 | ATTR_SOUND = "sound" |
17 | | -ATTR_SOUND_VARIANT = "sound_variant" |
18 | 17 | SERVICE_TEXT_COMMAND = "send_text_command" |
19 | 18 | SERVICE_SOUND_NOTIFICATION = "send_sound" |
20 | 19 |
|
21 | 20 | SCHEMA_SOUND_SERVICE = vol.Schema( |
22 | 21 | { |
23 | 22 | vol.Required(ATTR_SOUND): cv.string, |
24 | | - vol.Required(ATTR_SOUND_VARIANT): cv.positive_int, |
25 | 23 | vol.Required(ATTR_DEVICE_ID): cv.string, |
26 | 24 | }, |
27 | 25 | ) |
@@ -75,17 +73,14 @@ async def _async_execute_action(call: ServiceCall, attribute: str) -> None: |
75 | 73 | coordinator = config_entry.runtime_data |
76 | 74 |
|
77 | 75 | if attribute == ATTR_SOUND: |
78 | | - variant: int = call.data[ATTR_SOUND_VARIANT] |
79 | | - pad = "_" if variant > 10 else "_0" |
80 | | - file = f"{value}{pad}{variant!s}" |
81 | | - if value not in SOUNDS_LIST or variant > SOUNDS_LIST[value]: |
| 76 | + if value not in SOUNDS_LIST: |
82 | 77 | raise ServiceValidationError( |
83 | 78 | translation_domain=DOMAIN, |
84 | 79 | translation_key="invalid_sound_value", |
85 | | - translation_placeholders={"sound": value, "variant": str(variant)}, |
| 80 | + translation_placeholders={"sound": value}, |
86 | 81 | ) |
87 | 82 | await coordinator.api.call_alexa_sound( |
88 | | - coordinator.data[device.serial_number], file |
| 83 | + coordinator.data[device.serial_number], value |
89 | 84 | ) |
90 | 85 | elif attribute == ATTR_TEXT_COMMAND: |
91 | 86 | await coordinator.api.call_alexa_text_command( |
|
0 commit comments