Skip to content

Commit f4f111c

Browse files
authored
Improve copy for control intents (#3519)
<!-- Thank you for submitting a Pull Request and helping to improve Home Assistant. Please complete the following sections to help the processing and review of your changes. Please do not delete anything from this template. --> ## Summary <!-- Provide a brief summary of the changes you have made and most importantly what they aim to achieve --> ## Screenshots <!-- If this is a user-facing change not in the frontend, please include screenshots in light and dark mode. --> ## Link to pull request in Documentation repository <!-- Pull requests that add, change or remove functionality must have a corresponding pull request in the Companion App Documentation repository (https://github.com/home-assistant/companion.home-assistant). Please add the number of this pull request after the "#" --> Documentation: home-assistant/companion.home-assistant# ## Any other notes <!-- If there is any other information of note, like if this Pull Request is part of a bigger change, please include it here. -->
1 parent 99c6596 commit f4f111c

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

Sources/App/Resources/en.lproj/Localizable.strings

+3-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@
6767
"app_intents.intent.cover.title" = "Control cover";
6868
"app_intents.intent.light.title" = "Control light";
6969
"app_intents.intent.switch.title" = "Control switch";
70-
"app_intents.lights.light.target" = "Target state";
70+
"app_intents.state.target" = "Target state";
7171
"app_intents.lights.light.title" = "Light";
72+
"app_intents.switch.title" = "Switch";
7273
"app_intents.lights.off_state_icon.title" = "Icon for off state";
7374
"app_intents.lights.on_state_icon.title" = "Icon for on state";
7475
"app_intents.notify_when_run.description" = "Shows notification after executed";
@@ -1179,4 +1180,4 @@ Home Assistant is free and open source home automation software with a focus on
11791180
"widgets.sensors.description" = "Display state of sensors";
11801181
"widgets.sensors.not_configured" = "No Sensors Configured";
11811182
"widgets.sensors.title" = "Sensors";
1182-
"yes_label" = "Yes";
1183+
"yes_label" = "Yes";

Sources/Extensions/Widgets/Controls/Light/LightIntent.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ struct LightIntent: SetValueIntent {
99
@Parameter(title: .init("app_intents.lights.light.title", defaultValue: "Light"))
1010
var light: IntentLightEntity
1111

12-
@Parameter(title: .init("app_intents.lights.light.target", defaultValue: "Target state"))
12+
@Parameter(title: .init("app_intents.state.target", defaultValue: "Target state"))
1313
var value: Bool
1414

1515
@Parameter(title: .init("app_intents.state.toggle", defaultValue: "Toggle"), default: false)

Sources/Extensions/Widgets/Controls/Switch/SwitchIntent.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import Shared
66
struct SwitchIntent: SetValueIntent {
77
static var title: LocalizedStringResource = .init("app_intents.intent.switch.title", defaultValue: "Control switch")
88

9-
@Parameter(title: .init("app_intents.lights.light.title", defaultValue: "Light"))
9+
@Parameter(title: .init("app_intents.light.title", defaultValue: "Switch"))
1010
var entity: IntentSwitchEntity
1111

12-
@Parameter(title: .init("app_intents.lights.light.target", defaultValue: "Target state"))
12+
@Parameter(title: .init("app_intents.state.target", defaultValue: "Target state"))
1313
var value: Bool
1414

1515
@Parameter(title: .init("app_intents.state.toggle", defaultValue: "Toggle"), default: false)

Sources/Shared/Resources/Swiftgen/Strings.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,6 @@ public enum L10n {
331331
}
332332
public enum Lights {
333333
public enum Light {
334-
/// Target state
335-
public static var target: String { return L10n.tr("Localizable", "app_intents.lights.light.target") }
336334
/// Light
337335
public static var title: String { return L10n.tr("Localizable", "app_intents.lights.light.title") }
338336
}
@@ -459,6 +457,10 @@ public enum L10n {
459457
/// Toggle
460458
public static var toggle: String { return L10n.tr("Localizable", "app_intents.state.toggle") }
461459
}
460+
public enum Switch {
461+
/// Switch
462+
public static var title: String { return L10n.tr("Localizable", "app_intents.switch.title") }
463+
}
462464
public enum WidgetAction {
463465
/// Which actions?
464466
public static var actionsParameterConfiguration: String { return L10n.tr("Localizable", "app_intents.widget_action.actions_parameter_configuration") }

0 commit comments

Comments
 (0)