Skip to content

Commit

Permalink
Merge pull request #45 from BigNocciolino/dev
Browse files Browse the repository at this point in the history
Version 2.1.2
  • Loading branch information
BigNocciolino authored Nov 13, 2024
2 parents bfbac1e + ff2049b commit 2d15697
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 49 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg?style=for-the-badge)](https://github.com/custom-components/hacs)
# CryptoTracker

Component for tracking data generated by the API created by [fawazahmed0](https://github.com/fawazahmed0/currency-api). Which provides updated data every 24 hours, with a coverage of 150+ cryptocurrencies.
Component for tracking data generated by the API created by [fawazahmed0](https://github.com/fawazahmed0/exchange-api). Which provides updated data every 24 hours, with a coverage of 150+ cryptocurrencies.

**Note:** For those who have the component already configured from the config file, it will no longer work. Now it can only be configured from UI. [See this section](#moving-from-the-config-file)

Expand All @@ -24,7 +24,7 @@ After installing it go to `Configuration` => `Devices & Services` => `+ Add Inte

Now the component can be configured from the graphical interface, setting the value of `crypto` and the value of `base` (i.e. the value with which we want to convert crypto)

To get a full list of available currencies visit this [page](https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies.json).
To get a full list of available currencies visit this [page](https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies.json).

### My configuration

Expand Down
14 changes: 10 additions & 4 deletions custom_components/cryptostate/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"""Crypto tracking."""

from datetime import timedelta
import logging

from homeassistant.config_entries import ConfigEntry
from homeassistant.core import Config, HomeAssistant
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers.typing import ConfigType
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
Expand All @@ -14,9 +17,12 @@
SCAN_INTERVAL = timedelta(hours=3)

_LOGGER: logging.Logger = logging.getLogger(__package__)
PLATFORMS = ["sensor"]
PLATFORMS: list[Platform] = [
Platform.SENSOR,
]


async def async_setup(hass: HomeAssistant, config: Config):
async def async_setup(hass: HomeAssistant, config: ConfigType):
"""Set this integration using YAML is not supported."""
return True

Expand Down Expand Up @@ -70,7 +76,7 @@ async def _async_update_data(self):
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Handle removal of an entry."""
# coordinator = hass.data[DOMAIN][entry.entry_id]
unloaded = await hass.config_entries.async_unload_platforms(entry, "sensor")
unloaded = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unloaded:
hass.data[DOMAIN].pop(entry.entry_id)

Expand Down
2 changes: 1 addition & 1 deletion custom_components/cryptostate/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

NAME = "Crypto Tracker"
DOMAIN = "cryptostate"
VERSION = "2.0.0"
VERSION = "2.1.2"
ATTRIBUTION = "Data provided by https://github.com/fawazahmed0/currency-api#readme API"

ICON = "mdi:cash-multiple"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/cryptostate/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"requirements": [],
"config_flow": true,
"iot_class": "local_polling",
"version": "2.1.0"
"version": "2.1.2"
}
41 changes: 0 additions & 41 deletions info.md

This file was deleted.

0 comments on commit 2d15697

Please sign in to comment.