Skip to content

Commit 9f919d7

Browse files
authored
Merge pull request #101 from teuchezh/fix/language-type-union
fix(types): derive config language union from available locales
2 parents db28f8f + 295a3ee commit 9f919d7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Type definitions for Home Assistant and Weather Card
33
*/
44

5+
import type { SupportedLanguage } from './internationalization/locales.generated';
6+
57
// Home Assistant Entity State
68
export interface HassEntity {
79
entity_id: string;
@@ -125,7 +127,7 @@ export interface WeatherCardConfig {
125127
clockPosition?: 'top' | 'details';
126128
clockFormat?: '12h' | '24h';
127129
overlayOpacity?: number;
128-
language?: 'auto' | 'en' | 'ru' | 'de' | 'nl' | 'fr' | 'es' | 'it' | 'sk' | 'hu';
130+
language?: 'auto' | SupportedLanguage;
129131
height?: number | null;
130132
windSpeedUnit?: 'ms' | 'kmh';
131133
showAnimations?: boolean;
@@ -218,7 +220,7 @@ export interface ConfigInput {
218220
clock_position?: 'top' | 'details';
219221
clock_format?: '12h' | '24h';
220222
overlay_opacity?: number;
221-
language?: 'auto' | 'en' | 'ru' | 'de' | 'nl' | 'fr' | 'es' | 'it' | 'sk' | 'hu';
223+
language?: 'auto' | SupportedLanguage;
222224
wind_speed_unit?: 'ms' | 'kmh';
223225
show_animations?: boolean;
224226
sunrise_entity?: string;

0 commit comments

Comments
 (0)