Skip to content

Commit

Permalink
Merge pull request #24 from rattkin/main
Browse files Browse the repository at this point in the history
don't show tomorrow spot prices if there are none
  • Loading branch information
Antrac1t authored Oct 31, 2023
2 parents f66d1d2 + a25dc40 commit 9e73155
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ apex_config:
show: false
all_series_config:
type: column
group_by:
func: avg
duration: 1hour
now:
show: true
label: Nyní
Expand All @@ -105,6 +102,9 @@ header:
series:
- entity: binary_sensor.hdo
float_precision: 2
group_by:
func: avg
duration: 1hour
show:
in_header: before_now
unit: Kč/kWh
Expand Down
12 changes: 10 additions & 2 deletions custom_components/egddistribuce/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ def __init__(self, name, psc, codeA, codeB, codeDP, priceNT, priceVT):
self.codeA = codeA
self.codeB = codeB
self.codeDP = codeDP
self.priceNT = priceNT
self.priceVT = priceVT
self.responseRegionJson = "[]"
self.responseHDOJson = "[]"
self.region = "[]"
Expand All @@ -68,6 +66,16 @@ def __init__(self, name, psc, codeA, codeB, codeDP, priceNT, priceVT):
self.update()
self._attributes = {}

if priceNT is not None:
self.priceNT = priceNT
else:
self.priceNT = 0

if priceVT is not None:
self.priceVT = priceVT
else:
self.priceVT = 0

@property
def name(self):
return self._name
Expand Down

0 comments on commit 9e73155

Please sign in to comment.