Add pre-defined entity name translations (#89792)

This commit is contained in:
Franck Nijhof 2023-03-16 21:10:20 +01:00 committed by GitHub
parent e6f280cf7a
commit f9919bb7cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 402 additions and 4 deletions

View file

@ -28,6 +28,7 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::alarm_control_panel::title%]",
"state": { "state": {
"armed": "Armed", "armed": "Armed",
"disarmed": "Disarmed", "disarmed": "Disarmed",

View file

@ -2,6 +2,7 @@
"title": "Alert", "title": "Alert",
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::alert::title%]",
"state": { "state": {
"idle": "[%key:common::state::idle%]", "idle": "[%key:common::state::idle%]",
"off": "Acknowledged", "off": "Acknowledged",

View file

@ -2,6 +2,7 @@
"title": "Automation", "title": "Automation",
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::automation::title%]",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]" "on": "[%key:common::state::on%]"

View file

@ -108,162 +108,189 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::binary_sensor::title%]",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]" "on": "[%key:common::state::on%]"
} }
}, },
"battery": { "battery": {
"name": "Battery",
"state": { "state": {
"off": "Normal", "off": "Normal",
"on": "Low" "on": "Low"
} }
}, },
"battery_charging": { "battery_charging": {
"name": "Charging",
"state": { "state": {
"off": "Not charging", "off": "Not charging",
"on": "Charging" "on": "Charging"
} }
}, },
"carbon_monoxide": { "carbon_monoxide": {
"name": "Carbon monoxide",
"state": { "state": {
"off": "[%key:component::binary_sensor::entity_component::gas::state::off%]", "off": "[%key:component::binary_sensor::entity_component::gas::state::off%]",
"on": "[key:component::binary_sensor::entity_component::gas::state::on%]" "on": "[key:component::binary_sensor::entity_component::gas::state::on%]"
} }
}, },
"cold": { "cold": {
"name": "Cold",
"state": { "state": {
"off": "[%key:component::binary_sensor::entity_component::battery::state::off%]", "off": "[%key:component::binary_sensor::entity_component::battery::state::off%]",
"on": "Cold" "on": "Cold"
} }
}, },
"connectivity": { "connectivity": {
"name": "Connectivity",
"state": { "state": {
"off": "[%key:common::state::disconnected%]", "off": "[%key:common::state::disconnected%]",
"on": "[%key:common::state::connected%]" "on": "[%key:common::state::connected%]"
} }
}, },
"door": { "door": {
"name": "Door",
"state": { "state": {
"off": "[%key:common::state::closed%]", "off": "[%key:common::state::closed%]",
"on": "[%key:common::state::open%]" "on": "[%key:common::state::open%]"
} }
}, },
"garage_door": { "garage_door": {
"name": "Garage door",
"state": { "state": {
"off": "[%key:common::state::closed%]", "off": "[%key:common::state::closed%]",
"on": "[%key:common::state::open%]" "on": "[%key:common::state::open%]"
} }
}, },
"gas": { "gas": {
"name": "Gas",
"state": { "state": {
"off": "Clear", "off": "Clear",
"on": "Detected" "on": "Detected"
} }
}, },
"heat": { "heat": {
"name": "Heat",
"state": { "state": {
"off": "[%key:component::binary_sensor::entity_component::battery::state::off%]", "off": "[%key:component::binary_sensor::entity_component::battery::state::off%]",
"on": "Hot" "on": "Hot"
} }
}, },
"light": { "light": {
"name": "Light",
"state": { "state": {
"off": "No light", "off": "No light",
"on": "Light detected" "on": "Light detected"
} }
}, },
"lock": { "lock": {
"name": "Lock",
"state": { "state": {
"off": "[%key:common::state::locked%]", "off": "[%key:common::state::locked%]",
"on": "[%key:common::state::unlocked%]" "on": "[%key:common::state::unlocked%]"
} }
}, },
"moisture": { "moisture": {
"name": "Moisture",
"state": { "state": {
"off": "Dry", "off": "Dry",
"on": "Wet" "on": "Wet"
} }
}, },
"motion": { "motion": {
"name": "Motion",
"state": { "state": {
"off": "[key:component::binary_sensor::entity_component::gas::state::off%]", "off": "[key:component::binary_sensor::entity_component::gas::state::off%]",
"on": "[key:component::binary_sensor::entity_component::gas::state::on%]" "on": "[key:component::binary_sensor::entity_component::gas::state::on%]"
} }
}, },
"moving": { "moving": {
"name": "Moving",
"state": { "state": {
"off": "Not moving", "off": "Not moving",
"on": "Moving" "on": "Moving"
} }
}, },
"occupancy": { "occupancy": {
"name": "Occupancy",
"state": { "state": {
"off": "[key:component::binary_sensor::entity_component::gas::state::off%]", "off": "[key:component::binary_sensor::entity_component::gas::state::off%]",
"on": "[key:component::binary_sensor::entity_component::gas::state::on%]" "on": "[key:component::binary_sensor::entity_component::gas::state::on%]"
} }
}, },
"opening": { "opening": {
"name": "Opening",
"state": { "state": {
"off": "[%key:common::state::closed%]", "off": "[%key:common::state::closed%]",
"on": "[%key:common::state::open%]" "on": "[%key:common::state::open%]"
} }
}, },
"plug": { "plug": {
"name": "Plug",
"state": { "state": {
"off": "Unplugged", "off": "Unplugged",
"on": "Plugged in" "on": "Plugged in"
} }
}, },
"presence": { "presence": {
"name": "Presence",
"state": { "state": {
"off": "[%key:component::device_tracker::entity_component::_::state::not_home%]", "off": "[%key:component::device_tracker::entity_component::_::state::not_home%]",
"on": "[%key:component::device_tracker::entity_component::_::state::home%]" "on": "[%key:component::device_tracker::entity_component::_::state::home%]"
} }
}, },
"problem": { "problem": {
"name": "Problem",
"state": { "state": {
"off": "OK", "off": "OK",
"on": "Problem" "on": "Problem"
} }
}, },
"running": { "running": {
"name": "Running",
"state": { "state": {
"off": "Not running", "off": "Not running",
"on": "Running" "on": "Running"
} }
}, },
"safety": { "safety": {
"name": "Safety",
"state": { "state": {
"off": "Safe", "off": "Safe",
"on": "Unsafe" "on": "Unsafe"
} }
}, },
"smoke": { "smoke": {
"name": "Smoke",
"state": { "state": {
"off": "[key:component::binary_sensor::entity_component::gas::state::off%]", "off": "[key:component::binary_sensor::entity_component::gas::state::off%]",
"on": "[key:component::binary_sensor::entity_component::gas::state::on%]" "on": "[key:component::binary_sensor::entity_component::gas::state::on%]"
} }
}, },
"sound": { "sound": {
"name": "Sound",
"state": { "state": {
"off": "[key:component::binary_sensor::entity_component::gas::state::off%]", "off": "[key:component::binary_sensor::entity_component::gas::state::off%]",
"on": "[key:component::binary_sensor::entity_component::gas::state::on%]" "on": "[key:component::binary_sensor::entity_component::gas::state::on%]"
} }
}, },
"update": { "update": {
"name": "Update",
"state": { "state": {
"off": "Up-to-date", "off": "Up-to-date",
"on": "Update available" "on": "Update available"
} }
}, },
"vibration": { "vibration": {
"name": "Vibration",
"state": { "state": {
"off": "[key:component::binary_sensor::entity_component::gas::state::off%]", "off": "[key:component::binary_sensor::entity_component::gas::state::off%]",
"on": "[key:component::binary_sensor::entity_component::gas::state::on%]" "on": "[key:component::binary_sensor::entity_component::gas::state::on%]"
} }
}, },
"window": { "window": {
"name": "Window",
"state": { "state": {
"off": "[%key:common::state::closed%]", "off": "[%key:common::state::closed%]",
"on": "[%key:common::state::open%]" "on": "[%key:common::state::open%]"

View file

@ -7,5 +7,16 @@
"action_type": { "action_type": {
"press": "Press {entity_name} button" "press": "Press {entity_name} button"
} }
},
"entity_component": {
"_": {
"name": "[%key:component::button::title%]"
},
"restart": {
"name": "Restart"
},
"update": {
"name": "Update"
}
} }
} }

View file

@ -2,6 +2,7 @@
"title": "Calendar", "title": "Calendar",
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::calendar::title%]",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]" "on": "[%key:common::state::on%]"

View file

@ -2,6 +2,7 @@
"title": "Camera", "title": "Camera",
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::camera::title%]",
"state": { "state": {
"recording": "Recording", "recording": "Recording",
"streaming": "Streaming", "streaming": "Streaming",

View file

@ -17,6 +17,7 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "Thermostat",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "[%key:common::state::off%]",
"heat": "Heat", "heat": "Heat",

View file

@ -2,6 +2,7 @@
"title": "Configurator", "title": "Configurator",
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::configurator::title%]",
"state": { "state": {
"configure": "Configure", "configure": "Configure",
"configured": "Configured" "configured": "Configured"

View file

@ -29,6 +29,7 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::cover::title%]",
"state": { "state": {
"open": "[%key:common::state::open%]", "open": "[%key:common::state::open%]",
"opening": "Opening", "opening": "Opening",
@ -44,6 +45,36 @@
"name": "Tilt position" "name": "Tilt position"
} }
} }
},
"awning": {
"name": "Awning"
},
"blind": {
"name": "Blind"
},
"curtain": {
"name": "Curtain"
},
"damper": {
"name": "Damper"
},
"door": {
"name": "Door"
},
"garage": {
"name": "Garage"
},
"gate": {
"name": "Gate"
},
"shade": {
"name": "Shade"
},
"shutter": {
"name": "Shutter"
},
"window": {
"name": "Window"
} }
} }
} }

View file

@ -12,6 +12,7 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::device_tracker::title%]",
"state": { "state": {
"home": "[%key:common::state::home%]", "home": "[%key:common::state::home%]",
"not_home": "[%key:common::state::not_home%]" "not_home": "[%key:common::state::not_home%]"

View file

@ -18,6 +18,7 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::fan::title%]",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]" "on": "[%key:common::state::on%]"

View file

@ -157,6 +157,7 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::group::title%]",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]", "on": "[%key:common::state::on%]",

View file

@ -22,10 +22,17 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::humidifier::title%]",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]" "on": "[%key:common::state::on%]"
} }
},
"dehumidifier": {
"name": "Dehumidifier"
},
"humidifier": {
"name": "[%key:component::humidifier::entity_component::_::name%]"
} }
} }
} }

View file

@ -2,6 +2,7 @@
"title": "Input boolean", "title": "Input boolean",
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::input_boolean::title%]",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]" "on": "[%key:common::state::on%]"

View file

@ -21,6 +21,7 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::light::title%]",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]" "on": "[%key:common::state::on%]"

View file

@ -17,6 +17,7 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::lock::title%]",
"state": { "state": {
"jammed": "Jammed", "jammed": "Jammed",
"locked": "[%key:common::state::locked%]", "locked": "[%key:common::state::locked%]",

View file

@ -21,6 +21,7 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::media_player::title%]",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]", "on": "[%key:common::state::on%]",
@ -30,6 +31,15 @@
"standby": "[%key:common::state::standby%]", "standby": "[%key:common::state::standby%]",
"buffering": "Buffering" "buffering": "Buffering"
} }
},
"tv": {
"name": "TV"
},
"speaker": {
"name": "Speaker"
},
"receiver": {
"name": "Receiver"
} }
} }
} }

View file

@ -4,5 +4,136 @@
"action_type": { "action_type": {
"set_value": "Set value for {entity_name}" "set_value": "Set value for {entity_name}"
} }
},
"entity_component": {
"_": {
"name": "[%key:component::number::title%]"
},
"apparent_power": {
"name": "[%key:component::sensor::entity_component::apparent_power::name%]"
},
"aqi": {
"name": "[%key:component::sensor::entity_component::aqi::name%]"
},
"atmospheric_pressure": {
"name": "[%key:component::sensor::entity_component::atmospheric_pressure::name%]"
},
"battery": {
"name": "[%key:component::sensor::entity_component::battery::name%]"
},
"carbon_dioxide": {
"name": "[%key:component::sensor::entity_component::carbon_dioxide::name%]"
},
"carbon_monoxide": {
"name": "[%key:component::sensor::entity_component::carbon_monoxide::name%]"
},
"current": {
"name": "[%key:component::sensor::entity_component::current::name%]"
},
"data_rate": {
"name": "[%key:component::sensor::entity_component::data_rate::name%]"
},
"distance": {
"name": "[%key:component::sensor::entity_component::distance::name%]"
},
"energy": {
"name": "[%key:component::sensor::entity_component::energy::name%]"
},
"energy_storage": {
"name": "[%key:component::sensor::entity_component::energy_storage::name%]"
},
"frequency": {
"name": "[%key:component::sensor::entity_component::frequency::name%]"
},
"gas": {
"name": "[%key:component::sensor::entity_component::gas::name%]"
},
"humidity": {
"name": "[%key:component::sensor::entity_component::humidity::name%]"
},
"illuminance": {
"name": "[%key:component::sensor::entity_component::illuminance::name%]"
},
"irradiance": {
"name": "[%key:component::sensor::entity_component::irradiance::name%]"
},
"moisture": {
"name": "[%key:component::sensor::entity_component::moisture::name%]"
},
"nitrogen_dioxide": {
"name": "[%key:component::sensor::entity_component::nitrogen_dioxide::name%]"
},
"nitrogen_monoxide": {
"name": "[%key:component::sensor::entity_component::nitrogen_monoxide::name%]"
},
"nitrous_oxide": {
"name": "[%key:component::sensor::entity_component::nitrous_oxide::name%]"
},
"ozone": {
"name": "[%key:component::sensor::entity_component::ozone::name%]"
},
"pm1": {
"name": "[%key:component::sensor::entity_component::pm1::name%]"
},
"pm10": {
"name": "[%key:component::sensor::entity_component::pm10::name%]"
},
"pm25": {
"name": "[%key:component::sensor::entity_component::pm25::name%]"
},
"power_factor": {
"name": "[%key:component::sensor::entity_component::power_factor::name%]"
},
"power": {
"name": "[%key:component::sensor::entity_component::power::name%]"
},
"precipitation": {
"name": "[%key:component::sensor::entity_component::precipitation::name%]"
},
"precipitation_intensity": {
"name": "[%key:component::sensor::entity_component::precipitation_intensity::name%]"
},
"pressure": {
"name": "[%key:component::sensor::entity_component::pressure::name%]"
},
"reactive_power": {
"name": "[%key:component::sensor::entity_component::reactive_power::name%]"
},
"signal_strength": {
"name": "[%key:component::sensor::entity_component::signal_strength::name%]"
},
"sound_pressure": {
"name": "[%key:component::sensor::entity_component::sound_pressure::name%]"
},
"speed": {
"name": "[%key:component::sensor::entity_component::speed::name%]"
},
"sulphur_dioxide": {
"name": "[%key:component::sensor::entity_component::sulphur_dioxide::name%]"
},
"temperature": {
"name": "[%key:component::sensor::entity_component::temperature::name%]"
},
"volatile_organic_compounds": {
"name": "[%key:component::sensor::entity_component::volatile_organic_compounds::name%]"
},
"voltage": {
"name": "[%key:component::sensor::entity_component::voltage::name%]"
},
"volume": {
"name": "[%key:component::sensor::entity_component::volume::name%]"
},
"volume_storage": {
"name": "[%key:component::sensor::entity_component::volume_storage::name%]"
},
"water": {
"name": "[%key:component::sensor::entity_component::water::name%]"
},
"weight": {
"name": "[%key:component::sensor::entity_component::weight::name%]"
},
"wind_speed": {
"name": "[%key:component::sensor::entity_component::wind_speed::name%]"
}
} }
} }

View file

@ -2,6 +2,7 @@
"title": "Person", "title": "Person",
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::person::title%]",
"state": { "state": {
"home": "[%key:common::state::home%]", "home": "[%key:common::state::home%]",
"not_home": "[%key:common::state::not_home%]" "not_home": "[%key:common::state::not_home%]"

View file

@ -2,6 +2,7 @@
"title": "Plant Monitor", "title": "Plant Monitor",
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::plant::title%]",
"state": { "state": {
"ok": "[%key:component::binary_sensor::entity_component::problem::state::off%]", "ok": "[%key:component::binary_sensor::entity_component::problem::state::off%]",
"problem": "[%key:component::binary_sensor::entity_component::problem::state::on%]" "problem": "[%key:component::binary_sensor::entity_component::problem::state::on%]"

View file

@ -18,6 +18,7 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::remote::title%]",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]" "on": "[%key:common::state::on%]"

View file

@ -2,6 +2,7 @@
"title": "Schedule", "title": "Schedule",
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::schedule::title%]",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]" "on": "[%key:common::state::on%]"

View file

@ -2,6 +2,7 @@
"title": "Script", "title": "Script",
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::script::title%]",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]" "on": "[%key:common::state::on%]"

View file

@ -96,10 +96,149 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::sensor::title%]",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]" "on": "[%key:common::state::on%]"
} }
},
"date": {
"name": "Date"
},
"duration": {
"name": "Duration"
},
"apparent_power": {
"name": "Apparent power"
},
"aqi": {
"name": "Air quality index"
},
"atmospheric_pressure": {
"name": "Atmospheric pressure"
},
"battery": {
"name": "Battery"
},
"carbon_monoxide": {
"name": "Carbon monoxide"
},
"carbon_dioxide": {
"name": "Carbon dioxide"
},
"current": {
"name": "Current"
},
"data_rate": {
"name": "Data rate"
},
"data_size": {
"name": "Data size"
},
"distance": {
"name": "Distance"
},
"energy": {
"name": "Energy"
},
"energy_storage": {
"name": "Stored energy"
},
"frequency": {
"name": "Frequency"
},
"gas": {
"name": "Gas"
},
"humidity": {
"name": "Humidity"
},
"illuminance": {
"name": "Illuminance"
},
"irradiance": {
"name": "Irradiance"
},
"moisture": {
"name": "Moisture"
},
"monetary": {
"name": "Balance"
},
"nitrogen_dioxide": {
"name": "Nitrogen dioxide"
},
"nitrogen_monoxide": {
"name": "Nitrogen monoxide"
},
"nitrous_oxide": {
"name": "Nitrous oxide"
},
"ozone": {
"name": "Ozone"
},
"pm1": {
"name": "Particulate matter 0.1 μm"
},
"pm10": {
"name": "Particulate matter 10 μm"
},
"pm25": {
"name": "Particulate matter 2.5 μm"
},
"power_factor": {
"name": "Power factor"
},
"power": {
"name": "Power"
},
"precipitation": {
"name": "Precipitation"
},
"precipitation_intensity": {
"name": "Precipitation intensity"
},
"pressure": {
"name": "Pressure"
},
"reactive_power": {
"name": "Reactive power"
},
"signal_strength": {
"name": "Signal strength"
},
"sound_pressure": {
"name": "Sound pressure"
},
"speed": {
"name": "Speed"
},
"sulphur_dioxide": {
"name": "Sulphur dioxide"
},
"temperature": {
"name": "Temperature"
},
"volatile_organic_compounds": {
"name": "VOCs"
},
"voltage": {
"name": "Voltage"
},
"volume": {
"name": "Volume"
},
"volume_storage": {
"name": "Stored volume"
},
"water": {
"name": "Water"
},
"weight": {
"name": "Weight"
},
"wind_speed": {
"name": "Wind speed"
} }
} }
} }

View file

@ -12,6 +12,7 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::sun::title%]",
"state": { "state": {
"above_horizon": "Above horizon", "above_horizon": "Above horizon",
"below_horizon": "Below horizon" "below_horizon": "Below horizon"

View file

@ -18,10 +18,17 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::switch::title%]",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "[%key:common::state::off%]",
"on": "[%key:common::state::on%]" "on": "[%key:common::state::on%]"
} }
},
"switch": {
"name": "[%key:component::switch::entity_component::_::name%]"
},
"outlet": {
"name": "Outlet"
} }
} }
} }

View file

@ -1,6 +1,7 @@
{ {
"entity_component": { "entity_component": {
"_": { "_": {
"name": "Timer",
"state": { "state": {
"active": "[%key:common::state::active%]", "active": "[%key:common::state::active%]",
"idle": "[%key:common::state::idle%]", "idle": "[%key:common::state::idle%]",

View file

@ -6,5 +6,13 @@
"turned_on": "{entity_name} got an update available", "turned_on": "{entity_name} got an update available",
"turned_off": "{entity_name} became up-to-date" "turned_off": "{entity_name} became up-to-date"
} }
},
"entity_component": {
"_": {
"name": "[%key:component::update::title%]"
},
"firmware": {
"name": "firmware"
}
} }
} }

View file

@ -16,6 +16,7 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "[%key:component::vacuum::title%]",
"state": { "state": {
"cleaning": "Cleaning", "cleaning": "Cleaning",
"docked": "Docked", "docked": "Docked",

View file

@ -7,6 +7,7 @@
}, },
"entity_component": { "entity_component": {
"_": { "_": {
"name": "Water heater",
"state": { "state": {
"off": "[%key:common::state::off%]", "off": "[%key:common::state::off%]",
"eco": "Eco", "eco": "Eco",

View file

@ -1,6 +1,7 @@
{ {
"entity_component": { "entity_component": {
"_": { "_": {
"name": "Weather",
"state": { "state": {
"clear-night": "Clear, night", "clear-night": "Clear, night",
"cloudy": "Cloudy", "cloudy": "Cloudy",

View file

@ -266,6 +266,7 @@ def gen_strings_schema(config: Config, integration: Integration) -> vol.Schema:
}, },
vol.Optional("entity_component"): cv.schema_with_slug_keys( vol.Optional("entity_component"): cv.schema_with_slug_keys(
{ {
vol.Optional("name"): str,
vol.Optional("state"): cv.schema_with_slug_keys( vol.Optional("state"): cv.schema_with_slug_keys(
cv.string_with_no_html, cv.string_with_no_html,
slug_validator=translation_key_validator, slug_validator=translation_key_validator,

View file

@ -383,22 +383,25 @@ async def test_caching(hass: HomeAssistant) -> None:
for key in load1: for key in load1:
assert key.startswith( assert key.startswith(
"component.sensor.entity_component._.state." (
) or key.startswith("component.light.entity_component._.state.") "component.sensor.entity_component.",
"component.light.entity_component.",
)
)
load_sensor_only = await translation.async_get_translations( load_sensor_only = await translation.async_get_translations(
hass, "en", "entity_component", integrations={"sensor"} hass, "en", "entity_component", integrations={"sensor"}
) )
assert load_sensor_only assert load_sensor_only
for key in load_sensor_only: for key in load_sensor_only:
assert key.startswith("component.sensor.entity_component._.state.") assert key.startswith("component.sensor.entity_component.")
load_light_only = await translation.async_get_translations( load_light_only = await translation.async_get_translations(
hass, "en", "entity_component", integrations={"light"} hass, "en", "entity_component", integrations={"light"}
) )
assert load_light_only assert load_light_only
for key in load_light_only: for key in load_light_only:
assert key.startswith("component.light.entity_component._.state.") assert key.startswith("component.light.entity_component.")
hass.config.components.add("media_player") hass.config.components.add("media_player")