Ok, found and fixed both bugs, and released as version 0.0.2.
I had recently been focusing my testing on upgrading a system that already had Life360 config entries and forgot to go back and test adding an entry on a system that did not have any existing entries.
THANKS! Let me know if this fixes the problems for you.
I have been using this for a few days now and everything seems to be reporting correctly. The attributes all seem to match my current prod version. No issues so far.
Completely convinced this will be my doing, removed my previous set up and followed your instructions but on configuring I get a translation error - any pointers would be appreciated - I wondered if its referring to the documentation link which is pointing my instance of HA in the absence of anything else?
Translation Error: The intl string context variable “docs_url” was not provided to the string “To set advanced options, see Life360 documentation.
You may want to do that before adding accounts.”
Hmm, that looks a bit weird. But, no, I don’t think it’s anything you’re doing wrong.
First off, I should probably have mentioned that I only provided English translations in the test project. I have no idea how to get all the translations. That’s something that happens automagically for built-in integrations. I don’t know how to do it for a custom integration.
Having said that, it appears to be trying to use the strings JSON file(s) from the built-in integration, not the custom integration (because the custom one doesn’t have the string “To set advanced…”.) I.e., I’m assuming your system is configured for a different language. So, HA tries to find the corresponding .json file in custom_components/life360/translations, but when it doesn’t find it, it then tries finding it in homeassistant/components/life360/translations and finds it. But that’s the wrong one!
Bottom line, I don’t know how to provide all the language translations for the test custom integration, so either you’ll need to temporarily reconfigure your system to English, which I doubt you’ll want to do, or I guess you can’t use this.
Or, maybe you could copy custom_components/life360/translations/en.json to an appropriate xxx.json file (into custom_components/life360/translations.) At the very least it should work (but the strings will still be in English, unless you want to convert them in the xxx.json file.)
Hi. I’m getting an error: Retrying setup: ‘NoneType’ object is not subscriptable.
From the log details:
This error originated from a custom integration.
Logger: custom_components.life360
Source: custom_components/life360/helpers.py:171
Integration: Life360 (documentation, issues)
First occurred: 11:14:19 PM (5 occurrences)
Last logged: 11:16:15 PM
Unexpected error fetching life360 ([email protected]) data: ‘NoneType’ object is not subscriptable
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 191, in _async_refresh
self.data = await self._async_update_data()
File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 150, in _async_update_data
return await self.update_method()
File “/config/custom_components/life360/init.py”, line 154, in async_update_data
return await get_life360_data(hass, api)
File “/config/custom_components/life360/helpers.py”, line 171, in get_life360_data
place = loc[“name”] or “None”
TypeError: ‘NoneType’ object is not subscriptable
@pnbruckner I am no longer getting the error! Thanks for the quick response. Now if I can figure out how to pull the battery data for my dashboard purposes. Thanks again.
First, thank you again! You have caught at least two bugs that probably would have affected many users. I very much appreciate it!
Second, the implementation in the PR submitted for the official built-in integration has changed such that the version number for the config entry storage is not changing from 1 to 2 (as in my initial implementation, which this custom integration version uses.) That means you will definitely need to back out this change from your system (and restore the configuration & known_devices.yaml) before upgrading HA to the version that will (hopefully) eventually contain the updated integration (i.e., once the PR is approved and merged.)
Glad to hear it, and thanks for exposing this bug. I think I already knew I needed to fix this, but it helps to get verification.
BTW, there still should be an error, right? I mean, instead of the exception there should now be a “proper” error message in the log. Do you see one? If so, I’d be really interested to know exactly what it says.
UPDATE: PR has been approved and merged. Therefore these changes may make it into the 2022.7 release.
REMINDER: Back out this custom integration and restore your config before you update to the HA release with the new life360 implementation (whatever release that ends up being.)