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

Commit bc65c3f

Browse files
rhoriguchiludeeus
authored andcommitted
Add custom url in config, refactoring and code optimization (#12)
* 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
1 parent 32ec366 commit bc65c3f

File tree

2 files changed

+231
-220
lines changed

2 files changed

+231
-220
lines changed

README.md

Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,12 @@
33
A component which allows you to track and update your custom cards and components.\
44
**To get the best use for this component, use it together with the [tracker-card](https://github.com/custom-cards/tracker-card)**
55

6-
## ⚠️ This will **ONLY** work if your components and/or cards/elements is from
7-
8-
- https://github.com/custom-cards
9-
- https://github.com/custom-components
10-
- https://github.com/ciotlosm/custom-lovelace
11-
12-
***
13-
14-
## ⚠️ See here **if** you have used an earlier version of this
15-
16-
Before you install this version make sure that you remove these files (if you have them):
17-
18-
- `/custom_components/custom_components.py`
19-
- `/custom_components/custom_cards.py`
20-
- `/custom_components/sensor/custom_components.py`
21-
- `/custom_components/sensor/custom_cards.py`
22-
23-
And remove `custom_components` and `custom_cards` from your `configuration.yaml`
24-
25-
***
26-
276
## Installation
287

298
### Step 1
309

3110
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.
3211

33-
3412
### Step 2
3513

3614
Add this to your `configuration.yaml`
@@ -43,11 +21,53 @@ custom_updater:
4321
4422
| key | default | required | description
4523
| --- | --- | --- | ---
46-
| **track** | both | no | A list of what you want this component to track, possible values are `cards`/`components`
47-
| **hide_sensor** | False | no | Option to set the sensors to be `hidden`, possible values are `True` / `False`
24+
| **track** | both | no | A list of what you want this component to track, possible values are `cards`/`components`.
25+
| **hide_sensor** | False | no | Option to set the sensors to be `hidden`, possible values are `True` / `False`.
26+
| **card_urls** | Empty | no | A list of additional urls to json with card info.
27+
| **component_urls** | Empty | no | A list of additional urls to json with component info.
28+
29+
The component uses these json files to check for updates by default:
30+
31+
- https://raw.githubusercontent.com/custom-cards/information/master/repos.json
32+
- https://raw.githubusercontent.com/custom-components/information/master/repos.json
33+
34+
Use the `card_urls` and `component_urls` options in the configuration to add more.
4835

4936
***
5037

38+
### Format of card_urls json
39+
40+
The json can have multiple cards
41+
42+
```json
43+
{
44+
"canvas-gauge-card": {
45+
"updated_at": "2018-08-11",
46+
"version": "0.0.2",
47+
"remote_location": "https://raw.githubusercontent.com/custom-cards/canvas-gauge-card/master/canvas-gauge-card.js",
48+
"visit_repo": "https://github.com/custom-cards/canvas-gauge-card",
49+
"changelog": "https://github.com/custom-cards/canvas-gauge-card/releases/latest"
50+
}
51+
}
52+
```
53+
54+
### Format of component_urls json
55+
56+
The json can have multiple components
57+
58+
```json
59+
{
60+
"camera.combined": {
61+
"updated_at": "2018-08-08",
62+
"version": "0.0.1",
63+
"local_location": "/custom_components/camera/combined.py",
64+
"remote_location": "https://raw.githubusercontent.com/custom-components/camera.combined/master/custom_components/camera/combined.py",
65+
"visit_repo": "https://github.com/custom-components/camera.combined",
66+
"changelog": "https://github.com/custom-components/camera.combined/releases/latest"
67+
}
68+
}
69+
```
70+
5171
## Activate Debug logging
5272

5373
Put this in your `configuration.yaml`

0 commit comments

Comments
 (0)