mirror of
https://github.com/home-assistant/core.git
synced 2026-08-24 10:13:52 -05:00
Refactor pylint plugins into pylint_home_assistant package (#170521)
This commit is contained in:
@@ -60,7 +60,7 @@ class AemetConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
{
|
||||
vol.Required(CONF_API_KEY): str,
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
vol.Optional(CONF_NAME, default=DEFAULT_NAME): str,
|
||||
vol.Optional(
|
||||
CONF_LATITUDE, default=self.hass.config.latitude
|
||||
|
||||
@@ -35,7 +35,7 @@ class AirTouch5ConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
errors = {"base": "cannot_connect"}
|
||||
else:
|
||||
# Uses the host/IP value from CONF_HOST as unique ID, which is no longer allowed
|
||||
# pylint: disable-next=hass-unique-id-ip-based
|
||||
# pylint: disable-next=home-assistant-unique-id-ip-based
|
||||
await self.async_set_unique_id(user_input[CONF_HOST])
|
||||
self._abort_if_unique_id_configured()
|
||||
return self.async_create_entry(
|
||||
|
||||
@@ -98,7 +98,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
if not with_hassio:
|
||||
reader_writer = CoreBackupReaderWriter(hass)
|
||||
else:
|
||||
# pylint: disable-next=hass-component-root-import
|
||||
# pylint: disable-next=home-assistant-component-root-import
|
||||
from homeassistant.components.hassio.backup import ( # noqa: PLC0415
|
||||
SupervisorBackupReaderWriter,
|
||||
)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Config flow for the Bayesian integration."""
|
||||
# pylint: disable=hass-config-flow-name-field # Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable=home-assistant-config-flow-name-field # Name field is no longer allowed in config flow schemas
|
||||
|
||||
from collections.abc import Mapping
|
||||
from enum import StrEnum
|
||||
|
||||
@@ -90,7 +90,7 @@ class PassiveBluetoothDataUpdateCoordinator(
|
||||
|
||||
class PassiveBluetoothCoordinatorEntity[
|
||||
_PassiveBluetoothDataUpdateCoordinatorT: PassiveBluetoothDataUpdateCoordinator = PassiveBluetoothDataUpdateCoordinator
|
||||
]( # pylint: disable=hass-enforce-class-module
|
||||
]( # pylint: disable=home-assistant-enforce-class-module
|
||||
BaseCoordinatorEntity[_PassiveBluetoothDataUpdateCoordinatorT]
|
||||
):
|
||||
"""A class for entities using DataUpdateCoordinator."""
|
||||
|
||||
@@ -622,7 +622,7 @@ class PassiveBluetoothDataProcessor[_T, _DataT]:
|
||||
self.async_update_listeners(new_data, was_available, changed_entity_keys)
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class PassiveBluetoothProcessorEntity[
|
||||
_PassiveBluetoothDataProcessorT: PassiveBluetoothDataProcessor[Any, Any]
|
||||
](Entity):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""The Broadlink integration."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ async def async_setup_entry(
|
||||
) -> None:
|
||||
"""Set up the Broadlink climate entities."""
|
||||
# Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable-next=hass-use-runtime-data
|
||||
# pylint: disable-next=home-assistant-use-runtime-data
|
||||
device = hass.data[DOMAIN].devices[config_entry.entry_id]
|
||||
|
||||
if device.api.type in DOMAINS_AND_TYPES[Platform.CLIMATE]:
|
||||
|
||||
@@ -314,7 +314,7 @@ class BroadlinkFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
)
|
||||
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
data_schema = {vol.Required(CONF_NAME, default=device.name): str}
|
||||
return self.async_show_form(
|
||||
step_id="finish", data_schema=vol.Schema(data_schema), errors=errors
|
||||
|
||||
@@ -134,7 +134,7 @@ class BroadlinkDevice[_ApiT: blk.Device = blk.Device]:
|
||||
|
||||
self.update_manager = update_manager
|
||||
# Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable-next=hass-use-runtime-data
|
||||
# pylint: disable-next=home-assistant-use-runtime-data
|
||||
self.hass.data[DOMAIN].devices[config.entry_id] = self
|
||||
self.reset_jobs.append(config.add_update_listener(self.async_update))
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ async def async_setup_entry(
|
||||
) -> None:
|
||||
"""Set up Broadlink infrared entity."""
|
||||
# Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable-next=hass-use-runtime-data
|
||||
# pylint: disable-next=home-assistant-use-runtime-data
|
||||
device = hass.data[DOMAIN].devices[config_entry.entry_id]
|
||||
async_add_entities([BroadlinkInfraredEntity(device)])
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ async def async_setup_entry(
|
||||
) -> None:
|
||||
"""Set up the Broadlink light."""
|
||||
# Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable-next=hass-use-runtime-data
|
||||
# pylint: disable-next=home-assistant-use-runtime-data
|
||||
device = hass.data[DOMAIN].devices[config_entry.entry_id]
|
||||
lights = []
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ async def async_setup_entry(
|
||||
) -> None:
|
||||
"""Set up a Broadlink radio frequency transmitter."""
|
||||
# Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable-next=hass-use-runtime-data
|
||||
# pylint: disable-next=home-assistant-use-runtime-data
|
||||
device: BroadlinkDevice = hass.data[DOMAIN].devices[config_entry.entry_id]
|
||||
async_add_entities([BroadlinkRadioFrequency(device)])
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ async def async_setup_entry(
|
||||
) -> None:
|
||||
"""Set up a Broadlink remote."""
|
||||
# Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable-next=hass-use-runtime-data
|
||||
# pylint: disable-next=home-assistant-use-runtime-data
|
||||
device = hass.data[DOMAIN].devices[config_entry.entry_id]
|
||||
remote = BroadlinkRemote(
|
||||
device,
|
||||
|
||||
@@ -30,7 +30,7 @@ async def async_setup_entry(
|
||||
) -> None:
|
||||
"""Set up the Broadlink select."""
|
||||
# Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable-next=hass-use-runtime-data
|
||||
# pylint: disable-next=home-assistant-use-runtime-data
|
||||
device = hass.data[DOMAIN].devices[config_entry.entry_id]
|
||||
async_add_entities([BroadlinkDayOfWeek(device)])
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ async def async_setup_entry(
|
||||
) -> None:
|
||||
"""Set up the Broadlink sensor."""
|
||||
# Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable-next=hass-use-runtime-data
|
||||
# pylint: disable-next=home-assistant-use-runtime-data
|
||||
device = hass.data[DOMAIN].devices[config_entry.entry_id]
|
||||
sensor_data = device.update_manager.coordinator.data
|
||||
sensors = [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Support for Broadlink switches."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
import logging
|
||||
|
||||
@@ -21,7 +21,7 @@ async def async_setup_entry(
|
||||
) -> None:
|
||||
"""Set up the Broadlink time."""
|
||||
# Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable-next=hass-use-runtime-data
|
||||
# pylint: disable-next=home-assistant-use-runtime-data
|
||||
device = hass.data[DOMAIN].devices[config_entry.entry_id]
|
||||
async_add_entities([BroadlinkTime(device)])
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ from hass_nabucasa.google_report_state import ErrorResponse
|
||||
|
||||
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
||||
from homeassistant.components.google_assistant import DOMAIN as GOOGLE_DOMAIN
|
||||
from homeassistant.components.google_assistant.helpers import ( # pylint: disable=hass-component-root-import
|
||||
from homeassistant.components.google_assistant.helpers import ( # pylint: disable=home-assistant-component-root-import
|
||||
AbstractConfig,
|
||||
)
|
||||
from homeassistant.components.homeassistant.exposed_entities import (
|
||||
|
||||
@@ -9,7 +9,7 @@ from hass_nabucasa.voice import MAP_VOICE, Gender
|
||||
from homeassistant.auth.const import GROUP_ID_ADMIN
|
||||
from homeassistant.auth.models import User
|
||||
from homeassistant.components import webhook
|
||||
from homeassistant.components.google_assistant.http import ( # pylint: disable=hass-component-root-import
|
||||
from homeassistant.components.google_assistant.http import ( # pylint: disable=home-assistant-component-root-import
|
||||
async_get_users as async_get_google_assistant_users,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
||||
@@ -4,7 +4,7 @@ from typing import Any
|
||||
import uuid
|
||||
|
||||
from homeassistant.components.automation import DOMAIN as AUTOMATION_DOMAIN
|
||||
from homeassistant.components.automation.config import ( # pylint: disable=hass-component-root-import
|
||||
from homeassistant.components.automation.config import ( # pylint: disable=home-assistant-component-root-import
|
||||
async_validate_config_item,
|
||||
)
|
||||
from homeassistant.config import AUTOMATION_CONFIG_PATH
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
from typing import Any
|
||||
|
||||
from homeassistant.components.script import DOMAIN as SCRIPT_DOMAIN
|
||||
from homeassistant.components.script.config import ( # pylint: disable=hass-component-root-import
|
||||
from homeassistant.components.script.config import ( # pylint: disable=home-assistant-component-root-import
|
||||
async_validate_config_item,
|
||||
)
|
||||
from homeassistant.config import SCRIPT_CONFIG_PATH
|
||||
|
||||
@@ -168,7 +168,7 @@ class OptionsFlowHandler(OptionsFlowWithReload):
|
||||
data_schema = vol.Schema(
|
||||
{
|
||||
# Polling interval is user-configurable, which is no longer allowed
|
||||
# pylint: disable-next=hass-config-flow-polling-field
|
||||
# pylint: disable-next=home-assistant-config-flow-polling-field
|
||||
vol.Optional(
|
||||
CONF_SCAN_INTERVAL,
|
||||
default=self.config_entry.options.get(
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import datetime
|
||||
|
||||
from homeassistant.components.alarm_control_panel import AlarmControlPanelState
|
||||
from homeassistant.components.manual.alarm_control_panel import ( # pylint: disable=hass-component-root-import
|
||||
from homeassistant.components.manual.alarm_control_panel import ( # pylint: disable=home-assistant-component-root-import
|
||||
ManualAlarm,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Data used by this integration."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
import asyncio
|
||||
from collections import defaultdict
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Wrapper for media_source around async_upnp_client's DmsDevice ."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
import asyncio
|
||||
from collections.abc import Callable, Coroutine
|
||||
|
||||
@@ -54,7 +54,7 @@ def _schema_with_defaults(
|
||||
vol.Required(CONF_HOST, default=host): str,
|
||||
**AUTH_VOL_DICT,
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
vol.Optional(CONF_NAME, default=name): str,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -38,7 +38,7 @@ def tariff_transform(value: str) -> str:
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class DSMRReaderSensorEntityDescription(SensorEntityDescription):
|
||||
"""Sensor entity description for DSMR Reader."""
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""The EARN-E P1 Meter integration."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
from earn_e_p1 import DEFAULT_PORT, EarnEP1Listener
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class EmulatedRokuFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
data_schema=vol.Schema(
|
||||
{
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
vol.Required(CONF_NAME, default=default_name): str,
|
||||
vol.Required(CONF_LISTEN_PORT, default=default_port): vol.Coerce(
|
||||
int
|
||||
|
||||
@@ -14,7 +14,7 @@ from homeassistant.components.sensor import (
|
||||
SensorEntity,
|
||||
SensorStateClass,
|
||||
)
|
||||
from homeassistant.components.sensor.recorder import ( # pylint: disable=hass-component-root-import
|
||||
from homeassistant.components.sensor.recorder import ( # pylint: disable=home-assistant-component-root-import
|
||||
reset_detected,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
|
||||
@@ -24,7 +24,7 @@ DATA_SCHEMA = vol.Schema(
|
||||
),
|
||||
vol.Required(CONF_HOST): str,
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
vol.Required(CONF_NAME, default=DOMAIN): str,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -140,7 +140,7 @@ class FFmpegManager:
|
||||
return CONTENT_TYPE_MULTIPART.format("ffserver")
|
||||
|
||||
|
||||
class FFmpegBase[_HAFFmpegT: HAFFmpeg](Entity): # pylint: disable=hass-enforce-class-module
|
||||
class FFmpegBase[_HAFFmpegT: HAFFmpeg](Entity): # pylint: disable=home-assistant-enforce-class-module
|
||||
"""Interface object for FFmpeg."""
|
||||
|
||||
_attr_should_poll = False
|
||||
|
||||
@@ -17,7 +17,7 @@ from homeassistant.components.ffmpeg import (
|
||||
FFmpegManager,
|
||||
get_ffmpeg_manager,
|
||||
)
|
||||
from homeassistant.components.ffmpeg_motion.binary_sensor import ( # pylint: disable=hass-component-root-import
|
||||
from homeassistant.components.ffmpeg_motion.binary_sensor import ( # pylint: disable=home-assistant-component-root-import
|
||||
FFmpegBinarySensor,
|
||||
)
|
||||
from homeassistant.const import CONF_NAME
|
||||
|
||||
@@ -24,7 +24,7 @@ async def async_setup_entry(
|
||||
async_add_entities([IncidentsSensor(entry.runtime_data.client)])
|
||||
|
||||
|
||||
# pylint: disable-next=hass-invalid-inheritance # needs fixing
|
||||
# pylint: disable-next=home-assistant-invalid-inheritance # needs fixing
|
||||
class IncidentsSensor(RestoreEntity, SensorEntity):
|
||||
"""Representation of FireServiceRota incidents sensor."""
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ def get_model_selection_schema(
|
||||
)
|
||||
),
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
vol.Required(
|
||||
CONF_NAME,
|
||||
default=options.get(CONF_NAME) or vol.UNDEFINED,
|
||||
|
||||
@@ -5,7 +5,7 @@ from typing import Any
|
||||
|
||||
from homeassistant.components.camera import CameraEntityFeature
|
||||
from homeassistant.components.ffmpeg import CONF_EXTRA_ARGUMENTS, CONF_INPUT
|
||||
from homeassistant.components.ffmpeg.camera import ( # pylint: disable=hass-component-root-import
|
||||
from homeassistant.components.ffmpeg.camera import ( # pylint: disable=home-assistant-component-root-import
|
||||
DEFAULT_ARGUMENTS,
|
||||
FFmpegCamera,
|
||||
)
|
||||
|
||||
@@ -45,7 +45,7 @@ class FreeboxFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
|
||||
# Check if already configured
|
||||
# Uses the host/IP value from CONF_HOST as unique ID, which is no longer allowed
|
||||
# pylint: disable-next=hass-unique-id-ip-based
|
||||
# pylint: disable-next=home-assistant-unique-id-ip-based
|
||||
await self.async_set_unique_id(self._data[CONF_HOST])
|
||||
self._abort_if_unique_id_configured()
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class GoalZeroFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
CONF_HOST, default=user_input.get(CONF_HOST) or ""
|
||||
): str,
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
vol.Optional(
|
||||
CONF_NAME, default=user_input.get(CONF_NAME) or DEFAULT_NAME
|
||||
): str,
|
||||
|
||||
@@ -70,7 +70,7 @@ def _get_location_schema(hass: HomeAssistant) -> vol.Schema:
|
||||
return vol.Schema(
|
||||
{
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
vol.Required(CONF_NAME, default=hass.config.location_name): str,
|
||||
vol.Required(
|
||||
CONF_LOCATION,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Support for Actions on Google Assistant Smart Home Control."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
import logging
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ async def async_setup_entry(
|
||||
) -> None:
|
||||
"""Set up the platform."""
|
||||
# Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable-next=hass-use-runtime-data
|
||||
# pylint: disable-next=home-assistant-use-runtime-data
|
||||
yaml_config: ConfigType = hass.data[DOMAIN][DATA_CONFIG]
|
||||
google_config = config_entry.runtime_data
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ async def google_generative_ai_config_option_schema(
|
||||
default_name = DEFAULT_CONVERSATION_NAME
|
||||
schema: dict[vol.Required | vol.Optional, Any] = {
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
vol.Required(CONF_NAME, default=default_name): str,
|
||||
}
|
||||
else:
|
||||
|
||||
@@ -53,7 +53,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: GoogleMailConfigEntry) -
|
||||
DOMAIN,
|
||||
{DATA_AUTH: auth, CONF_NAME: entry.title},
|
||||
# Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable-next=hass-use-runtime-data
|
||||
# pylint: disable-next=home-assistant-use-runtime-data
|
||||
hass.data[DOMAIN][DATA_HASS_CONFIG],
|
||||
)
|
||||
)
|
||||
|
||||
@@ -68,7 +68,7 @@ RECONFIGURE_SCHEMA = vol.Schema(
|
||||
CONFIG_SCHEMA = RECONFIGURE_SCHEMA.extend(
|
||||
{
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
vol.Required(CONF_NAME, default=DEFAULT_NAME): cv.string,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -71,7 +71,7 @@ def _get_location_schema(hass: HomeAssistant) -> vol.Schema:
|
||||
return vol.Schema(
|
||||
{
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
vol.Required(CONF_NAME, default=hass.config.location_name): str,
|
||||
vol.Required(
|
||||
CONF_LOCATION,
|
||||
|
||||
@@ -145,6 +145,6 @@ class GoveeBluetoothSensorEntity(
|
||||
)
|
||||
|
||||
@property
|
||||
def native_value(self) -> _SensorValueType: # pylint: disable=hass-return-type
|
||||
def native_value(self) -> _SensorValueType: # pylint: disable=home-assistant-return-type
|
||||
"""Return the native value."""
|
||||
return self.processor.entity_data.get(self.entity_key)
|
||||
|
||||
@@ -39,7 +39,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
DATA_SCHEMA = vol.Schema(
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
{vol.Required(CONF_HOST): str, vol.Required(CONF_NAME): str},
|
||||
extra=vol.ALLOW_EXTRA,
|
||||
)
|
||||
|
||||
@@ -89,7 +89,7 @@ def get_user_step_schema(data: Mapping[str, Any]) -> vol.Schema:
|
||||
return vol.Schema(
|
||||
{
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
vol.Optional(
|
||||
CONF_NAME, default=data.get(CONF_NAME, DEFAULT_NAME)
|
||||
): cv.string,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""The Hisense AEH-W4A1 integration."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
import ipaddress
|
||||
import logging
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Pyaehw4a1 platform to control of Hisense AEH-W4A1 Climate Devices."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
@@ -157,7 +157,7 @@ class HiveFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
|
||||
schema = vol.Schema(
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
{vol.Optional(CONF_DEVICE_NAME, default=self.device_name): str}
|
||||
)
|
||||
return self.async_show_form(
|
||||
@@ -234,7 +234,7 @@ class HiveOptionsFlowHandler(OptionsFlow):
|
||||
schema = vol.Schema(
|
||||
{
|
||||
# Polling interval is user-configurable, which is no longer allowed
|
||||
# pylint: disable-next=hass-config-flow-polling-field
|
||||
# pylint: disable-next=home-assistant-config-flow-polling-field
|
||||
vol.Optional(CONF_SCAN_INTERVAL, default=self.interval): vol.All(
|
||||
vol.Coerce(int), vol.Range(min=30)
|
||||
)
|
||||
|
||||
@@ -307,7 +307,7 @@ class OptionsFlowHandler(OptionsFlow, ABC):
|
||||
|
||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
||||
"""Set up the options flow."""
|
||||
# pylint: disable=hass-component-root-import
|
||||
# pylint: disable=home-assistant-component-root-import
|
||||
from homeassistant.components.zha.radio_manager import ( # noqa: PLC0415
|
||||
ZhaMultiPANMigrationHelper,
|
||||
)
|
||||
@@ -449,7 +449,7 @@ class OptionsFlowHandler(OptionsFlow, ABC):
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
) -> ConfigFlowResult:
|
||||
"""Configure the Silicon Labs Multiprotocol add-on."""
|
||||
# pylint: disable=hass-component-root-import
|
||||
# pylint: disable=home-assistant-component-root-import
|
||||
from homeassistant.components.zha import DOMAIN as ZHA_DOMAIN # noqa: PLC0415
|
||||
from homeassistant.components.zha.radio_manager import ( # noqa: PLC0415
|
||||
ZhaMultiPANMigrationHelper,
|
||||
@@ -741,7 +741,7 @@ class OptionsFlowHandler(OptionsFlow, ABC):
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
) -> ConfigFlowResult:
|
||||
"""Perform initial backup and reconfigure ZHA."""
|
||||
# pylint: disable=hass-component-root-import
|
||||
# pylint: disable=home-assistant-component-root-import
|
||||
from homeassistant.components.zha import DOMAIN as ZHA_DOMAIN # noqa: PLC0415
|
||||
from homeassistant.components.zha.radio_manager import ( # noqa: PLC0415
|
||||
ZhaMultiPANMigrationHelper,
|
||||
|
||||
@@ -25,7 +25,7 @@ from homeassistant.components.binary_sensor import (
|
||||
BinarySensorDeviceClass,
|
||||
)
|
||||
from homeassistant.components.camera import DOMAIN as CAMERA_DOMAIN
|
||||
from homeassistant.components.device_automation.trigger import ( # pylint: disable=hass-component-root-import
|
||||
from homeassistant.components.device_automation.trigger import ( # pylint: disable=home-assistant-component-root-import
|
||||
async_validate_trigger_config,
|
||||
)
|
||||
from homeassistant.components.event import DOMAIN as EVENT_DOMAIN, EventDeviceClass
|
||||
|
||||
@@ -141,7 +141,7 @@ CONFIG_DEFAULTS = {
|
||||
|
||||
@TYPES.register("Camera")
|
||||
# False-positive on pylint, not a CameraEntity
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class Camera(HomeDoorbellAccessory, PyhapCamera): # type: ignore[misc]
|
||||
"""Generate a Camera accessory."""
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Lutron Homeworks Series 4 and 8 config flow."""
|
||||
# pylint: disable=hass-config-flow-name-field # Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable=home-assistant-config-flow-name-field # Name field is no longer allowed in config flow schemas
|
||||
|
||||
from functools import partial
|
||||
import logging
|
||||
|
||||
@@ -381,7 +381,7 @@ class HuaweiLteOptionsFlow(OptionsFlow):
|
||||
data_schema = vol.Schema(
|
||||
{
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
vol.Optional(
|
||||
CONF_NAME,
|
||||
default=self.config_entry.options.get(
|
||||
|
||||
@@ -812,7 +812,7 @@ async def async_setup_entry(
|
||||
_LOGGER.debug("Ignoring sensor %s.%s due to None value", key, item)
|
||||
continue
|
||||
if not (desc := SENSOR_META[key].descriptions.get(item)):
|
||||
_LOGGER.debug( # pylint: disable=hass-logger-period # false positive
|
||||
_LOGGER.debug( # pylint: disable=home-assistant-logger-period # false positive
|
||||
(
|
||||
"Ignoring unknown sensor %s.%s. "
|
||||
"Opening an issue at GitHub against the "
|
||||
|
||||
@@ -33,7 +33,7 @@ async def async_setup_entry(
|
||||
)
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HuePresence(GenericZLLSensor, BinarySensorEntity):
|
||||
"""The presence sensor entity for a Hue motion sensor device."""
|
||||
|
||||
|
||||
@@ -313,7 +313,7 @@ def hass_to_hue_brightness(value):
|
||||
return max(1, round((value / 255) * 254))
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueLight(CoordinatorEntity, LightEntity):
|
||||
"""Representation of a Hue light."""
|
||||
|
||||
|
||||
@@ -40,12 +40,12 @@ async def async_setup_entry(
|
||||
await bridge.sensor_manager.async_register_component("sensor", async_add_entities)
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class GenericHueGaugeSensorEntity(GenericZLLSensor, SensorEntity):
|
||||
"""Parent class for all 'gauge' Hue device sensors."""
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueLightLevel(GenericHueGaugeSensorEntity):
|
||||
"""The light level sensor entity for a Hue motion sensor device."""
|
||||
|
||||
@@ -81,7 +81,7 @@ class HueLightLevel(GenericHueGaugeSensorEntity):
|
||||
return attributes
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueTemperature(GenericHueGaugeSensorEntity):
|
||||
"""The temperature sensor entity for a Hue motion sensor device."""
|
||||
|
||||
@@ -98,7 +98,7 @@ class HueTemperature(GenericHueGaugeSensorEntity):
|
||||
return self.sensor.temperature / 100
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueBattery(GenericHueSensor, SensorEntity):
|
||||
"""Battery class for when a batt-powered device is only represented as an event."""
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ class SensorManager:
|
||||
self._component_add_entities[platform](value)
|
||||
|
||||
|
||||
class GenericHueSensor(GenericHueDevice, entity.Entity): # pylint: disable=hass-enforce-class-module
|
||||
class GenericHueSensor(GenericHueDevice, entity.Entity): # pylint: disable=home-assistant-enforce-class-module
|
||||
"""Representation of a Hue sensor."""
|
||||
|
||||
should_poll = False
|
||||
|
||||
@@ -6,7 +6,7 @@ from homeassistant.helpers.device_registry import DeviceInfo
|
||||
from ..const import CONF_ALLOW_UNREACHABLE, DEFAULT_ALLOW_UNREACHABLE, DOMAIN
|
||||
|
||||
|
||||
class GenericHueDevice(entity.Entity): # pylint: disable=hass-enforce-class-module
|
||||
class GenericHueDevice(entity.Entity): # pylint: disable=home-assistant-enforce-class-module
|
||||
"""Representation of a Hue device."""
|
||||
|
||||
def __init__(self, sensor, name, bridge, primary_sensor=None):
|
||||
|
||||
@@ -124,7 +124,7 @@ async def async_setup_entry(
|
||||
register_items(api.sensors.security_area_motion, HueMotionAwareSensor)
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueMotionSensor(HueBaseEntity, BinarySensorEntity):
|
||||
"""Representation of a Hue Motion sensor."""
|
||||
|
||||
@@ -150,7 +150,7 @@ class HueMotionSensor(HueBaseEntity, BinarySensorEntity):
|
||||
return motion_feature.motion
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueGroupedMotionSensor(HueMotionSensor):
|
||||
"""Representation of a Hue Grouped Motion sensor."""
|
||||
|
||||
@@ -173,7 +173,7 @@ class HueGroupedMotionSensor(HueMotionSensor):
|
||||
)
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueMotionAwareSensor(HueMotionSensor):
|
||||
"""Representation of a Motion sensor based on Hue Motion Aware.
|
||||
|
||||
@@ -227,7 +227,7 @@ class HueMotionAwareSensor(HueMotionSensor):
|
||||
)
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueEntertainmentActiveSensor(HueBaseEntity, BinarySensorEntity):
|
||||
"""Representation of a Hue Entertainment Configuration as binary sensor."""
|
||||
|
||||
@@ -251,7 +251,7 @@ class HueEntertainmentActiveSensor(HueBaseEntity, BinarySensorEntity):
|
||||
return self.resource.metadata.name
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueContactSensor(HueBaseEntity, BinarySensorEntity):
|
||||
"""Representation of a Hue Contact sensor."""
|
||||
|
||||
@@ -273,7 +273,7 @@ class HueContactSensor(HueBaseEntity, BinarySensorEntity):
|
||||
return self.resource.contact_report.state != ContactState.CONTACT
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueTamperSensor(HueBaseEntity, BinarySensorEntity):
|
||||
"""Representation of a Hue Tamper sensor."""
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ RESOURCE_TYPE_NAMES = {
|
||||
}
|
||||
|
||||
|
||||
class HueBaseEntity(Entity): # pylint: disable=hass-enforce-class-module
|
||||
class HueBaseEntity(Entity): # pylint: disable=home-assistant-enforce-class-module
|
||||
"""Generic Entity Class for a Hue resource."""
|
||||
|
||||
_attr_should_poll = False
|
||||
|
||||
@@ -79,7 +79,7 @@ async def async_setup_entry(
|
||||
)
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class GroupedHueLight(HueBaseEntity, LightEntity):
|
||||
"""Representation of a Grouped Hue light."""
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ async def async_setup_entry(
|
||||
)
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueLight(HueBaseEntity, LightEntity):
|
||||
"""Representation of a Hue light."""
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ async def async_setup_entry(
|
||||
register_items(api.sensors.grouped_light_level, HueGroupedLightLevelSensor)
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueSensorBase(HueBaseEntity, SensorEntity):
|
||||
"""Representation of a Hue sensor."""
|
||||
|
||||
@@ -131,7 +131,7 @@ class HueSensorBase(HueBaseEntity, SensorEntity):
|
||||
self.controller = controller
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueTemperatureSensor(HueSensorBase):
|
||||
"""Representation of a Hue Temperature sensor."""
|
||||
|
||||
@@ -149,7 +149,7 @@ class HueTemperatureSensor(HueSensorBase):
|
||||
return round(self.resource.temperature.value, 1)
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueLightLevelSensor(HueSensorBase):
|
||||
"""Representation of a Hue LightLevel (illuminance) sensor."""
|
||||
|
||||
@@ -178,7 +178,7 @@ class HueLightLevelSensor(HueSensorBase):
|
||||
}
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueGroupedLightLevelSensor(HueLightLevelSensor):
|
||||
"""Representation of a LightLevel (illuminance) sensor from a Hue GroupedLightLevel resource."""
|
||||
|
||||
@@ -203,7 +203,7 @@ class HueGroupedLightLevelSensor(HueLightLevelSensor):
|
||||
)
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueBatterySensor(HueSensorBase):
|
||||
"""Representation of a Hue Battery sensor."""
|
||||
|
||||
@@ -229,7 +229,7 @@ class HueBatterySensor(HueSensorBase):
|
||||
return {"battery_state": self.resource.power_state.battery_state.value}
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class HueZigbeeConnectivitySensor(HueSensorBase):
|
||||
"""Representation of a Hue ZigbeeConnectivity sensor."""
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ class PowerViewShadeBase(ShadeEntity, CoverEntity):
|
||||
await self.async_update()
|
||||
self.async_write_ha_state()
|
||||
|
||||
# pylint: disable-next=hass-missing-super-call
|
||||
# pylint: disable-next=home-assistant-missing-super-call
|
||||
async def async_added_to_hass(self) -> None:
|
||||
"""When entity is added to hass."""
|
||||
self.async_on_remove(
|
||||
|
||||
@@ -136,7 +136,7 @@ class PowerViewSensor(ShadeEntity, SensorEntity):
|
||||
"""Return the class of this entity."""
|
||||
return self.entity_description.device_class_fn(self._shade)
|
||||
|
||||
# pylint: disable-next=hass-missing-super-call
|
||||
# pylint: disable-next=home-assistant-missing-super-call
|
||||
async def async_added_to_hass(self) -> None:
|
||||
"""When entity is added to hass."""
|
||||
self.async_on_remove(
|
||||
|
||||
@@ -123,7 +123,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
return True
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class InputButton(collection.CollectionEntity, ButtonEntity, RestoreEntity):
|
||||
"""Representation of a button."""
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ class InputSelectStorageCollection(collection.DictStorageCollection):
|
||||
return {CONF_ID: item[CONF_ID]} | update_data
|
||||
|
||||
|
||||
# pylint: disable-next=hass-enforce-class-module
|
||||
# pylint: disable-next=home-assistant-enforce-class-module
|
||||
class InputSelect(collection.CollectionEntity, SelectEntity, RestoreEntity):
|
||||
"""Representation of a select input."""
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Native Home Assistant iOS app component."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
import datetime
|
||||
from http import HTTPStatus
|
||||
|
||||
@@ -36,7 +36,7 @@ async def async_setup_platform(
|
||||
async_add_entities(entities, True)
|
||||
|
||||
|
||||
# pylint: disable-next=hass-invalid-inheritance # needs fixing
|
||||
# pylint: disable-next=home-assistant-invalid-inheritance # needs fixing
|
||||
class Iperf3Sensor(RestoreEntity, SensorEntity):
|
||||
"""A Iperf3 sensor implementation."""
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ class IslamicPrayerFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
data_schema=vol.Schema(
|
||||
{
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
vol.Optional(CONF_NAME, default=NAME): TextSelector(),
|
||||
vol.Required(
|
||||
CONF_LOCATION, default=home_location
|
||||
|
||||
@@ -365,7 +365,7 @@ class ISYAuxSensorEntity(ISYSensorEntity):
|
||||
"""Return the target value."""
|
||||
return None if self.target is None else self.target.value
|
||||
|
||||
# pylint: disable-next=hass-missing-super-call
|
||||
# pylint: disable-next=home-assistant-missing-super-call
|
||||
async def async_added_to_hass(self) -> None:
|
||||
"""Subscribe to the node control change events.
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ class ISYEnableSwitchEntity(ISYAuxControlEntity, SwitchEntity):
|
||||
self._attr_name = description.name # Override super
|
||||
self._change_handler: EventListener | None = None
|
||||
|
||||
# pylint: disable-next=hass-missing-super-call
|
||||
# pylint: disable-next=home-assistant-missing-super-call
|
||||
async def async_added_to_hass(self) -> None:
|
||||
"""Subscribe to the node control change events."""
|
||||
self._change_handler = self._node.isy.nodes.status_events.subscribe(
|
||||
|
||||
@@ -197,7 +197,7 @@ class KeeneticOptionsFlowHandler(OptionsFlowWithReload):
|
||||
options = vol.Schema(
|
||||
{
|
||||
# Polling interval is user-configurable, which is no longer allowed
|
||||
# pylint: disable-next=hass-config-flow-polling-field
|
||||
# pylint: disable-next=home-assistant-config-flow-polling-field
|
||||
vol.Required(
|
||||
CONF_SCAN_INTERVAL,
|
||||
default=self.config_entry.options.get(
|
||||
|
||||
@@ -45,7 +45,7 @@ async def async_setup_entry(
|
||||
)
|
||||
|
||||
|
||||
# pylint: disable=hass-enforce-class-module
|
||||
# pylint: disable=home-assistant-enforce-class-module
|
||||
class DemoInfraredEntityBase(Entity):
|
||||
"""Representation of a demo infrared entity."""
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Support for Konnected devices."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
import copy
|
||||
import hmac
|
||||
|
||||
@@ -25,7 +25,7 @@ async def async_setup_entry(
|
||||
) -> None:
|
||||
"""Set up binary sensors attached to a Konnected device from a config entry."""
|
||||
# Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable-next=hass-use-runtime-data
|
||||
# pylint: disable-next=home-assistant-use-runtime-data
|
||||
data = hass.data[DOMAIN]
|
||||
device_id = config_entry.data["id"]
|
||||
sensors = [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Config flow for konnected.io integration."""
|
||||
# pylint: disable=hass-config-flow-name-field # Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable=home-assistant-config-flow-name-field # Name field is no longer allowed in config flow schemas
|
||||
|
||||
import asyncio
|
||||
import copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Support for Konnected devices."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
@@ -45,7 +45,7 @@ async def async_setup_entry(
|
||||
) -> None:
|
||||
"""Set up sensors attached to a Konnected device from a config entry."""
|
||||
# Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable-next=hass-use-runtime-data
|
||||
# pylint: disable-next=home-assistant-use-runtime-data
|
||||
data = hass.data[DOMAIN]
|
||||
device_id = config_entry.data["id"]
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Support for wired switches attached to a Konnected device."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
@@ -74,7 +74,7 @@ class KrakenOptionsFlowHandler(OptionsFlow):
|
||||
|
||||
options = {
|
||||
# Polling interval is user-configurable, which is no longer allowed
|
||||
# pylint: disable-next=hass-config-flow-polling-field
|
||||
# pylint: disable-next=home-assistant-config-flow-polling-field
|
||||
vol.Optional(
|
||||
CONF_SCAN_INTERVAL,
|
||||
default=self.config_entry.options.get(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Support for LinkPlay devices."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Support for LinkPlay media players."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Utilities for the LinkPlay component."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
from aiohttp import ClientSession
|
||||
from linkplay.utils import async_create_unverified_client_session
|
||||
|
||||
@@ -43,7 +43,7 @@ DATA_SCHEMA_OPTIONS = vol.Schema(
|
||||
DATA_SCHEMA_SETUP = vol.Schema(
|
||||
{
|
||||
# Approved exemption: user names the local file camera
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
vol.Optional(CONF_NAME, default=DEFAULT_NAME): TextSelector(),
|
||||
}
|
||||
).extend(DATA_SCHEMA_OPTIONS.schema)
|
||||
|
||||
@@ -112,7 +112,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
"""Configure based on config entry."""
|
||||
if DOMAIN not in hass.data:
|
||||
# Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable-next=hass-use-runtime-data
|
||||
# pylint: disable-next=home-assistant-use-runtime-data
|
||||
hass.data[DOMAIN] = {"devices": set(), "unsub_device_tracker": {}}
|
||||
webhook.async_register(
|
||||
hass, DOMAIN, "Locative", entry.data[CONF_WEBHOOK_ID], handle_webhook
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Support for the Locative platform."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
from homeassistant.components.device_tracker import TrackerEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
|
||||
@@ -111,7 +111,7 @@ class LoqedConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
else vol.Schema(
|
||||
{
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
vol.Required(CONF_NAME): str,
|
||||
vol.Required(CONF_API_TOKEN): str,
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ from pychromecast import Chromecast
|
||||
from pychromecast.const import CAST_TYPE_CHROMECAST
|
||||
|
||||
from homeassistant.components.cast import DOMAIN as CAST_DOMAIN
|
||||
from homeassistant.components.cast.home_assistant_cast import ( # pylint: disable=hass-component-root-import
|
||||
from homeassistant.components.cast.home_assistant_cast import ( # pylint: disable=home-assistant-component-root-import
|
||||
ATTR_URL_PATH,
|
||||
ATTR_VIEW_PATH,
|
||||
NO_URL_AVAILABLE_ERROR,
|
||||
|
||||
@@ -80,7 +80,7 @@ class LutronOccupancySensor(LutronCasetaEntity, BinarySensorEntity):
|
||||
"""Return the brightness of the light."""
|
||||
return self._device["status"] == OCCUPANCY_GROUP_OCCUPIED
|
||||
|
||||
# pylint: disable-next=hass-missing-super-call
|
||||
# pylint: disable-next=home-assistant-missing-super-call
|
||||
async def async_added_to_hass(self) -> None:
|
||||
"""Register callbacks."""
|
||||
self._smartbridge.add_occupancy_subscriber(
|
||||
@@ -125,7 +125,7 @@ class LutronCasetaBatterySensor(LutronCasetaEntity, BinarySensorEntity):
|
||||
"""Return the unique ID of the battery sensor."""
|
||||
return f"{super().unique_id}_battery"
|
||||
|
||||
# pylint: disable-next=hass-missing-super-call
|
||||
# pylint: disable-next=home-assistant-missing-super-call
|
||||
async def async_added_to_hass(self) -> None:
|
||||
"""Skip bridge subscriptions; the battery sensor is polled."""
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Support for Mailgun."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
import hashlib
|
||||
import hmac
|
||||
|
||||
@@ -43,7 +43,7 @@ def get_service(
|
||||
) -> MailgunNotificationService | None:
|
||||
"""Get the Mailgun notification service."""
|
||||
# Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable-next=hass-use-runtime-data
|
||||
# pylint: disable-next=home-assistant-use-runtime-data
|
||||
data = hass.data[DOMAIN]
|
||||
mailgun_service = MailgunNotificationService(
|
||||
data.get(CONF_DOMAIN),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Config flow to configure Met component."""
|
||||
# pylint: disable=hass-config-flow-name-field # Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable=home-assistant-config-flow-name-field # Name field is no longer allowed in config flow schemas
|
||||
|
||||
from typing import Any
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class MetEireannFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
data_schema=vol.Schema(
|
||||
{
|
||||
# Name field is no longer allowed in config flow schemas
|
||||
# pylint: disable-next=hass-config-flow-name-field
|
||||
# pylint: disable-next=home-assistant-config-flow-name-field
|
||||
vol.Required(CONF_NAME, default=HOME_LOCATION_NAME): str,
|
||||
vol.Required(
|
||||
CONF_LATITUDE, default=self.hass.config.latitude
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Support for Meteo-France weather data."""
|
||||
# pylint: disable=hass-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
# pylint: disable=home-assistant-use-runtime-data # Uses legacy hass.data[DOMAIN] pattern
|
||||
|
||||
import logging
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user