Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small cleanup #15

Merged
merged 3 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions zha/application/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,21 @@
class Platform(StrEnum):
"""Available entity platforms."""

AIR_QUALITY = "air_quality"
ALARM_CONTROL_PANEL = "alarm_control_panel"
BINARY_SENSOR = "binary_sensor"
BUTTON = "button"
CALENDAR = "calendar"
CAMERA = "camera"
CLIMATE = "climate"
COVER = "cover"
DATE = "date"
DATETIME = "datetime"
DEVICE_TRACKER = "device_tracker"
EVENT = "event"
FAN = "fan"
GEO_LOCATION = "geo_location"
HUMIDIFIER = "humidifier"
IMAGE = "image"
IMAGE_PROCESSING = "image_processing"
LAWN_MOWER = "lawn_mower"
LIGHT = "light"
LOCK = "lock"
MAILBOX = "mailbox"
MEDIA_PLAYER = "media_player"
NOTIFY = "notify"
NUMBER = "number"
REMOTE = "remote"
SCENE = "scene"
SELECT = "select"
SENSOR = "sensor"
SIREN = "siren"
STT = "stt"
SWITCH = "switch"
TEXT = "text"
TIME = "time"
TODO = "todo"
TTS = "tts"
VACUUM = "vacuum"
VALVE = "valve"
UNKNOWN = "unknown"
UPDATE = "update"
WAKE_WORD = "wake_word"
WATER_HEATER = "water_heater"
WEATHER = "weather"
23 changes: 1 addition & 22 deletions zha/application/const.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""All constants related to the ZHA component."""
"""Constants for ZHA."""

from __future__ import annotations

import enum
import logging
from numbers import Number
from typing import Any, Final

Expand Down Expand Up @@ -188,26 +187,6 @@ def __voluptuous_compile__(self, schema: vol.Schema) -> Any: # pylint: disable=
DATA_ZHA_DEVICE_TRIGGER_CACHE = "zha_device_trigger_cache"
DATA_ZHA_GATEWAY = "zha_gateway"

DEBUG_COMP_BELLOWS = "bellows"
DEBUG_COMP_ZHA = "homeassistant.components.zha"
DEBUG_COMP_ZIGPY = "zigpy"
DEBUG_COMP_ZIGPY_ZNP = "zigpy_znp"
DEBUG_COMP_ZIGPY_DECONZ = "zigpy_deconz"
DEBUG_COMP_ZIGPY_XBEE = "zigpy_xbee"
DEBUG_COMP_ZIGPY_ZIGATE = "zigpy_zigate"
DEBUG_LEVEL_CURRENT = "current"
DEBUG_LEVEL_ORIGINAL = "original"
DEBUG_LEVELS = {
DEBUG_COMP_BELLOWS: logging.DEBUG,
DEBUG_COMP_ZHA: logging.DEBUG,
DEBUG_COMP_ZIGPY: logging.DEBUG,
DEBUG_COMP_ZIGPY_ZNP: logging.DEBUG,
DEBUG_COMP_ZIGPY_DECONZ: logging.DEBUG,
DEBUG_COMP_ZIGPY_XBEE: logging.DEBUG,
DEBUG_COMP_ZIGPY_ZIGATE: logging.DEBUG,
}
DEBUG_RELAY_LOGGERS = [DEBUG_COMP_ZHA, DEBUG_COMP_ZIGPY]

DEFAULT_RADIO_TYPE = "ezsp"
DEFAULT_BAUDRATE = 57600
DEFAULT_DATABASE_NAME = "zigbee.db"
Expand Down
4 changes: 2 additions & 2 deletions zha/application/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def probe_single_cluster(
cluster_handler: ClusterHandler,
endpoint: Endpoint,
) -> None:
"""Probe specified cluster for specific component."""
"""Probe specified cluster for specific platform."""
if platform is None or platform not in PLATFORMS:
return
cluster_handler_list = [cluster_handler]
Expand Down Expand Up @@ -544,7 +544,7 @@ def initialize(self, gateway: Gateway) -> None:


class GroupProbe:
"""Determine the appropriate component for a group."""
"""Determine the appropriate platform for a group."""

def __init__(self) -> None:
"""Initialize instance."""
Expand Down
6 changes: 1 addition & 5 deletions zha/application/helpers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
"""Helpers for Zigbee Home Automation.

For more details about this component, please refer to the documentation at
https://home-assistant.io/integrations/zha/
"""
"""Helpers for Zigbee Home Automation."""

from __future__ import annotations

Expand Down
7 changes: 1 addition & 6 deletions zha/application/platforms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@


class EntityCategory(StrEnum):
"""Category of an entity.

An entity with a category will:
- Not be exposed to cloud, Alexa, or Google Assistant components
- Not be included in indirect service calls to devices or areas
"""
"""Category of an entity."""

# Config: An entity which allows changing the configuration of a device.
CONFIG = "config"
Expand Down
2 changes: 1 addition & 1 deletion zha/application/platforms/binary_sensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def translation_key(self) -> str | None:

@property
def device_class(self) -> BinarySensorDeviceClass | None:
"""Return device class from component DEVICE_CLASSES."""
"""Return device class from platform DEVICE_CLASSES."""
zone_type = self._cluster_handler.cluster.get("zone_type")
return IAS_ZONE_CLASS_MAPPING.get(zone_type)

Expand Down
6 changes: 1 addition & 5 deletions zha/zigbee/cluster_handlers/hvac.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
"""HVAC cluster handlers module for Zigbee Home Automation.

For more details about this component, please refer to the documentation at
https://home-assistant.io/integrations/zha/
"""
"""HVAC cluster handlers module for Zigbee Home Automation."""

from __future__ import annotations

Expand Down
6 changes: 1 addition & 5 deletions zha/zigbee/cluster_handlers/security.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
"""Security cluster handlers module for Zigbee Home Automation.

For more details about this component, please refer to the documentation at
https://home-assistant.io/integrations/zha/
"""
"""Security cluster handlers module for Zigbee Home Automation."""

from __future__ import annotations

Expand Down
Loading