Skip to content

Commit

Permalink
Set FontFamily on init
Browse files Browse the repository at this point in the history
  • Loading branch information
Garulf committed Feb 18, 2022
1 parent e15fd7c commit 6b7fb16
Showing 1 changed file with 6 additions and 25 deletions.
31 changes: 6 additions & 25 deletions plugin/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ def match(query, entity, friendly_name):


class Commander(Flox, Clipboard):

def __init__(self):
super().__init__()
self.font_family = "#Material Design Icons Desktop"


def init_hass(self):
self.logger.debug("Initializing Home Assistant Client")
self.client = Client(
Expand Down Expand Up @@ -58,11 +64,6 @@ def query(self, query):
parameters=[f"{self.user_keyword} {domain}."],
dont_hide=True,
glyph=self.client.grab_icon(domain),
font_family=str(
Path(self.plugindir).joinpath(
"#Material Design Icons Desktop"
)
),
)
return
# logbook
Expand All @@ -74,11 +75,6 @@ def query(self, query):
method=self.change_query,
parameters=[f'{self.user_keyword} {entry.get("entity_id")}'],
glyph=self.client.grab_icon("history"),
font_family=str(
Path(self.plugindir).joinpath(
"#Material Design Icons Desktop"
)
),
dont_hide=True,
)
return
Expand Down Expand Up @@ -110,11 +106,6 @@ def query(self, query):
method="action",
parameters=[entity._entity, q],
glyph=entity._icon(),
font_family=str(
Path(self.plugindir).joinpath(
"#Material Design Icons Desktop"
)
),
)

if len(self._results) > MAX_ITEMS:
Expand All @@ -137,11 +128,6 @@ def create_context(self, data):
glyph=self.client.grab_icon(
getattr(getattr(entity, attr), "icon", "image_broken")
),
font_family=str(
Path(self.plugindir).joinpath(
"#Material Design Icons Desktop"
)
),
)
if getattr(getattr(entity, attr), "_service", False):
self._results.insert(0, self._results.pop(-1))
Expand All @@ -150,11 +136,6 @@ def create_context(self, data):
title=str(getattr(entity, attr)),
subtitle=str(attr.replace("_", " ").title()),
glyph=self.client.grab_icon("information"),
font_family=str(
Path(self.plugindir).joinpath(
"#Material Design Icons Desktop"
)
),
method=self.put,
parameters=[str(getattr(entity, attr))],
)
Expand Down

0 comments on commit 6b7fb16

Please sign in to comment.