Skip to content

Homie compliance phase 2: id, topic and domain validation #92

Open

Description

@dcj

Part of #91. Under the epic's policy these warn in the next release and raise in the minor release after it, since existing devices with, for example, uppercase or underscore ids work today. Line numbers refer to homieiot/convention@7edc221.

  • Device, node and property ids match the topic id format: lowercase a-z, 0-9 and - (:39). Today any string reaches the topic; a / silently changes topic depth and +/# make the publish invalid.
  • Ids beginning with $ are reserved for attributes (:41); a node named $state or a property named $target is rejected.
  • Ids are unique: devices across the tree, nodes per device, properties per node (:194, :294, :326). Today a second node or property with an existing id silently replaces the first, and two branches of a tree can both contain device x.
  • homie_domain is a single valid segment (:156); today a/b is accepted and "" silently becomes ebus.
  • Controller.broadcast() subtopic segments follow the id format (:533).

sanitize_homie_id() stays as an explicit helper; its normalization (collapsing hyphens, mapping _ and .) is documented as SDK behavior, with the note that distinct inputs can collide.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions