Generalize the infrared and radio_frequency strings (#170462)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Paulus Schoutsen
2026-05-14 17:55:48 +01:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 62a79389ed
commit e8ea01980e
7 changed files with 167 additions and 51 deletions
@@ -34,7 +34,13 @@ class HoneywellStringLightsConfigFlow(ConfigFlow, domain=DOMAIN):
return self.async_abort(reason="no_transmitters")
if not transmitters:
return self.async_abort(reason="no_compatible_transmitters")
return self.async_abort(
reason="no_compatible_transmitters",
description_placeholders={
"frequency": f"{sample_command.frequency / 1_000_000} MHz",
"modulation": sample_command.modulation.name,
},
)
if user_input is not None:
registry = er.async_get(self.hass)
@@ -2,16 +2,16 @@
"config": {
"abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]",
"no_compatible_transmitters": "No radio frequency transmitter supports 433.92 MHz OOK transmissions. Please add a compatible transmitter first.",
"no_transmitters": "No radio frequency transmitters are available. Please set up a transmitter first."
"no_compatible_transmitters": "[%key:common::config_flow::abort::no_compatible_radio_frequency_transmitters%]",
"no_transmitters": "[%key:common::config_flow::abort::no_radio_frequency_transmitters%]"
},
"step": {
"user": {
"data": {
"transmitter": "Radio frequency transmitter"
"transmitter": "[%key:common::config_flow::data::radio_frequency_transmitter%]"
},
"data_description": {
"transmitter": "The radio frequency transmitter used to control the Honeywell String Lights."
"transmitter": "[%key:common::config_flow::data_description::radio_frequency_transmitter%]"
}
}
}
@@ -35,7 +35,7 @@
},
"infrared_fan": {
"abort": {
"no_infrared_entities": "No infrared entities found. Please set up an infrared device first."
"no_infrared_entities": "[%key:common::config_flow::abort::no_infrared_entities%]"
},
"entry_type": "Infrared fan",
"initiate_flow": {
@@ -44,8 +44,8 @@
"step": {
"user": {
"data": {
"infrared_entity_id": "Infrared emitter",
"infrared_receiver_entity_id": "Infrared receiver",
"infrared_entity_id": "[%key:common::config_flow::data::infrared_entity_id%]",
"infrared_receiver_entity_id": "[%key:common::config_flow::data::infrared_receiver_entity_id%]",
"name": "[%key:common::config_flow::data::name%]"
},
"description": "Select infrared devices for the fan."
@@ -1,20 +1,20 @@
{
"config": {
"abort": {
"already_configured": "This LG device has already been configured with this transmitter.",
"no_emitters": "No infrared transmitter entities found. Please set up an infrared device first."
"already_configured": "This LG device has already been configured with this emitter.",
"no_emitters": "[%key:common::config_flow::abort::no_infrared_emitters%]"
},
"step": {
"user": {
"data": {
"device_type": "Device type",
"infrared_entity_id": "Infrared transmitter"
"device_type": "[%key:common::generic::device_type%]",
"infrared_entity_id": "[%key:common::config_flow::data::infrared_entity_id%]"
},
"data_description": {
"device_type": "The type of LG device to control.",
"infrared_entity_id": "The infrared transmitter entity to use for sending commands."
"infrared_entity_id": "[%key:common::config_flow::data_description::infrared_entity_id%]"
},
"description": "Select the device type and the infrared transmitter entity to use for controlling your LG device.",
"description": "Select the device type and the infrared emitter entity to use for controlling your LG device.",
"title": "Set up LG IR Remote"
}
}
@@ -22,98 +22,98 @@
"entity": {
"button": {
"back": {
"name": "Back"
"name": "[%key:common::entity::button::back::name%]"
},
"down": {
"name": "Down"
"name": "[%key:common::entity::button::down::name%]"
},
"exit": {
"name": "Exit"
"name": "[%key:common::entity::button::exit::name%]"
},
"guide": {
"name": "Guide"
"name": "[%key:common::entity::button::guide::name%]"
},
"hdmi_1": {
"name": "HDMI 1"
"name": "[%key:common::entity::button::hdmi_1::name%]"
},
"hdmi_2": {
"name": "HDMI 2"
"name": "[%key:common::entity::button::hdmi_2::name%]"
},
"hdmi_3": {
"name": "HDMI 3"
"name": "[%key:common::entity::button::hdmi_3::name%]"
},
"hdmi_4": {
"name": "HDMI 4"
"name": "[%key:common::entity::button::hdmi_4::name%]"
},
"home": {
"name": "Home"
"name": "[%key:common::entity::button::home::name%]"
},
"info": {
"name": "Info"
"name": "[%key:common::entity::button::info::name%]"
},
"input": {
"name": "Input"
"name": "[%key:common::entity::button::input::name%]"
},
"left": {
"name": "Left"
"name": "[%key:common::entity::button::left::name%]"
},
"menu": {
"name": "Menu"
"name": "[%key:common::entity::button::menu::name%]"
},
"num_0": {
"name": "Number 0"
"name": "[%key:common::entity::button::num_0::name%]"
},
"num_1": {
"name": "Number 1"
"name": "[%key:common::entity::button::num_1::name%]"
},
"num_2": {
"name": "Number 2"
"name": "[%key:common::entity::button::num_2::name%]"
},
"num_3": {
"name": "Number 3"
"name": "[%key:common::entity::button::num_3::name%]"
},
"num_4": {
"name": "Number 4"
"name": "[%key:common::entity::button::num_4::name%]"
},
"num_5": {
"name": "Number 5"
"name": "[%key:common::entity::button::num_5::name%]"
},
"num_6": {
"name": "Number 6"
"name": "[%key:common::entity::button::num_6::name%]"
},
"num_7": {
"name": "Number 7"
"name": "[%key:common::entity::button::num_7::name%]"
},
"num_8": {
"name": "Number 8"
"name": "[%key:common::entity::button::num_8::name%]"
},
"num_9": {
"name": "Number 9"
"name": "[%key:common::entity::button::num_9::name%]"
},
"ok": {
"name": "OK"
"name": "[%key:common::entity::button::ok::name%]"
},
"power": {
"name": "Power"
"name": "[%key:common::entity::button::power::name%]"
},
"power_off": {
"name": "Power off"
"name": "[%key:common::entity::button::power_off::name%]"
},
"power_on": {
"name": "Power on"
"name": "[%key:common::entity::button::power_on::name%]"
},
"right": {
"name": "Right"
"name": "[%key:common::entity::button::right::name%]"
},
"up": {
"name": "Up"
"name": "[%key:common::entity::button::up::name%]"
}
}
},
"selector": {
"device_type": {
"options": {
"tv": "TV"
"tv": "[%key:common::generic::tv%]"
}
}
}
@@ -74,7 +74,13 @@ class NovyCookerHoodConfigFlow(ConfigFlow, domain=DOMAIN):
return self.async_abort(reason="no_transmitters")
if not transmitters:
return self.async_abort(reason="no_compatible_transmitters")
return self.async_abort(
reason="no_compatible_transmitters",
description_placeholders={
"frequency": f"{FREQUENCY / 1_000_000} MHz",
"modulation": MODULATION.name,
},
)
if user_input is not None:
registry = er.async_get(self.hass)
@@ -2,19 +2,19 @@
"config": {
"abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]",
"no_compatible_transmitters": "No radio frequency transmitter supports 433.92 MHz OOK transmissions. Please add a compatible transmitter first.",
"no_transmitters": "No radio frequency transmitters are available. Please set up a transmitter first.",
"no_compatible_transmitters": "[%key:common::config_flow::abort::no_compatible_radio_frequency_transmitters%]",
"no_transmitters": "[%key:common::config_flow::abort::no_radio_frequency_transmitters%]",
"reconfigure_successful": "[%key:common::config_flow::abort::reconfigure_successful%]"
},
"step": {
"reconfigure": {
"data": {
"code": "[%key:component::novy_cooker_hood::config::step::user::data::code%]",
"transmitter": "[%key:component::novy_cooker_hood::config::step::user::data::transmitter%]"
"transmitter": "[%key:common::config_flow::data::radio_frequency_transmitter%]"
},
"data_description": {
"code": "[%key:component::novy_cooker_hood::config::step::user::data_description::code%]",
"transmitter": "[%key:component::novy_cooker_hood::config::step::user::data_description::transmitter%]"
"transmitter": "[%key:common::config_flow::data_description::radio_frequency_transmitter%]"
},
"description": "[%key:component::novy_cooker_hood::config::step::user::description%]"
},
@@ -36,11 +36,11 @@
"user": {
"data": {
"code": "Code",
"transmitter": "Radio frequency transmitter"
"transmitter": "[%key:common::config_flow::data::radio_frequency_transmitter%]"
},
"data_description": {
"code": "The code your hood is paired with (1-10). Code 1 is the factory default.",
"transmitter": "The radio frequency transmitter used to control the Novy cooker hood."
"transmitter": "[%key:common::config_flow::data_description::radio_frequency_transmitter%]"
},
"description": "After you submit, Home Assistant will toggle the hood light on and off to verify the code works."
}
+104
View File
@@ -24,7 +24,11 @@
"already_configured_service": "Service is already configured",
"already_in_progress": "Configuration flow is already in progress",
"cloud_not_connected": "Not connected to Home Assistant Cloud.",
"no_compatible_radio_frequency_transmitters": "No radio frequency transmitter supports {frequency} {modulation} transmissions. Please add a compatible transmitter first.",
"no_devices_found": "No devices found on the network",
"no_infrared_emitters": "No infrared emitter entities found. Please set up an infrared device first.",
"no_infrared_entities": "No infrared entities found. Please set up an infrared device first.",
"no_radio_frequency_transmitters": "No radio frequency transmitters are available. Please set up a device first.",
"oauth2_authorize_url_timeout": "Timeout while generating an authorization URL.",
"oauth2_error": "Received invalid token data.",
"oauth2_failed": "Error while obtaining access token.",
@@ -54,6 +58,8 @@
"email": "Email",
"host": "Host",
"implementation": "Application credentials",
"infrared_entity_id": "Infrared emitter",
"infrared_receiver_entity_id": "Infrared receiver",
"ip": "IP address",
"language": "Language",
"latitude": "Latitude",
@@ -67,12 +73,17 @@
"pin": "PIN code",
"port": "Port",
"prompt": "Instructions",
"radio_frequency_transmitter": "Radio frequency transmitter",
"ssl": "Uses an SSL certificate",
"url": "URL",
"usb_path": "USB device path",
"username": "Username",
"verify_ssl": "Verify SSL certificate"
},
"data_description": {
"infrared_entity_id": "The infrared emitter entity to use for sending commands.",
"radio_frequency_transmitter": "The radio frequency transmitter to use for sending commands."
},
"description": {
"confirm_setup": "Do you want to start setup?",
"implementation": "The credentials you want to use to authenticate.",
@@ -120,13 +131,106 @@
"turned_on": "{entity_name} turned on"
}
},
"entity": {
"button": {
"back": {
"name": "Back"
},
"down": {
"name": "Down"
},
"exit": {
"name": "Exit"
},
"guide": {
"name": "Guide"
},
"hdmi_1": {
"name": "HDMI 1"
},
"hdmi_2": {
"name": "HDMI 2"
},
"hdmi_3": {
"name": "HDMI 3"
},
"hdmi_4": {
"name": "HDMI 4"
},
"home": {
"name": "Home"
},
"info": {
"name": "Info"
},
"input": {
"name": "Input"
},
"left": {
"name": "Left"
},
"menu": {
"name": "Menu"
},
"num_0": {
"name": "Number 0"
},
"num_1": {
"name": "Number 1"
},
"num_2": {
"name": "Number 2"
},
"num_3": {
"name": "Number 3"
},
"num_4": {
"name": "Number 4"
},
"num_5": {
"name": "Number 5"
},
"num_6": {
"name": "Number 6"
},
"num_7": {
"name": "Number 7"
},
"num_8": {
"name": "Number 8"
},
"num_9": {
"name": "Number 9"
},
"ok": {
"name": "OK"
},
"power": {
"name": "Power"
},
"power_off": {
"name": "Power off"
},
"power_on": {
"name": "Power on"
},
"right": {
"name": "Right"
},
"up": {
"name": "Up"
}
}
},
"exceptions": {
"oauth2_implementation_unavailable": {
"message": "OAuth2 implementation unavailable, will retry"
}
},
"generic": {
"device_type": "Device type",
"model": "Model",
"tv": "TV",
"ui_managed": "Managed via UI"
},
"state": {