Convert nut to a multi step config flow (#33803)

* Convert nut to a multi step config flow

* Users can now choose the ups they want in
step 2 (or skipped if only one)

* Users can now select the resources they want
to monitor based on what is actually available
on the device

* CONF_NAME has been removed as we now get the
name from NUT

* Device classes have been added which allows
the battery charge state to be seen in the
devices UI

* Remove update_interval as its for a followup PR

* explict

* reduce

* fix bug, add tests for options flow

* Test for dupe import

* Test for dupe import

* Call step directly

* Update homeassistant/components/nut/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
J. Nick KostonandMartin Hjelmare authored and GitHub committed 2020-04-08 11:45:45 -05:00
1 parent db9b6aba31
commit 7383e81609
7 files changed
+482 -160

No files matched your search

+14 -5
View File
@@ -4,14 +4,23 @@
"step": {
"user": {
"title": "Connect to the NUT server",
"description": "If there are multiple UPSs attached to the NUT server, enter the name UPS to query in the 'Alias' field.",
"data": {
"name": "Name",
"host": "Host",
"port": "Port",
"alias": "Alias",
"username": "Username",
"password": "Password",
"password": "Password"
}
},
"ups": {
"title": "Choose the UPS to Monitor",
"data": {
"alias": "Alias",
"resources": "Resources"
}
},
"resources": {
"title": "Choose the Resources to Monitor",
"data": {
"resources": "Resources"
}
}
@@ -27,7 +36,7 @@
"options": {
"step": {
"init": {
"description": "Choose Sensor Resources",
"description": "Choose Sensor Resources.",
"data": {
"resources": "Resources"
}