-
• #2
@Gordon - I am trying to figure out how to make mylocation a dependancy for pastel clock.
I've got the following in apps.json but I am not seeing mylocation installed when I install pastel clock.
"dependencies": {"mylocation":"type"},
Not very clear what 'type' means here ?
For mylocation I have:
"type": "widget",
I dont want the app to show in the launcher as its only a settings app.
I've put widget as I could not find anything else.UPDATE: changes to apps.json take an age to propage on github to your loader.
Now I am getting an error message - when I try to install pastel.<TOAST>[error] Device connection failed, Error: Dependency of 'mylocation' listed, but nothing satisfies it!
-
• #3
If set from GPS, will it update automatically, or does the wearer need to go back into the settings menu? It looks like the latter, but the former strikes me as more desirable. Obviously the idea is to not be checking GPS all the time, but is there a middle ground between actual current location and the home location?
-
• #4
The wearer will need to go back into the settings menu. Unless you travel 100s of miles to different cities everyday it does not make a lot of difference in terms of sunrise/sunset times. The majority of people will just commute to work and back and the difference in sunrise / sunset times will be in fractions of seconds. Sunrise / Sunset times for the same location change by around 2 minutes per day. In my Pastel Clock I am just scheduling a recalculation once per hour. The difference between the London Sunset and Newcastle sunset today is about 10 minutes.
It would be possible to have the GPS grab the location in the background through a widget BUT the GPS takes a lot of power and would quickly run the battery down in a few hours. Once we have worked out if it is possible to make the Bnagle 2 - GPS sleep and wake up at intervals this might lead to a low power option. I did this for the Bangle 1 - but its a lot of experimentation, trial and error and the documentation for the Bangle 2 GPS is in chinese. I have a translated version of the datasheet but have not yet got to the point where I can face starting work on it. It took about 30 hours of fiddling to get to the point of writing the gpssetup app for Bangle 1. This extended battery life from 6 hours to between 1-2 days with the GPS updating every 2 minutes.
-
• #5
Try
"dependencies": {"mylocation":"app"},
- I think that'll work? -
• #6
Pastel:
dependencies": {"mylocation":"app"}
worked in that mylocation was installed when pastel was installed - with mylocation set as a widget. But a pull request failed on mylocation as a widget.When I set mylocation to an app type, it gets shown in the loader as a blank icon and if you click on it - the watch freezes with a 'loading ....' message. This is because there is no mylocation.app.js - there is only a mylocation.settings.js file. Now I could swap them over and make the settings.js just load the App file - this is how gpssetup works if I recall.
I'll give that a go first.
UPDATE: I converted MyLocation to an App which seems like overkill just so that I can get dependency installs to work. It seems an App can depend on an App but not a widget or a simple app that just installs a xxx.settings.js file. I think we need a type = settings so we can have apps that just slot into the settings App.
Anyway just done a pull request for MyLocation, a nice Pebble Style clock and the sunrise, sunset update for Pastel. Hopefully the pull request will pass all tests now.
1 Attachment
I have produced an app which adds a settings menu to set the lat/lon of mylocation to mylocation.json. This can then be used by other apps to do calculations based on lat/lon.
For example I am using it in my Pastel clock to work out sunrise / sunset. Choose from 6 preset cities or set from the GPS.
See Readme.
https://github.com/hughbarney/BangleApps/blob/master/apps/mylocation/README.md