Skip to content

Commit

Permalink
readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
panzelva committed Oct 12, 2022
1 parent 2b90ca0 commit 5d013f8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,30 @@ Repozitář by se vám měl zobrazit mezi ostatními repozitáři.

## Sensory

| Jméno | ID | Popis |
| ----------------------------------------------- | ---------------------------------------------------------------- | ----- |
| `Current kWh price in CZK` | `sensor.nanogreen_current_kwh_price_in_czk` | |
| `Is currently cheapest electricity hour in day` | `sensor.nanogreen_is_currently_cheapest_electricity_hour_in_day` | |
| `Base cheapest hour` | `sensor.nanogreen_base_cheapest_hour` | |
| `Base second cheapest hour` | `sensor.nanogreen_base_second_cheapest_hour` | |
| `Offpeak cheapest hour` | `sensor.nanogreen_offpeak_cheapest_hour` | |
| `Offpeak second cheapest hour` | `sensor.nanogreen_offpeak_second_cheapest_hour` | |
| `Peak cheapest hour` | `sensor.nanogreen_peak_cheapest_hour` | |
| `Peak second cheapest hour` | `sensor.nanogreen_peak_second_cheapest_hour` | |
| Jméno | ID |
| ----------------------------------------------- | ---------------------------------------------------------------- |
| `Current kWh price in CZK` | `sensor.nanogreen_current_kwh_price_in_czk` |
| `Is currently cheapest electricity hour in day` | `sensor.nanogreen_is_currently_cheapest_electricity_hour_in_day` |
| `Base cheapest hour` | `sensor.nanogreen_base_cheapest_hour` |
| `Base second cheapest hour` | `sensor.nanogreen_base_second_cheapest_hour` |
| `Offpeak cheapest hour` | `sensor.nanogreen_offpeak_cheapest_hour` |
| `Offpeak second cheapest hour` | `sensor.nanogreen_offpeak_second_cheapest_hour` |
| `Peak cheapest hour` | `sensor.nanogreen_peak_cheapest_hour` |
| `Peak second cheapest hour` | `sensor.nanogreen_peak_second_cheapest_hour` |

Vysvětlení:

PEAK LOAD (8:00 - 20:00)

OFFPEAK LOAD (0:00 - 8:00, 20:00 - 24:00)

## Grafy

### Cena elektřiny

![Graf ceny elektřiny](docs/examples/graf.png)

- lze použít https://github.com/RomRider/apexcharts-card pro vizualizace
- Po nainstalování [ApexCharts](https://github.com/RomRider/apexcharts-card) přes HACS de návodu, přidejte custom komponentu a vložte do ní níže uvedený kód.

```yaml
type: custom:apexcharts-card
Expand Down
22 changes: 9 additions & 13 deletions custom_components/nanogreen/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,31 @@
SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
SensorEntityDescription(
key=ATTR_API_CURRENT_PRICE,
name="Current kWh price in CZK",
name="Current price [CZK/kWh]",
),
SensorEntityDescription(
key=ATTR_API_IS_CURRENTLY_CHEAPEST_HOUR,
name="Is currently cheapest electricity hour in day",
name="Day cheapest hour [bool]",
),
SensorEntityDescription(
key=ATTR_API_TODAY_BASE_CHEAPEST_HOUR,
name="Base cheapest hour",
name="Day cheapest hour",
),
SensorEntityDescription(
key=ATTR_API_TODAY_PEAK_CHEAPEST_HOUR,
name="Peak cheapest hour",
),
SensorEntityDescription(
key=ATTR_API_TODAY_OFFPEAK_CHEAPEST_HOUR,
name="Offpeak cheapest hour",
key=ATTR_API_TODAY_BASE_SECOND_CHEAPEST_HOUR,
name="Day second cheapest hour",
),
SensorEntityDescription(
key=ATTR_API_TODAY_BASE_SECOND_CHEAPEST_HOUR,
name="Base second cheapest hour",
key=ATTR_API_TODAY_PEAK_CHEAPEST_HOUR,
name="Peak cheapest hour",
),
SensorEntityDescription(
key=ATTR_API_TODAY_PEAK_SECOND_CHEAPEST_HOUR,
name="Peak second cheapest hour",
),
SensorEntityDescription(
key=ATTR_API_TODAY_OFFPEAK_SECOND_CHEAPEST_HOUR,
name="Offpeak second cheapest hour",
key=ATTR_API_TODAY_OFFPEAK_CHEAPEST_HOUR,
name="Offpeak cheapest hour",
),
SensorEntityDescription(
key=ATTR_API_TODAY_OFFPEAK_SECOND_CHEAPEST_HOUR,
Expand Down
2 changes: 1 addition & 1 deletion custom_components/nanogreen/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(
super().__init__()
self.entity_description = description
self._coordinator = coordinator
self._attr_name = f"{name} {description.name}"
self._attr_name = description.name
self._attr_unique_id = unique_id

@property
Expand Down

0 comments on commit 5d013f8

Please sign in to comment.