Skip to content

PQ0002 — Command handler without YAML declaration

A handler exists for a command that no device type lists in commands:.

The code can carry out the command. The model never offers it.

public Task Handle(Access.Lock cmd, CancellationToken ct) { ... }   // no device type declares pq.command.access.lock

Why the build warns

The handler is dead code from the model's point of view. No device type advertises the command, so nothing addresses it to this adapter's devices.

How to fix it

Declare the command under the device type that handles it:

- type_id: Door
  commands:
    - pq.command.access.lock

Or delete the handler if the device does not support the command.

If you disagree with a report

Do not suppress it. A wrong report is a bug in the check — report it with the YAML and handler that triggered it.