zigul/HomeAssistant-CEZdistribuce

Weekend HDO time is used instedead of WorkDay HDO

Closed this issue · 4 comments

I've just installed this add-on and find out that Weekend schedule is used instead of Workday schedule for HDO. Today is Monday and HDO has switched off at 18:50 which is weekend switch off time. It seems that code is expecting that in JSON is first workday schedule and then weekend schedule. But in my case it just vice versa.

See JSON form my region:

response_json:
  data:
    - primaryKey: 8179
      ID: 8179
      VALID_FROM: 1667170800000
      VALID_TO: 4070905200000
      DUMP_ID: 40
      POVEL: A1B6DP7
      KOD_POVELU: '187'
      SAZBA: D25d
      INFO: sazba+TUV
      PLATNOST: So - Ne
      DOBA: '8'
      CAS_ZAP_1: '2:30'
      CAS_VYP_1: '7:30'
      CAS_ZAP_2: '15:50'
      CAS_VYP_2: '18:50'
      CAS_ZAP_3: null
      CAS_VYP_3: null
      CAS_ZAP_4: null
      CAS_VYP_4: null
      CAS_ZAP_5: null
      CAS_VYP_5: null
      CAS_ZAP_6: null
      CAS_VYP_6: null
      CAS_ZAP_7: null
      CAS_VYP_7: null
      CAS_ZAP_8: null
      CAS_VYP_8: null
      CAS_ZAP_9: null
      CAS_VYP_9: null
      CAS_ZAP_10: null
      CAS_VYP_10: null
      DATE_OF_ENTRY: 1666178193000
      DESCRIPTION: 2022_podzim_morava
    - primaryKey: 8106
      ID: 8106
      VALID_FROM: 1667170800000
      VALID_TO: 4070905200000
      DUMP_ID: 40
      POVEL: A1B6DP7
      KOD_POVELU: '187'
      SAZBA: D25d
      INFO: sazba+TUV
      PLATNOST: Po - Pá
      DOBA: '8'
      CAS_ZAP_1: '2:30'
      CAS_VYP_1: '7:30'
      CAS_ZAP_2: '14:15'
      CAS_VYP_2: '17:15'
      CAS_ZAP_3: null
      CAS_VYP_3: null
      CAS_ZAP_4: null
      CAS_VYP_4: null
      CAS_ZAP_5: null
      CAS_VYP_5: null
      CAS_ZAP_6: null
      CAS_VYP_6: null
      CAS_ZAP_7: null
      CAS_VYP_7: null
      CAS_ZAP_8: null
      CAS_VYP_8: null
      CAS_ZAP_9: null
      CAS_VYP_9: null
      CAS_ZAP_10: null
      CAS_VYP_10: null
      DATE_OF_ENTRY: 1666178192000
      DESCRIPTION: 2022_podzim_morava
  pageSize: 20
  pageNumber: 1
  pageOffset: 0
  pageBarItems: 5
  totalNumberOfRecords: 2
  pagingModel: {}
  firstRecordNumberForPage: 0
  lastPageNumber: 1
  lastRecordNumber: 2
  onePage: true
  pageNumbersNavigation:
    - 1
  defaultPageNumbersAround:
    - 1
  fullyInitialized: true
  last: true
  first: true
device_class: ''
icon: mdi:power
friendly_name: HDO_NT

I have the same problem. How should I solve it?

I have the same problem. How should I solve it?
I've made Pull request with solution for this issue 3 month ago. But no answer.
You can get my code solving this issue from my fork https://github.com/psasin/HomeAssistant-CEZdistribuce

Everything works as it should
Thank you

Fixed in version 0.4.8