Skip to content

Commit

Permalink
refactor: reformat and sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jcwillox committed Feb 14, 2023
1 parent d0b063e commit af2de2c
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 58 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ This plugin could be thought of as almost a staging ground for features that if

Much like [card-mod] Canary extends the default lovelace cards, so you don't need to actually define a `canary-card` for these options to work. The options are added to their respective cards as 'extensions'.

### Available Extensions

* [Generic Entity Row](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row)
* [`secondary_info`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row#secondary_info)
* [`canary_style`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row#canary_style)
* [`canary_theme`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row#canary_theme)
* [`hide_warning`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row#hide_warning)
* [Generic Card](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Card)
* [`no_card`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Card#no_card)
* [`canary_style`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Card#canary_style)
* [`canary_theme`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Card#canary_theme)
* [Glance Card](https://github.com/jcwillox/lovelace-canary/wiki/Glance-Card)
* [`align`](https://github.com/jcwillox/lovelace-canary/wiki/Glance-Card#align)
* [Vertical Stack](https://github.com/jcwillox/lovelace-canary/wiki/Vertical-Stack)
* [`in_card`](https://github.com/jcwillox/lovelace-canary/wiki/Vertical-Stack#in_card)
* [Canary Card](https://github.com/jcwillox/lovelace-canary/wiki/Canary-Card)
* `style`
* `theme`
### Available Extensions

- [Generic Entity Row](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row)
- [`secondary_info`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row#secondary_info)
- [`canary_style`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row#canary_style)
- [`canary_theme`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row#canary_theme)
- [`hide_warning`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row#hide_warning)
- [Generic Card](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Card)
- [`no_card`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Card#no_card)
- [`canary_style`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Card#canary_style)
- [`canary_theme`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Card#canary_theme)
- [Glance Card](https://github.com/jcwillox/lovelace-canary/wiki/Glance-Card)
- [`align`](https://github.com/jcwillox/lovelace-canary/wiki/Glance-Card#align)
- [Vertical Stack](https://github.com/jcwillox/lovelace-canary/wiki/Vertical-Stack)
- [`in_card`](https://github.com/jcwillox/lovelace-canary/wiki/Vertical-Stack#in_card)
- [Canary Card](https://github.com/jcwillox/lovelace-canary/wiki/Canary-Card)
- `style`
- `theme`

For more information head over to the [wiki](https://github.com/jcwillox/lovelace-canary/wiki).

Expand Down
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"name": "Canary"
}
}
36 changes: 20 additions & 16 deletions info.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
### Highlights

#### Template Secondary Info

<img src="https://github.com/jcwillox/lovelace-canary/blob/master/examples/secondary-info.png?raw=true" width="400px">

#### Vertical Stack in Card

<img src="https://github.com/jcwillox/lovelace-canary/blob/master/examples/vertical-stack-in-card.png?raw=true" width="400px">

#### Glance Card Entities Alignment

<img src="https://github.com/jcwillox/lovelace-canary/blob/master/examples/glances-align.png?raw=true" width="400px">

### Info
Expand All @@ -16,22 +19,23 @@ Much like [card-mod] Canary extends the default lovelace cards, so you don't nee
Check out the [documentation] for the configuration options and examples.

Available Extensions:
* [Generic Entity Row](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row)
* [`secondary_info`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row#secondary_info)
* [`canary_style`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row#canary_style)
* [`canary_theme`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row#canary_theme)
* [`hide_warning`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row#hide_warning)
* [Generic Card](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Card)
* [`no_card`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Card#no_card)
* [`canary_style`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Card#canary_style)
* [`canary_theme`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Card#canary_theme)
* [Glance Card](https://github.com/jcwillox/lovelace-canary/wiki/Glance-Card)
* [`align`](https://github.com/jcwillox/lovelace-canary/wiki/Glance-Card#align)
* [Vertical Stack](https://github.com/jcwillox/lovelace-canary/wiki/Vertical-Stack)
* [`in_card`](https://github.com/jcwillox/lovelace-canary/wiki/Vertical-Stack#in_card)
* [Canary Card](https://github.com/jcwillox/lovelace-canary/wiki/Canary-Card)
* `style`
* `theme`

- [Generic Entity Row](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row)
- [`secondary_info`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row#secondary_info)
- [`canary_style`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row#canary_style)
- [`canary_theme`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row#canary_theme)
- [`hide_warning`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Entity-Row#hide_warning)
- [Generic Card](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Card)
- [`no_card`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Card#no_card)
- [`canary_style`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Card#canary_style)
- [`canary_theme`](https://github.com/jcwillox/lovelace-canary/wiki/Generic-Card#canary_theme)
- [Glance Card](https://github.com/jcwillox/lovelace-canary/wiki/Glance-Card)
- [`align`](https://github.com/jcwillox/lovelace-canary/wiki/Glance-Card#align)
- [Vertical Stack](https://github.com/jcwillox/lovelace-canary/wiki/Vertical-Stack)
- [`in_card`](https://github.com/jcwillox/lovelace-canary/wiki/Vertical-Stack#in_card)
- [Canary Card](https://github.com/jcwillox/lovelace-canary/wiki/Canary-Card)
- `style`
- `theme`

[card-mod]: https://github.com/thomasloven/lovelace-card-mod
[documentation]: https://github.com/jcwillox/lovelace-canary/wiki
8 changes: 4 additions & 4 deletions src/canary-card.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { hass } from "card-tools/src/hass";
import { property, state } from "lit/decorators.js";
import { LitElement } from "lit";
import {
HomeAssistant,
LovelaceCard,
applyThemesOnElement,
computeCardSize,
createThing,
HomeAssistant,
LovelaceCard
} from "custom-card-helpers";
import { LitElement } from "lit";
import { property, state } from "lit/decorators.js";
import type { CanaryCardConfig } from "./types";

export class CanaryCard extends LitElement implements LovelaceCard {
Expand Down
4 changes: 2 additions & 2 deletions src/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const DEFAULT_SECONDARY_INFO = [
"last-triggered",
"position",
"tilt-position",
"brightness"
"brightness",
];

// language=CSS
Expand All @@ -17,5 +17,5 @@ export const VERTICAL_STACK_IN_CARD_STYLE = `
export const NO_CARD_STYLE = {
boxShadow: "none",
background: "none",
border: "none"
border: "none",
};
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { name } from "../package.json";
import { fireEvent } from "custom-card-helpers";
import { name } from "../package.json";

// allow dynamic updating of secondary info.
import "./secondary-info";
Expand Down
8 changes: 4 additions & 4 deletions src/modules/generic-card.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { extensionEnabled, findConfig, moduleEnabled } from "../utils";
import { mapStyle } from "../styles";
import { NO_CARD_STYLE } from "../const";
import { hass } from "card-tools/src/hass";
import { createModule } from "../module";
import { applyThemesOnElement } from "custom-card-helpers";
import { StyleInfo } from "lit/directives/style-map.js";
import { NO_CARD_STYLE } from "../const";
import { createModule } from "../module";
import { mapStyle } from "../styles";
import { extensionEnabled, findConfig, moduleEnabled } from "../utils";

const MODULE = "generic-card";
const ELEMENT = "ha-card";
Expand Down
10 changes: 5 additions & 5 deletions src/modules/generic-entity-row.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { hass, provideHass } from "card-tools/src/hass";
import { hasOldTemplate } from "card-tools/src/old-templates";
import { DEFAULT_SECONDARY_INFO } from "../const";
import { hasTemplate } from "card-tools/src/templates";
import { hass, provideHass } from "card-tools/src/hass";
import { extensionEnabled, moduleEnabled } from "../utils";
import { createModule } from "../module";
import { mapStyle } from "../styles";
import { applyThemesOnElement } from "custom-card-helpers";
import { StyleInfo } from "lit/directives/style-map.js";
import { DEFAULT_SECONDARY_INFO } from "../const";
import { createModule } from "../module";
import { mapStyle } from "../styles";
import { extensionEnabled, moduleEnabled } from "../utils";

const MODULE = "generic-entity-row";
const ELEMENT = "hui-generic-entity-row";
Expand Down
2 changes: 1 addition & 1 deletion src/modules/glance-card.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { extensionEnabled, moduleEnabled } from "../utils";
import { createModule } from "../module";
import { extensionEnabled, moduleEnabled } from "../utils";

const MODULE = "glance-card";
const ELEMENT = "hui-glance-card";
Expand Down
4 changes: 2 additions & 2 deletions src/modules/vertical-stack.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { LovelaceCard } from "custom-card-helpers";
import { NO_CARD_STYLE, VERTICAL_STACK_IN_CARD_STYLE } from "../const";
import { extensionEnabled, moduleEnabled } from "../utils";
import { createModule } from "../module";
import { LovelaceCard } from "custom-card-helpers";
import { extensionEnabled, moduleEnabled } from "../utils";

const MODULE = "vertical-stack";
const ELEMENT = "hui-vertical-stack-card";
Expand Down
2 changes: 1 addition & 1 deletion src/modules/warning.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { extensionEnabled, findConfig, moduleEnabled } from "../utils";
import { createModule } from "../module";
import { extensionEnabled, findConfig, moduleEnabled } from "../utils";

const MODULE = "warning";
const ELEMENT = "hui-warning";
Expand Down
4 changes: 2 additions & 2 deletions src/secondary-info.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { subscribeRenderTemplate } from "card-tools/src/templates.js";
import { parseOldTemplate } from "card-tools/src/old-templates";
import { oldExtractEntities } from "./templates";
import { subscribeRenderTemplate } from "card-tools/src/templates.js";
import { HomeAssistant } from "custom-card-helpers";
import { oldExtractEntities } from "./templates";

interface SecondaryInfoConfig {
template: Record<string, unknown> | string;
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HomeAssistant, LovelaceCard } from "custom-card-helpers";
import { LitElement, PropertyValues } from "lit";
import { LovelaceCardConfig } from "custom-card-helpers/src/types";
import { LitElement, PropertyValues } from "lit";
import { StyleInfo } from "lit/directives/style-map.js";

declare global {
Expand Down

0 comments on commit af2de2c

Please sign in to comment.