Moving this part after the end of callback breaks GS 3.10. After line 907, [device_id, device_type, icon, percentage, state, seconds] are losing their values. Probably GetDevicesRemote is called asyncronously, which means that code here is executed even before code into callback.
To avoid duplicating code, you can have a
```
update_battery_values: function (seconds, percentage, icon) {
    if (seconds > 60){
        let time = Math.round(seconds / 60);
        let minutes = time % 60;
        let hours = Math.floor(time / 60);
        this.timeString = C_("battery time remaining","%d:%02d").format(hours,minutes);
    } else {
        this.timeString = '-- ';
    }
    this.percentage = Math.ceil(percentage);
    this.gicon = Gio.icon_new_for_string(icon);
    if (Schema.get_boolean(this.elt + '-display'))
        this.actor.show()
    if (Schema.get_boolean(this.elt + '-show-menu'))
        this.menu_item.actor.show();
    }
}
```
and call it both into callback(before line 907) and in first part of if clause.