Class StringCharacteristic

    • Method Detail

      • makeBuilder

        protected CompletableFuture<javax.json.JsonObjectBuilder> makeBuilder​(int iid)
        Creates the JSON serialized form of the accessory for use over the HomeKit Accessory Protocol.
        Overrides:
        makeBuilder in class BaseCharacteristic<String>
        Parameters:
        iid - the static id of the accessory.
        Returns:
        a future that will complete with the JSON builder for the object.
      • convert

        public String convert​(javax.json.JsonValue jsonValue)
        Converts from the JSON value to a Java object of the type T
        Specified by:
        convert in class BaseCharacteristic<String>
        Parameters:
        jsonValue - the JSON value to convert from.
        Returns:
        the converted Java object.
      • setValue

        public void setValue​(String value)
                      throws Exception
        Update the characteristic value using a new value supplied by the connected client.
        Specified by:
        setValue in class BaseCharacteristic<String>
        Parameters:
        value - the new value to set.
        Throws:
        Exception - if the value cannot be set.
      • getDefault

        public String getDefault()
        Supplies a default value for the characteristic to send to connected clients when the real value. cannot be retrieved.
        Specified by:
        getDefault in class BaseCharacteristic<String>
        Returns:
        a sensible default value.