Fix loading flume integration (#29926)
* Fix https://github.com/home-assistant/home-assistant/issues/29853 * Run script.gen_requirements * Update to store Token File in config directory * Update to store Token File in config directory * Update to store Token File in config directorypull/30056/head
parent
f1d22db009
commit
9836e78120
|
@ -3,9 +3,9 @@
|
|||
"name": "Flume",
|
||||
"documentation": "https://www.home-assistant.io/integrations/flume/",
|
||||
"requirements": [
|
||||
"pyflume==0.2.1"
|
||||
"pyflume==0.2.4"
|
||||
],
|
||||
"dependencies": [],
|
||||
"codeowners": ["@ChrisMandich"]
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -37,11 +37,14 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
password = config[CONF_PASSWORD]
|
||||
client_id = config[CONF_CLIENT_ID]
|
||||
client_secret = config[CONF_CLIENT_SECRET]
|
||||
flume_token_file = hass.config.path("FLUME_TOKEN_FILE")
|
||||
time_zone = str(hass.config.time_zone)
|
||||
name = config[CONF_NAME]
|
||||
flume_entity_list = []
|
||||
|
||||
flume_devices = FlumeDeviceList(username, password, client_id, client_secret)
|
||||
flume_devices = FlumeDeviceList(
|
||||
username, password, client_id, client_secret, flume_token_file
|
||||
)
|
||||
|
||||
for device in flume_devices.device_list:
|
||||
if device["type"] == FLUME_TYPE_SENSOR:
|
||||
|
@ -53,6 +56,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
device["id"],
|
||||
time_zone,
|
||||
SCAN_INTERVAL,
|
||||
flume_token_file,
|
||||
)
|
||||
flume_entity_list.append(FlumeSensor(flume, f"{name} {device['id']}"))
|
||||
|
||||
|
|
|
@ -1231,7 +1231,7 @@ pyflexit==0.3
|
|||
pyflic-homeassistant==0.4.dev0
|
||||
|
||||
# homeassistant.components.flume
|
||||
pyflume==0.2.1
|
||||
pyflume==0.2.4
|
||||
|
||||
# homeassistant.components.flunearyou
|
||||
pyflunearyou==1.0.3
|
||||
|
|
Loading…
Reference in New Issue