{
	"pluginAlias": "easee",
	"headerDisplay": "Homebridge plugin for Easee Charger",
	"pluginType": "platform",
	"singular": true,
	"schema": {
		"type": "object",
		"properties": {
			"name": {
				"title": "Accessory Name",
				"description": "Name for this accessory",
				"type": "string",
				"required": true,
				"placeholder": "Easee",
				"default": "Easee"
			},
			"username": {
				"title": "Username",
				"description": "Account email address or phone number",
				"type": "string",
				"placeholder": "username",
				"required": true
			},
			"password": {
				"title": "Password",
				"description": "Account password",
				"type": "string",
				"placeholder": "password",
				"required": true
			},
			"cars": {
			"title": "Cars",
			"type": "array",
			"required": true,
			"items": {
				"title": "Car Info",
				"type": "object",
				"properties": {
						"carName": {
					"title": "Name of your Car",
					"type": "string",
					"minLength": 3,
					"required": false,
							"placeholder": "My EV"
				},
				"chargerName": {
					"title": "Name of your Charger used for this car, reference the logging for exact names",
					"type": "string",
					"minLength": 3,
					"required": false,
							"placeholder": "Easee"
				},
				"kwH": {
					"title": "Battery Size in kwH for this car",
					"type": "integer",
							"required": false,
							"placeholder": 78
						}
					}
				}
			},
			"locationAddress": {
			"title": "Street Address",
			"type": "string",
			"required": false,
			"placeholder": "Leave blank for all locations"
		},
			"showControls": {
				"title": "Show Charger Controls",
				"type": "integer",
				"required": true,
				"default": 0,
				"description": "Select the control type to display in Homkit.",
				"oneOf": [
					{
						"title": "None",
						"enum": [0]
					},
					{
						"title": "Toggle Charging State",
						"enum": [1]
					},
					{
						"title": "Start/Stop Charging Reguires Authorzation to be enabled",
						"enum": [2]
					},
					{
						"title": "Pause/Resume Charging",
						"enum": [3]
					},
					{
						"title": "Full Control in the form of a Fahrenheit Thermostat",
						"enum": [4]
					},
					{
						"title": "Full Control in the form of a Celsius Thermostat",
						"enum": [5]
					}
				]
			},
			"showLight": {
				"title": "Expose Switch for adjusting LED Brightness",
				"type": "boolean",
				"required": true,
				"default": false
			},
			"useOutlet": {
				"title": "Display option in Homekit as outlet, instead of switch",
				"type": "boolean",
				"required": false,
				"default": false
			},
			"showReboot": {
				"title": "Expose Switch to reboot charger",
				"type": "boolean",
				"required": true,
				"default": false
			},
			"showOverride": {
				"title": "Expose Switch to override any exsiting charging schedule and start immediately",
				"type": "boolean",
				"required": true,
				"default": false
			},
			"socSensor": {
				"title": "State of Charge Sensor",
				"type": "boolean",
				"required": false,
				"default": false,
				"description": "Do you want to create a Humidity Sensor for automations based on battery level?"
			},
			"showEqualizer": {
				"title": "Show Equalizer",
				"type": "boolean",
				"required": false,
				"default": false,
				"description": "Do you want to expose a Easee Equalizer if one is installed?"
			},
			"showSignalRMessages": {
				"title": "Show all observation messages",
				"type": "boolean",
				"required": false,
				"default": false,
				"description": "Do you want to log SignalR observations?"
			},
			"showAPIMessages": {
				"title": "Show API responses",
				"type": "boolean",
				"required": false,
				"default": false,
				"description": "Do you want to log API response messages?"
			},
			"experimental": {
				"title": "Experimental Mode",
				"type": "boolean",
				"required": false,
				"default": false,
				"description": "Use max continuous current mode for Equalizer ? (experimental)"
			},
			"eqMin": {
				"title": "Equalizer Min percent",
				"type": "integer",
				"minimum": 15,
				"maximum": 100,
				"required": false,
				"default": 15
			},
			"eqMax": {
				"title": "Equalizer Max percent",
				"type": "integer",
				"minimum": 15,
				"maximum": 100,
				"required": false,
				"default": 100
			}
		}
	},
	"layout": [
		{
			"type": "help",
			"helpvalue": "<h4><b>Required settings<b/></h4>"
		},
		{
			"type": "flex",
			"flex-flow": "row wrap",
			"items": [
				"name"
			]
		},
		{
			"type": "help",
			"helpvalue": "<p class='help-block'> <h6><b>Easee account info login<b></h6></p>"
		},
		{
			"type": "flex",
			"flex-flow": "row wrap",
			"items": [
				"username",
				"password"
			]
		},
		{
      "type": "help",
      "helpvalue": "<h6><b>Location Support</b></h6><p class='help-block'> If you have more than one location and want to display them in separate Homebridge/HomeKit homes you can retrive only the devices at this street address otherwise leave blank.<br/>The address must match the address configured in the Easee app, review the log file to see the adresses as configured in the Easee app.</p>"
    },
    {
      "type": "flex",
      "flex-flow": "row wrap",
      "items": [
        "locationAddress"
      ]
    },
		{
      "type": "help",
      "helpvalue": "<h6><b>Charging Estimate</b></h6><p class='help-block'> The plugin will attempt to calulate in real time the percent charge added based on these values for each car. If no car is added then the display of a battery service will be supressed.<br/></p>"
    },
		{
			"key": "cars",
			"type": "tabarray",
			"title": "{{ value.carName || 'new Car' }}",
			"items": [
				"cars[].carName",
				"cars[].chargerName",
				"cars[].kwH"
					]
		},
		{
			"type": "flex",
			"flex-flow": "row wrap",
			"items": [
				"showControls",
				"useOutlet"
			]
		},
		{
			"type": "fieldset",
			"title": "Options",
			"description": "Expand to select addition options",
			"expandable": true,
			"flex-flow": "row wrap",
			"items": [
				"showLight",
				"showReboot",
				"showOverride",
				"socSensor",
				"showEqualizer",
				"experimental",
				"eqMin",
				"eqMax"
			]
		},
		{
			"type": "fieldset",
			"title": "Debug logging",
			"description": "Expand to enable additional debug logging",
			"expandable": true,
			"flex-flow": "row wrap",
			"items": [
				"showAPIMessages",
				"showSignalRMessages"
			]
		}
	]
}