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

    Class CoverInfo

    Cover specific information

    Hierarchy (View Summary)

    Index

    Properties

    component: "cover" = 'cover'

    One of the supported MQTT components, for instance binary_sensor

    device?: DeviceInfo

    Information about the device this sensor belongs to

    deviceClass?: string

    Sets the class of the device, changing the device state and icon that is displayed on the frontend.

    enabledByDefault?: boolean

    Flag which defines if the entity should be enabled when first added.

    entityCategory?: string

    Classification of a non-primary entity.

    expireAfter?: number

    If set, it defines the number of seconds after the sensor’s state expires, if it’s not updated. After expiry, the sensor’s state becomes unavailable. Default the sensors state never expires.

    forceUpdate?: boolean

    Sends update events even if the value hasn’t changed. Useful if you want to have meaningful value graphs in history.

    icon?: string

    Icon of the entity

    name: string

    Name of the sensor inside Home Assistant

    objectId?: string

    Set this to generate the entity_id in HA instead of using name

    optimistic?: boolean

    Flag that defines if light works in optimistic mode. Default: true if no state_topic defined, else false.

    payloadClose: "CLOSE" = 'CLOSE'

    Command payload to close the cover

    payloadOpen: string = 'OPEN'

    Command payload to open the cover

    payloadStop: string = 'STOP'

    Command payload to stop the cover

    positionClosed: number = 0

    Number which represents the fully closed position

    positionOpen: number = 100

    Number which represents the fully open position

    qos?: number

    The maximum QoS level to be used when receiving messages.

    retain?: boolean

    If the published message should have the retain flag on or not

    stateClosed: string = 'closed'

    Payload that represents a closed state

    stateClosing: string = 'closing'

    Payload that represents closing state

    stateOpen: string = 'open'

    Payload that represents open state

    stateOpening: string = 'opening'

    Payload that represents opening state

    stateStopped: string = 'stopped'

    Payload that represents stopped state

    stateTopic?: string

    The MQTT topic subscribed to receive state updates.

    uniqueId?: string

    Set this to enable editing sensor from the HA ui and to integrate with a device

    Accessors

    Methods

    • Generates a JSON object that can be used as an MQTT payload.

      Returns Record<string, unknown>

    • Mapping of class properties to MQTT payload keys.

      Returns {
          component: "component";
          device: "device";
          deviceClass: "device_class";
          enabledByDefault: "enabled_by_default";
          entityCategory: "entity_category";
          expireAfter: "expire_after";
          forceUpdate: "force_update";
          icon: "icon";
          name: "name";
          objectId: "object_id";
          optimistic: "optimistic";
          payloadClose: "payload_close";
          payloadOpen: "payload_open";
          payloadStop: "payload_stop";
          positionClosed: "position_closed";
          positionOpen: "position_open";
          qos: "qos";
          retain: "retain";
          stateClosed: "state_closed";
          stateClosing: "state_closing";
          stateOpen: "state_open";
          stateOpening: "state_opening";
          stateStopped: "state_stopped";
          stateTopic: "state_topic";
          uniqueId: "unique_id";
      }