Initial changes to template

This commit is contained in:
2020-05-04 21:32:17 +03:00
parent 2c3f7ae901
commit fc7bc9b517
10 changed files with 32 additions and 32 deletions

View File

@@ -25,8 +25,8 @@ assignees: ''
Home Assistant frontend: Developer tools -> Info.
-->
- template-card release with the issue:
- Last working template-card release (if known):
- time-picker-card release with the issue:
- Last working time-picker-card release (if known):
- Browser and Operating System:
### Problem-relevant configuration

View File

@@ -1,6 +1,6 @@
---
name: Feature request
about: Suggest a feature for template-card
about: Suggest a feature for time-picker-card
title: ''
labels: feature request
assignees: ''

View File

@@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build template-card.js
- name: Build time-picker-card.js
run: |
npm install
npm run build
@@ -19,6 +19,6 @@ jobs:
- name: Upload to release
uses: shopify/upload-to-release@1.0.0
with:
name: template-card.js
path: dist/template-card.js
name: time-picker-card.js
path: dist/time-picker-card.js
repo-token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,15 +1,15 @@
# Lovelace Template Card by [@georgesg](https://www.github.com/georgesg)
# Lovelace Time Picker Card by [@georgesg](https://www.github.com/georgesg)
[![hacs_badge][hacs-shield]][hacs]
[![GitHub Release][releases-shield]][releases]
![CI](https://github.com/GeorgeSG/lovelace-template-card/workflows/CI/badge.svg)
![CI](https://github.com/GeorgeSG/lovelace-time-picker-card/workflows/CI/badge.svg)
[![Project Maintenance][maintenance-shield]][maintenance]
[![GitHub Activity][commits-shield]][commits]
[![License][license-shield]][license]
## Overview
This is a Template for a lovelace card, mostly the same as [boilerplate-card](https://github.com/custom-cards/boilerplate-card), but with some of my preferences applied on top.
This is a Time Picker card for Lovelace.
## Installation
@@ -17,23 +17,23 @@ Install using [HACS](https://hacs.xyz) or follow this [guide](https://github.com
```yaml
resources:
- url: /local/template-card.js
- url: /local/time-picker-card.js
type: module
```
## Usage
```yaml
type: 'custom:template-card'
type: 'custom:time-picker-card'
```
[commits-shield]: https://img.shields.io/github/commit-activity/y/GeorgeSG/lovelace-template-card?style=flat-square
[commits]: https://github.com/GeorgeSG/lovelace-template-card/commits/master
[license-shield]: https://img.shields.io/github/license/GeorgeSG/lovelace-template-card?style=flat-square
[license]: https://github.com/GeorgeSG/lovelace-template-card/blob/master/LICENSE
[commits-shield]: https://img.shields.io/github/commit-activity/y/GeorgeSG/lovelace-time-picker-card?style=flat-square
[commits]: https://github.com/GeorgeSG/lovelace-time-picker-card/commits/master
[license-shield]: https://img.shields.io/github/license/GeorgeSG/lovelace-time-picker-card?style=flat-square
[license]: https://github.com/GeorgeSG/lovelace-time-picker-card/blob/master/LICENSE
[maintenance-shield]: https://img.shields.io/maintenance/yes/2020.svg?style=flat-square
[maintenance]: https://github.com/GeorgeSG/lovelace-template-card
[releases-shield]: https://img.shields.io/github/release/GeorgeSG/lovelace-template-card.svg?style=flat-square
[releases]: https://github.com/GeorgeSG/lovelace-template-card/releases
[maintenance]: https://github.com/GeorgeSG/lovelace-time-picker-card
[releases-shield]: https://img.shields.io/github/release/GeorgeSG/lovelace-time-picker-card.svg?style=flat-square
[releases]: https://github.com/GeorgeSG/lovelace-time-picker-card/releases
[hacs-shield]: https://img.shields.io/badge/HACS-Custom-orange.svg?style=flat-square
[hacs]: https://github.com/custom-components/hacs

View File

@@ -1,5 +1,5 @@
{
"name": "Template Card",
"name": "Time Picker Card",
"render_readme": true,
"filename": "template-card.js"
"filename": "time-picker-card.js"
}

2
package-lock.json generated
View File

@@ -1,5 +1,5 @@
{
"name": "template-card",
"name": "time-picker-card",
"version": "0.0.0",
"lockfileVersion": 1,
"requires": true,

View File

@@ -1,8 +1,8 @@
{
"name": "template-card",
"name": "time-picker-card",
"version": "0.0.0",
"author": "Georgi Gardev <georgi@gardev.com>",
"description": "Lovelace template-card",
"description": "Lovelace time-picker-card",
"keywords": [
"home-assistant",
"homeassistant",
@@ -13,7 +13,7 @@
"lovelace-custom-card"
],
"license": "MIT",
"repository": "git@github.com:GeorgeSG/lovelace-template-card.git",
"repository": "git@github.com:GeorgeSG/lovelace-time-picker-card.git",
"scripts": {
"start": "rollup -c --watch",
"build": "npm run lint && npm run rollup",

View File

@@ -18,7 +18,7 @@ const serveOptions = {
};
export default {
input: 'src/template-card.ts',
input: 'src/time-picker-card.ts',
output: {
dir: './dist',
format: 'es',

View File

@@ -2,25 +2,25 @@ import { HomeAssistant } from 'custom-card-helpers';
import { CSSResult, customElement, html, LitElement, property, TemplateResult } from 'lit-element';
import { CARD_VERSION } from './const';
import { styles } from './styles';
import { TemplateCardConfig } from './types';
import { TimePickerCardConfig } from './types';
console.info(
`%c TEMPLATE-CARD \n%c Version ${CARD_VERSION} `,
`%c TIME-PICKER-CARD \n%c Version ${CARD_VERSION} `,
'color: darkgreen; font-weight: bold; background: black',
'color: white; font-weight: bold; background: dimgray'
);
@customElement('template-card')
export class TemplateCard extends LitElement {
@customElement('time-picker-card')
export class TimePickerCard extends LitElement {
@property() private hass?: HomeAssistant;
@property() private config?: TemplateCardConfig;
@property() private config?: TimePickerCardConfig;
render(): TemplateResult | null {
if (!this.config || !this.hass) {
return null;
}
return html`<ha-card>TemplateCard</ha-card>`;
return html`<ha-card>TimePickerCard</ha-card>`;
}
setConfig(config): void {

View File

@@ -1,3 +1,3 @@
export interface TemplateCardConfig {
export interface TimePickerCardConfig {
entity: string;
}