yenoiwesa / homebridge-daikin-airbase

A Homebridge plugin for the Daikin Airbase WiFi module
Apache License 2.0
21 stars 4 forks source link

[Idea] add config schema for homebridge-config-ui-x plugin #5

Closed TimofeyK closed 4 years ago

TimofeyK commented 4 years ago

Your plugin is truly plug and play but users still need adding platform block in the config.json

homebridge-config-ui-x plugin supports automatic generation of config blocks based on config schema

https://github.com/oznu/homebridge-config-ui-x/wiki/Developers%3A-Plugin-Settings-GUI

yenoiwesa commented 4 years ago

Hi @TimofeyK,

I just published release v2.0.2 with the JSON schema.

I don't use Homebridge UI myself, so please let me know if it works :-)

TimofeyK commented 4 years ago

This didn’t work - the UI does not show Settings button for the plugin

I can’t find the file config.schema.json in plugin’s folder

yenoiwesa commented 4 years ago

Huh my bad, I was excluding every file that is not part of the source in my package.json file 😞 I unpublished release v2.0.2 and published a new v2.0.3 that does include the file.

TimofeyK commented 4 years ago

OK, the file is there now and the UI can read it. I fixed the plugin ID and added two other parameters:

{
    "pluginAlias": "DaikinAirbase",
    "pluginType": "platform",
    "singular": true,
    "headerDisplay": "Homebridge plugin for the Daikin Airbase WiFi module",
    "footerDisplay": "",
    "schema": {
        "type": "object",
        "properties": {
            "name": {
                "title": "Plugin Name",
                "description": "Plugin name as displayed in the homebridge log.",
                "type": "string",
                "required": true,
                "default": "Daikin Airbase"
            },
            "hostname": {
                "title": "Host Name",
                "description": "The hostname of the controller.",
                "type": "string",
                "required": false,
                "default": ""
            },
            "pollingInterval": {
                "title": "Polling Interval",
                "description": "The polling interval for refreshing the platform's accessories state for automations, in minutes. By detault set to 5 minutes, it can be set to 0 to disable polling.",
                "type": "integer",
                "required": false,
                "default": ""
            }
        }
    }
}

DE178B95-85AB-444E-81FA-BDD667FA6283

yenoiwesa commented 4 years ago

I didn't put these two options in the UI on purpose because they're supposed to be for advanced users only. Maybe I should add them but hidden into an advanced settings panel?

TimofeyK commented 4 years ago

Good idea. I didn’t thought about that

yenoiwesa commented 4 years ago

I just published version 2.0.4 of the plugin with the advanced settings section in the configuration schema.

Let me know how that works :-)

TimofeyK commented 4 years ago

You need to remove dash in the PluginAlias

TimofeyK commented 4 years ago

With the dash removed (as in my example above) so the platform name is matching the plugin: F65A3136-8439-4822-A128-CA5C0F81B34C

yenoiwesa commented 4 years ago

Fixed in release 2.0.5

TimofeyK commented 4 years ago

Oh, no! This was the last issue. What are we going to do now?! 😁

yenoiwesa commented 4 years ago

Haha, I know!

Oh well, probably time for me to do some refactoring on my homebridge somfy connexoon plugin, I learned a few things about homekit writting this one that I didn't know at the time!

Thanks a lot for your help working with me on this plugin @TimofeyK, hope many people will be able to enjoy our work :-)