We have moved at community.getvera.com

Author Topic: Global functions  (Read 2570 times)

Offline waynebrady

  • Full Member
  • ***
  • Posts: 110
  • Karma: +0/-0
Global functions
« on: October 26, 2011, 02:14:04 pm »
Can someone tell me if there is a place where I can place global functions to be reused in multiple scenes?

The reason for this is because I want to write an email function, and I want to stop duplicating the same function in every one of my scenes.

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: Global functions
« Reply #1 on: October 26, 2011, 02:24:18 pm »
Does this thread help?

Also, have you seen the SND plug-in?
« Last Edit: October 26, 2011, 02:38:23 pm by oTi@ »
Dezwaved at the moment...

Offline mysticjay

  • Full Member
  • ***
  • Posts: 184
  • Karma: +1/-1
Re: Global functions
« Reply #2 on: October 26, 2011, 11:23:25 pm »
I had the same question, posted in Prog/General and saw this one...so removed mine...thx oTi@
Vera 2 (1.1.1338), Trane TZEMT400BB3,ML IWD600S(2), ML IWS1000S(2) , FI8905W, Aeon DSB04100-ZWUS, GE 45609(2), GE 45606(2), GE 45608, GE 45614 (5), LFM-20(2), Kwikset 99100-011 (5) , Hawking HRMD1, Droid X and Xoom as Remotes, Harmony Link

Offline waynebrady

  • Full Member
  • ***
  • Posts: 110
  • Karma: +0/-0
Re: Global functions
« Reply #3 on: October 27, 2011, 12:14:06 am »
oTi@ -

Thanks! Just tried it and it works like a charm!

Offline waynebrady

  • Full Member
  • ***
  • Posts: 110
  • Karma: +0/-0
Re: Global functions
« Reply #4 on: October 27, 2011, 12:16:31 am »
It's kind of annoying that I have to SCP my updates via the terminal. Is there a way of making a plugin out of this so that it can be updated via the UI4 interface?

I ask because I usually don't have access to my LAN, but have access to the web interface.

Offline mcvflorin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1755
  • Karma: +11/-3
Re: Global functions
« Reply #5 on: October 27, 2011, 06:51:16 am »
That's a good plugin idea: an interface for uploading Lua files to /usr/lib/lua. Let's see if I can make one quickly.

Edit: It appears that it would take longer than I first thought, so I won't make the plugin now.
« Last Edit: October 27, 2011, 07:49:06 am by mcvflorin »

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: Global functions
« Reply #6 on: October 27, 2011, 07:21:32 am »
Possibly as workaround for now, upload via the existing interface, then:

https://<fwd1|fwd2>.mios.com/<user>/<pass>/<serial>/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunLua&Code=os.execute("mv /etc/cmh-ludl/<filename> /usr/lib/lua")
« Last Edit: October 27, 2011, 07:36:47 am by oTi@ »
Dezwaved at the moment...

Offline waynebrady

  • Full Member
  • ***
  • Posts: 110
  • Karma: +0/-0
Re: Global functions
« Reply #7 on: October 28, 2011, 02:58:02 am »
oTi-

Nice. Does that mean I can access a http-formed link to arm my vista20p alarm as well?