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

Odometer Entity Not Created #55

Closed
pbnj4640 opened this issue Dec 8, 2020 · 6 comments
Closed

Odometer Entity Not Created #55

pbnj4640 opened this issue Dec 8, 2020 · 6 comments

Comments

@pbnj4640
Copy link

pbnj4640 commented Dec 8, 2020

I have all the expected entities available with the exception of the odometer.

https://imgur.com/a/euFIhmc

@itchannel
Copy link
Owner

Can you please check your Home Assistant log and let me know if you have any errors from the fordpass Integration

@pbnj4640
Copy link
Author

pbnj4640 commented Dec 9, 2020

Yes I am. My car (I guess) doesn't support GPS?

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 316, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 531, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
sstate = self.state
File "/config/custom_components/fordpass/sensor.py", line 199, in state
return self.get_value("state")
File "/config/custom_components/fordpass/sensor.py", line 51, in get_value
return self.coordinator.data[self.sensor]["gpsState"]
TypeError: 'NoneType' object is not subscriptable

@pbnj4640
Copy link
Author

pbnj4640 commented Dec 9, 2020

Also device tracker

Error adding entities for domain device_tracker with platform fordpass
Error while setting up fordpass platform for device_tracker
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 316, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 531, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
sstate = self.state
File "/usr/src/homeassistant/homeassistant/components/device_tracker/config_entry.py", line 103, in state
if self.latitude is not None:
File "/config/custom_components/fordpass/device_tracker.py", line 28, in latitude
return float(self.coordinator.data[self.sensor]["latitude"])
TypeError: 'NoneType' object is not subscriptable

@itchannel
Copy link
Owner

Looks like it. Will add in a check to mark the sensor as unavailable in the next release.

@itchannel
Copy link
Owner

I have fixed the two above errors so it now checks to see if your car supports GPS before adding the tracker entity. Let me know if this doesn't fix the odometer issue but hoping now the tracker issue is resolved the script should be fine.

@pbnj4640
Copy link
Author

This solved it! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants