diff --git a/.github/workflows/hassfest.yml b/.github/workflows/hassfest.yml new file mode 100644 index 0000000..82aefa7 --- /dev/null +++ b/.github/workflows/hassfest.yml @@ -0,0 +1,15 @@ +name: Validate with hassfest + +on: + push: + pull_request: + schedule: + - cron: "0 0 * * *" + +jobs: + validate: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v3" + - uses: home-assistant/actions/hassfest@master + diff --git a/custom_components/polestar_api/__init__.py b/custom_components/polestar_api/__init__.py index 65f713a..bc7a8af 100644 --- a/custom_components/polestar_api/__init__.py +++ b/custom_components/polestar_api/__init__.py @@ -19,7 +19,7 @@ ) from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady - +from homeassistant.helpers import config_validation as cv from .const import ( DOMAIN, @@ -30,6 +30,8 @@ Platform.SENSOR, ] +CONFIG_SCHEMA = cv.removed(DOMAIN, raise_if_present=False) + _LOGGER = logging.getLogger(__name__) diff --git a/custom_components/polestar_api/manifest.json b/custom_components/polestar_api/manifest.json index 6100b11..66d8c97 100644 --- a/custom_components/polestar_api/manifest.json +++ b/custom_components/polestar_api/manifest.json @@ -1,9 +1,10 @@ { "domain": "polestar_api", - "name": "polestar_api", - "version": "0.0.1", + "name": "Polestar API", + "codeowners": ["@leeyuentuen"], "config_flow": true, - "documentation": "https://github.com/leeyuentuen/polestar_api", "dependencies": [], - "codeowners": ["leeyuentuen"] + "documentation": "https://github.com/leeyuentuen/polestar_api", + "iot_class": "cloud_polling", + "version": "1.0.5" } diff --git a/custom_components/polestar_api/translations/de.json b/custom_components/polestar_api/translations/de.json index d990d4c..37b4aaf 100644 --- a/custom_components/polestar_api/translations/de.json +++ b/custom_components/polestar_api/translations/de.json @@ -19,4 +19,4 @@ "no_token": "Kein Token in der Antwort gefunden. Bitte überprüfe Deine Anmeldeinformationen." } } -} \ No newline at end of file +} diff --git a/custom_components/polestar_api/translations/en.json b/custom_components/polestar_api/translations/en.json index 1a2104f..8ec0462 100644 --- a/custom_components/polestar_api/translations/en.json +++ b/custom_components/polestar_api/translations/en.json @@ -1,22 +1,29 @@ { - "config": { - "step": { - "user": { - "title": "Configure Polestar EV", - "description": "Enter Authentication of Polestar EV", - "data": { - "name": "Friendly name", - "username": "Username", - "password": "Password", - "vin": "VIN" + "config": { + "step": { + "user": { + "title": "Configure Polestar EV", + "description": "Enter Authentication of Polestar EV", + "data": { + "name": "Friendly name", + "username": "Username", + "password": "Password", + "vin": "VIN" + } + } + }, + "abort": { + "api_timeout": "Timeout connecting to the api.", + "api_failed": "Unexpected error creating api.", + "already_configured": "Polestar API is already configured", + "no_token": "No token found in response. Please check your credentials." } - } }, - "abort": { - "api_timeout": "Timeout connecting to the api.", - "api_failed": "Unexpected error creating api.", - "already_configured": "Polestar API is already configured", - "no_token": "No token found in response. Please check your credentials." + "entity": { + "sensor": { + "polestar_api_estimate_distance_to_empty_km": { + "name": "Distance km Remaining" + } + } } - } -} +} \ No newline at end of file