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

Commit

Permalink
Merge pull request #16 from AitorDB/bugfix/support-old-ha-language
Browse files Browse the repository at this point in the history
Fix issue when reading locale in old HA versions
  • Loading branch information
AitorDB authored May 17, 2021
2 parents 5797910 + 5067521 commit b2922bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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

0 comments on commit b2922bd

Please sign in to comment.