diff --git a/neon_homeassistant_skill/__init__.py b/neon_homeassistant_skill/__init__.py index 7c7a569..c8252b0 100644 --- a/neon_homeassistant_skill/__init__.py +++ b/neon_homeassistant_skill/__init__.py @@ -125,6 +125,17 @@ def disable_ha_intents(self): self._intents_enabled = False # Handlers + + @intent_handler("get.all.devices.intent") # pragma: no cover + def handle_rebuild_device_list(self, message: Message): + self.bus.emit( + message.forward( + "ovos.phal.plugin.homeassistant.rebuild.device.list", + None, + ) + ) + self.speak_dialog("acknowledge") + @intent_handler("enable.intent") # pragma: no cover def handle_enable_intent(self, message: Message): self.settings["disable_intents"] = False diff --git a/neon_homeassistant_skill/locale/en-us/skill.json b/neon_homeassistant_skill/locale/en-us/skill.json index 05dde3c..f1108b8 100644 --- a/neon_homeassistant_skill/locale/en-us/skill.json +++ b/neon_homeassistant_skill/locale/en-us/skill.json @@ -32,5 +32,5 @@ "skill", "plugin" ], - "version": "0.0.23" + "version": "0.0.24" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 4888366..d6a83ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "neon-homeassistant-skill" -version = "0.0.23" +version = "0.0.24" description = "An OVOS/Neon.AI Skill for Home Assistant, which integrates with ovos-PHAL-plugin-homeassistant." authors = ["Mike Gray "] readme = "README.md" diff --git a/skill.json b/skill.json index 05dde3c..f1108b8 100644 --- a/skill.json +++ b/skill.json @@ -32,5 +32,5 @@ "skill", "plugin" ], - "version": "0.0.23" + "version": "0.0.24" } \ No newline at end of file diff --git a/test/test_intents.yaml b/test/test_intents.yaml index ea55a43..f2eba5f 100644 --- a/test/test_intents.yaml +++ b/test/test_intents.yaml @@ -1484,6 +1484,8 @@ en-us: disable.intent: - Disable Home Assistant - I don't use Home Assistant + get.all.devices.intent: + - rebuild device list unmatched intents: en-us: - set a reminder to change my oil at 4 PM diff --git a/test/test_resources.yaml b/test/test_resources.yaml index bb6b7ef..18debb5 100644 --- a/test/test_resources.yaml +++ b/test/test_resources.yaml @@ -47,5 +47,6 @@ intents: - assist.intent - disable.intent - enable.intent + - get.all.devices.intent # Adapt intents are the name passed to the constructor adapt: [] diff --git a/test/test_skill.py b/test/test_skill.py index 76a8b03..835f0f0 100644 --- a/test/test_skill.py +++ b/test/test_skill.py @@ -115,3 +115,8 @@ def test_set_light_color_response_silent_entities(self): self.skill.speak_dialog.assert_has_calls( [call("lights.current.color", data={"device": "bunny", "color": "mauve"})] ) + + def test_get_all_devices(self): + self.skill.speak_dialog = Mock() + self.skill.handle_rebuild_device_list(Message(msg_type="test")) + self.skill.speak_dialog.assert_called_once_with("acknowledge")