Skip to content
This repository has been archived by the owner on Jan 18, 2021. It is now read-only.

Commit

Permalink
Add custom url in config, refactoring and code optimization (#12)
Browse files Browse the repository at this point in the history
* Use config correctly

* Format imports

* Remove unused code

* Use super class for duplicate code and code cleanup

* Reduce request amount and code cleanup

* Add .gitignore

* Add field that custom url can be defined and Revert config change

* Update README.md

* Removed unnecessary "warnings"

* Minor adjustments and version bump

* Delete .gitignore

* Added clarification about urls
  • Loading branch information
rhoriguchi authored and ludeeus committed Aug 12, 2018
1 parent 32ec366 commit bc65c3f
Show file tree
Hide file tree
Showing 2 changed files with 231 additions and 220 deletions.
68 changes: 44 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,12 @@
A component which allows you to track and update your custom cards and components.\
**To get the best use for this component, use it together with the [tracker-card](https://github.com/custom-cards/tracker-card)**

## ⚠️ This will **ONLY** work if your components and/or cards/elements is from

- https://github.com/custom-cards
- https://github.com/custom-components
- https://github.com/ciotlosm/custom-lovelace

***

## ⚠️ See here **if** you have used an earlier version of this

Before you install this version make sure that you remove these files (if you have them):

- `/custom_components/custom_components.py`
- `/custom_components/custom_cards.py`
- `/custom_components/sensor/custom_components.py`
- `/custom_components/sensor/custom_cards.py`

And remove `custom_components` and `custom_cards` from your `configuration.yaml`

***

## Installation

### Step 1

Install this component by copying `/custom_components/custom_updater.py` from this repo to `<config directory>/custom_components/custom_updater.py` on your Home Assistant instanse.


### Step 2

Add this to your `configuration.yaml`
Expand All @@ -43,11 +21,53 @@ custom_updater:
| key | default | required | description
| --- | --- | --- | ---
| **track** | both | no | A list of what you want this component to track, possible values are `cards`/`components`
| **hide_sensor** | False | no | Option to set the sensors to be `hidden`, possible values are `True` / `False`
| **track** | both | no | A list of what you want this component to track, possible values are `cards`/`components`.
| **hide_sensor** | False | no | Option to set the sensors to be `hidden`, possible values are `True` / `False`.
| **card_urls** | Empty | no | A list of additional urls to json with card info.
| **component_urls** | Empty | no | A list of additional urls to json with component info.

The component uses these json files to check for updates by default:

- https://raw.githubusercontent.com/custom-cards/information/master/repos.json
- https://raw.githubusercontent.com/custom-components/information/master/repos.json

Use the `card_urls` and `component_urls` options in the configuration to add more.

***

### Format of card_urls json

The json can have multiple cards

```json
{
"canvas-gauge-card": {
"updated_at": "2018-08-11",
"version": "0.0.2",
"remote_location": "https://raw.githubusercontent.com/custom-cards/canvas-gauge-card/master/canvas-gauge-card.js",
"visit_repo": "https://github.com/custom-cards/canvas-gauge-card",
"changelog": "https://github.com/custom-cards/canvas-gauge-card/releases/latest"
}
}
```

### Format of component_urls json

The json can have multiple components

```json
{
"camera.combined": {
"updated_at": "2018-08-08",
"version": "0.0.1",
"local_location": "/custom_components/camera/combined.py",
"remote_location": "https://raw.githubusercontent.com/custom-components/camera.combined/master/custom_components/camera/combined.py",
"visit_repo": "https://github.com/custom-components/camera.combined",
"changelog": "https://github.com/custom-components/camera.combined/releases/latest"
}
}
```

## Activate Debug logging

Put this in your `configuration.yaml`
Expand Down
Loading

0 comments on commit bc65c3f

Please sign in to comment.