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

Add support for different Paulmann manufacturer name #2695

Merged
merged 1 commit into from Nov 1, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions tests/test_paulmann.py
@@ -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
@@ -1,3 +1,4 @@
"""Paulmann module."""

PAULMANN = "Paulmann LichtGmbH"
PAULMANN_VARIANT = "Paulmann Licht GmbH"
4 changes: 2 additions & 2 deletions zhaquirks/paulmann/fourbtnremote.py
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