add-on repo
@ -54,15 +54,15 @@ USER1_SEX | string | Yes | male / female
|
|||||||
USER1_NAME | string | Yes | Name of the user
|
USER1_NAME | string | Yes | Name of the user
|
||||||
USER1_HEIGHT | int | Yes | Height (in cm) of the user
|
USER1_HEIGHT | int | Yes | Height (in cm) of the user
|
||||||
USER1_DOB | string | Yes | DOB (in yyyy-mm-dd format)
|
USER1_DOB | string | Yes | DOB (in yyyy-mm-dd format)
|
||||||
USER2_LT | int | No | If the weight is less than this number, we'll assume that we're weighing User #2
|
USER2_LT | int | No | If the weight is less than this number, we'll assume that we're weighing User #2. Defaults to USER1_GT Value
|
||||||
USER2_SEX | string | No | male / female
|
USER2_SEX | string | No | male / female. Defaults to female
|
||||||
USER2_NAME | string | No | Name of the user
|
USER2_NAME | string | No | Name of the user. Defaults to Serena
|
||||||
USER2_HEIGHT | int | No |Height (in cm) of the user
|
USER2_HEIGHT | int | No |Height (in cm) of the user. Defaults to 95
|
||||||
USER2_DOB | string | No | DOB (in yyyy-mm-dd format)
|
USER2_DOB | string | No | DOB (in yyyy-mm-dd format). Defaults to 1990-01-01
|
||||||
USER3_SEX | string | No | male / female
|
USER3_SEX | string | No | male / female. Defaults to female
|
||||||
USER3_NAME | string | No | Name of the user
|
USER3_NAME | string | No | Name of the user. Defaults to Missy
|
||||||
USER3_HEIGHT | int | No |Height (in cm) of the user
|
USER3_HEIGHT | int | No |Height (in cm) of the user. Defaults to 150
|
||||||
USER3_DOB | string | No | DOB (in yyyy-mm-dd format)
|
USER3_DOB | string | No | DOB (in yyyy-mm-dd format). Defaults to 1990-01-01
|
||||||
|
|
||||||
|
|
||||||
7. Start the add-on
|
7. Start the add-on
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
@ -17,8 +17,8 @@
|
|||||||
"MISCALE_MAC": "00:00:00:00:00:00",
|
"MISCALE_MAC": "00:00:00:00:00:00",
|
||||||
"MQTT_PREFIX": "miScale",
|
"MQTT_PREFIX": "miScale",
|
||||||
"MQTT_HOST": "192.168.0.1",
|
"MQTT_HOST": "192.168.0.1",
|
||||||
"MQTT_USERNAME": "",
|
"MQTT_USERNAME": "user",
|
||||||
"MQTT_PASSWORD": "",
|
"MQTT_PASSWORD": "passwd",
|
||||||
"MQTT_PORT": 1883,
|
"MQTT_PORT": 1883,
|
||||||
"TIME_INTERVAL": 30,
|
"TIME_INTERVAL": 30,
|
||||||
"MQTT_DISCOVERY": true,
|
"MQTT_DISCOVERY": true,
|
||||||
@ -43,16 +43,16 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
"schema": {
|
"schema": {
|
||||||
"HCI_DEV": "str",
|
"HCI_DEV": "str?",
|
||||||
"MISCALE_MAC": "str",
|
"MISCALE_MAC": "str",
|
||||||
"MQTT_PREFIX": "str",
|
"MQTT_PREFIX": "str?",
|
||||||
"MQTT_HOST": "str",
|
"MQTT_HOST": "str",
|
||||||
"MQTT_USERNAME": "str",
|
"MQTT_USERNAME": "str?",
|
||||||
"MQTT_PASSWORD": "str",
|
"MQTT_PASSWORD": "str?",
|
||||||
"MQTT_PORT": "int",
|
"MQTT_PORT": "int?",
|
||||||
"TIME_INTERVAL": "int",
|
"TIME_INTERVAL": "int?",
|
||||||
"MQTT_DISCOVERY": "bool",
|
"MQTT_DISCOVERY": "bool?",
|
||||||
"MQTT_DISCOVERY_PREFIX": "str",
|
"MQTT_DISCOVERY_PREFIX": "str?",
|
||||||
|
|
||||||
"USER1_GT": "int",
|
"USER1_GT": "int",
|
||||||
"USER1_SEX": "str",
|
"USER1_SEX": "str",
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
@ -28,34 +28,126 @@ try:
|
|||||||
with open('/data/options.json') as json_file:
|
with open('/data/options.json') as json_file:
|
||||||
sys.stdout.write(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - Loading Config From Add-On Options...\n")
|
sys.stdout.write(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - Loading Config From Add-On Options...\n")
|
||||||
data = json.load(json_file)
|
data = json.load(json_file)
|
||||||
|
try:
|
||||||
MISCALE_MAC = data["MISCALE_MAC"]
|
MISCALE_MAC = data["MISCALE_MAC"]
|
||||||
MQTT_USERNAME = None if(data["MQTT_USERNAME"] == "") else data["MQTT_USERNAME"]
|
except:
|
||||||
MQTT_PASSWORD = None if(data["MQTT_PASSWORD"] == "") else data["MQTT_PASSWORD"]
|
sys.stderr.write(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - MAC Address not provided...\n")
|
||||||
|
raise
|
||||||
|
try:
|
||||||
|
MQTT_USERNAME = data["MQTT_USERNAME"]
|
||||||
|
except:
|
||||||
|
MQTT_USERNAME = None
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
MQTT_PASSWORD = data["MQTT_PASSWORD"]
|
||||||
|
except:
|
||||||
|
MQTT_PASSWORD = None
|
||||||
|
pass
|
||||||
|
try:
|
||||||
MQTT_HOST = data["MQTT_HOST"]
|
MQTT_HOST = data["MQTT_HOST"]
|
||||||
|
except:
|
||||||
|
sys.stderr.write(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - MQTT Host not provided...\n")
|
||||||
|
raise
|
||||||
|
try:
|
||||||
MQTT_PORT = int(data["MQTT_PORT"])
|
MQTT_PORT = int(data["MQTT_PORT"])
|
||||||
|
except:
|
||||||
|
MQTT_PORT = 1883
|
||||||
|
pass
|
||||||
|
try:
|
||||||
MQTT_PREFIX = data["MQTT_PREFIX"]
|
MQTT_PREFIX = data["MQTT_PREFIX"]
|
||||||
|
except:
|
||||||
|
MQTT_PREFIX = "miScale"
|
||||||
|
pass
|
||||||
|
try:
|
||||||
TIME_INTERVAL = int(data["TIME_INTERVAL"])
|
TIME_INTERVAL = int(data["TIME_INTERVAL"])
|
||||||
|
except:
|
||||||
|
TIME_INTERVAL = 30
|
||||||
|
pass
|
||||||
|
try:
|
||||||
MQTT_DISCOVERY = data["MQTT_DISCOVERY"]
|
MQTT_DISCOVERY = data["MQTT_DISCOVERY"]
|
||||||
|
except:
|
||||||
|
MQTT_DISCOVERY = True
|
||||||
|
pass
|
||||||
|
try:
|
||||||
MQTT_DISCOVERY_PREFIX = data["MQTT_DISCOVERY_PREFIX"]
|
MQTT_DISCOVERY_PREFIX = data["MQTT_DISCOVERY_PREFIX"]
|
||||||
|
except:
|
||||||
|
MQTT_DISCOVERY_PREFIX = "homeassistant"
|
||||||
|
pass
|
||||||
|
try:
|
||||||
HCI_DEV = data["HCI_DEV"][-1]
|
HCI_DEV = data["HCI_DEV"][-1]
|
||||||
|
except:
|
||||||
# User Variables...
|
HCI_DEV = "hci0"[-1]
|
||||||
|
pass
|
||||||
|
try:
|
||||||
USER1_GT = int(data["USER1_GT"])
|
USER1_GT = int(data["USER1_GT"])
|
||||||
|
except:
|
||||||
|
sys.stderr.write(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - USER1_GT not provided...\n")
|
||||||
|
raise
|
||||||
|
try:
|
||||||
USER1_SEX = data["USER1_SEX"]
|
USER1_SEX = data["USER1_SEX"]
|
||||||
|
except:
|
||||||
|
sys.stderr.write(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - USER1_SEX not provided...\n")
|
||||||
|
raise
|
||||||
|
try:
|
||||||
USER1_NAME = data["USER1_NAME"]
|
USER1_NAME = data["USER1_NAME"]
|
||||||
|
except:
|
||||||
|
sys.stderr.write(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - USER1_NAME not provided...\n")
|
||||||
|
raise
|
||||||
|
try:
|
||||||
USER1_HEIGHT = int(data["USER1_HEIGHT"])
|
USER1_HEIGHT = int(data["USER1_HEIGHT"])
|
||||||
|
except:
|
||||||
|
sys.stderr.write(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - USER1_HEIGHT not provided...\n")
|
||||||
|
raise
|
||||||
|
try:
|
||||||
USER1_DOB = data["USER1_DOB"]
|
USER1_DOB = data["USER1_DOB"]
|
||||||
|
except:
|
||||||
|
sys.stderr.write(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - USER1_DOB not provided...\n")
|
||||||
|
raise
|
||||||
|
try:
|
||||||
USER2_LT = int(data["USER2_LT"])
|
USER2_LT = int(data["USER2_LT"])
|
||||||
|
except:
|
||||||
|
USER2_LT = USER1_GT
|
||||||
|
pass
|
||||||
|
try:
|
||||||
USER2_SEX = data["USER2_SEX"]
|
USER2_SEX = data["USER2_SEX"]
|
||||||
|
except:
|
||||||
|
USER2_SEX = "female"
|
||||||
|
pass
|
||||||
|
try:
|
||||||
USER2_NAME = data["USER2_NAME"]
|
USER2_NAME = data["USER2_NAME"]
|
||||||
|
except:
|
||||||
|
USER2_NAME = "Serena"
|
||||||
|
pass
|
||||||
|
try:
|
||||||
USER2_HEIGHT = int(data["USER2_HEIGHT"])
|
USER2_HEIGHT = int(data["USER2_HEIGHT"])
|
||||||
|
except:
|
||||||
|
USER2_HEIGHT = 95
|
||||||
|
pass
|
||||||
|
try:
|
||||||
USER2_DOB = data["USER2_DOB"]
|
USER2_DOB = data["USER2_DOB"]
|
||||||
|
except:
|
||||||
|
USER2_DOB = "1990-01-01"
|
||||||
|
pass
|
||||||
|
try:
|
||||||
USER3_SEX = data["USER3_SEX"]
|
USER3_SEX = data["USER3_SEX"]
|
||||||
|
except:
|
||||||
|
USER3_SEX = "female"
|
||||||
|
pass
|
||||||
|
try:
|
||||||
USER3_NAME = data["USER3_NAME"]
|
USER3_NAME = data["USER3_NAME"]
|
||||||
|
except:
|
||||||
|
USER3_NAME = "Missy"
|
||||||
|
pass
|
||||||
|
try:
|
||||||
USER3_HEIGHT = int(data["USER3_HEIGHT"])
|
USER3_HEIGHT = int(data["USER3_HEIGHT"])
|
||||||
|
except:
|
||||||
|
USER3_HEIGHT = 150
|
||||||
|
pass
|
||||||
|
try:
|
||||||
USER3_DOB = data["USER3_DOB"]
|
USER3_DOB = data["USER3_DOB"]
|
||||||
|
except:
|
||||||
|
USER3_DOB = "1990-01-01"
|
||||||
|
pass
|
||||||
sys.stdout.write(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - Config Loaded...\n")
|
sys.stdout.write(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - Config Loaded...\n")
|
||||||
|
|
||||||
# Failed to open options.json, Loading Config From Environment (Not HA Add-On)
|
# Failed to open options.json, Loading Config From Environment (Not HA Add-On)
|
5
repository.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"name": "Lolouk44 Add-Ons",
|
||||||
|
"url": "https://github.com/lolouk44/hassio-addons",
|
||||||
|
"maintainer": "lolouk44"
|
||||||
|
}
|