Hi,
Could you describe more precisely what you want to do?
If you just want to display a message, there is no need to create a custom “layout” / device template. The generic device template can handle this quite well if you declare the message attribute:
class MyHelloWorld extends env.devices.Device
attributes:
message:
description: "The message to display"
type: "string"
constructor : (@config) ->
env.logger.info(@config)
@id = @config.id
@name = @config.name
@_message = @config.message
super()
getMessage: -> Promise.resolve(@_message)
It should display the message attribute automatically at the right of the device.
If you still need to create a custom template you can do it by setting the template attribute:
class MyHelloWorld extends env.devices.Device
attributes:
message:
description: "The message to display"
type: "string"
template: 'MyHelloWorld'
constructor : (@config) ->
env.logger.info(@config)
@id = @config.id
@name = @config.name
@_message = @config.message
super()
getMessage: -> Promise.resolve(@_message)
You don’t need a template-getter function, the docs are out of date, I will update them. (The :
in template: 'MyHelloWorld'
is important, check the coffeescript docs for more details.) If you need more details let me know. Be sure to set the “mode” setting of the mobile-frontend to “development” and clear all caches.