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

fix!: Improve bind/bridge/groups parsing and resolving consistency #24432

Merged
merged 6 commits into from
Oct 22, 2024

Conversation

Nerivec
Copy link
Collaborator

@Nerivec Nerivec commented Oct 21, 2024

  • No longer use resolveEntityAndEndpoint for payload parsing (only for topic parsing, better consistency, speed)
    • 'zigbee2mqtt/bridge/request/device/configure_reporting' (same for response)
      • before: {id: 'device/endpoint'}
      • after: {id: 'device', endpoint: 'endpoint'}
    • 'zigbee2mqtt/bridge/request/device/(bind|unbind)' (same for response)
      • before: {from: 'sourceDevice/sourceEndpoint', to: 'target'}
      • after: {from: 'sourceDevice', from_endpoint: 'sourceEndpoint', to: 'target'}

      • before: {from: 'sourceDevice/sourceEndpoint', to: 'targetDevice/targetEndpoint'}
      • after: {from: 'sourceDevice', from_endpoint: 'sourceEndpoint', to: 'targetDevice', to_Endpoint: 'targetEndpoint'}

      • fromEndpoint: 'default' automatically added to response if none supplied in request
    • 'zigbee2mqtt/bridge/request/group/members/(remove|add|remove_all)' (same for response)
      • before: {device: 'device/endpoint', group: 'group'}
      • after: {device: 'device', endpoint: 'endpoint', group: 'group'}
  • Short-circuit unnecessary logic on payload failure for Bind and Groups
  • Cleanup response data payloads for Bind and Groups on error (smaller mqtt footprint, match behavior from other topics)
  • Extract payload parsing/resolving from actual logic for Bind (in parseMQTTMessage)
  • Fix duplicate JSON parsing
  • Improve typing

Note: the remaining resolveEntityAndEndpoint in Groups will get removed by #24338

TODO:

lib/extension/bind.ts Outdated Show resolved Hide resolved
@Koenkk Koenkk merged commit ad1908c into Koenkk:feat/2.0.0 Oct 22, 2024
11 checks passed
@Nerivec Nerivec deleted the improve-bind-bridge-groups branch October 22, 2024 20:01
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.

2 participants