smockle-archive / homebridge-lutron-caseta

Homebridge plugin for integration with the Lutron Caséta SmartBridge Pro
Other
14 stars 9 forks source link

Plugin Settings GUI support (w/ attached attempt) #46

Closed jmissig closed 4 years ago

jmissig commented 4 years ago

New-style plugins can be configured in a settings GUI.

I made a config.schema.json. It works for me. Haven’t really verified it beyond that.

config.schema.json.zip

{
   "pluginAlias":"LutronCasetaPlatform",
   "pluginType":"platform",
   "singular":true,
   "schema":{
      "type":"object",
      "properties":{
         "bridgeConnection":{
            "type":"object",
            "properties":{
               "host":{
                  "type":"string",
                  "required":true,
                  "format":"hostname"
               }
            }
         },
         "accessories":{
            "type":"array",
            "items":{
               "title":"Pico Remote Config",
               "type":"object",
               "properties":{
                  "name":{
                     "type":"string",
                     "required":true
                  },
                  "type":{
                     "type":"string",
                     "oneOf":[
                        { "title":"PJ2-2B", "enum":["PJ2-2B"] },
                        { "title":"PJ2-3B", "enum":["PJ2-3B"] },
                        { "title":"PJ2-3BRL", "enum":["PJ2-3BRL"] },
                        { "title":"PJ2-4B", "enum":["PJ2-4B"] },
                        { "title":"PICO-REMOTE", "enum":["PICO-REMOTE"] }
                     ],
                     "required":true
                  },
                  "integrationID":{
                     "type":"integer",
                     "required":true
                  }
               }
            }
         }
      }
   }
}
smockle commented 4 years ago

@jmissig If you open a PR, I’d be happy to merge it and publish a new version with this included.

smockle commented 4 years ago

Fixed by #47

smockle commented 4 years ago

Published version 3.0.6, which includes these changes. I verified that the config.schema.json is included in the package: https://unpkg.com/browse/homebridge-lutron-caseta-smockle@3.0.6/.