Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Posten API returning "Invalid date" as day of delivery #2

Open
2 tasks done
fiLLLip opened this issue Sep 18, 2020 · 4 comments
Open
2 tasks done

Posten API returning "Invalid date" as day of delivery #2

fiLLLip opened this issue Sep 18, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@fiLLLip
Copy link

fiLLLip commented Sep 18, 2020

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:
1.0.1
Last working release (if known):

Browser and Operating System:
Chrome on Pop!_OS 20.04 LTS

Description of problem:
Card not loading due to data quality
image
Manually removing "Invalid date" from state makes it work again.

Javascript errors shown in the web inspector (if applicable):


Additional information:

@fiLLLip fiLLLip added the bug Something isn't working label Sep 18, 2020
@ezand
Copy link
Owner

ezand commented Sep 18, 2020

Thanks @fiLLLip, the exception handling could be better (it's almost non-existing 😊 ). Will implement some handling of bad data from the sensor when I have the time 👍

@Olen
Copy link

Olen commented Sep 21, 2020

Seems like Posten has a problem with dates after 29. september. I get the exact same result as you, with "Invalid date" after that on a completely different address.
Should have had more experience with typescript so I could have created a PR.

@Olen
Copy link

Olen commented Sep 21, 2020

I made a quick-fix by modifying the Posten Delivery Days sensor to filter out the Invalid dates:

  value_template: "{{ value_json.nextDeliveryDays  | reject('==', 'Invalid date') | list }}"

The card should probably still do some error-checking, but at least that got it back for now.

@Olen
Copy link

Olen commented Sep 21, 2020

Meldte det inn til posten kundeservice også. De skulle ta det videre.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants