diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 21a469b..645e69c 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -6,7 +6,7 @@ # PRs introducing known-vulnerable packages will be blocked from merging. # # Source repository: https://github.com/actions/dependency-review-action -name: 'Dependency Review' +name: "Dependency Review" on: [pull_request] permissions: @@ -21,7 +21,7 @@ jobs: with: egress-policy: audit - - name: 'Checkout Repository' + - name: "Checkout Repository" uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: 'Dependency Review' + - name: "Dependency Review" uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0 diff --git a/.github/workflows/ghaction-github-labeler.yaml b/.github/workflows/ghaction-github-labeler.yaml index ab43b7d..9e6832e 100644 --- a/.github/workflows/ghaction-github-labeler.yaml +++ b/.github/workflows/ghaction-github-labeler.yaml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - issues: write # for crazy-max/ghaction-github-labeler to create, rename, update and delete label + issues: write # for crazy-max/ghaction-github-labeler to create, rename, update and delete label steps: - name: Harden Runner uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 diff --git a/.github/workflows/issue-auto.yaml b/.github/workflows/issue-auto.yaml index 881d41c..10a235d 100644 --- a/.github/workflows/issue-auto.yaml +++ b/.github/workflows/issue-auto.yaml @@ -11,7 +11,7 @@ jobs: titlePrefixCheck: runs-on: ubuntu-latest permissions: - issues: write # for peter-evans/close-issue to close issues + issues: write # for peter-evans/close-issue to close issues steps: - name: Harden Runner uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index 30e53a1..5336f14 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -12,8 +12,8 @@ jobs: stale: runs-on: ubuntu-latest permissions: - issues: write # for actions/stale to close stale issues - pull-requests: write # for actions/stale to close stale PRs + issues: write # for actions/stale to close stale issues + pull-requests: write # for actions/stale to close stale PRs steps: - name: Harden Runner uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 diff --git a/custom_components/xplora_watch/config_flow.py b/custom_components/xplora_watch/config_flow.py index b38a380..766f6a4 100644 --- a/custom_components/xplora_watch/config_flow.py +++ b/custom_components/xplora_watch/config_flow.py @@ -7,11 +7,6 @@ from types import MappingProxyType from typing import Any -from pyxplora_api.exception_classes import Error, LoginError, PhoneOrEmailFail -from pyxplora_api.pyxplora_api_async import PyXploraApi -from pyxplora_api.status import UserContactType -import voluptuous as vol - from homeassistant import config_entries, core from homeassistant.config_entries import ConfigEntry, OptionsFlow, OptionsFlowWithConfigEntry from homeassistant.const import ( @@ -42,6 +37,10 @@ TextSelectorConfig, TextSelectorType, ) +from pyxplora_api.exception_classes import Error, LoginError, PhoneOrEmailFail +from pyxplora_api.pyxplora_api_async import PyXploraApi +from pyxplora_api.status import UserContactType +import voluptuous as vol from .const import ( CONF_HOME_LATITUDE, diff --git a/custom_components/xplora_watch/const_schema.py b/custom_components/xplora_watch/const_schema.py index c93fd56..730e99b 100644 --- a/custom_components/xplora_watch/const_schema.py +++ b/custom_components/xplora_watch/const_schema.py @@ -2,8 +2,6 @@ from __future__ import annotations -import voluptuous as vol - from homeassistant.const import CONF_COUNTRY_CODE, CONF_EMAIL, CONF_LANGUAGE, CONF_PASSWORD from homeassistant.helpers.selector import ( SelectOptionDict, @@ -14,6 +12,7 @@ TextSelectorConfig, TextSelectorType, ) +import voluptuous as vol from .const import CONF_PHONENUMBER, CONF_TIMEZONE, CONF_USERLANG, DEFAULT_LANGUAGE, SUPPORTED_LANGUAGES, XPLORA_USER_LANGS diff --git a/custom_components/xplora_watch/coordinator.py b/custom_components/xplora_watch/coordinator.py index b9a43be..640880b 100644 --- a/custom_components/xplora_watch/coordinator.py +++ b/custom_components/xplora_watch/coordinator.py @@ -7,17 +7,16 @@ from typing import Any import aiohttp -from pyxplora_api.const import DEFAULT_TIMEOUT -from pyxplora_api.model import ChatsNew -from pyxplora_api.pyxplora_api_async import PyXploraApi -from pyxplora_api.status import LocationType, WatchOnlineStatus - from homeassistant.components.device_tracker.const import ATTR_BATTERY, ATTR_LOCATION_NAME from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_COUNTRY_CODE, CONF_EMAIL, CONF_LANGUAGE, CONF_PASSWORD, CONF_SCAN_INTERVAL from homeassistant.core import HomeAssistant from homeassistant.helpers import aiohttp_client from homeassistant.helpers.update_coordinator import DataUpdateCoordinator +from pyxplora_api.const import DEFAULT_TIMEOUT +from pyxplora_api.model import ChatsNew +from pyxplora_api.pyxplora_api_async import PyXploraApi +from pyxplora_api.status import LocationType, WatchOnlineStatus from .const import ( API_KEY_MAPBOX, diff --git a/custom_components/xplora_watch/helper.py b/custom_components/xplora_watch/helper.py index 5126e8b..6f94054 100644 --- a/custom_components/xplora_watch/helper.py +++ b/custom_components/xplora_watch/helper.py @@ -11,8 +11,6 @@ import aiofiles from geopy import distance -from pydub import AudioSegment - from homeassistant.config_entries import ConfigEntry from homeassistant.const import ATTR_LATITUDE, ATTR_LONGITUDE, CONF_LANGUAGE from homeassistant.core import HomeAssistant @@ -20,6 +18,7 @@ from homeassistant.loader import DATA_CUSTOM_COMPONENTS from homeassistant.util.yaml.dumper import dump from homeassistant.util.yaml.loader import JSON_TYPE, Secrets, parse_yaml +from pydub import AudioSegment from .const import ( ATTR_SERVICE_DELETE_MSG, diff --git a/custom_components/xplora_watch/services.py b/custom_components/xplora_watch/services.py index 0421506..500cf94 100644 --- a/custom_components/xplora_watch/services.py +++ b/custom_components/xplora_watch/services.py @@ -5,11 +5,10 @@ import logging from typing import Any -from pyxplora_api.exception_classes import NoAdminError -import voluptuous as vol - from homeassistant.core import HomeAssistant, ServiceCall, callback import homeassistant.helpers.config_validation as cv +from pyxplora_api.exception_classes import NoAdminError +import voluptuous as vol from .const import ( ATTR_SERVICE_DELETE_MSG, diff --git a/custom_components/xplora_watch/switch.py b/custom_components/xplora_watch/switch.py index 13711cd..6a2a9e8 100644 --- a/custom_components/xplora_watch/switch.py +++ b/custom_components/xplora_watch/switch.py @@ -5,13 +5,12 @@ import logging from typing import Any -from pyxplora_api.pyxplora_api_async import PyXploraApi - from homeassistant.components.switch import SwitchDeviceClass, SwitchEntity, SwitchEntityDescription from homeassistant.config_entries import ConfigEntry from homeassistant.const import ATTR_ID, CONF_LANGUAGE, CONF_NAME from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.entity_platform import AddEntitiesCallback +from pyxplora_api.pyxplora_api_async import PyXploraApi from .const import ( ATTR_SERVICE_USER,