Reply
Thread Tools
Posts: 1,313 | Thanked: 2,977 times | Joined on Jun 2011 @ Finland
#1101
Originally Posted by Morpog View Post
As you hit version 2.0, I donated a 2nd time.

Thanks for this great app and ongoing support!
Thank you for the support (again), much appreciated!
__________________
My N9/N950 projects:
 
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#1102
Had a little time to test the alarm action. Seems to work ok except for the obvious snooze problem. I don't know how c++ works but in the simple-client source code, snooze is set with event.setSnooze. I suppose it's not that simple?

Is it at all possible to set the 'application' value as 'clock' so maybe the alarm(s) would show in the stock application? I mainly ask because it's now (almost) impossible to for example cancel a set alarm.

I also got a call when testing this and had some peculiar behaviour when the alarm was supposed to go off while the call was active. The alarm went off only when I brought the ProfileMatic UI to the front.

I'll test some more tomorrow once I'm sober enough... Have a good weekend!
 

The Following 2 Users Say Thank You to slarti For This Useful Post:
Posts: 1,313 | Thanked: 2,977 times | Joined on Jun 2011 @ Finland
#1103
Originally Posted by slarti View Post
Had a little time to test the alarm action. Seems to work ok except for the obvious snooze problem. I don't know how c++ works but in the simple-client source code, snooze is set with event.setSnooze. I suppose it's not that simple?
Actually it was that simple... I didn't even consider that as the interface made no sense at all. SetSnooze can be called if you want to add custom buttons - but of course no custom buttons were needed, I had the default buttons there. Furthermore, me calling addButton and setSnooze on it didn't actually add any buttons. But it did alter the snooze behaviour.

So now all is well and good. I have updated the beta version.

Is it at all possible to set the 'application' value as 'clock' so maybe the alarm(s) would show in the stock application? I mainly ask because it's now (almost) impossible to for example cancel a set alarm.
I put into the new beta the application as clock. It shows in the stock application. Unfortunately it shows always 00:00 as time. And trying to disable the alarm has no effect at all. I do not know how that could be fixed, so I'm leaning on it being better not shown at all in the stock application if it can't be controlled...

I also got a call when testing this and had some peculiar behaviour when the alarm was supposed to go off while the call was active. The alarm went off only when I brought the ProfileMatic UI to the front.
That is weird... and I can only guess that me setting application as ProfileMatic in that beta could somehow affect that. I have not experienced such problems, but I have not also had an alarm during phone call. Let me know if you find out more.

I'll test some more tomorrow once I'm sober enough... Have a good weekend!
Good weekend also... listening to alarms is a good way to shake the last remaining bits of hangover :P.
__________________
My N9/N950 projects:
 

The Following 2 Users Say Thank You to ajalkane For This Useful Post:
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#1104
Originally Posted by ajalkane View Post
I put into the new beta the application as clock. It shows in the stock application. Unfortunately it shows always 00:00 as time. And trying to disable the alarm has no effect at all. I do not know how that could be fixed, so I'm leaning on it being better not shown at all in the stock application if it can't be controlled...
I think this is fixable. You just need a few more attributes set for the event to make sense to the clock application.

Here are the attributes from an event set by PM:

Code:
QMap(("APPLICATION", QVariant(QString, "clock") ) ( "COOKIE" ,  QVariant(QString, "25124") ) ( "PLUGIN", QVariant(QString, "libclockalarm") ) ( "STATE" ,  QVariant(QString, "QUEUED") ) ( "TITLE" ,  QVariant(QString, "Guuu") ) )
And here is a 'normal' alarm:

Code:
QMap(("APPLICATION", QVariant(QString, "clock") ) ( "COOKIE" ,  QVariant(QString, "25125") ) ( "PLUGIN" ,  QVariant(QString, "libclockalarm") ) ( "STATE" ,  QVariant(QString, "QUEUED") ) ( "TITLE" ,  QVariant(QString, "Test") ) ( "alarmtime" ,  QVariant(QString, "07:30") ) ( "enabled" ,  QVariant(QString, "1") ) ( "snooze" ,  QVariant(QString, "10") ) ( "sound" ,  QVariant(QString, "/usr/share/sounds/ring-tones/Clock 2.mp3") ) ( "trigger" ,  QVariant(QString, "1361079000") )
So you're missing "alarmtime", "enabled", "snooze", "sound" and "trigger"

It is possible to delete the event from the clock application even in this version.

Originally Posted by ajalkane View Post
That is weird... and I can only guess that me setting application as ProfileMatic in that beta could somehow affect that. I have not experienced such problems, but I have not also had an alarm during phone call. Let me know if you find out more.
It doesn't behave oddly with this version. At least not in the two calls I tried.

Originally Posted by ajalkane View Post
Good weekend also... listening to alarms is a good way to shake the last remaining bits of hangover :P.
Nothing compared to the shrieking kids who think it's funny to see daddy being a bit nauseous...
 

The Following User Says Thank You to slarti For This Useful Post:
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#1105
One more question about the appendRule method and its dbus struct. The part that has the time conditions start or stop times has four different integers. The first two are hours and minutes. What are the last two that are always zero?
 
Posts: 1,313 | Thanked: 2,977 times | Joined on Jun 2011 @ Finland
#1106
Thanks. Those missing attributes seem very promising. I will test on Monday. And can set the sound file individually for each alarm? Must include that if it works.

The third pair of numbers in time structure are seconds. Not really used by PM so that's why they are always zero.
__________________
My N9/N950 projects:
 

The Following User Says Thank You to ajalkane For This Useful Post:
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#1107
Originally Posted by ajalkane View Post
And can set the sound file individually for each alarm? Must include that if it works.
You can, at least in the stock application.

Originally Posted by ajalkane View Post
The third pair of numbers in time structure are seconds. Not really used by PM so that's why they are always zero.
I thought so. I tried to update my alarm rule with second accuracy so that it would execute the actions the second the alarm goes off. I guess PM uses minute accuracy for execution.

That's ok. I don't know if I actually have a use for that precision.
 

The Following User Says Thank You to slarti For This Useful Post:
Posts: 1,313 | Thanked: 2,977 times | Joined on Jun 2011 @ Finland
#1108
Originally Posted by slarti View Post
I think this is fixable. You just need a few more attributes set for the event to make sense to the clock application.

Here are the attributes from an event set by PM:

Code:
QMap(("APPLICATION", QVariant(QString, "clock") ) ( "COOKIE" ,  QVariant(QString, "25124") ) ( "PLUGIN", QVariant(QString, "libclockalarm") ) ( "STATE" ,  QVariant(QString, "QUEUED") ) ( "TITLE" ,  QVariant(QString, "Guuu") ) )
Btw. are you using some dbus command to query the attributes, and if so can you paste it here? I think it'd useful while I'm iterating this thing.
__________________
My N9/N950 projects:
 
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#1109
I'm actually using the simple-client but you can use this script to get the attributes for everything with "APPLICATION":"clock"

EDIT: Made it print out more nicely

Code:
#!/usr/bin/python

import dbus

bus = dbus.SystemBus()

time_obj = bus.get_object('com.nokia.time', '/com/nokia/time')
time_intf = dbus.Interface(time_obj, 'com.nokia.time')

cookies = time_intf.get_cookies_by_attributes({'APPLICATION': 'clock'})

for cookie in cookies:
        attributes = time_intf.query_attributes(cookie)
        print cookie
        for key,value in attributes.items():
                print '   '+key,value

Last edited by slarti; 2013-02-18 at 18:24.
 

The Following User Says Thank You to slarti For This Useful Post:
Posts: 1,313 | Thanked: 2,977 times | Joined on Jun 2011 @ Finland
#1110
The beta version with alarm action has been updated again.

It is now as good as I could get it, thought not exactly how I wanted. But still pretty good:

- You can set alarms
- Title for the alarm must be set
- How long until alarm fires when condition is activated must be set
- Advanced option: set snooze time (if not set the default is used, typically 10 minutes)
- Advanced option: set the sound file to play when alarm is activated. A full file path must be set, I have not included any file manager nor similar selector as in the clock application - nor do I intend to.
- An active alarm is shown in clock application. If you snooze ProfileMatic's alert, it will remain in the clock application. But if you press "Stop" on the alarm, it will be removed from the clock application. If you have snoozed the alarm, and disable it from clock UI, it will become your responsibility to delete it. In other words, if you disable it from clock UI, and ProfileMatic issues new alarms with same title you will end up with several same titled alarms in the clock UI.

Thanks to slarti for help in getting the alarm action working this well. It really would be much less functional without his help.

Unless there's some feedback that I can do something about, this will be what'll be in the next release.
__________________
My N9/N950 projects:
 

The Following 7 Users Say Thank You to ajalkane For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 13:57.