Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 967 Bytes

plugin-api.md

File metadata and controls

40 lines (28 loc) · 967 Bytes

Plugin API

The plugin API is intentionally small in Phase 1 and will become stable only after the first real device integration.

Current lifecycle

A plugin implements:

class Plugin:
    async def start(self, config, mqtt): ...
    async def stop(self): ...

The registry will later map a configuration type to a plugin factory.

Planned responsibilities

A plugin will receive controlled interfaces for:

  • transport subscription and publishing;
  • device registration;
  • datapoint state updates;
  • availability updates;
  • structured logging.

Planned configuration

plugins:
  - id: living_room_dimmer
    type: shelly_dimmer_gen3
    name: Living room light
    mqtt:
      base_topic: shellydimmerg3-dcb4d9c12590

Compatibility policy

The Python plugin API is considered internal before HMBridge 1.0. Configuration formats intended for users should nevertheless be changed cautiously and documented in CHANGELOG.md.