Skip to content

Commit

Permalink
Merge pull request #7 from tomvanswam/dev
Browse files Browse the repository at this point in the history
Change to HACS default repo
  • Loading branch information
tomvanswam committed Aug 9, 2020
2 parents 9a10de2 + df34857 commit e78117f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ A custom Lovelace card that displays an indicator in a circle for use with [Home

1. Go to [HACS](https://hacs.xyz/) (Home Assistant Community Store) on your Home Assistant instance
1. Select `Frontend`
1. Press menu icon and select `Custom repositories`
1. Add new repository
<pre>
url: https://github.com/tomvanswam/compass-card
category: Lovelace
</pre>
1. Press add icon and search for `compass`
1. Select Compass Card repo and install
1. Force refresh the Home Assistant page (<kbd>Ctrl</kbd> + <kbd>F5</kbd>)
1. Add compass-card to your page

Expand Down
2 changes: 1 addition & 1 deletion dist/compass-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ found at http://polymer.github.io/PATENTS.txt
left: calc((100% - 16px) / 2);
z-index: 99;
}
`,Ne="mdi:compass",Pe={N:0,NNE:22.5,NE:45,ENE:67.5,E:90,ESE:112.5,SE:135,SSE:157.5,S:180,SSW:202.5,SW:225,WSW:247.5,W:270,WNW:292.5,NW:315,NNW:337.5},Ce=Object.keys(Pe);var Me={version:"Version",description:"Show a compass with an indicator in the direction of the entity's value",invalid_configuration:"Invalid configuration",no_entity:"Entity not configured",offset_not_a_number:"Direction offset is not a number"},Ee={common:Me},ke={version:"Versie",description:"Toon een kompas met een pijl wijzend naar de waarde van de entity",invalid_configuration:"Foutieve configuratie",no_entity:"Entity niet geconfigureerd",offset_not_a_number:"Direction offset is geen nummer"},Te={common:ke};const Ae={en:Object.freeze({__proto__:null,common:Me,default:Ee}),nl:Object.freeze({__proto__:null,common:ke,default:Te})};function Ve(e,t="",i=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let r;try{r=e.split(".").reduce((e,t)=>e[t],Ae[n])}catch(t){r=e.split(".").reduce((e,t)=>e[t],Ae.en)}return void 0===r&&(r=e.split(".").reduce((e,t)=>e[t],Ae.en)),""!==t&&""!==i&&(r=r.replace(t,i)),r}var Oe;console.info(`%c COMPASS-CARD \n%c ${Ve("common.version")} 0.0.1 `,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),window.customCards=window.customCards||[],window.customCards.push({type:"compass-card",name:"Compass Card",description:Ve("common.description")});let De=Oe=class extends te{static async getConfigElement(){return document.createElement("compass-card-editor")}static getStubConfig(){return{}}setConfig(e){if(!e)throw new Error(Ve("common.invalid_configuration"));e.test_gui&&function(){var e=document.querySelector("home-assistant");if(e=(e=(e=(e=(e=(e=(e=(e=e&&e.shadowRoot)&&e.querySelector("home-assistant-main"))&&e.shadowRoot)&&e.querySelector("app-drawer-layout partial-panel-resolver"))&&e.shadowRoot||e)&&e.querySelector("ha-panel-lovelace"))&&e.shadowRoot)&&e.querySelector("hui-root")){var t=e.lovelace;return t.current_view=e.___curView,t}return null}().setEditMode(!0),this.config=Object.assign({},e)}shouldUpdate(e){return function(e,t,i){if(t.has("config")||i)return!0;if(e.config.entity){var n=t.get("hass");return!n||n.states[e.config.entity]!==e.hass.states[e.config.entity]}return!1}(this,e,!1)}render(){if(!this.config||!this.hass)return $``;if(!this.config.entity)return $`
`,Ne="mdi:compass",Pe={N:0,NNE:22.5,NE:45,ENE:67.5,E:90,ESE:112.5,SE:135,SSE:157.5,S:180,SSW:202.5,SW:225,WSW:247.5,W:270,WNW:292.5,NW:315,NNW:337.5},Ce=Object.keys(Pe);var Me={version:"Version",description:"Show a compass with an indicator in the direction of the entity's value",invalid_configuration:"Invalid configuration",no_entity:"Entity not configured",offset_not_a_number:"Direction offset is not a number"},Ee={common:Me},ke={version:"Versie",description:"Toon een kompas met een pijl wijzend naar de waarde van de entity",invalid_configuration:"Foutieve configuratie",no_entity:"Entity niet geconfigureerd",offset_not_a_number:"Direction offset is geen nummer"},Te={common:ke};const Ae={en:Object.freeze({__proto__:null,common:Me,default:Ee}),nl:Object.freeze({__proto__:null,common:ke,default:Te})};function Ve(e,t="",i=""){const n=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_");let r;try{r=e.split(".").reduce((e,t)=>e[t],Ae[n])}catch(t){r=e.split(".").reduce((e,t)=>e[t],Ae.en)}return void 0===r&&(r=e.split(".").reduce((e,t)=>e[t],Ae.en)),""!==t&&""!==i&&(r=r.replace(t,i)),r}var Oe;console.info(`%c COMPASS-CARD \n%c ${Ve("common.version")} 0.0.3 `,"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),window.customCards=window.customCards||[],window.customCards.push({type:"compass-card",name:"Compass Card",description:Ve("common.description")});let De=Oe=class extends te{static async getConfigElement(){return document.createElement("compass-card-editor")}static getStubConfig(){return{}}setConfig(e){if(!e)throw new Error(Ve("common.invalid_configuration"));e.test_gui&&function(){var e=document.querySelector("home-assistant");if(e=(e=(e=(e=(e=(e=(e=(e=e&&e.shadowRoot)&&e.querySelector("home-assistant-main"))&&e.shadowRoot)&&e.querySelector("app-drawer-layout partial-panel-resolver"))&&e.shadowRoot||e)&&e.querySelector("ha-panel-lovelace"))&&e.shadowRoot)&&e.querySelector("hui-root")){var t=e.lovelace;return t.current_view=e.___curView,t}return null}().setEditMode(!0),this.config=Object.assign({},e)}shouldUpdate(e){return function(e,t,i){if(t.has("config")||i)return!0;if(e.config.entity){var n=t.get("hass");return!n||n.states[e.config.entity]!==e.hass.states[e.config.entity]}return!1}(this,e,!1)}render(){if(!this.config||!this.hass)return $``;if(!this.config.entity)return $`
<ha-card style="background-color: var(--error-color);">
<div class="warning">
${Ve("common.no_entity")}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "compass-card",
"version": "0.0.2",
"version": "0.0.3",
"description": "Lovelace compass-card",
"keywords": [
"home-assistant",
Expand Down
2 changes: 1 addition & 1 deletion src/const.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const CARD_VERSION = '0.0.2';
export const CARD_VERSION = '0.0.3';
export const FONT_SIZE = 14;
export const FONT_SIZE_HEADER = 14;
export const ICONS = {
Expand Down

0 comments on commit e78117f

Please sign in to comment.