Protocol::HAP::Accessory(3p) Perl Library Manual Protocol::HAP::Accessory(3p)

Protocol::HAP::Accessory - base class for HAP accessories

    use Protocol::HAP::Accessory;
    my $accessory = Protocol::HAP::Accessory->new(
        aid => 1,
        name => 'My Accessory',
        manufacturer => 'Acme Corp',
        model => 'Model X',
    );
    $accessory->add_service($service);

This module supplies the base class for HomeKit accessories. Each accessory holds the necessary Accessory Information service.

The constructor takes an optional "logger" argument: an object with "debug", "info", "warning", and "error" methods that take printf-style arguments. The default is the null logger of Protocol::HAP, which drops every message.

The accessory passes its logger to the services and characteristics it builds itself, such as the Accessory Information service. It never touches the logger of an object it receives.

Protocol::HAP, Protocol::HAP::Service, spec/HAP.md

2026-08-18 OpenBSD