Skip to content
Draft
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
15 changes: 0 additions & 15 deletions zha/application/platforms/binary_sensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,21 +515,6 @@ class ReplaceFilter(BinarySensor):
)


@register_entity(AQARA_OPPLE_CLUSTER)
class AqaraPetFeederErrorDetected(BinarySensor):
"""ZHA aqara pet feeder error detected binary sensor."""

_attribute_name = "error_detected"
_unique_id_suffix = "error_detected"
_attr_device_class: BinarySensorDeviceClass = BinarySensorDeviceClass.PROBLEM
_cluster_id = AQARA_OPPLE_CLUSTER

_cluster_match = ClusterMatch(
server_clusters=frozenset({AQARA_OPPLE_CLUSTER}),
models=frozenset({"aqara.feeder.acn001"}),
)


@register_entity(AQARA_OPPLE_CLUSTER)
class XiaomiPlugConsumerConnected(BinarySensor):
"""ZHA Xiaomi plug consumer connected binary sensor."""
Expand Down
16 changes: 0 additions & 16 deletions zha/application/platforms/button/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,22 +222,6 @@ class NoPresenceStatusResetButton(WriteAttributeButton):
)


@register_entity(AQARA_OPPLE_CLUSTER)
class AqaraPetFeederFeedButton(WriteAttributeButton):
"""Defines a feed button for the aqara c1 pet feeder."""

_unique_id_suffix = "feeding"
_attribute_name = "feeding"
_attribute_value = 1
_attr_translation_key = "feed"
_cluster_id = AQARA_OPPLE_CLUSTER

_cluster_match = ClusterMatch(
server_clusters=frozenset({AQARA_OPPLE_CLUSTER}),
models=frozenset({"aqara.feeder.acn001"}),
)


@register_entity(AQARA_OPPLE_CLUSTER)
class AqaraSelfTestButton(WriteAttributeButton):
"""Defines a ZHA self-test button for Aqara smoke sensors."""
Expand Down
43 changes: 1 addition & 42 deletions zha/application/platforms/number/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from zha.application.platforms.number.bacnet import BACNET_UNITS_TO_HA_UNITS
from zha.application.platforms.number.const import ICONS, NumberDeviceClass, NumberMode
from zha.quirks import DANFOSS_ALLY_THERMOSTAT
from zha.units import UnitOfMass, UnitOfTemperature, UnitOfTime
from zha.units import UnitOfTemperature, UnitOfTime

if TYPE_CHECKING:
from zha.zigbee.device import Device
Expand Down Expand Up @@ -787,47 +787,6 @@ class TiRouterTransmitPower(NumberConfigurationEntity):
}


@register_entity(AQARA_OPPLE_CLUSTER)
class AqaraPetFeederServingSize(NumberConfigurationEntity):
"""Aqara pet feeder serving size configuration entity."""

_unique_id_suffix = "serving_size"
_attr_entity_category = EntityCategory.CONFIG
_attr_native_min_value: float = 1
_attr_native_max_value: float = 10
_attribute_name = "serving_size"
_attr_translation_key: str = "serving_size"
_cluster_id = AQARA_OPPLE_CLUSTER

_attr_mode: NumberMode = NumberMode.BOX

_cluster_match = ClusterMatch(
server_clusters=frozenset({AQARA_OPPLE_CLUSTER}),
models=frozenset({"aqara.feeder.acn001"}),
)


@register_entity(AQARA_OPPLE_CLUSTER)
class AqaraPetFeederPortionWeight(NumberConfigurationEntity):
"""Aqara pet feeder portion weight configuration entity."""

_unique_id_suffix = "portion_weight"
_attr_entity_category = EntityCategory.CONFIG
_attr_native_min_value: float = 1
_attr_native_max_value: float = 100
_attribute_name = "portion_weight"
_attr_translation_key: str = "portion_weight"
_cluster_id = AQARA_OPPLE_CLUSTER

_attr_mode: NumberMode = NumberMode.BOX
_attr_native_unit_of_measurement: str = UnitOfMass.GRAMS

_cluster_match = ClusterMatch(
server_clusters=frozenset({AQARA_OPPLE_CLUSTER}),
models=frozenset({"aqara.feeder.acn001"}),
)


@register_entity(AQARA_OPPLE_CLUSTER)
class AqaraThermostatAwayTemp(NumberConfigurationEntity):
"""Aqara away preset temperature configuration entity."""
Expand Down
23 changes: 0 additions & 23 deletions zha/application/platforms/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,29 +716,6 @@ class AqaraT2RelayDecoupledMode(ZCLEnumSelectEntity):
)


class AqaraFeedingMode(types.enum8):
"""Feeding mode."""

Manual = 0x00
Schedule = 0x01


@register_entity(AQARA_OPPLE_CLUSTER)
class AqaraPetFeederMode(ZCLEnumSelectEntity):
"""Representation of an Aqara pet feeder mode configuration entity."""

_unique_id_suffix = "feeding_mode"
_attribute_name = "feeding_mode"
_enum = AqaraFeedingMode
_attr_translation_key: str = "feeding_mode"
_cluster_id = AQARA_OPPLE_CLUSTER

_cluster_match = ClusterMatch(
server_clusters=frozenset({AQARA_OPPLE_CLUSTER}),
models=frozenset({"aqara.feeder.acn001"}),
)


class AqaraThermostatPresetMode(types.enum8):
"""Thermostat preset mode."""

Expand Down
72 changes: 0 additions & 72 deletions zha/application/platforms/sensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
UnitOfElectricPotential,
UnitOfEnergy,
UnitOfFrequency,
UnitOfMass,
UnitOfPower,
UnitOfPressure,
UnitOfSpeed,
Expand Down Expand Up @@ -3350,77 +3349,6 @@ class IkeaFilterRunTime(Sensor):
)


class AqaraFeedingSource(types.enum8):
"""Aqara pet feeder feeding source."""

Feeder = 0x01
HomeAssistant = 0x02


@register_entity(AQARA_OPPLE_CLUSTER)
class AqaraPetFeederLastFeedingSource(EnumSensor):
"""Sensor that displays the last feeding source of pet feeder."""

_attribute_name = "last_feeding_source"
_unique_id_suffix = "last_feeding_source"
_attr_translation_key: str = "last_feeding_source"
_enum = AqaraFeedingSource
_cluster_id = AQARA_OPPLE_CLUSTER

_cluster_match = ClusterMatch(
server_clusters=frozenset({AQARA_OPPLE_CLUSTER}),
models=frozenset({"aqara.feeder.acn001"}),
)


@register_entity(AQARA_OPPLE_CLUSTER)
class AqaraPetFeederLastFeedingSize(Sensor):
"""Sensor that displays the last feeding size of the pet feeder."""

_attribute_name = "last_feeding_size"
_unique_id_suffix = "last_feeding_size"
_attr_translation_key: str = "last_feeding_size"
_cluster_id = AQARA_OPPLE_CLUSTER

_cluster_match = ClusterMatch(
server_clusters=frozenset({AQARA_OPPLE_CLUSTER}),
models=frozenset({"aqara.feeder.acn001"}),
)


@register_entity(AQARA_OPPLE_CLUSTER)
class AqaraPetFeederPortionsDispensed(Sensor):
"""Sensor that displays the number of portions dispensed by the pet feeder."""

_attribute_name = "portions_dispensed"
_unique_id_suffix = "portions_dispensed"
_attr_translation_key: str = "portions_dispensed_today"
_attr_state_class: SensorStateClass = SensorStateClass.TOTAL_INCREASING
_cluster_id = AQARA_OPPLE_CLUSTER

_cluster_match = ClusterMatch(
server_clusters=frozenset({AQARA_OPPLE_CLUSTER}),
models=frozenset({"aqara.feeder.acn001"}),
)


@register_entity(AQARA_OPPLE_CLUSTER)
class AqaraPetFeederWeightDispensed(Sensor):
"""Sensor that displays the weight dispensed by the pet feeder."""

_attribute_name = "weight_dispensed"
_unique_id_suffix = "weight_dispensed"
_attr_translation_key: str = "weight_dispensed_today"
_attr_native_unit_of_measurement = UnitOfMass.GRAMS
_attr_state_class: SensorStateClass = SensorStateClass.TOTAL_INCREASING
_cluster_id = AQARA_OPPLE_CLUSTER

_cluster_match = ClusterMatch(
server_clusters=frozenset({AQARA_OPPLE_CLUSTER}),
models=frozenset({"aqara.feeder.acn001"}),
)


@register_entity(AQARA_OPPLE_CLUSTER)
class AqaraSmokeDensityDbm(Sensor):
"""Sensor that displays the smoke density of an Aqara smoke sensor in dB/m."""
Expand Down
31 changes: 0 additions & 31 deletions zha/application/platforms/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,37 +662,6 @@ class DisableLed(ConfigurableAttributeSwitch):
)


@register_entity(AQARA_OPPLE_CLUSTER)
class AqaraPetFeederLEDIndicator(ConfigurableAttributeSwitch):
"""Representation of a LED indicator configuration entity."""

_unique_id_suffix = "disable_led_indicator"
_attribute_name = "disable_led_indicator"
_attr_translation_key = "led_indicator"
_force_inverted = True
_cluster_id = AQARA_OPPLE_CLUSTER

_cluster_match = ClusterMatch(
server_clusters=frozenset({AQARA_OPPLE_CLUSTER}),
models=frozenset({"aqara.feeder.acn001"}),
)


@register_entity(AQARA_OPPLE_CLUSTER)
class AqaraPetFeederChildLock(ConfigurableAttributeSwitch):
"""Representation of a child lock configuration entity."""

_unique_id_suffix = "child_lock"
_attribute_name = "child_lock"
_attr_translation_key = "child_lock"
_cluster_id = AQARA_OPPLE_CLUSTER

_cluster_match = ClusterMatch(
server_clusters=frozenset({AQARA_OPPLE_CLUSTER}),
models=frozenset({"aqara.feeder.acn001"}),
)


@register_entity(OnOff.cluster_id)
class TuyaChildLockSwitch(ConfigurableAttributeSwitch):
"""Representation of a child lock configuration entity."""
Expand Down
24 changes: 0 additions & 24 deletions zha/application/platforms/virtual.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,30 +680,6 @@ class AqaraPlugInit(_AqaraOppleInitBase):
}


@register_entity(AQARA_OPPLE_CLUSTER)
class AqaraFeederInit(_AqaraOppleInitBase):
"""Aqara pet feeder attribute init."""

_cluster_match = ClusterMatch(
server_clusters=frozenset({AQARA_OPPLE_CLUSTER}),
models=frozenset({"aqara.feeder.acn001"}),
)
_server_cluster_config = {
AQARA_OPPLE_CLUSTER: ClusterConfig(
attributes={
"portions_dispensed": AttrConfig(read_on_startup=False),
"weight_dispensed": AttrConfig(read_on_startup=False),
"error_detected": AttrConfig(read_on_startup=False),
"disable_led_indicator": AttrConfig(read_on_startup=False),
"child_lock": AttrConfig(read_on_startup=False),
"feeding_mode": AttrConfig(read_on_startup=False),
"serving_size": AttrConfig(read_on_startup=False),
"portion_weight": AttrConfig(read_on_startup=False),
},
),
}


@register_entity(AQARA_OPPLE_CLUSTER)
class AqaraThermostatAgl001Init(_AqaraOppleInitBase):
"""Aqara E1 radiator thermostat attribute init."""
Expand Down