Skip to content

Commit

Permalink
Add support for different Paulmann manufacturer name (#2695)
Browse files Browse the repository at this point in the history
  • Loading branch information
MattFromGer authored Nov 1, 2023
1 parent d1a1b59 commit 8382404
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions tests/test_paulmann.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"""Tests for Paulmann quirks."""

import pytest

import zhaquirks.paulmann.fourbtnremote


def test_fourbtnremote_signature(assert_signature_matches_quirk):
@pytest.mark.parametrize("manufacturer", ("Paulmann LichtGmbH", "Paulmann Licht GmbH"))
def test_fourbtnremote_signature(assert_signature_matches_quirk, manufacturer):
"""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)",
Expand Down Expand Up @@ -39,7 +42,7 @@ def test_fourbtnremote_signature(assert_signature_matches_quirk):
],
},
},
"manufacturer": "Paulmann LichtGmbH",
"manufacturer": manufacturer,
"model": "501.34",
"class": "paulmann.fourbtnremote.PaulmannRemote4Btn",
}
Expand Down
1 change: 1 addition & 0 deletions zhaquirks/paulmann/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Paulmann module."""

PAULMANN = "Paulmann LichtGmbH"
PAULMANN_VARIANT = "Paulmann Licht GmbH"
4 changes: 2 additions & 2 deletions zhaquirks/paulmann/fourbtnremote.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
PROFILE_ID,
SHORT_PRESS,
)
from zhaquirks.paulmann import PAULMANN
from zhaquirks.paulmann import PAULMANN, PAULMANN_VARIANT


class PaulmannRemote4Btn(CustomDevice):
Expand All @@ -49,7 +49,7 @@ class PaulmannRemote4Btn(CustomDevice):
# device_version=0
# input_clusters=[0, 1, 3, 2821, 4096]
# output_clusters=[3, 4, 5, 6, 8, 25, 768, 4096]>
MODELS_INFO: [(PAULMANN, "501.34")],
MODELS_INFO: [(PAULMANN, "501.34"), (PAULMANN_VARIANT, "501.34")],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
Expand Down

0 comments on commit 8382404

Please sign in to comment.