feat: initial smart home dashboard
All checks were successful
Deploy to Coolify / deploy (push) Successful in 44s
All checks were successful
Deploy to Coolify / deploy (push) Successful in 44s
- Next.js 14 + TypeScript + Tailwind CSS - Glassmorphism design with ambient orbs - Cards: Light x2, Temperature, AirPurifier, Tasks, Weather, Savings - Home Assistant integration (demo mode if no token) - Vikunja tasks API - Pulse savings API - wttr.in weather - Framer Motion animations - Dark/light theme toggle - Bottom navigation - Dockerfile for deployment
This commit is contained in:
19
lib/ha.ts
Normal file
19
lib/ha.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
export interface HAState {
|
||||
entity_id: string;
|
||||
state: string;
|
||||
attributes: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface HAStates {
|
||||
demo: boolean;
|
||||
states: Record<string, HAState>;
|
||||
}
|
||||
|
||||
export function getBrightnessPct(brightness?: number): number {
|
||||
if (!brightness) return 0;
|
||||
return Math.round((brightness / 255) * 100);
|
||||
}
|
||||
|
||||
export function pctToBrightness(pct: number): number {
|
||||
return Math.round((pct / 100) * 255);
|
||||
}
|
||||
Reference in New Issue
Block a user