Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Climate presets missing icons #44

Open
esr2 opened this issue Oct 5, 2023 · 3 comments
Open

Climate presets missing icons #44

esr2 opened this issue Oct 5, 2023 · 3 comments

Comments

@esr2
Copy link

esr2 commented Oct 5, 2023

The 2023.10 update for Tile cards allows climate presets in the UI with icons. Unfortunately the icons don't seem to be set properly for the presets.

Screenshot_20231004-202230

@Crewski
Copy link
Owner

Crewski commented Oct 9, 2023

I'm struggling to find any documentation about the icons, but I'll keep looking.

My ecobee is having the same issue.

@Crewski
Copy link
Owner

Crewski commented Oct 17, 2023

Looking into this a little more, it looks like unless the preset is one of the "built-in" modes in HA, it'll get that dot. It's frontend related, not in the core. So for now it looks like we can't override it. Here is the relevant code from the home-assistant/frontend repo.

frontend/src/data/climate.ts

type ClimateBuiltInPresetMode =
  | "eco"
  | "away"
  | "boost"
  | "comfort"
  | "home"
  | "sleep"
  | "activity";

export const CLIMATE_PRESET_MODE_ICONS: Record<
  ClimateBuiltInPresetMode,
  string
> = {
  away: mdiAccountArrowRight,
  boost: mdiRocketLaunch,
  comfort: mdiSofa,
  eco: mdiLeaf,
  home: mdiHome,
  sleep: mdiBed,
  activity: mdiMotionSensor,
};

export const computePresetModeIcon = (mode: string) =>
  mode in CLIMATE_PRESET_MODE_ICONS
    ? CLIMATE_PRESET_MODE_ICONS[mode]
    : mdiCircleMedium;

@esr2
Copy link
Author

esr2 commented Oct 19, 2023

Ooo, good find! This seems like something that should be augmentable in some way. Or maybe they'd consider supporting some more options in that map?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants