Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

Fix issue when reading locale in old HA versions #16

Merged
merged 1 commit into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class SunCard extends LitElement {

processLastHass () {
this.config.darkMode = this.config.darkMode ?? this.lastHass.themes.darkMode
this.config.language = this.config.language ?? this.lastHass.locale.language
this.config.language = this.config.language ?? this.lastHass.locale?.language ?? this.lastHass.language

const times = {
dawn: this.parseTime(this.lastHass.states['sun.sun'].attributes.next_dawn),
Expand Down
1 change: 1 addition & 0 deletions src/types/custom/custom-card-helpers.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
declare module 'custom-card-helpers' {
export interface HomeAssistant {
themes: Themes & { darkMode: boolean }
language: string,
locale: { language: string }
states: {
'sun.sun': {
Expand Down