Clean up
This commit is contained in:
parent
9cf9bc11d3
commit
e8d6057264
@ -124,8 +124,7 @@ def showEntities(query):
|
||||
|
||||
entity_query_list = query.string.split()
|
||||
|
||||
|
||||
# query entities from HASS
|
||||
# Query entities from HASS
|
||||
try:
|
||||
response = requests.get(config["state_query"], headers=config["headers"])
|
||||
response.raise_for_status()
|
||||
@ -193,7 +192,7 @@ def showEntities(query):
|
||||
entity["state"].capitalize()
|
||||
)
|
||||
|
||||
# build item for list
|
||||
# Build item for list
|
||||
item = Item(id=__title__,
|
||||
icon=entity_icon,
|
||||
text=entity["attributes"]["friendly_name"],
|
||||
@ -201,7 +200,7 @@ def showEntities(query):
|
||||
subtext="%s | %s" % (state_colored, entity_class.capitalize())
|
||||
)
|
||||
|
||||
# add actions depending on class
|
||||
# Add actions depending on class
|
||||
if entity_class in toggle_types:
|
||||
item.addAction(FuncAction("Toggle", lambda d=data: sendCommand(d, "homeassistant/toggle")))
|
||||
|
||||
@ -220,7 +219,7 @@ def showEntities(query):
|
||||
|
||||
results.append(item)
|
||||
|
||||
# no entity found
|
||||
# No entity found
|
||||
if len(results) == 0:
|
||||
results.append(
|
||||
Item(id=__title__,
|
||||
|
Loading…
x
Reference in New Issue
Block a user