Skip to content

Remove the zha-quirks compatibility shims once a zha-quirks release with the entity APIs is required #980

Open

Description

@zigpy-review-bot

Summary

#919 and #978 added two compatibility shims so that zha-quirks releases without zigpy/zha-device-handlers#5410 keep working. That PR is merged, but the newest zha-quirks release (2.3.0) predates it. The shims can be removed once every zha-quirks version that can run with ZHA includes it. In practice, that is when HA Core pins a zha-quirks release with it and zha's own lock uses one.

Changes

  • from_quirk in ZclPlatformEntity.__init__ (zha/application/platforms/__init__.py, TODO "remove this backwards compatibility shim after zha-device-handlers#5410 is merged"). Only zha-quirks releases before that PR pass this keyword.
  • The deprecated endpoint and targets_cluster on the RSSI/LQI sensors (zha/application/platforms/sensor/__init__.py, TODO "remove once zha-quirks only filters ZclPlatformEntity by endpoint/cluster and HA Core's websocket_get_groupable_devices no longer reads entity.endpoint"). The quirks half is done in Add APIs to directly create ZHA entities zha-device-handlers#5410: EntityFilter only checks endpoint and cluster on ZclPlatformEntity. The HA Core half is still open: websocket_get_groupable_devices (homeassistant/components/zha/websocket_api.py) still filters entities with entity_ref.entity_data.entity.endpoint.id == ep_id.
  • Snapshot: when zha's lock picks up the first zha-quirks release with that PR, regenerate tests/data/devices/frient-a-s-splzb-141-0x00020009.json. The frient quirk now replaces the device temperature entity with WholeDegreeDeviceTemperature. When this was checked against the PR branch, only class_name and suggested_display_precision changed in the snapshot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    code qualityImprovement to code qualityquirksQuirks related

    Type

    Fields

    Priority

    None yet

    Size

    None yet

    Area

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions