Ruff pushed all their 2023 experimental changes to stable as a "2024.2" release at end of Feb. So the CI linting broke on 1 Mar. Mostly it seems to be that a blank line is expected between file docstring and imports now.
@@ -6,6 +6,7 @@ Based on sean6541/tuya-homeassistant for service call logic, and TarxBoy's
investigation into Goldair's tuyapi statuses
https://github.com/codetheweb/tuyapi/issues/31.
"""
+
import logging
from homeassistant.config_entries import ConfigEntry
@@ -1,6 +1,7 @@
Setup for different kinds of Tuya alarm control panels.
from homeassistant.components.alarm_control_panel import AlarmControlPanelEntity
Setup for different kinds of Tuya Binary sensors
from homeassistant.components.binary_sensor import (
Setup for different kinds of Tuya button devices
from homeassistant.components.button import ButtonDeviceClass, ButtonEntity
Setup for different kinds of Tuya climate devices
from homeassistant.components.climate import (
Setup for different kinds of Tuya cover devices
from homeassistant.components.cover import (
@@ -1,4 +1,5 @@
"""Diagnostics support for tuya-local."""
from __future__ import annotations
from typing import Any
Implementation of Tuya events
from homeassistant.components.event import EventDeviceClass, EventEntity
Setup for different kinds of Tuya fan devices
Helper for general config
from .. import DOMAIN
Config parser for Tuya Local devices.
from base64 import b64decode, b64encode
from collections.abc import Sequence
Mixins to make writing new platforms easier
from homeassistant.const import (
Setup for different kinds of Tuya humidifier devices
from homeassistant.components.humidifier import (
Setup for different kinds of Tuya lawn mowers
from homeassistant.components.lawn_mower import LawnMowerEntity
from homeassistant.components.lawn_mower.const import (
SERVICE_DOCK,
Setup for different kinds of Tuya light devices
from struct import pack, unpack
Setup for different kinds of Tuya lock devices
from homeassistant.components.lock import LockEntity
from .device import TuyaLocalDevice
Setup for different kinds of Tuya numbers
from homeassistant.components.number import NumberEntity
@@ -2,6 +2,7 @@
Implementation of Tuya remote control devices
Based on broadlink integration for code saving under HA storage
import asyncio
import json
Setup for different kinds of Tuya selects
from homeassistant.components.select import SelectEntity
Setup for different kinds of Tuya sensors
from homeassistant.components.sensor import (
Setup for Tuya siren devices
from homeassistant.components.siren import SirenEntity, SirenEntityFeature
from homeassistant.components.siren.const import (
ATTR_DURATION,
Setup for different kinds of Tuya switch devices
from homeassistant.components.switch import SwitchDeviceClass, SwitchEntity
Setup for different kinds of Tuya vacuum cleaners
from homeassistant.components.vacuum import (
SERVICE_CLEAN_SPOT,
SERVICE_RETURN_TO_BASE,
Setup for different kinds of Tuya water heater devices
from homeassistant.components.water_heater import (
"""Tests for the Avatto roller blinds controller."""
from homeassistant.components.cover import CoverDeviceClass, CoverEntityFeature
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.const import UnitOfTime
from ..const import AVATTO_CURTAIN_PAYLOAD
"""Tests for the bcom intercom camera"""
from ..const import BCOM_CAMERA_PAYLOAD
from .base_device_tests import TuyaDeviceTestCase
"""Tests for the switch entity."""
from homeassistant.components.light import ColorMode, LightEntityFeature
from homeassistant.components.switch import SwitchDeviceClass
"""Tests for Digoo DSSP202 dual switch with timers and energy monitoring"""
"""Tests for the energy monitoring powerstrip."""
from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorDeviceClass
"""Tests for the ES01 powerstrip."""
"""Tests for the essentials air purifier."""
from homeassistant.components.button import ButtonDeviceClass
"""Tests for the simple garage door opener."""
from ..const import SIMPLE_GARAGE_DOOR_PAYLOAD
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
"""Tests for the Logicom Strippy 4-way+USB powerstrip."""
"""Tests for the M027 curtain module."""
@@ -3,6 +3,7 @@ Test MoeBot S mower.
Primarily for testing the STOP command which this device is the first to use,
and the lawn_mower platform.
LawnMowerActivity,
LawnMowerEntityFeature,
"""Tests for the MoesHouse RGB smart socket."""
"""Tests for Parkside PLGS 2012 A1 Smart Charger"""
from homeassistant.components.number.const import NumberDeviceClass
"""Tests for the PC321-TY Power Clamp Energy meter"""
STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL_INCREASING,
"""Tests for the Quto 03 Sprinkler."""
from homeassistant.const import PERCENTAGE, UnitOfTime
"""Tests for the QS C01 curtain module."""
"""Tests for SD123 Human Presence Radar HPR01"""
from ..const import SD123_PRESENCE_PAYLOAD
"""Tests for the simple blinds controller."""
from ..const import SIMPLE_BLINDS_PAYLOAD
"""Tests for a simple switch with timer"""
UnitOfElectricCurrent,
"""Tests for the Woox R4028 powerstrip."""
"""Tests for the ZX G30 Alarm Control Panel."""
from homeassistant.components.alarm_control_panel import (
AlarmControlPanelEntityFeature as Feature,
)
"""Tests for the alarm_control_panel entity."""
from unittest.mock import AsyncMock, Mock
import pytest
"""Tests for the binary_sensor entity."""
"""Tests for the button entity."""
"""Tests for the camera entity."""
"""Tests for the light entity."""
"""Tests for the config flow."""
from unittest.mock import ANY, AsyncMock, MagicMock, patch
"""Tests for the cover entity."""
"""Test the config parser"""
from unittest import IsolatedAsyncioTestCase
from unittest.mock import MagicMock
"""Tests for diagnostics platform"""
from unittest.mock import AsyncMock
"""Tests for the event entity."""
"""Tests for the fan entity."""
"""Tests for the humidifier entity."""
"""Tests for the lawn_mower entity."""
"""Tests for the lock entity."""
"""Tests for the number entity."""
"""Tests for the remote entity."""
"""Tests for the select entity."""
"""Tests for the sensor entity."""
"""Tests for the siren entity."""
Tests for translation files.
from fnmatch import fnmatch
from os import walk
from os.path import dirname, join
"""Tests for the vacuum entity."""
"""Tests for the water heater entity."""
"""Find matching devices for the supplied dp list"""
import sys
@@ -5,6 +5,7 @@ This script was created to check for entity ids that change between versions.
The script needs to be run on the version before a potential id changing
modification, then again after to compare the two outputs.
from custom_components.tuya_local.helpers.device_config import (