Skip to content

Commit

Permalink
Merge branch 'release/0.0.79'
Browse files Browse the repository at this point in the history
  • Loading branch information
dmulcahey committed Aug 30, 2022
2 parents 170cc1f + c914660 commit cad654f
Show file tree
Hide file tree
Showing 40 changed files with 1,704 additions and 269 deletions.
2 changes: 2 additions & 0 deletions requirements_test_all.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
asynctest
isort
black
flake8
codecov
colorlog
codespell
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from setuptools import find_packages, setup

VERSION = "0.0.78"
VERSION = "0.0.79"


setup(
Expand Down
49 changes: 49 additions & 0 deletions tests/test_paulmann.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
"""Tests for Paulmann quirks."""

import zhaquirks.paulmann.fourbtnremote


def test_fourbtnremote_signature(assert_signature_matches_quirk):
"""Test PaulmannRemote4Btn signature is matched to its quirk."""
signature = {
"node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4644, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
"endpoints": {
"1": {
"profile_id": 260,
"device_type": "0x0001",
"in_clusters": ["0x0000", "0x0001", "0x0003", "0x0b05", "0x1000"],
"out_clusters": [
"0x0003",
"0x0004",
"0x0005",
"0x0006",
"0x0008",
"0x0019",
"0x0300",
"0x1000",
],
},
"2": {
"profile_id": 260,
"device_type": "0x0001",
"in_clusters": ["0x0000", "0x0001", "0x0003", "0x0b05", "0x1000"],
"out_clusters": [
"0x0003",
"0x0004",
"0x0005",
"0x0006",
"0x0008",
"0x0019",
"0x0300",
"0x1000",
],
},
},
"manufacturer": "Paulmann LichtGmbH",
"model": "501.34",
"class": "paulmann.fourbtnremote.PaulmannRemote4Btn",
}

assert_signature_matches_quirk(
zhaquirks.paulmann.fourbtnremote.PaulmannRemote4Btn, signature
)
10 changes: 10 additions & 0 deletions tests/test_quirks.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,16 @@ def test_migrated_lighting_automation_triggers(quirk: CustomDevice) -> None:
(const.LONG_RELEASE, const.DIM_DOWN),
]
],
zhaquirks.paulmann.fourbtnremote.PaulmannRemote4Btn: [
[
(const.LONG_RELEASE, const.BUTTON_1),
(const.LONG_RELEASE, const.BUTTON_2),
],
[
(const.LONG_RELEASE, const.BUTTON_3),
(const.LONG_RELEASE, const.BUTTON_4),
],
],
zhaquirks.thirdreality.button.Button: [
[
(const.LONG_PRESS, const.LONG_PRESS),
Expand Down
1 change: 0 additions & 1 deletion zhaquirks/bitron/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"""Bitron/SMaBiT module."""

BITRON = "Bitron Home"
DIAGNOSTICS_CLUSTER_ID = 0x0B05 # decimal = 2821
7 changes: 4 additions & 3 deletions zhaquirks/bitron/thermostat.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
PowerConfiguration,
Time,
)
from zigpy.zcl.clusters.homeautomation import Diagnostic
from zigpy.zcl.clusters.hvac import Thermostat, UserInterface

from zhaquirks import PowerConfigurationCluster
from zhaquirks.bitron import BITRON, DIAGNOSTICS_CLUSTER_ID
from zhaquirks.bitron import BITRON
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
Expand Down Expand Up @@ -64,7 +65,7 @@ class Av201032(CustomDevice):
PollControl.cluster_id,
Thermostat.cluster_id,
UserInterface.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
],
OUTPUT_CLUSTERS: [Identify.cluster_id, Ota.cluster_id],
}
Expand All @@ -84,7 +85,7 @@ class Av201032(CustomDevice):
PollControl.cluster_id,
Thermostat.cluster_id,
UserInterface.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
],
OUTPUT_CLUSTERS: [Identify.cluster_id, Ota.cluster_id],
}
Expand Down
7 changes: 3 additions & 4 deletions zhaquirks/centralite/cl_3130.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Ota,
PollControl,
)
from zigpy.zcl.clusters.homeautomation import Diagnostic
from zigpy.zcl.clusters.measurement import TemperatureMeasurement

from zhaquirks import PowerConfigurationCluster
Expand All @@ -33,8 +34,6 @@
)
from zhaquirks.osram import OSRAM

DIAGNOSTICS_CLUSTER_ID = 0x0B05 # decimal = 2821


class CustomPowerConfigurationCluster(PowerConfigurationCluster):
"""Custom PowerConfigurationCluster."""
Expand Down Expand Up @@ -63,7 +62,7 @@ class CentraLite3130(CustomDevice):
Identify.cluster_id,
PollControl.cluster_id,
TemperatureMeasurement.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
],
OUTPUT_CLUSTERS: [
Identify.cluster_id,
Expand All @@ -82,7 +81,7 @@ class CentraLite3130(CustomDevice):
CustomPowerConfigurationCluster,
Identify.cluster_id,
PollControl.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
],
OUTPUT_CLUSTERS: [
Identify.cluster_id,
Expand Down
7 changes: 3 additions & 4 deletions zhaquirks/centralite/cl_3157100.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import Basic, Identify, Ota, PollControl, Time
from zigpy.zcl.clusters.homeautomation import Diagnostic
from zigpy.zcl.clusters.hvac import Fan, Thermostat, UserInterface

from zhaquirks import PowerConfigurationCluster
Expand All @@ -15,8 +16,6 @@
PROFILE_ID,
)

DIAGNOSTICS_CLUSTER_ID = 0x0B05 # decimal = 2821


class CentraLite3157100(CustomDevice):
"""Custom device representing centralite 3157100."""
Expand All @@ -39,7 +38,7 @@ class CentraLite3157100(CustomDevice):
Fan.cluster_id,
UserInterface.cluster_id,
PollControl.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
}
Expand All @@ -59,7 +58,7 @@ class CentraLite3157100(CustomDevice):
Fan.cluster_id,
UserInterface.cluster_id,
PollControl.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
}
Expand Down
10 changes: 5 additions & 5 deletions zhaquirks/centralite/cl_3300S.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import Basic, BinaryInput, Identify, Ota, PollControl
from zigpy.zcl.clusters.homeautomation import Diagnostic
from zigpy.zcl.clusters.measurement import TemperatureMeasurement
from zigpy.zcl.clusters.security import IasZone

Expand All @@ -16,7 +17,6 @@
PROFILE_ID,
)

DIAGNOSTICS_CLUSTER_ID = 0x0B05 # decimal = 2821
MANUFACTURER_SPECIFIC_PROFILE_ID = 0xC2DF # decimal = 49887


Expand Down Expand Up @@ -44,7 +44,7 @@ class CentraLite3300S(CustomDevice):
PollControl.cluster_id,
TemperatureMeasurement.cluster_id,
IasZone.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
},
Expand All @@ -60,7 +60,7 @@ class CentraLite3300S(CustomDevice):
PowerConfigurationCluster.cluster_id,
Identify.cluster_id,
BinaryInput.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
],
OUTPUT_CLUSTERS: [Identify.cluster_id],
},
Expand All @@ -77,15 +77,15 @@ class CentraLite3300S(CustomDevice):
PollControl.cluster_id,
TemperatureMeasurement.cluster_id,
IasZone.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
},
2: {
INPUT_CLUSTERS: [
Basic.cluster_id,
Identify.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
],
OUTPUT_CLUSTERS: [Identify.cluster_id],
},
Expand Down
11 changes: 5 additions & 6 deletions zhaquirks/centralite/cl_3305S.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import Basic, Identify, Ota, PollControl
from zigpy.zcl.clusters.homeautomation import Diagnostic
from zigpy.zcl.clusters.measurement import OccupancySensing, TemperatureMeasurement
from zigpy.zcl.clusters.security import IasZone

Expand All @@ -16,8 +17,6 @@
PROFILE_ID,
)

DIAGNOSTICS_CLUSTER_ID = 0x0B05 # decimal = 2821


class CentraLite3305S(CustomDevice):
"""Custom device representing centralite 3305."""
Expand Down Expand Up @@ -48,7 +47,7 @@ class CentraLite3305S(CustomDevice):
PollControl.cluster_id,
TemperatureMeasurement.cluster_id,
IasZone.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
},
Expand All @@ -64,7 +63,7 @@ class CentraLite3305S(CustomDevice):
PowerConfigurationCluster.cluster_id,
Identify.cluster_id,
OccupancySensing.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
],
OUTPUT_CLUSTERS: [Identify.cluster_id],
},
Expand All @@ -81,7 +80,7 @@ class CentraLite3305S(CustomDevice):
PollControl.cluster_id,
TemperatureMeasurement.cluster_id,
IasZone.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
},
Expand All @@ -90,7 +89,7 @@ class CentraLite3305S(CustomDevice):
Basic.cluster_id,
Identify.cluster_id,
OccupancySensing.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
],
OUTPUT_CLUSTERS: [Identify.cluster_id],
},
Expand Down
6 changes: 3 additions & 3 deletions zhaquirks/centralite/cl_3310S.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from zigpy.quirks import CustomCluster, CustomDevice
import zigpy.types as t
from zigpy.zcl.clusters.general import Basic, Identify, Ota, PollControl
from zigpy.zcl.clusters.homeautomation import Diagnostic
from zigpy.zcl.clusters.measurement import TemperatureMeasurement

from zhaquirks import PowerConfigurationCluster
Expand All @@ -16,7 +17,6 @@
PROFILE_ID,
)

DIAGNOSTICS_CLUSTER_ID = 0x0B05 # decimal = 2821
SMRT_THINGS_REL_HUM_CLSTR = 0xFC45


Expand Down Expand Up @@ -55,7 +55,7 @@ class CentraLite3310S(CustomDevice):
Identify.cluster_id,
PollControl.cluster_id,
TemperatureMeasurement.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
SmartthingsRelativeHumidityCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Identify.cluster_id, Ota.cluster_id],
Expand All @@ -72,7 +72,7 @@ class CentraLite3310S(CustomDevice):
Identify.cluster_id,
PollControl.cluster_id,
TemperatureMeasurement.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
SmartthingsRelativeHumidityCluster,
],
OUTPUT_CLUSTERS: [Identify.cluster_id, Ota.cluster_id],
Expand Down
10 changes: 5 additions & 5 deletions zhaquirks/centralite/cl_3321S.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import Basic, Identify, Ota, PollControl
from zigpy.zcl.clusters.homeautomation import Diagnostic
from zigpy.zcl.clusters.measurement import TemperatureMeasurement
from zigpy.zcl.clusters.security import IasZone

Expand All @@ -18,7 +19,6 @@
)
from zhaquirks.samjin import SAMJIN

DIAGNOSTICS_CLUSTER_ID = 0x0B05 # decimal = 2821
MANUFACTURER_SPECIFIC_CLUSTER_ID = 0xFC0F # decimal = 64527
MANUFACTURER_SPECIFIC_PROFILE_ID = 0xC2DF # decimal = 49887

Expand Down Expand Up @@ -48,7 +48,7 @@ class CentraLite3321S(CustomDevice):
PollControl.cluster_id,
TemperatureMeasurement.cluster_id,
IasZone.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
CentraLiteAccelCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
Expand All @@ -64,7 +64,7 @@ class CentraLite3321S(CustomDevice):
Basic.cluster_id,
PowerConfigurationCluster.cluster_id,
Identify.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
MANUFACTURER_SPECIFIC_CLUSTER_ID,
],
OUTPUT_CLUSTERS: [Identify.cluster_id],
Expand All @@ -82,7 +82,7 @@ class CentraLite3321S(CustomDevice):
PollControl.cluster_id,
TemperatureMeasurement.cluster_id,
IasZone.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
CentraLiteAccelCluster,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
Expand All @@ -91,7 +91,7 @@ class CentraLite3321S(CustomDevice):
INPUT_CLUSTERS: [
Basic.cluster_id,
Identify.cluster_id,
DIAGNOSTICS_CLUSTER_ID,
Diagnostic.cluster_id,
MANUFACTURER_SPECIFIC_CLUSTER_ID,
],
OUTPUT_CLUSTERS: [Identify.cluster_id],
Expand Down
Loading

0 comments on commit cad654f

Please sign in to comment.