From 8b222549a1c4848ed79cc96a4bcb0c9abc11aea3 Mon Sep 17 00:00:00 2001 From: Black Roland Date: Thu, 7 Nov 2024 01:35:47 +0300 Subject: [PATCH] Hassfest validation pipeline --- .github/workflows/hassfest.yaml | 15 +++++++++++++++ .../yandexgpt_conversation/__init__.py | 10 ++++++---- .../yandexgpt_conversation/manifest.json | 8 ++++---- .../yandexgpt_conversation/services.yaml | 1 + 4 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/hassfest.yaml diff --git a/.github/workflows/hassfest.yaml b/.github/workflows/hassfest.yaml new file mode 100644 index 0000000..a764d0f --- /dev/null +++ b/.github/workflows/hassfest.yaml @@ -0,0 +1,15 @@ +name: Validate with hassfest + +on: + push: + branches: + - master + schedule: + - cron: "28 21 7 * *" + +jobs: + validate: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v3" + - uses: home-assistant/actions/hassfest@master diff --git a/custom_components/yandexgpt_conversation/__init__.py b/custom_components/yandexgpt_conversation/__init__.py index d58e6fb..addd054 100644 --- a/custom_components/yandexgpt_conversation/__init__.py +++ b/custom_components/yandexgpt_conversation/__init__.py @@ -10,22 +10,24 @@ import voluptuous as vol from homeassistant.config_entries import ConfigEntry -from homeassistant.const import Platform, CONF_API_KEY +from homeassistant.const import CONF_API_KEY, Platform from homeassistant.core import ( HomeAssistant, - SupportsResponse, ServiceCall, ServiceResponse, + SupportsResponse, ) -from homeassistant.helpers import config_validation as cv, selector +from homeassistant.helpers import config_validation as cv +from homeassistant.helpers import selector from homeassistant.helpers.typing import ConfigType from yandex_cloud_ml_sdk import YCloudML +from .const import CONF_FOLDER_ID, DOMAIN from .yandexart import YandexArt -from .const import DOMAIN, CONF_FOLDER_ID SERVICE_GENERATE_IMAGE = "generate_image" PLATFORMS = (Platform.CONVERSATION,) +CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN) async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: diff --git a/custom_components/yandexgpt_conversation/manifest.json b/custom_components/yandexgpt_conversation/manifest.json index 65a06b5..7d4b32f 100644 --- a/custom_components/yandexgpt_conversation/manifest.json +++ b/custom_components/yandexgpt_conversation/manifest.json @@ -1,15 +1,15 @@ { "domain": "yandexgpt_conversation", "name": "YandexGPT", - "version": "1.0.3", "after_dependencies": ["assist_pipeline", "intent"], "codeowners": ["@black-roland"], "config_flow": true, "dependencies": ["conversation"], "documentation": "https://github.com/black-roland/homeassistant-yandexgpt/wiki", - "issue_tracker": "https://github.com/black-roland/homeassistant-yandexgpt/issues", - "loggers": ["yandexgpt_conversation"], "integration_type": "service", "iot_class": "cloud_polling", - "requirements": ["yandex-cloud-ml-sdk"] + "issue_tracker": "https://github.com/black-roland/homeassistant-yandexgpt/issues", + "loggers": ["yandexgpt_conversation"], + "requirements": ["yandex-cloud-ml-sdk"], + "version": "1.0.3" } diff --git a/custom_components/yandexgpt_conversation/services.yaml b/custom_components/yandexgpt_conversation/services.yaml index 6284e28..9fca2f8 100644 --- a/custom_components/yandexgpt_conversation/services.yaml +++ b/custom_components/yandexgpt_conversation/services.yaml @@ -11,6 +11,7 @@ generate_image: selector: number: min: 0 + max: 2999999999999999 prompt: required: true selector: