A number of Kickstarter projects launched by citizens of the countries of the former USSR proved to be successful.
This
article lists some of them. Perhaps one of the most successful Ukrainian projects is the
smart LaMetric indicator . The highlight of this indicator is the possibility of writing additional programs for it (he is “smart”).
Introduction
The indicator was developed by Lviv. On Habré there are two articles from one of the developers
one ,
two . The articles describe the device hardware. I want to pay attention to the software.
The device comes with five pre-installed programs:
- clock
- weather indicator
- internet radio
- stopwatch
- timer

In addition, about fifty other programs are also available for installation from a special Store, such as, for example, indicators of the number of Facebook page likes or people in space at the moment:

Development
LaMetric software is divided into two classes: Indicator App and Button App. To first class
These are applications that display some useful information in real time. To the second - those that perform some action when you press the central button on the top panel of the device.
')
We will develop a small LaMetric-application that will show the current price of a barrel of Brent oil from the
site . Before developing it is necessary to register on the
site of developers .
Display information application indicators can be in four ways:
- Name - just text with icon
- Metric - much like Name, the developer interface offers a number of predefined icons, such as the up and down arrows
- Goal - sets the initial and desired final value of a parameter. The application displays the current value and progress towards the goal.
- Sparkline - data is displayed as a histogram
According to the method of obtaining information, the Indicator App is divided into two types:
- Poll - the application will poll the specified resource at a specified frequency
- Push - the application should transfer data for display using a POST request
Whatever type is used, Metric applications accept data in the form of the following JSON:
{ "frames": [ { "index": 0, "text": "40$", "icon": "i124" } ] }
If the application transmits multiple frames, they will scroll in the specified order. The “icon” parameter indicates the icon that will be displayed from the left edge of the indicator.
I picked up a small server on Google App Engine, which on a GET request gives information in the required format. The main server code is shown below:
class MainPage(webapp2.RequestHandler): def get(self): price = self.newPrice() oldPrice = Price.oldPrice() icon = ICON_EQ if oldPrice.value > price: icon = ICON_DOWN elif oldPrice.value < price: icon = ICON_UP data = { "frames": [ { "index": 0, "text": "%.2f$" % price, "icon": icon } ] } self.response.headers['Content-Type'] = 'Application/json' self.response.write(dumps(data)) def newPrice(self): result = urlfetch.fetch('http://bloomberg.com/energy/') tree = etree.HTML(result.content) prices = tree.xpath('//td[@class="data-table__row__cell"][@data-type="value"]/text()') return float(prices[1])
The full code can be viewed on
Github .
LaMetric application development comes down to choosing how to display information:

and specify the method of delivery of information:

In the Store Info section, you must specify the icon and description of the application:

After the application is published, it becomes available in the Store and can be installed on the device:

Thus, the smart LaMetric indicator allows you to make available a variety of useful (and not very) information.
The project is actively developing. In the plans of developers, for example, support for
IFTTT and Google Analytics.