Announcement

Collapse
No announcement yet.

[VB.NET] updateEvent healper functions discussion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [VB.NET] updateEvent healper functions discussion

    discussion for helper functions scripts located here:
    http://forums.homeseer.com/showthread.php?p=985620
    Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

  • #2
    Dan

    These functions are great, thank you. I have a simple one, the right time to turn on yard lights, that has been pesky. Its dusk, unless cloudy or darker, which can happen intermittently too early. Isnowafter helps solve that.

    Isevtenabled helps with my code that manages SNEVL sprinklers.

    I like that its written around readability of the final code. It helps when coding and months later when I will go back to change or scatch my head.

    Thanks for your work on this.

    Paul
    Paul

    Comment


    • #3
      Great addition! I will be using that!

      But if I can comment on just one thing...
      Functions should in .NET use the "Return" statement instead of setting the function name to a value (which is mostly included to be backwards compatible).

      Like this:
      Code:
      Public Function SomeName(byval somevalue as Integer) as String
           'Do something clever here
           Return "This is correct"
      End Function


      It doesn't really matter, but it improves readability by much. In my opinion.
      HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
      Running on Windows 10 (64) virtualized
      on ESXi (Fujitsu Primergy TX150 S8).
      WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

      Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

      Comment


      • #4
        Thanks! I did not know. I saw an example online, while trying to figure out how to make a sub return.

        I'll try to make that change soon and then re-post.

        Any other additions?

        --Dan
        Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

        Comment


        • #5
          Originally posted by pbibm View Post
          Dan

          These functions are great, thank you. I have a simple one, the right time to turn on yard lights, that has been pesky. Its dusk, unless cloudy or darker, which can happen intermittently too early. Isnowafter helps solve that.

          Isevtenabled helps with my code that manages SNEVL sprinklers.

          I like that its written around readability of the final code. It helps when coding and months later when I will go back to change or scatch my head.

          Thanks for your work on this.

          Paul
          Paul,

          I am glad to hear this is working for you.

          I just really got annoyed with having to remember how to format the time/date math stuff. Then, afterwords I had to document the snot out of it to remember...which was a pain. So I thought, make it human readable. isafter, is before, etc. Then it turns into SIMPLE TRUE/FALSE.

          I have a few more additions to the updateevent.vb, after that is done and tested, I'll try to make the change that moskus suggested.

          --Dan
          Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

          Comment

          Working...
          X