Skip to content

Commit 4332c0e

Browse files
authored
Add intent handler for conversation (home-assistant#2284)
<!-- 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 Adds an intent handler for the conversation feature in core-2023.2. ## Screenshots ![simulator_screenshot_5002493C-BF10-4193-87B9-59E69CD78B6F](https://user-images.githubusercontent.com/74188/213895975-825f2b28-b530-4a32-87b7-475c07f041ef.png) ## 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 1233f18 commit 4332c0e

File tree

9 files changed

+374
-14
lines changed

9 files changed

+374
-14
lines changed

HomeAssistant.xcodeproj/project.pbxproj

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@
348348
11B62DC024F2F06100E5CB55 /* UIApplication+OpenSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B62DBF24F2F06100E5CB55 /* UIApplication+OpenSettings.swift */; };
349349
11B63B0A2979A07000D908ED /* AssistIntentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B63B092979A07000D908ED /* AssistIntentHandler.swift */; };
350350
11B63B0B2979A07000D908ED /* AssistIntentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B63B092979A07000D908ED /* AssistIntentHandler.swift */; };
351+
11B63B0A2979A07000D908ED /* AssistIntentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B63B092979A07000D908ED /* AssistIntentHandler.swift */; };
352+
11B63B0B2979A07000D908ED /* AssistIntentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B63B092979A07000D908ED /* AssistIntentHandler.swift */; };
351353
11B63B0F297A19DC00D908ED /* MatterSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 11B63B0E297A19DC00D908ED /* MatterSupport.framework */; platformFilter = ios; settings = {ATTRIBUTES = (Weak, ); }; };
352354
11B6774D28303D35006E9B1A /* SecurityExceptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B6774C28303D35006E9B1A /* SecurityExceptions.swift */; };
353355
11B6774E28303D35006E9B1A /* SecurityExceptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B6774C28303D35006E9B1A /* SecurityExceptions.swift */; };
@@ -1429,6 +1431,7 @@
14291431
11B62DBD24F2EDD800E5CB55 /* EurekaCondition+Additions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "EurekaCondition+Additions.swift"; sourceTree = "<group>"; };
14301432
11B62DBF24F2F06100E5CB55 /* UIApplication+OpenSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIApplication+OpenSettings.swift"; sourceTree = "<group>"; };
14311433
11B63B092979A07000D908ED /* AssistIntentHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssistIntentHandler.swift; sourceTree = "<group>"; };
1434+
11B63B092979A07000D908ED /* AssistIntentHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssistIntentHandler.swift; sourceTree = "<group>"; };
14321435
11B63B0E297A19DC00D908ED /* MatterSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MatterSupport.framework; path = System/Library/Frameworks/MatterSupport.framework; sourceTree = SDKROOT; };
14331436
11B6774C28303D35006E9B1A /* SecurityExceptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecurityExceptions.swift; sourceTree = "<group>"; };
14341437
11B6B57B2948F8E100B8B552 /* HomeAssistant-Extensions-Matter.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "HomeAssistant-Extensions-Matter.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -2730,18 +2733,19 @@
27302733
11B38EE0275C545C00205C7B /* Intents */ = {
27312734
isa = PBXGroup;
27322735
children = (
2736+
11B63B092979A07000D908ED /* AssistIntentHandler.swift */,
27332737
B66C58B02150891B004AB261 /* CallServiceIntentHandler.swift */,
27342738
B66C58B22150892A004AB261 /* FireEventIntentHandler.swift */,
2735-
B66C58B42150898A004AB261 /* SendLocationIntentHandler.swift */,
2736-
B6DF8BC3221D047400370A59 /* GetCameraImageIntentHandler.swift */,
2737-
B62817EF221D269B000BA86A /* RenderTemplateIntentHandler.swift */,
2738-
111858D324CB5B8900B8CDDC /* PerformActionIntentHandler.swift */,
2739-
11BD8BBC24E76BAD004B9A54 /* WidgetActionsIntentHandler.swift */,
2740-
112B705A2526B1C500FEAA76 /* UpdateSensorsIntentHandler.swift */,
27412739
115BC82A267704E300452430 /* FocusStatusIntentHandler.swift */,
2740+
B6DF8BC3221D047400370A59 /* GetCameraImageIntentHandler.swift */,
2741+
11B38EE1275C547A00205C7B /* IntentHandlerFactory.swift */,
27422742
115560E4270116AF00A8F818 /* OpenPageIntentHandler.swift */,
2743+
111858D324CB5B8900B8CDDC /* PerformActionIntentHandler.swift */,
27432744
11F2E7B227500DAD00CF144C /* PickAServerError.swift */,
2744-
11B38EE1275C547A00205C7B /* IntentHandlerFactory.swift */,
2745+
B62817EF221D269B000BA86A /* RenderTemplateIntentHandler.swift */,
2746+
B66C58B42150898A004AB261 /* SendLocationIntentHandler.swift */,
2747+
112B705A2526B1C500FEAA76 /* UpdateSensorsIntentHandler.swift */,
2748+
11BD8BBC24E76BAD004B9A54 /* WidgetActionsIntentHandler.swift */,
27452749
);
27462750
path = Intents;
27472751
sourceTree = "<group>";
@@ -5588,6 +5592,7 @@
55885592
11EE9B4A24C5116F00404AF8 /* ModelManager.swift in Sources */,
55895593
119A7E0E2529769A00D7000D /* UIImageView+UIActivityIndicator.swift in Sources */,
55905594
B67CE8B622200F220034C1D0 /* UIColor+HA.swift in Sources */,
5595+
11B63B0B2979A07000D908ED /* AssistIntentHandler.swift in Sources */,
55915596
1115044E2528485200DCFA94 /* WatchHelpers.swift in Sources */,
55925597
1133F59D25F1DA5D00AD776F /* CLLocation+Sanitize.swift in Sources */,
55935598
B67CE8B522200F220034C1D0 /* String+HA.swift in Sources */,
@@ -5783,6 +5788,7 @@
57835788
B613936924F728F8002B8C5D /* InputOutputDeviceSensor.swift in Sources */,
57845789
11C4629624B19FC700031902 /* URLSessionTask+WebhookPersisted.swift in Sources */,
57855790
11F2F25E25871D6000F61F7C /* NotificationAttachmentParserCamera.swift in Sources */,
5791+
11B63B0A2979A07000D908ED /* AssistIntentHandler.swift in Sources */,
57865792
1133F59C25F1DA5D00AD776F /* CLLocation+Sanitize.swift in Sources */,
57875793
11AF4D1C249C8AA0006C74C0 /* BatterySensor.swift in Sources */,
57885794
D014EEA92128E192008EA6F5 /* ConnectionInfo.swift in Sources */,

Sources/App/Resources/Base.lproj/Intents.intentdefinition

Lines changed: 278 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
<key>INIntentDefinitionNamespace</key>
1010
<string>sI7YSe</string>
1111
<key>INIntentDefinitionSystemVersion</key>
12-
<string>21A559</string>
12+
<string>22D5038i</string>
1313
<key>INIntentDefinitionToolsBuildVersion</key>
14-
<string>13A1030d</string>
14+
<string>14B47b</string>
1515
<key>INIntentDefinitionToolsVersion</key>
16-
<string>13.1</string>
16+
<string>14.1</string>
1717
<key>INIntents</key>
1818
<array>
1919
<dict>
@@ -1441,6 +1441,30 @@
14411441
<key>INIntentParameterArraySizeSizeClass</key>
14421442
<string>ExtraLarge</string>
14431443
</dict>
1444+
<dict>
1445+
<key>INIntentParameterArraySizeSize</key>
1446+
<integer>1</integer>
1447+
<key>INIntentParameterArraySizeSizeClass</key>
1448+
<string>AccessoryInline</string>
1449+
</dict>
1450+
<dict>
1451+
<key>INIntentParameterArraySizeSize</key>
1452+
<integer>1</integer>
1453+
<key>INIntentParameterArraySizeSizeClass</key>
1454+
<string>AccessoryCorner</string>
1455+
</dict>
1456+
<dict>
1457+
<key>INIntentParameterArraySizeSize</key>
1458+
<integer>1</integer>
1459+
<key>INIntentParameterArraySizeSizeClass</key>
1460+
<string>AccessoryCircular</string>
1461+
</dict>
1462+
<dict>
1463+
<key>INIntentParameterArraySizeSize</key>
1464+
<integer>2</integer>
1465+
<key>INIntentParameterArraySizeSizeClass</key>
1466+
<string>AccessoryRectangular</string>
1467+
</dict>
14441468
</array>
14451469
<key>INIntentParameterConfigurable</key>
14461470
<true/>
@@ -1728,6 +1752,30 @@
17281752
<key>INIntentParameterArraySizeSizeClass</key>
17291753
<string>ExtraLarge</string>
17301754
</dict>
1755+
<dict>
1756+
<key>INIntentParameterArraySizeSize</key>
1757+
<integer>1</integer>
1758+
<key>INIntentParameterArraySizeSizeClass</key>
1759+
<string>AccessoryInline</string>
1760+
</dict>
1761+
<dict>
1762+
<key>INIntentParameterArraySizeSize</key>
1763+
<integer>1</integer>
1764+
<key>INIntentParameterArraySizeSizeClass</key>
1765+
<string>AccessoryCorner</string>
1766+
</dict>
1767+
<dict>
1768+
<key>INIntentParameterArraySizeSize</key>
1769+
<integer>1</integer>
1770+
<key>INIntentParameterArraySizeSizeClass</key>
1771+
<string>AccessoryCircular</string>
1772+
</dict>
1773+
<dict>
1774+
<key>INIntentParameterArraySizeSize</key>
1775+
<integer>2</integer>
1776+
<key>INIntentParameterArraySizeSizeClass</key>
1777+
<string>AccessoryRectangular</string>
1778+
</dict>
17311779
</array>
17321780
<key>INIntentParameterConfigurable</key>
17331781
<true/>
@@ -1799,6 +1847,233 @@
17991847
<key>INIntentVerb</key>
18001848
<string>Open</string>
18011849
</dict>
1850+
<dict>
1851+
<key>INIntentCategory</key>
1852+
<string>request</string>
1853+
<key>INIntentConfigurable</key>
1854+
<true/>
1855+
<key>INIntentDescription</key>
1856+
<string>Ask for Assistance</string>
1857+
<key>INIntentDescriptionID</key>
1858+
<string>A1pokw</string>
1859+
<key>INIntentInput</key>
1860+
<string>text</string>
1861+
<key>INIntentKeyParameter</key>
1862+
<string>text</string>
1863+
<key>INIntentLastParameterTag</key>
1864+
<integer>2</integer>
1865+
<key>INIntentManagedParameterCombinations</key>
1866+
<dict>
1867+
<key>text,server</key>
1868+
<dict>
1869+
<key>INIntentParameterCombinationSupportsBackgroundExecution</key>
1870+
<true/>
1871+
<key>INIntentParameterCombinationTitle</key>
1872+
<string>Assist with "${text}"</string>
1873+
<key>INIntentParameterCombinationTitleID</key>
1874+
<string>d65H6l</string>
1875+
<key>INIntentParameterCombinationUpdatesLinked</key>
1876+
<true/>
1877+
</dict>
1878+
</dict>
1879+
<key>INIntentName</key>
1880+
<string>Assist</string>
1881+
<key>INIntentParameterCombinations</key>
1882+
<dict>
1883+
<key>text,server</key>
1884+
<dict>
1885+
<key>INIntentParameterCombinationIsLinked</key>
1886+
<true/>
1887+
<key>INIntentParameterCombinationSupportsBackgroundExecution</key>
1888+
<true/>
1889+
<key>INIntentParameterCombinationTitle</key>
1890+
<string>Assist with "${text}"</string>
1891+
<key>INIntentParameterCombinationTitleID</key>
1892+
<string>YmPx5q</string>
1893+
</dict>
1894+
</dict>
1895+
<key>INIntentParameters</key>
1896+
<array>
1897+
<dict>
1898+
<key>INIntentParameterConfigurable</key>
1899+
<true/>
1900+
<key>INIntentParameterCustomDisambiguation</key>
1901+
<true/>
1902+
<key>INIntentParameterDisplayName</key>
1903+
<string>Server</string>
1904+
<key>INIntentParameterDisplayNameID</key>
1905+
<string>hXWHln</string>
1906+
<key>INIntentParameterDisplayPriority</key>
1907+
<integer>1</integer>
1908+
<key>INIntentParameterName</key>
1909+
<string>server</string>
1910+
<key>INIntentParameterObjectType</key>
1911+
<string>IntentServer</string>
1912+
<key>INIntentParameterObjectTypeNamespace</key>
1913+
<string>sI7YSe</string>
1914+
<key>INIntentParameterPromptDialogs</key>
1915+
<array>
1916+
<dict>
1917+
<key>INIntentParameterPromptDialogCustom</key>
1918+
<true/>
1919+
<key>INIntentParameterPromptDialogFormatString</key>
1920+
<string>Which server?</string>
1921+
<key>INIntentParameterPromptDialogFormatStringID</key>
1922+
<string>ftQHJw</string>
1923+
<key>INIntentParameterPromptDialogType</key>
1924+
<string>Configuration</string>
1925+
</dict>
1926+
<dict>
1927+
<key>INIntentParameterPromptDialogCustom</key>
1928+
<true/>
1929+
<key>INIntentParameterPromptDialogType</key>
1930+
<string>Primary</string>
1931+
</dict>
1932+
<dict>
1933+
<key>INIntentParameterPromptDialogCustom</key>
1934+
<true/>
1935+
<key>INIntentParameterPromptDialogFormatString</key>
1936+
<string>There are ${count} options matching ‘${server}’.</string>
1937+
<key>INIntentParameterPromptDialogFormatStringID</key>
1938+
<string>EA0zLv</string>
1939+
<key>INIntentParameterPromptDialogType</key>
1940+
<string>DisambiguationIntroduction</string>
1941+
</dict>
1942+
<dict>
1943+
<key>INIntentParameterPromptDialogCustom</key>
1944+
<true/>
1945+
<key>INIntentParameterPromptDialogFormatString</key>
1946+
<string>Just to confirm, you wanted ‘${server}’?</string>
1947+
<key>INIntentParameterPromptDialogFormatStringID</key>
1948+
<string>ni0OSe</string>
1949+
<key>INIntentParameterPromptDialogType</key>
1950+
<string>Confirmation</string>
1951+
</dict>
1952+
</array>
1953+
<key>INIntentParameterSupportsDynamicEnumeration</key>
1954+
<true/>
1955+
<key>INIntentParameterSupportsResolution</key>
1956+
<true/>
1957+
<key>INIntentParameterTag</key>
1958+
<integer>2</integer>
1959+
<key>INIntentParameterType</key>
1960+
<string>Object</string>
1961+
</dict>
1962+
<dict>
1963+
<key>INIntentParameterConfigurable</key>
1964+
<true/>
1965+
<key>INIntentParameterDisplayName</key>
1966+
<string>Text</string>
1967+
<key>INIntentParameterDisplayNameID</key>
1968+
<string>txfcnn</string>
1969+
<key>INIntentParameterDisplayPriority</key>
1970+
<integer>2</integer>
1971+
<key>INIntentParameterMetadata</key>
1972+
<dict>
1973+
<key>INIntentParameterMetadataCapitalization</key>
1974+
<string>Sentences</string>
1975+
<key>INIntentParameterMetadataDefaultValueID</key>
1976+
<string>adkcOI</string>
1977+
</dict>
1978+
<key>INIntentParameterName</key>
1979+
<string>text</string>
1980+
<key>INIntentParameterPromptDialogs</key>
1981+
<array>
1982+
<dict>
1983+
<key>INIntentParameterPromptDialogCustom</key>
1984+
<true/>
1985+
<key>INIntentParameterPromptDialogType</key>
1986+
<string>Configuration</string>
1987+
</dict>
1988+
<dict>
1989+
<key>INIntentParameterPromptDialogCustom</key>
1990+
<true/>
1991+
<key>INIntentParameterPromptDialogType</key>
1992+
<string>Primary</string>
1993+
</dict>
1994+
</array>
1995+
<key>INIntentParameterTag</key>
1996+
<integer>1</integer>
1997+
<key>INIntentParameterType</key>
1998+
<string>String</string>
1999+
</dict>
2000+
</array>
2001+
<key>INIntentResponse</key>
2002+
<dict>
2003+
<key>INIntentResponseCodes</key>
2004+
<array>
2005+
<dict>
2006+
<key>INIntentResponseCodeConciseFormatString</key>
2007+
<string>${result}</string>
2008+
<key>INIntentResponseCodeConciseFormatStringID</key>
2009+
<string>zIiPij</string>
2010+
<key>INIntentResponseCodeFormatString</key>
2011+
<string>${result}</string>
2012+
<key>INIntentResponseCodeFormatStringID</key>
2013+
<string>NUF0Pa</string>
2014+
<key>INIntentResponseCodeName</key>
2015+
<string>success</string>
2016+
<key>INIntentResponseCodeSuccess</key>
2017+
<true/>
2018+
</dict>
2019+
<dict>
2020+
<key>INIntentResponseCodeConciseFormatString</key>
2021+
<string>Failed: ${error}</string>
2022+
<key>INIntentResponseCodeConciseFormatStringID</key>
2023+
<string>2LIxe4</string>
2024+
<key>INIntentResponseCodeFormatString</key>
2025+
<string>Failed: ${error}</string>
2026+
<key>INIntentResponseCodeFormatStringID</key>
2027+
<string>GiSjQE</string>
2028+
<key>INIntentResponseCodeName</key>
2029+
<string>failure</string>
2030+
</dict>
2031+
</array>
2032+
<key>INIntentResponseLastParameterTag</key>
2033+
<integer>2</integer>
2034+
<key>INIntentResponseOutput</key>
2035+
<string>result</string>
2036+
<key>INIntentResponseParameters</key>
2037+
<array>
2038+
<dict>
2039+
<key>INIntentResponseParameterDisplayName</key>
2040+
<string>Result</string>
2041+
<key>INIntentResponseParameterDisplayNameID</key>
2042+
<string>xN51te</string>
2043+
<key>INIntentResponseParameterDisplayPriority</key>
2044+
<integer>1</integer>
2045+
<key>INIntentResponseParameterName</key>
2046+
<string>result</string>
2047+
<key>INIntentResponseParameterTag</key>
2048+
<integer>1</integer>
2049+
<key>INIntentResponseParameterType</key>
2050+
<string>String</string>
2051+
</dict>
2052+
<dict>
2053+
<key>INIntentResponseParameterDisplayName</key>
2054+
<string>Error</string>
2055+
<key>INIntentResponseParameterDisplayNameID</key>
2056+
<string>K4xrvF</string>
2057+
<key>INIntentResponseParameterDisplayPriority</key>
2058+
<integer>2</integer>
2059+
<key>INIntentResponseParameterName</key>
2060+
<string>error</string>
2061+
<key>INIntentResponseParameterTag</key>
2062+
<integer>2</integer>
2063+
<key>INIntentResponseParameterType</key>
2064+
<string>String</string>
2065+
</dict>
2066+
</array>
2067+
</dict>
2068+
<key>INIntentTitle</key>
2069+
<string>Assist</string>
2070+
<key>INIntentTitleID</key>
2071+
<string>B28HAk</string>
2072+
<key>INIntentType</key>
2073+
<string>Custom</string>
2074+
<key>INIntentVerb</key>
2075+
<string>Request</string>
2076+
</dict>
18022077
</array>
18032078
<key>INTypes</key>
18042079
<array>

Sources/App/Resources/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@
566566
<string>UpdateSensorsIntent</string>
567567
<string>WidgetActionsIntent</string>
568568
<string>WidgetOpenPageIntent</string>
569+
<string>AssistIntent</string>
569570
</array>
570571
<key>ITSAppUsesNonExemptEncryption</key>
571572
<false/>
@@ -644,6 +645,7 @@
644645
<string>UpdateSensorsIntent</string>
645646
<string>WidgetActionsIntent</string>
646647
<string>WidgetOpenPageIntent</string>
648+
<string>AssistIntent</string>
647649
</array>
648650
<key>UIApplicationShortcutItems</key>
649651
<array>

0 commit comments

Comments
 (0)