{
	"pluginAlias": "enlighten-lux",
	"pluginType": "accessory",
	"singular": false,
	"headerDisplay": "This plugin show the power produced by your Envoy solar system as a light sensor accessory.",
	"schema": {
		"type": "object",
		"properties": {
			"name": {
				"title": "Accessory name",
				"type": "string",
				"required": true,
				"placeholder": "Envoy Power",
				"default": ""
			},
			"connection": {
				"title": "Method",
				"type": "string",
				"default": "bonjour",
				"oneOf": [
					{
						"title": "Bonjour",
						"enum": [
							"bonjour"
						]
					},
					{
						"title": "Custom URL",
						"enum": [
							"url"
						]
					},
					{
						"title": "API",
						"enum": [
							"api"
						]
					}
				],
				"required": true
			},
			"url": {
				"title": "Custom URL",
				"type": "string",
				"condition": {
					"functionBody": "return model.connection === 'url';"
				},
				"placeholder": "http://envoy_ip/production.json"
			},
			"site_id": {
				"title": "Site ID",
				"type": "string",
				"condition": {
					"functionBody": "return model.connection === 'api';"
				}
			},
			"api_key": {
				"title": "API Key",
				"type": "string",
				"condition": {
					"functionBody": "return model.connection === 'api';"
				}
			},
			"api_user_id": {
				"title": "API User ID",
				"type": "string",
				"condition": {
					"functionBody": "return model.connection === 'api';"
				}
			},
			"type": {
				"title": "Choose production values: inverters and eim",
				"type": "string",
				"condition": {
					"functionBody": "return model.connection !== 'api';"
				},
				"default": "eim",
				"oneOf": [
					{
						"title": "eim",
						"enum": [
							"eim"
						]
					},
					{
						"title": "inverters",
						"enum": [
							"inverters"
						]
					}
				],
				"required": true,
				"description": "Please see ReadMe on github fo details"
			},
			"update_interval": {
				"title": "Update interval",
				"type": "integer",
				"default": "5",
				"minimum": 1,
				"description": "Please note that API data is updated only every 15 minutes and access is limited (https://developer.enphase.com/plans). The free plan allowing to make 10'000 requests per month, by default it refreshes every 5 minutes (12 * 24 * 31 = 8928)."
			}
		}
	}
}