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

TypeError: 'datetime.datetime' object is not subscriptable #4

Closed
peetereczek opened this issue Jan 29, 2020 · 4 comments
Closed

TypeError: 'datetime.datetime' object is not subscriptable #4

peetereczek opened this issue Jan 29, 2020 · 4 comments
Labels
bug Something isn't working.

Comments

@peetereczek
Copy link

Version of the custom_component
37d4419

Configuration

binary_sensor:
  - platform: car_wash
    weather: weather.budapest

Description

Seems that script is not working. Take a look on below stack, is there anything I should change?
Latest version of Home Assistant 0.104.3

Debug log


Wed Jan 29 2020 20:40:03 GMT+0100
Update for binary_sensor.car_wash fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/car_wash/binary_sensor.py", line 165, in async_update
    fc_date = fc_date[:10]
TypeError: 'datetime.datetime' object is not subscriptable

@peetereczek peetereczek added the bug Something isn't working. label Jan 29, 2020
@Limych
Copy link
Owner

Limych commented Jan 29, 2020

The reason here is not in the sensor bug, but in the fact that your weather provider sends data in a non-standard format.
Please specify what weather provider you use - I will try to add a code to the sensor that corrects this bug of your provider.

@peetereczek
Copy link
Author

I haven't changed weather provider since installation. I'm using met.no https://www.home-assistant.io/integrations/met/

Limych added a commit that referenced this issue Jan 30, 2020
@Limych Limych closed this as completed Jan 30, 2020
@peetereczek
Copy link
Author

Fixed, thanks!

And even weather is good to wash the car ;)
image

Limych pushed a commit that referenced this issue Mar 5, 2021
Limych added a commit that referenced this issue Mar 5, 2021
@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

2 participants