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

Remove LevelControl cluster for TRADFRI plug #2594

Merged
merged 2 commits into from
Sep 26, 2023
Merged

Conversation

MattWestb
Copy link
Contributor

@MattWestb MattWestb commented Sep 18, 2023

Proposed change

This removes the LevelControl cluster for the IKEA TRADFRI plug to not create the on_level and other settings entities in ZHA, as that can cause confusion about whether or not the on/off plug is a dimmer.

Additional information

The original quirk for older firmware already removed the LevelControl cluster. This PR also does it for newer firmware versions.
See home-assistant/core#100454 for context

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify that the new code works

The original quirk was doing it but later firmware have change the signature so it was not working.
@MattWestb
Copy link
Contributor Author

For historical information on firmware 2.3.089 the signature is without quirk:

{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.FullFunctionDevice|MainsPowered|RxOnWhenIdle|AllocateAddress: 142>, manufacturer_code=4476, 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=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x010a",
      "input_clusters": [
        "0x0000",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x0008",
        "0x1000"
      ],
      "output_clusters": [
        "0x0005",
        "0x0019",
        "0x0020",
        "0x1000"
      ]
    },
    "242": {
      "profile_id": "0xa1e0",
      "device_type": "0x0061",
      "input_clusters": [
        "0x0021"
      ],
      "output_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "IKEA of Sweden",
  "model": "TRADFRI control outlet",
  "class": "zigpy.device.Device"
}

@TheJulianJES TheJulianJES changed the title Deleting the level cluster Remove LevelControl cluster for TRADFRI plug Sep 18, 2023
@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (7745c83) 86.54% compared to head (9f847f5) 86.54%.
Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #2594   +/-   ##
=======================================
  Coverage   86.54%   86.54%           
=======================================
  Files         276      276           
  Lines        8502     8505    +3     
=======================================
+ Hits         7358     7361    +3     
  Misses       1144     1144           
Files Changed Coverage Δ
zhaquirks/ikea/tradfriplug.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TheJulianJES
Copy link
Collaborator

This will mark all LevelControl configuration entities for existing devices as "unavailable/no longer provided".
I think that should be fine though(?), as they were useless before.

@MattWestb
Copy link
Contributor Author

I dont need it but some users is not liking not working GUI entries and its looks working OK after deleting and adding the plug new (so ZHA is deleting the old cluster in the DB).

@TheJulianJES TheJulianJES merged commit 7385465 into zigpy:dev Sep 26, 2023
14 checks passed
@MattWestb
Copy link
Contributor Author

Thanks J

@MattWestb MattWestb deleted the patch-1 branch September 27, 2023 06:45
elupus pushed a commit to elupus/zha-device-handlers that referenced this pull request Jan 17, 2024
lgraf pushed a commit to lgraf/zha-device-handlers that referenced this pull request May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants