Skip to content

Commit

Permalink
feat: better icons for smart meters and Remo E (lite)
Browse files Browse the repository at this point in the history
  • Loading branch information
SegaraRai committed Dec 4, 2023
1 parent 79704e5 commit 1e73559
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion components/NatureDeviceCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<div class="flex flex-row items-center gap-4">
<div class="flex-1 flex flex-col items-center gap-4 overflow-hidden">
<div
class="w-20 h-20 i-solar-notification-unread-outline text-gray-800 dark:text-gray-200"
class="w-20 h-20 text-gray-800 dark:text-gray-200"
:class="getNatureDeviceIcon(device)"
/>
<div class="max-w-full truncate" v-text="device.name" />
</div>
Expand Down
3 changes: 2 additions & 1 deletion pages/devices/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<div id="overview" class="relative flex flex-row items-start gap-16">
<div class="flex-none flex flex-col items-center gap-2 overflow-hidden">
<div
class="w-32 h-32 i-solar-notification-unread-outline text-gray-800 dark:text-gray-200"
class="w-32 h-32 text-gray-800 dark:text-gray-200"
:class="getNatureDeviceIcon(device)"
/>
<div class="max-w-full text-2xl line-clamp-2" v-text="device.name" />
</div>
Expand Down
7 changes: 7 additions & 0 deletions utils/natureDeviceIcons.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { NatureDevice } from "./natureTypes";

export function getNatureDeviceIcon(device: NatureDevice): string {
return /^remo-e(-lite)?\//i.test(device.firmware_version)
? "i-solar-graph-new-linear"
: "i-solar-notification-unread-outline";
}
4 changes: 2 additions & 2 deletions utils/icons.ts → utils/natureIcons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const MAP: ReadonlyMap<NatureIcon, string> = new Map([
["ico_light_projector", "i-ph-lamp-light"],
["ico_lock", "i-ph-app-window-light"],
["ico_power_dist_board", "i-ph-app-window-light"],
["ico_projector", "i-ph-app-window-light"],
["ico_projector", "i-ph-projector-screen-chart-light"],
["ico_robot", "i-ph-app-window-light"],
["ico_smartmeter", "i-ph-app-window-light"],
["ico_smartmeter", "i-ph-wave-sine-light"],
["ico_solarpower", "i-ph-app-window-light"],
["ico_tv", "i-ph-television-simple-light"],
["ico_other", "i-ph-app-window-light"],
Expand Down

0 comments on commit 1e73559

Please sign in to comment.