Skip to content

Add set temperature, set brightness and lock commands - #5657

Merged
bgoncal merged 2 commits into
mainfrom
siri-set-value-and-lock
Sep 6, 2026
Merged

Add set temperature, set brightness and lock commands#5657
bgoncal merged 2 commits into
mainfrom
siri-set-value-and-lock

Conversation

@bgoncal

@bgoncal bgoncal commented Sep 5, 2026

Copy link
Copy Markdown
Member

AI Policy

Select exactly one option that describes AI usage in this contribution:

  • I have not used AI for this contribution.
  • AI assistance was used for this contribution.
  • AI fully generated the code for this contribution, but I've reviewed and understood it before submitting and will respond without AI during review.

Summary

Follows #5652 with the commands people ask for that were still missing.

  • Set temperature on a thermostat, in the unit the server uses. The range is capped at 7–35 to match the frontend's own defaults, so a misheard number can't ask for something absurd.
  • Set brightness on a light, as a percentage.
  • Lock a lock. Unlocking is deliberately not offered by voice.
  • Siri now also answers to HA, Hass and Home, and accepts the app name as a prefix, so "Home Assistant turn on the kitchen light" works as well as "Turn on the kitchen light in Home Assistant".

Nine of Apple's ten App Shortcut slots are used.

Screenshots

No new UI. The commands are spoken, and their results are the dialog Siri reads back.

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#

Any other notes

A phrase can only interpolate a finite set of options, so the number can't be spoken in one breath: "Set a temperature in Home Assistant" works and Siri then asks for the value.

SetTemperatureAppIntent hard-codes its 7–35 range because App Intents requires a compile-time literal there. A test pins it to ClimateControlState's defaults so the two can't drift apart.

Also answers to "HA", "Hass" and "Home", and takes the app name as a prefix,
so "Home Assistant turn on the kitchen light" works.
Copilot AI lite review requested due to automatic review settings September 5, 2026 23:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

It directly edits non-English localized AppShortcuts.strings files (which are Lokalise-managed) and includes a user-visible fallback string issue that should be corrected before merge.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds additional Siri/App Shortcuts voice commands to the iOS Companion App’s App Intents extension, covering commonly requested controls (set thermostat temperature, set light brightness, and lock a lock) and expanding Siri’s ability to recognize the app name.

Changes:

  • Add new App Intents + App Entities for thermostat temperature, light brightness, and locking.
  • Expand the HomeAssistantAppShortcuts phrases (including app-name-prefixed variants) and bump the shortcut-count test.
  • Add new localization keys / dialogs and a small refactor to entity subtitle context building.
File summaries
File Description
Tests/App/Utilities/SiriValueIntentsTests.swift New tests for locks/temperature bounds/dialog text
Tests/App/Utilities/HomeAssistantAppShortcutsTests.swift Updates expected shortcut count (6 → 9)
Sources/Shared/Resources/Swiftgen/Strings.swift SwiftGen updates for new localized keys
Sources/Extensions/EntityProvider+Details.swift Adds shared contextSubtitle(serverName:) helper
Sources/Extensions/AppIntents/Control/ThermostatAppEntityQuery.swift Thermostat picker/query for App Intents
Sources/Extensions/AppIntents/Control/ThermostatAppEntity.swift Thermostat App Entity model
Sources/Extensions/AppIntents/Control/SetTemperatureAppIntent.swift New “set temperature” intent (7–35 bounded)
Sources/Extensions/AppIntents/Control/SetBrightnessAppIntent.swift New “set brightness %” intent
Sources/Extensions/AppIntents/Control/LockEntityAppIntent.swift New “lock” intent (no unlock)
Sources/Extensions/AppIntents/Control/LockAppEntityQuery.swift Lock picker/query for App Intents
Sources/Extensions/AppIntents/Control/LockAppEntity.swift Lock App Entity model
Sources/Extensions/AppIntents/Control/DimmableLightAppEntityQuery.swift Light picker/query for brightness intent
Sources/Extensions/AppIntents/Control/DimmableLightAppEntity.swift Light App Entity model for brightness intent
Sources/Extensions/AppIntents/Control/ControllableEntityAppEntity.swift Refactors subtitle to shared helper
Sources/App/Utilities/AppShortcuts/HomeAssistantAppShortcuts.swift Adds 3 new shortcuts + more phrases
Sources/App/Resources/en.lproj/Localizable.strings Adds new intent/dialog localized strings
Sources/App/Resources/en.lproj/AppShortcuts.strings Adds new shortcut phrase localizations
Sources/App/Resources/en-GB.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/bg.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/ca-ES.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/cs.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/cy-GB.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/da.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/de.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/el.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/es.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/es-ES.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/es-MX.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/et.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/fi.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/fr.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/he.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/hu.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/id.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/it.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/ja.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/ko-KR.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/ml.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/nb.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/nl.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/pl-PL.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/pt-BR.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/ru.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/sl.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/sv.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/tr.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/uk.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/vi.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/zh-Hans.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/zh-Hant.lproj/AppShortcuts.strings Updates phrase localization entries
Sources/App/Resources/Info.plist Adds Siri alternative app names (“HA”, “Hass”, “Home”)
HomeAssistant.xcodeproj/project.pbxproj Adds new intent/entity source files to project
Review details
  • Files reviewed: 52/52 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Sources/Extensions/AppIntents/Control/DimmableLightAppEntity.swift
Comment thread Sources/App/Resources/zh-Hans.lproj/AppShortcuts.strings Outdated
…k name

The type name showed as "DimmableLight" when the localized string was missing.
@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 19.83806% with 198 lines in your changes missing coverage. Please review.
✅ Project coverage is 35.55%. Comparing base (c3d1737) to head (c53eef3).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...pIntents/Control/DimmableLightAppEntityQuery.swift 0.00% 35 Missing ⚠️
...nsions/AppIntents/Control/LockAppEntityQuery.swift 0.00% 35 Missing ⚠️
.../AppIntents/Control/ThermostatAppEntityQuery.swift 0.00% 35 Missing ⚠️
...ns/AppIntents/Control/SetBrightnessAppIntent.swift 0.00% 17 Missing ⚠️
...s/AppIntents/Control/SetTemperatureAppIntent.swift 0.00% 17 Missing ⚠️
...ns/AppIntents/Control/DimmableLightAppEntity.swift 0.00% 15 Missing ⚠️
.../Extensions/AppIntents/Control/LockAppEntity.swift 0.00% 15 Missing ⚠️
...sions/AppIntents/Control/ThermostatAppEntity.swift 0.00% 15 Missing ⚠️
...sions/AppIntents/Control/LockEntityAppIntent.swift 0.00% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5657      +/-   ##
==========================================
+ Coverage   35.29%   35.55%   +0.25%     
==========================================
  Files        1013     1042      +29     
  Lines       73124    74323    +1199     
==========================================
+ Hits        25812    26427     +615     
- Misses      47312    47896     +584     
Files with missing lines Coverage Δ
...ities/AppShortcuts/HomeAssistantAppShortcuts.swift 100.00% <100.00%> (ø)
...pIntents/Control/ControllableEntityAppEntity.swift 100.00% <100.00%> (ø)
Sources/Extensions/EntityProvider+Details.swift 86.50% <100.00%> (+1.88%) ⬆️
...sions/AppIntents/Control/LockEntityAppIntent.swift 0.00% <0.00%> (ø)
...ns/AppIntents/Control/DimmableLightAppEntity.swift 0.00% <0.00%> (ø)
.../Extensions/AppIntents/Control/LockAppEntity.swift 0.00% <0.00%> (ø)
...sions/AppIntents/Control/ThermostatAppEntity.swift 0.00% <0.00%> (ø)
...ns/AppIntents/Control/SetBrightnessAppIntent.swift 0.00% <0.00%> (ø)
...s/AppIntents/Control/SetTemperatureAppIntent.swift 0.00% <0.00%> (ø)
...pIntents/Control/DimmableLightAppEntityQuery.swift 0.00% <0.00%> (ø)
... and 2 more

... and 51 files with indirect coverage changes

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bgoncal
bgoncal merged commit 89c8801 into main Sep 6, 2026
14 checks passed
@bgoncal
bgoncal deleted the siri-set-value-and-lock branch September 6, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants