mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-06-21 15:20:00 +08:00
style: pylint check add ignore item
This commit is contained in:
@ -68,6 +68,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
async def async_setup(hass: HomeAssistant, hass_config: dict) -> bool:
|
async def async_setup(hass: HomeAssistant, hass_config: dict) -> bool:
|
||||||
|
# pylint: disable=unused-argument
|
||||||
hass.data.setdefault(DOMAIN, {})
|
hass.data.setdefault(DOMAIN, {})
|
||||||
# {[entry_id:str]: MIoTClient}, miot client instance
|
# {[entry_id:str]: MIoTClient}, miot client instance
|
||||||
hass.data[DOMAIN].setdefault('miot_clients', {})
|
hass.data[DOMAIN].setdefault('miot_clients', {})
|
||||||
|
@ -56,7 +56,6 @@ from homeassistant.components.light import (
|
|||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
ATTR_COLOR_TEMP_KELVIN,
|
ATTR_COLOR_TEMP_KELVIN,
|
||||||
ATTR_RGB_COLOR,
|
ATTR_RGB_COLOR,
|
||||||
ATTR_HS_COLOR,
|
|
||||||
ATTR_EFFECT,
|
ATTR_EFFECT,
|
||||||
LightEntity,
|
LightEntity,
|
||||||
LightEntityFeature,
|
LightEntityFeature,
|
||||||
@ -64,8 +63,7 @@ from homeassistant.components.light import (
|
|||||||
)
|
)
|
||||||
from homeassistant.util.color import (
|
from homeassistant.util.color import (
|
||||||
value_to_brightness,
|
value_to_brightness,
|
||||||
brightness_to_value,
|
brightness_to_value
|
||||||
color_hs_to_RGB
|
|
||||||
)
|
)
|
||||||
|
|
||||||
from .miot.miot_spec import MIoTSpecProperty
|
from .miot.miot_spec import MIoTSpecProperty
|
||||||
@ -96,6 +94,7 @@ async def async_setup_entry(
|
|||||||
|
|
||||||
class Light(MIoTServiceEntity, LightEntity):
|
class Light(MIoTServiceEntity, LightEntity):
|
||||||
"""Light entities for Xiaomi Home."""
|
"""Light entities for Xiaomi Home."""
|
||||||
|
# pylint: disable=unused-argument
|
||||||
_prop_on: Optional[MIoTSpecProperty]
|
_prop_on: Optional[MIoTSpecProperty]
|
||||||
_prop_brightness: Optional[MIoTSpecProperty]
|
_prop_brightness: Optional[MIoTSpecProperty]
|
||||||
_prop_color_temp: Optional[MIoTSpecProperty]
|
_prop_color_temp: Optional[MIoTSpecProperty]
|
||||||
|
@ -13,6 +13,7 @@ from enum import Enum, auto
|
|||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.components import zeroconf
|
from homeassistant.components import zeroconf
|
||||||
|
|
||||||
|
# pylint: disable=relative-beyond-top-level
|
||||||
from .common import MIoTMatcher
|
from .common import MIoTMatcher
|
||||||
from .const import (
|
from .const import (
|
||||||
DEFAULT_CTRL_MODE, DEFAULT_INTEGRATION_LANGUAGE, DEFAULT_NICK_NAME, DOMAIN,
|
DEFAULT_CTRL_MODE, DEFAULT_INTEGRATION_LANGUAGE, DEFAULT_NICK_NAME, DOMAIN,
|
||||||
|
@ -56,6 +56,7 @@ from typing import Optional
|
|||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
# pylint: disable=relative-beyond-top-level
|
||||||
from .common import calc_group_id
|
from .common import calc_group_id
|
||||||
from .const import (
|
from .const import (
|
||||||
DEFAULT_OAUTH2_API_HOST,
|
DEFAULT_OAUTH2_API_HOST,
|
||||||
|
@ -78,6 +78,7 @@ from homeassistant.helpers.entity import DeviceInfo
|
|||||||
from homeassistant.components.switch import SwitchDeviceClass
|
from homeassistant.components.switch import SwitchDeviceClass
|
||||||
from homeassistant.util import slugify
|
from homeassistant.util import slugify
|
||||||
|
|
||||||
|
# pylint: disable=relative-beyond-top-level
|
||||||
from .specs.specv2entity import (
|
from .specs.specv2entity import (
|
||||||
SPEC_ACTION_TRANS_MAP,
|
SPEC_ACTION_TRANS_MAP,
|
||||||
SPEC_DEVICE_TRANS_MAP,
|
SPEC_DEVICE_TRANS_MAP,
|
||||||
|
@ -53,6 +53,7 @@ from typing import Callable, TypeVar
|
|||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
# pylint: disable=relative-beyond-top-level
|
||||||
from .miot_error import MIoTEvError
|
from .miot_error import MIoTEvError
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
@ -50,6 +50,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
|
# pylint: disable=relative-beyond-top-level
|
||||||
from .common import load_json_file
|
from .common import load_json_file
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
@ -66,6 +66,7 @@ from cryptography.hazmat.primitives import padding
|
|||||||
from cryptography.hazmat.backends import default_backend
|
from cryptography.hazmat.backends import default_backend
|
||||||
from cryptography.hazmat.primitives import hashes
|
from cryptography.hazmat.primitives import hashes
|
||||||
|
|
||||||
|
# pylint: disable=relative-beyond-top-level
|
||||||
from .miot_error import MIoTErrorCode
|
from .miot_error import MIoTErrorCode
|
||||||
from .miot_ev import MIoTEventLoop, TimeoutHandle
|
from .miot_ev import MIoTEventLoop, TimeoutHandle
|
||||||
from .miot_network import InterfaceStatus, MIoTNetwork, NetworkInfo
|
from .miot_network import InterfaceStatus, MIoTNetwork, NetworkInfo
|
||||||
|
@ -63,6 +63,7 @@ from zeroconf.asyncio import (
|
|||||||
AsyncZeroconf,
|
AsyncZeroconf,
|
||||||
AsyncServiceBrowser)
|
AsyncServiceBrowser)
|
||||||
|
|
||||||
|
# pylint: disable=relative-beyond-top-level
|
||||||
from .miot_error import MipsServiceError
|
from .miot_error import MipsServiceError
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
@ -66,6 +66,7 @@ from paho.mqtt.client import (
|
|||||||
Client,
|
Client,
|
||||||
MQTTv5)
|
MQTTv5)
|
||||||
|
|
||||||
|
# pylint: disable=relative-beyond-top-level
|
||||||
from .common import MIoTMatcher
|
from .common import MIoTMatcher
|
||||||
from .const import MIHOME_MQTT_KEEPALIVE
|
from .const import MIHOME_MQTT_KEEPALIVE
|
||||||
from .miot_error import MIoTErrorCode, MIoTMipsError
|
from .miot_error import MIoTErrorCode, MIoTMipsError
|
||||||
|
@ -54,6 +54,7 @@ from urllib.parse import urlencode
|
|||||||
from urllib.request import Request, urlopen
|
from urllib.request import Request, urlopen
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
# pylint: disable=relative-beyond-top-level
|
||||||
from .const import DEFAULT_INTEGRATION_LANGUAGE, SPEC_STD_LIB_EFFECTIVE_TIME
|
from .const import DEFAULT_INTEGRATION_LANGUAGE, SPEC_STD_LIB_EFFECTIVE_TIME
|
||||||
from .miot_error import MIoTSpecError
|
from .miot_error import MIoTSpecError
|
||||||
from .miot_storage import (
|
from .miot_storage import (
|
||||||
|
@ -66,6 +66,7 @@ from cryptography import x509
|
|||||||
from cryptography.hazmat.primitives import hashes
|
from cryptography.hazmat.primitives import hashes
|
||||||
from cryptography.hazmat.primitives.asymmetric import ed25519
|
from cryptography.hazmat.primitives.asymmetric import ed25519
|
||||||
|
|
||||||
|
# pylint: disable=relative-beyond-top-level
|
||||||
from .common import load_json_file
|
from .common import load_json_file
|
||||||
from .const import (
|
from .const import (
|
||||||
DEFAULT_INTEGRATION_LANGUAGE,
|
DEFAULT_INTEGRATION_LANGUAGE,
|
||||||
|
@ -46,6 +46,7 @@ off Xiaomi or its affiliates' products.
|
|||||||
MIoT redirect web pages.
|
MIoT redirect web pages.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# pylint: disable=line-too-long
|
||||||
|
|
||||||
def oauth_redirect_page(lang: str, status: str) -> str:
|
def oauth_redirect_page(lang: str, status: str) -> str:
|
||||||
"""Return oauth redirect page."""
|
"""Return oauth redirect page."""
|
||||||
|
Reference in New Issue
Block a user