From 45c87be656f1f3494aacc7787716c027e13002c7 Mon Sep 17 00:00:00 2001 From: Lennard Beers Date: Wed, 10 May 2023 16:45:29 +0200 Subject: [PATCH] fix: code quality --- .github/workflows/quality.yml | 4 ++-- custom_components/template_media_player/const.py | 1 - custom_components/template_media_player/media_player.py | 9 +++------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index c06ecfc..bf12f7f 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -42,7 +42,7 @@ jobs: - name: Run isort run: | - python -m isort --check-only --diff custom_components/template_media_player + python -m isort --check-only --diff --profile black custom_components/template_media_player mypy: runs-on: ubuntu-latest @@ -61,7 +61,7 @@ jobs: - name: Run mypy run: | - python -m mypy custom_components/template_media_player + python -m mypy custom_components/template_media_player --ignore-missing-imports bandit: runs-on: ubuntu-latest diff --git a/custom_components/template_media_player/const.py b/custom_components/template_media_player/const.py index 5f37949..74248d2 100644 --- a/custom_components/template_media_player/const.py +++ b/custom_components/template_media_player/const.py @@ -32,7 +32,6 @@ # Attributes Templates -CONF_ACCESS_TOKEN_TEMPLATE = "access_token" CONF_ANNOUNCE_TEMPLATE = "announce" CONF_APP_ID_TEMPLATE = "app_id" CONF_APP_NAME_TEMPLATE = "app_name" diff --git a/custom_components/template_media_player/media_player.py b/custom_components/template_media_player/media_player.py index 1ae9fc1..b5dcaa7 100644 --- a/custom_components/template_media_player/media_player.py +++ b/custom_components/template_media_player/media_player.py @@ -3,10 +3,10 @@ import logging from typing import Any, Optional +import homeassistant.helpers.config_validation as cv import voluptuous as vol - +from homeassistant.components.media_player import DOMAIN as DOMAIN_MEDIA_PLAYER from homeassistant.components.media_player import ( - DOMAIN as DOMAIN_MEDIA_PLAYER, ENTITY_ID_FORMAT, PLATFORM_SCHEMA, MediaPlayerDeviceClass, @@ -22,7 +22,6 @@ from homeassistant.const import ATTR_FRIENDLY_NAME, CONF_ENTITY_PICTURE_TEMPLATE from homeassistant.core import HomeAssistant, callback from homeassistant.exceptions import TemplateError -import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import async_generate_entity_id from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -125,9 +124,7 @@ async def _async_create_entities(hass: HomeAssistant, config: ConfigType): browse_media_entity_id: str | None = media_player_config.get( CONF_BROWSE_MEDIA_ENTITY_ID ) - global_template: Template | None = media_player_config.get( - CONF_GLOBAL_TEMPLATE - ) + global_template: Template | None = media_player_config.get(CONF_GLOBAL_TEMPLATE) availability_template: Template | None = media_player_config.get( CONF_AVAILABILITY_TEMPLATE )