def __init__(self, hass, config: dict, see) -> None: """Initialize the TrackR device scanner.""" from pytrackr.api import trackrApiInterface self.hass = hass self.api = trackrApiInterface(config.get(CONF_USERNAME), config.get(CONF_PASSWORD)) self.see = see self.devices = self.api.get_trackrs() self._update_info() track_utc_time_change(self.hass, self._update_info, second=range(0, 60, 30))
print("Battery level: " + str(device.battery_level())) print("Icon: " + str(device.icon())) print("Time updated diff: " + str(device.time_updated_diff())) print("Group item: " + str(device.group_item())) print("Lost: " + str(device.lost())) print("\n") def update_states(): # calling update on one device will update the api interface # dictionary which stores all devices states. devices[0].update_state_from_api() email = input("Enter your trackr email: ") password = input("Enter your trackr password: "******"\n\nMove your phone/trackr so the location can change.") print( "Sleeping for 2 minutes for a device update. Not sure how long it takes.") print( "Try force closing the app and re-opening it, that should force a location update." ) time.sleep(120) update_states() output_device_states()