Skip to content

Commit aa4441b

Browse files
authored
Merge pull request #35 from zigul/32-bug-problém-s-časy-pro-evv1
Solves: #35 and #34 - fixed bug in defined times - fixed bug with invalid data if only one object is defined locally
2 parents a6251d8 + 0257fb7 commit aa4441b

File tree

4 files changed

+58
-109
lines changed

4 files changed

+58
-109
lines changed

.gitignore

+1-55
Original file line numberDiff line numberDiff line change
@@ -173,54 +173,9 @@ cython_debug/
173173
# Built Visual Studio Code Extensions
174174
*.vsix
175175

176-
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
177-
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
178-
179-
# User-specific stuff
180-
.idea/**/workspace.xml
181-
.idea/**/tasks.xml
182-
.idea/**/usage.statistics.xml
183-
.idea/**/dictionaries
184-
.idea/**/shelf
185-
186-
# AWS User-specific
187-
.idea/**/aws.xml
188-
189-
# Generated files
190-
.idea/**/contentModel.xml
191-
192-
# Sensitive or high-churn files
193-
.idea/**/dataSources/
194-
.idea/**/dataSources.ids
195-
.idea/**/dataSources.local.xml
196-
.idea/**/sqlDataSources.xml
197-
.idea/**/dynamic.xml
198-
.idea/**/uiDesigner.xml
199-
.idea/**/dbnavigator.xml
200-
201-
# Gradle
202-
.idea/**/gradle.xml
203-
.idea/**/libraries
204-
205-
# Gradle and Maven with auto-import
206-
# When using Gradle or Maven with auto-import, you should exclude module files,
207-
# since they will be recreated, and may cause churn. Uncomment if using
208-
# auto-import.
209-
# .idea/artifacts
210-
# .idea/compiler.xml
211-
# .idea/jarRepositories.xml
212-
# .idea/modules.xml
213-
# .idea/*.iml
214-
# .idea/modules
215-
# *.iml
216-
# *.ipr
217-
218176
# CMake
219177
cmake-build-*/
220178

221-
# Mongo Explorer plugin
222-
.idea/**/mongoSettings.xml
223-
224179
# File-based project format
225180
*.iws
226181

@@ -233,20 +188,11 @@ out/
233188
# JIRA plugin
234189
atlassian-ide-plugin.xml
235190

236-
# Cursive Clojure plugin
237-
.idea/replstate.xml
238-
239-
# SonarLint plugin
240-
.idea/sonarlint/
241191

242192
# Crashlytics plugin (for Android Studio and IntelliJ)
243193
com_crashlytics_export_strings.xml
244194
crashlytics.properties
245195
crashlytics-build.properties
246196
fabric.properties
247197

248-
# Editor-based Rest Client
249-
.idea/httpRequests
250-
251-
# Android studio 3.1+ serialized cache file
252-
.idea/caches/build_file_checksums.ser
198+
.idea/

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Add the following to your `configuration.yaml` file:
2929
# Example configuration.yaml entry for showing current HDO state
3030
binary_sensor:
3131
- platform: cezdistribuce
32-
name: nizky tarif
32+
name: stred_a1b5dp6
3333
region: stred
3434
code: A1B5DP6
3535
```

custom_components/cezdistribuce/continuous_measurement.py

+55-52
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ def isContinuousCode() -> list:
2020
@staticmethod
2121
def getCode(code: str) -> dict:
2222
"return specific dict for code or empty dict if code not exists"
23+
data = ContinuousMeasurement.CODES.get(code)
24+
if len(data) == 1:
25+
data = data[0]
2326
to_response = {"data": ContinuousMeasurement.CODES.get(code)}
2427
_LOGGER.debug("select data for code %s: %s", code, to_response)
2528
return to_response
@@ -54,7 +57,7 @@ def getCode(code: str) -> dict:
5457
"CAS_ZAP_2": "18:00",
5558
"CAS_VYP_2": "20:00",
5659
"CAS_ZAP_3": "23:00",
57-
"CAS_VYP_3": "00:00",
60+
"CAS_VYP_3": "23:59",
5861
"CAS_ZAP_4": None,
5962
"CAS_VYP_4": None,
6063
"CAS_ZAP_5": None,
@@ -77,7 +80,7 @@ def getCode(code: str) -> dict:
7780
"CAS_ZAP_2": "17:00",
7881
"CAS_VYP_2": "19:00",
7982
"CAS_ZAP_3": "22:00",
80-
"CAS_VYP_3": "00:00",
83+
"CAS_VYP_3": "23:59",
8184
"CAS_ZAP_4": None,
8285
"CAS_VYP_4": None,
8386
"CAS_ZAP_5": None,
@@ -98,7 +101,30 @@ def getCode(code: str) -> dict:
98101
"CAS_ZAP_1": "0:00",
99102
"CAS_VYP_1": "6:00",
100103
"CAS_ZAP_2": "22:00",
101-
"CAS_VYP_2": "00:00",
104+
"CAS_VYP_2": "23:59",
105+
"CAS_ZAP_3": None,
106+
"CAS_VYP_3": None,
107+
"CAS_ZAP_4": None,
108+
"CAS_VYP_4": None,
109+
"CAS_ZAP_5": None,
110+
"CAS_VYP_5": None,
111+
"CAS_ZAP_6": None,
112+
"CAS_VYP_6": None,
113+
"CAS_ZAP_7": None,
114+
"CAS_VYP_7": None,
115+
"CAS_ZAP_8": None,
116+
"CAS_VYP_8": None,
117+
"CAS_ZAP_9": None,
118+
"CAS_VYP_9": None,
119+
"CAS_ZAP_10": None,
120+
"CAS_VYP_10": None,
121+
}
122+
AKU8V5: dict = {
123+
"PLATNOST": "Po - Ne",
124+
"CAS_ZAP_1": "1:00",
125+
"CAS_VYP_1": "6:00",
126+
"CAS_ZAP_2": "18:00",
127+
"CAS_VYP_2": "21:00",
102128
"CAS_ZAP_3": None,
103129
"CAS_VYP_3": None,
104130
"CAS_ZAP_4": None,
@@ -116,31 +142,6 @@ def getCode(code: str) -> dict:
116142
"CAS_ZAP_10": None,
117143
"CAS_VYP_10": None,
118144
}
119-
AKU8V5: dict = (
120-
{
121-
"PLATNOST": "Po - Ne",
122-
"CAS_ZAP_1": "1:00",
123-
"CAS_VYP_1": "6:00",
124-
"CAS_ZAP_2": "18:00",
125-
"CAS_VYP_2": "21:00",
126-
"CAS_ZAP_3": None,
127-
"CAS_VYP_3": None,
128-
"CAS_ZAP_4": None,
129-
"CAS_VYP_4": None,
130-
"CAS_ZAP_5": None,
131-
"CAS_VYP_5": None,
132-
"CAS_ZAP_6": None,
133-
"CAS_VYP_6": None,
134-
"CAS_ZAP_7": None,
135-
"CAS_VYP_7": None,
136-
"CAS_ZAP_8": None,
137-
"CAS_VYP_8": None,
138-
"CAS_ZAP_9": None,
139-
"CAS_VYP_9": None,
140-
"CAS_ZAP_10": None,
141-
"CAS_VYP_10": None,
142-
},
143-
)
144145
AKU8V6: dict = {
145146
"PLATNOST": "Po - Ne",
146147
"CAS_ZAP_1": "3:00",
@@ -194,7 +195,7 @@ def getCode(code: str) -> dict:
194195
"CAS_ZAP_2": "13:00",
195196
"CAS_VYP_2": "16:00",
196197
"CAS_ZAP_3": "19:00",
197-
"CAS_VYP_3": "0:00",
198+
"CAS_VYP_3": "23:59",
198199
"CAS_ZAP_4": None,
199200
"CAS_VYP_4": None,
200201
"CAS_ZAP_5": None,
@@ -221,7 +222,7 @@ def getCode(code: str) -> dict:
221222
"CAS_ZAP_4": "14:00",
222223
"CAS_VYP_4": "16:00",
223224
"CAS_ZAP_5": "17:00",
224-
"CAS_VYP_5": "0:00",
225+
"CAS_VYP_5": "23:59",
225226
"CAS_ZAP_6": None,
226227
"CAS_VYP_6": None,
227228
"CAS_ZAP_7": None,
@@ -244,7 +245,7 @@ def getCode(code: str) -> dict:
244245
"CAS_ZAP_4": "14:00",
245246
"CAS_VYP_4": "16:00",
246247
"CAS_ZAP_5": "17:00",
247-
"CAS_VYP_5": "0:00",
248+
"CAS_VYP_5": "23:59",
248249
"CAS_ZAP_6": None,
249250
"CAS_VYP_6": None,
250251
"CAS_ZAP_7": None,
@@ -267,7 +268,7 @@ def getCode(code: str) -> dict:
267268
"CAS_ZAP_4": "16:00",
268269
"CAS_VYP_4": "19:00",
269270
"CAS_ZAP_5": "20:00",
270-
"CAS_VYP_5": "0:00",
271+
"CAS_VYP_5": "23:59",
271272
"CAS_ZAP_6": None,
272273
"CAS_VYP_6": None,
273274
"CAS_ZAP_7": None,
@@ -290,7 +291,7 @@ def getCode(code: str) -> dict:
290291
"CAS_ZAP_4": "15:00",
291292
"CAS_VYP_4": "17:00",
292293
"CAS_ZAP_5": "18:00",
293-
"CAS_VYP_5": "0:00",
294+
"CAS_VYP_5": "23:59",
294295
"CAS_ZAP_6": None,
295296
"CAS_VYP_6": None,
296297
"CAS_ZAP_7": None,
@@ -305,15 +306,15 @@ def getCode(code: str) -> dict:
305306
EVV1: dict = {
306307
"PLATNOST": "Po - Ne",
307308
"CAS_ZAP_1": "0:00",
308-
"CAS_VYP_1": "9:00",
309-
"CAS_ZAP_2": "10:00",
310-
"CAS_VYP_2": "11:00",
311-
"CAS_ZAP_3": "12:00",
309+
"CAS_VYP_1": "6:00",
310+
"CAS_ZAP_2": "7:00",
311+
"CAS_VYP_2": "9:00",
312+
"CAS_ZAP_3": "10:00",
312313
"CAS_VYP_3": "13:00",
313314
"CAS_ZAP_4": "14:00",
314315
"CAS_VYP_4": "16:00",
315316
"CAS_ZAP_5": "17:00",
316-
"CAS_VYP_5": "0:00",
317+
"CAS_VYP_5": "23:59",
317318
"CAS_ZAP_6": None,
318319
"CAS_VYP_6": None,
319320
"CAS_ZAP_7": None,
@@ -336,7 +337,7 @@ def getCode(code: str) -> dict:
336337
"CAS_ZAP_4": "16:00",
337338
"CAS_VYP_4": "19:00",
338339
"CAS_ZAP_5": "20:00",
339-
"CAS_VYP_5": "0:00",
340+
"CAS_VYP_5": "23:59",
340341
"CAS_ZAP_6": None,
341342
"CAS_VYP_6": None,
342343
"CAS_ZAP_7": None,
@@ -359,7 +360,7 @@ def getCode(code: str) -> dict:
359360
"CAS_ZAP_4": "15:00",
360361
"CAS_VYP_4": "17:00",
361362
"CAS_ZAP_5": "18:00",
362-
"CAS_VYP_5": "0:00",
363+
"CAS_VYP_5": "23:59",
363364
"CAS_ZAP_6": None,
364365
"CAS_VYP_6": None,
365366
"CAS_ZAP_7": None,
@@ -378,7 +379,7 @@ def getCode(code: str) -> dict:
378379
"CAS_ZAP_2": "10:00",
379380
"CAS_VYP_2": "12:00",
380381
"CAS_ZAP_3": "13:00",
381-
"CAS_VYP_3": "10:00",
382+
"CAS_VYP_3": "23:59",
382383
"CAS_ZAP_4": None,
383384
"CAS_VYP_4": None,
384385
"CAS_ZAP_5": None,
@@ -445,7 +446,7 @@ def getCode(code: str) -> dict:
445446
"CAS_ZAP_1": "0:00",
446447
"CAS_VYP_1": "4:30",
447448
"CAS_ZAP_2": "8:30",
448-
"CAS_VYP_2": "0:00",
449+
"CAS_VYP_2": "23:59",
449450
"CAS_ZAP_3": None,
450451
"CAS_VYP_3": None,
451452
"CAS_ZAP_4": None,
@@ -468,7 +469,7 @@ def getCode(code: str) -> dict:
468469
"CAS_ZAP_1": "0:00",
469470
"CAS_VYP_1": "14:00",
470471
"CAS_ZAP_2": "18:00",
471-
"CAS_VYP_2": "0:00",
472+
"CAS_VYP_2": "23:59",
472473
"CAS_ZAP_3": None,
473474
"CAS_VYP_3": None,
474475
"CAS_ZAP_4": None,
@@ -491,7 +492,7 @@ def getCode(code: str) -> dict:
491492
"CAS_ZAP_1": "0:00",
492493
"CAS_VYP_1": "6:00",
493494
"CAS_ZAP_2": "10:00",
494-
"CAS_VYP_2": "0:00",
495+
"CAS_VYP_2": "23:59",
495496
"CAS_ZAP_3": None,
496497
"CAS_VYP_3": None,
497498
"CAS_ZAP_4": None,
@@ -510,7 +511,7 @@ def getCode(code: str) -> dict:
510511
"CAS_VYP_10": None,
511512
}
512513
ZAV1_WEEK: dict = {
513-
"PLATNOST": "Po - Pa",
514+
"PLATNOST": "So - Ne",
514515
"CAS_ZAP_1": "0:00",
515516
"CAS_VYP_1": "23:59",
516517
"CAS_ZAP_2": None,
@@ -537,7 +538,7 @@ def getCode(code: str) -> dict:
537538
"CAS_ZAP_1": "0:00",
538539
"CAS_VYP_1": "3:00",
539540
"CAS_ZAP_2": "7:00",
540-
"CAS_VYP_2": "0:00",
541+
"CAS_VYP_2": "23:59",
541542
"CAS_ZAP_3": None,
542543
"CAS_VYP_3": None,
543544
"CAS_ZAP_4": None,
@@ -556,7 +557,7 @@ def getCode(code: str) -> dict:
556557
"CAS_VYP_10": None,
557558
}
558559
ZAV2_WEEK: dict = {
559-
"PLATNOST": "Po - Pa",
560+
"PLATNOST": "So - Ne",
560561
"CAS_ZAP_1": "0:00",
561562
"CAS_VYP_1": "23:59",
562563
"CAS_ZAP_2": None,
@@ -581,7 +582,7 @@ def getCode(code: str) -> dict:
581582
VIKV1_1: dict = {
582583
"PLATNOST": "Pa - Pa",
583584
"CAS_ZAP_1": "12:00",
584-
"CAS_VYP_1": "0:00",
585+
"CAS_VYP_1": "23:59",
585586
"CAS_ZAP_2": None,
586587
"CAS_VYP_2": None,
587588
"CAS_ZAP_3": None,
@@ -654,7 +655,7 @@ def getCode(code: str) -> dict:
654655
"CAS_ZAP_2": "10:00",
655656
"CAS_VYP_2": "16:00",
656657
"CAS_ZAP_3": "20:00",
657-
"CAS_VYP_3": "0:00",
658+
"CAS_VYP_3": "23:59",
658659
"CAS_ZAP_4": None,
659660
"CAS_VYP_4": None,
660661
"CAS_ZAP_5": None,
@@ -675,7 +676,7 @@ def getCode(code: str) -> dict:
675676
"CAS_ZAP_1": "0:00",
676677
"CAS_VYP_1": "7:00",
677678
"CAS_ZAP_2": "15:00",
678-
"CAS_VYP_2": "0:00",
679+
"CAS_VYP_2": "23:59",
679680
"CAS_ZAP_3": None,
680681
"CAS_VYP_3": None,
681682
"CAS_ZAP_4": None,
@@ -700,7 +701,7 @@ def getCode(code: str) -> dict:
700701
"CAS_ZAP_2": "10:00",
701702
"CAS_VYP_2": "18:00",
702703
"CAS_ZAP_3": "23:00",
703-
"CAS_VYP_3": "0:00",
704+
"CAS_VYP_3": "23:59",
704705
"CAS_ZAP_4": None,
705706
"CAS_VYP_4": None,
706707
"CAS_ZAP_5": None,
@@ -742,5 +743,7 @@ def getCode(code: str) -> dict:
742743
"ZAV1": [ZAV1_WORK, ZAV1_WEEK],
743744
"ZAV2": [ZAV2_WORK, ZAV2_WEEK],
744745
"VIKV1": [VIKV1_1, VIKV1_2, VIKV1_3],
745-
"VYRV": [VYRV1, VYRV2, VYRV3],
746+
"VYRV1": [VYRV1],
747+
"VYRV2": [VYRV2],
748+
"VYRV3": [VYRV3],
746749
}

custom_components/cezdistribuce/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"domain": "cezdistribuce",
33
"name": "CEZ Distribuce",
4-
"version": "0.4.9",
4+
"version": "0.5.0",
55
"documentation": "https://github.com/zigul/HomeAssistant-CEZdistribuce",
66
"issue_tracker": "https://github.com/zigul/HomeAssistant-CEZdistribuce/issues",
77
"dependencies": [],

0 commit comments

Comments
 (0)