Improve lists in integrations [C-D] (#113072)
This commit is contained in:
parent
4d77bec681
commit
c75342bd9a
32 changed files with 276 additions and 311 deletions
|
@ -48,12 +48,12 @@ def setup_platform(
|
|||
rest = CurrencylayerData(_RESOURCE, parameters)
|
||||
|
||||
response = requests.get(_RESOURCE, params=parameters, timeout=10)
|
||||
sensors = []
|
||||
for variable in config[CONF_QUOTE]:
|
||||
sensors.append(CurrencylayerSensor(rest, base, variable))
|
||||
if "error" in response.json():
|
||||
return
|
||||
add_entities(sensors, True)
|
||||
add_entities(
|
||||
(CurrencylayerSensor(rest, base, variable) for variable in config[CONF_QUOTE]),
|
||||
True,
|
||||
)
|
||||
|
||||
|
||||
class CurrencylayerSensor(SensorEntity):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue