Move MQTT discovery information into devices.json.
We inject some "magic" overrides when `devices.json` is created, rather than at runtime; this means that users can update the discovery information directly in their `devices.json` configuration rather than in the code. This way, they can change existing or add new discovery information without needing a code change.
This commit is contained in:
@@ -17,6 +17,7 @@ from Crypto.Hash import SHA256
|
||||
from Crypto.Random import get_random_bytes
|
||||
|
||||
from HCxml2json import xml2json
|
||||
from HADiscovery import augment_device_features
|
||||
|
||||
# These two lines enable debugging at httplib level (requests->urllib3->http.client)
|
||||
# You will see the REQUEST, including HEADERS and DATA, and RESPONSE with HEADERS but without DATA.
|
||||
@@ -310,6 +311,6 @@ for app in account["data"]["homeAppliances"]:
|
||||
|
||||
machine = xml2json(features, description)
|
||||
config["description"] = machine["description"]
|
||||
config["features"] = machine["features"]
|
||||
config["features"] = augment_device_features(machine["features"])
|
||||
|
||||
print(json.dumps(configs, indent=4))
|
||||
|
||||
Reference in New Issue
Block a user