From 63bcb0bfd5d4ca0783841c581cae2b96230445cb Mon Sep 17 00:00:00 2001 From: ITSpecialist111 <142685548+ITSpecialist111@users.noreply.github.com> Date: Sat, 19 Oct 2024 10:50:45 +0100 Subject: [PATCH] Updated v1.0 --- .github/workflows/validate.yaml | 14 ++++++++++---- .../custom_components/ai_suggester/__init__.py | 4 +++- .../custom_components/ai_suggester/manifest.json | 9 +++++---- .../custom_components/ai_suggester/services.yaml | 1 + .../custom_components/ai_suggester/strings.json | 7 ++++++- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 64ec5b3..c75819e 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -1,7 +1,7 @@ name: Validate on: - push: + push: pull_request: schedule: - cron: "0 0 * * *" @@ -9,9 +9,15 @@ on: jobs: validate-hacs: - runs-on: "ubuntu-latest" + runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" - name: HACS validation - uses: "hacs/action@main" + uses: hacs/action@main with: - category: "integration" \ No newline at end of file + category: "integration" diff --git a/ai_suggester/custom_components/ai_suggester/__init__.py b/ai_suggester/custom_components/ai_suggester/__init__.py index 19b9b0b..6dd105c 100644 --- a/ai_suggester/custom_components/ai_suggester/__init__.py +++ b/ai_suggester/custom_components/ai_suggester/__init__.py @@ -1,7 +1,8 @@ """The AI Automation Suggester integration.""" import logging - +import voluptuous as vol +import homeassistant.helpers.config_validation as cv from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant @@ -10,6 +11,7 @@ _LOGGER = logging.getLogger(__name__) +CONFIG_SCHEMA = cv.config_entry_only_config_schema async def async_setup(hass: HomeAssistant, config: dict): """Set up the AI Automation Suggester component.""" diff --git a/ai_suggester/custom_components/ai_suggester/manifest.json b/ai_suggester/custom_components/ai_suggester/manifest.json index ec0bdd7..b0a316b 100644 --- a/ai_suggester/custom_components/ai_suggester/manifest.json +++ b/ai_suggester/custom_components/ai_suggester/manifest.json @@ -2,10 +2,11 @@ "domain": "ai_suggester", "name": "AI Automation Suggester", "version": "1.0.0", - "documentation": "https://github.com/ITSpecialist111/ai_automation_suggester", - "requirements": ["openai>=1.0.0,<2.0.0"], + "config_flow": true, + "codeowners": ["@ITSpecialist111"], "dependencies": [], - "codeowners": ["@yITSpecialist111"], + "documentation": "https://github.com/ITSpecialist111/ai_automation_suggester", "iot_class": "cloud_polling", - "config_flow": true + "requirements": ["openai>=1.0.0,<2.0.0"] } + diff --git a/ai_suggester/custom_components/ai_suggester/services.yaml b/ai_suggester/custom_components/ai_suggester/services.yaml index 9d78c41..9cdc50e 100644 --- a/ai_suggester/custom_components/ai_suggester/services.yaml +++ b/ai_suggester/custom_components/ai_suggester/services.yaml @@ -1,3 +1,4 @@ generate_suggestions: + name: Generate Suggestions description: "Manually trigger AI automation suggestions." fields: {} diff --git a/ai_suggester/custom_components/ai_suggester/strings.json b/ai_suggester/custom_components/ai_suggester/strings.json index f00195f..274328d 100644 --- a/ai_suggester/custom_components/ai_suggester/strings.json +++ b/ai_suggester/custom_components/ai_suggester/strings.json @@ -6,7 +6,6 @@ "title": "Configure AI Automation Suggester", "data": { "scan_frequency": "Scan Frequency (hours)", - "use_local_ai": "Use Local AI (Work In Progress)", "openai_api_key": "OpenAI API Key" } } @@ -14,5 +13,11 @@ "error": { "required": "This field is required." } + }, + "services": { + "generate_suggestions": { + "name": "Generate Suggestions", + "description": "Manually trigger AI automation suggestions." + } } }