Currently the order is undefined, so we're just showing them in the order that Linux gives them to us. I think it would be nice for them to be in date order, so the last updated one is first, but that's not been implemented yet!
Posts made by joerick
RE: Assigning state['volume'] = mute
Re: font size, if you're comfortable with the developer console in Tide (Window>Toggle Developer Tools), you can increase it by pasting this command into the console there:
document.getElementById('editor').style.fontSize = '16px'
but yes I definitely need to add an option for that!
RE: Assigning state['volume'] = mute
Yep, if you're using the mute global variable you need to put
global muteinside the function where it's set, so in your case it should be in the
This annoying error is why we recommend that the
statedict is used instead for app memory. So I'd suggest setting
RE: Webhook submits last data every hour
Yes, that's by design, so that apps can start up and get some info from the webhook straight away.
You'll also see a webhook event if your network goes down and up.
If you want to get just events, you could pass a datestamp or a UUID in your POST to the webhook and look at that on the Tingbot to tell if the event is new.
RE: More pygame drawing options.
Because Tingbot libs are built on top of pygame, all those functions are available for use as well as the tingbot-python functions. You just use them with
screen.surfaceas the pygame drawing surface.
Here's an example:
import tingbot from tingbot import * import pygame @every(seconds=1.0/30) def loop(): screen.fill(color='black') pygame.draw.circle( screen.surface, (255, 255, 255), (120, 120), 100, ) tingbot.run()
RE: ansii encoding
In Python 2, you need to specify the encoding of each file. This just means putting the following at the top of each file:
# coding: utf8
Then, if you want to use a character in a string, put a
ucharacter before the quote, e.g.
screen.text(u'In Belgium, we use the character ë.')
ucharacter tells Python that this string is a 'unicode' string, which is a different type from the normal strings.
RE: Remote access
You're right that most VNC servers latch onto the X session, so that's not going to work.
I haven't tried but this project might work: https://github.com/ponty/framebuffer-vncserver it's display only though, so you'd only be able to see what the app was doing with that.
Maybe you could use webhooks to send commands to your app?
RE: Exiting Apps
Hi @rufflemuffin! It's possible that your buttons are not wired up correctly - perhaps you could check all combos of buttons to see if that makes the current app exit? You should be pressing two buttons at the same time. If you're installing Tingbot OS by flashing the SD card in the normal way there's nothing extra that you should need to do for this to work. Let me know how you get on! Joe
RE: Variable @every
It's possible! Here's what I would do:
import time intervalposition = 1 intervals = [0,1,3,5,10,20,30,60] last_action_time = 0 def action(): # here is your action code! pass @every(seconds=1.0/30) def main(): action_interval = intervals[intervalposition] next_action_fire_time = last_action_time + action_interval if time.time() > next_action_fire_time: action() last_action_time = time.time()
So here you're running the
main()function all the time, but it is checking if it's the right time to call
action(), which is where your code will go. Since
action_intervalis being checked continuously, you can change your interval position and it'll react immediately.
🏪 We have a shop! Order a new Tingbot today!
We just launched our new shop! If you missed out on the Kickstarter, want to get one for Christmas, or just want another one for yourself head on over!
To get them in time for Christmas, make sure your orders are in by 6pm Thursday the 15th (UK only). If you’re after this date, or not in the UK, we can’t be sure they’ll be there in time.
RE: Bluetooth sound
It's not something I've tried myself (I use a USB sound card in my project), but after reading some tutorials I think that this one looks good - https://www.raspberrypi.org/magpi/bluetooth-audio-raspberry-pi-3/ - Note you'll have to SSH into the Tingbot, and instead of using Bluetooth Manager, you could try using
bluetoothctlon the command line.
RE: Springboard problems
Hey geab! We don't normally upload the springboard from Tide - it won't install into the right place on the tingbot to be used as the default app. But you should be able to 'Run' that app on the Tingbot to test out changes while developing it. Is that what you're trying to do?