-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a973a2f
commit c08d84e
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
src/test/kotlin/it/casaricci/hass/plugin/completion/EntityCompletionTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package it.casaricci.hass.plugin.completion | ||
|
||
import com.intellij.codeInsight.completion.CompletionType | ||
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixture4TestCase | ||
import org.junit.Test | ||
|
||
class EntityCompletionTest : LightPlatformCodeInsightFixture4TestCase() { | ||
|
||
override fun getTestDataPath(): String = "src/test/resources/completion/entity" | ||
|
||
@Test | ||
fun testLocalCompletion() { | ||
myFixture.configureByFiles("configuration.yaml", "scripts.yaml") | ||
myFixture.complete(CompletionType.BASIC) | ||
val lookupElementStrings = myFixture.lookupElementStrings | ||
assertNotNull(lookupElementStrings) | ||
assertSameElements( | ||
lookupElementStrings!!, | ||
"script.script_test1", | ||
"script.do_some_action", | ||
"script.do_some_other_action" | ||
) | ||
} | ||
|
||
@Test | ||
fun testRemoteCompletion() { | ||
// TODO we need somehow to inject states.json into systemDir | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
script: | ||
script_test1: | ||
sequence: | ||
- action: <caret> | ||
|
||
# TODO add some other supported local entities (e.g. input_text, automation, ...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
script: | ||
do_some_action: | ||
sequence: | ||
- action: notify.test | ||
|
||
do_some_other_action: | ||
sequence: | ||
- action: notify.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[ | ||
{ | ||
"entity_id": "scene.house_entrance", | ||
"state": "2025-01-15T18:09:37.483591+00:00", | ||
"attributes": { | ||
"entity_id": [ | ||
"light.living_ceiling", | ||
"light.living_stand", | ||
"light.living_main", | ||
"input_boolean.house_entrance_lights" | ||
], | ||
"friendly_name": "house_entrance" | ||
}, | ||
"last_changed": "2025-01-15T18:09:37.483638+00:00", | ||
"last_reported": "2025-01-15T18:09:37.483638+00:00", | ||
"last_updated": "2025-01-15T18:09:37.483638+00:00", | ||
"context": { | ||
"id": "01JHNJG65V7YKPVPFNPGY61FJA", | ||
"parent_id": "01JHNJG65VWQHRE2DZBPANA6SP", | ||
"user_id": null | ||
} | ||
} | ||
] |