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

Commit

Permalink
add message when you enabled the letter but didn't activate it
Browse files Browse the repository at this point in the history
  • Loading branch information
peternijssen committed May 15, 2019
1 parent a73714c commit 7ce7db7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
20 changes: 18 additions & 2 deletions postnl-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ class PostNL extends LitElement {
${this.renderLetters()}
${this.renderDelivery()}
${this.renderDistribution()}
${this.renderWarning()}
${this.renderMomentJSWarning()}
${this.renderLetterWarning()}
</ha-card>
`
}
Expand All @@ -319,7 +321,8 @@ class PostNL extends LitElement {
`
}

renderWarning() {
// Remove when mandatory
renderMomentJSWarning() {
if (window.moment) return ''

return html`
Expand All @@ -329,6 +332,19 @@ class PostNL extends LitElement {
`
}

renderLetterWarning() {
if (!this.letterObject) return ''

// Remove undefined check after the first of june
if (typeof this.letterObject.attributes.enabled === 'undefined' || this.letterObject.attributes.enabled) return ''

return html`
<footer>
It seems you have set the letter object, but you haven't activated this within PostNL yet. Consider removing the letter object from the card or activate this option in PostNL.
</footer>
`
}

renderLettersInfo() {
if (!this.letterObject) return ''

Expand Down
4 changes: 2 additions & 2 deletions tracker.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"postnl-card": {
"version": "0.9.4",
"version": "0.9.5",
"updated_at": "2019-05-15",
"visit_repo": "https://github.com/peternijssen/lovelace-postnl",
"remote_location": "https://github.com/peternijssen/lovelace-postnl/releases/download/0.9.4/postnl-card.js",
"remote_location": "https://github.com/peternijssen/lovelace-postnl/releases/download/0.9.5/postnl-card.js",
"changelog": "https://github.com/peternijssen/lovelace-postnl/releases/latest"
}
}

0 comments on commit 7ce7db7

Please sign in to comment.