<commit_before>/**
 *  smartthings.groovy
 *
 *  <NAME>
 *  IOTDB.org
 *  2014-02-01
 *
 *  Allow control of your SmartThings via an API; 
 *  Allow monitoring of your SmartThings using
 *  MQTT through the IOTDB MQTT Bridge.
 *
 *  Follow us on Twitter:
 *  - @iotdb
 *  - @dpjanes
 *
 *  A work in progress!
 *
 *  This is for SmartThing's benefit. There's no need to 
 *  change this unless you really want to
 */
 
definition(
    name: "IOTDB.bridge",
    namespace: "",
    author: "<NAME>",
    description: "Bridge to/from JSON/MQTT.",
    category: "My Apps",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience%402x.png",
    oauth: true)
    
/* --- IOTDB section --- */
/*
 *  IOTDB MQTT Bridge
 *  - this works for now
 *  - your life is private
 *  - just set to empty values to turn off MQTT
 *
 *  The values below can be copied from this page
 *  - https://iotdb.org/playground/mqtt/bridge
 *
 *  Make sure you are logged into IOTDB first
 */
def _settings()
{
    [ 
		iotdb_api_username: "",
        iotdb_api_key: ""
    ]
}

    

/* --- setup section --- */
/*
 *  The user 
 *  Make sure that if you change anything related to this in the code
 *  that you update the preferences in your installed apps.
 *
 *  Note that there's a SmartThings magic that's _required_ here,
 *  in that you cannot access a device unless you have it listed
 *  in the preferences. Access to those devices is given through
 *  the name used here (i.e. d_*)
 */
preferences {
    section("Allow IOTDB to Control & Access These Things...") {
        input "d_switch", "capability.switch", title: "Switch", multiple: true
        input "d_motion", "capability.motionSensor", title: "Motion", required: false, multiple: true
        input "d_temperature", "capability.temperatureMeasurement", title: "Temperature", multiple: true
        input "d_contact", "capability.contactSensor", title: "Contact", required: false, multiple: true
        input "d_acceleration", "capability.accelerationSensor", title: "Acceleration", required: false, multiple: true
        input "d_presence", "capability.presenceSensor", title: "Presence", required: false, multiple: true
        input "d_battery", "capability.battery", title: "Battery", multiple: true
        input "d_threeAxis", "capability.threeAxis", title: "3 Axis", multiple: true
    }
}

/*
input "d_alarm", "capability.alarm", title: "alarm", multiple: true
input "d_configuration", "capability.configuration", title: "configuration", multiple: true
input "d_illuminanceMeasurement", "capability.illuminanceMeasurement", title: "illuminanceMeasurement", multiple: true
input "d_polling", "capability.polling", title: "polling", multiple: true<commit_msg>added "required: false"<commit_after>/**
 *  smartthings.groovy
 *
 *  <NAME>
 *  IOTDB.org
 *  2014-02-01
 *
 *  Allow control of your SmartThings via an API; 
 *  Allow monitoring of your SmartThings using
 *  MQTT through the IOTDB MQTT Bridge.
 *
 *  Follow us on Twitter:
 *  - @iotdb
 *  - @dpjanes
 *
 *  A work in progress!
 *
 *  This is for SmartThing's benefit. There's no need to 
 *  change this unless you really want to
 */
 
definition(
    name: "IOTDB.bridge",
    namespace: "",
    author: "<NAME>",
    description: "Bridge to/from JSON/MQTT.",
    category: "My Apps",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience%402x.png",
    oauth: true)
    
/* --- IOTDB section --- */
/*
 *  IOTDB MQTT Bridge
 *  - this works for now
 *  - your life is private
 *  - just set to empty values to turn off MQTT
 *
 *  The values below can be copied from this page
 *  - https://iotdb.org/playground/mqtt/bridge
 *
 *  Make sure you are logged into IOTDB first
 */
def _settings()
{
    [ 
		iotdb_api_username: "",
        iotdb_api_key: ""
    ]
}

    

/* --- setup section --- */
/*
 *  The user 
 *  Make sure that if you change anything related to this in the code
 *  that you update the preferences in your installed apps.
 *
 *  Note that there's a SmartThings magic that's _required_ here,
 *  in that you cannot access a device unless you have it listed
 *  in the preferences. Access to those devices is given through
 *  the name used here (i.e. d_*)
 */
preferences {
    section("Allow IOTDB to Control & Access These Things...") {
        input "d_switch", "capability.switch", title: "Switch", required: false, multiple: true
        input "d_motion", "capability.motionSensor", title: "Motion", required: false, required: false, multiple: true
        input "d_temperature", "capability.temperatureMeasurement", title: "Temperature", required: false, multiple: true
        input "d_contact", "capability.contactSensor", title: "Contact", required: false, required: false, multiple: true
        input "d_acceleration", "capability.accelerationSensor", title: "Acceleration", required: false, multiple: true
        input "d_presence", "capability.presenceSensor", title: "Presence", required: false, multiple: true
        input "d_battery", "capability.battery", title: "Battery", required: false, multiple: true
        input "d_threeAxis", "capability.threeAxis", title: "3 Axis", required: false, multiple: true
    }
}

/*
input "d_alarm", "capability.alarm", title: "alarm", multiple: true
input "d_configuration", "capability.configuration", title: "configuration", multiple: true
input "d_illuminanceMeasurement", "capability.illuminanceMeasurement", title: "illuminanceMeasurement", multiple: true
input "d_polling", "capability.polling", title: "polling", multiple: true
{'fraction_non_alphanumeric': 0.12339465463380771, 'fraction_numerical': 0.0052065255119750084, 'mean_word_length': 3.491816056118472, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7176813', 'n_tokens_mistral': 1836, 'n_tokens_neox': 1771, 'n_words': 571}