@ginden/ha-mqtt-discoverable
    Preparing search index...

    Class Image

    Implements an MQTT image for Home Assistant discovery

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    attributesTopic: string
    availabilityTopic?: string
    configTopic: string
    entity: ImageInfo
    entityTopic: string
    stateTopic: string
    wroteConfiguration: boolean = false

    Accessors

    • get mqtt(): MqttClient

      Returns MqttClient

    Methods

    • Parameters

      • state: null | string | number | Buffer<ArrayBufferLike> = null
      • topic: null | string = null
      • last_reset: null | string = null
      • retain: boolean = true

      Returns Promise<undefined | Packet>

    • Returns {
          availability_topic?: string;
          json_attributes_topic: string;
          state_topic: string;
      }

    • Parameters

      • attributes: Record<string, unknown>

      Returns Promise<undefined | Packet>

    • This method will throw an error if the availability topic is not set

      Parameters

      • available: boolean

      Returns Promise<undefined | Packet>

    • Update the image URL

      Parameters

      • imageUrl: string

      Returns Promise<undefined | Packet>