Jump to content

Suggestion: Code formatting


Mark Sanctuary

Recommended Posts

Posted

I have noticed in the Admin Console that the code is not evenly indented it is also noticeable in the code pasted in other posts. Also the more than one spaces in code is sometimes a bit wierd too. Could it be tweaked to use 4 or 5 spaces per nesting and nix the extra spaces?

 

First example:

 

If 
   Status AC is Off 
   And ( 
       Time is 5:00PM 
       Or Time is 4:00PM 
       And Temp > 90 
   )

Then 
   Set AC on 

Another example:

 

If 
   On Mon, Tue, Wed, Thu, Fri 
   From 9:00:00AM 
   To 5:30:00PM (same day) 

   Or On Sat 
   From 10:00:00AM 
   To 2:00:00PM (same day) 

Then 
   - No Actions - (To add one, press 'Action') 

Finally 
   - No Actions - (To add one, press 'Action') 

One more example:

 

If-(
 | Receive X10 House Code 'A' Unit Code '2' Command '3 - on'
 | Or-(
 |   | Status '04.BF.8D.1' is On
 |   | And From Sunset
 |   |     For 3 hours
 |   | And(
 |   |   |   -(
 |   |   |   | Program 'Office Hours' is True
 |   |   |   | And Program 'Office Hours' is False
 |   |   |   -)
 |   |   | Or Control '07.EB.6D.1' is Fast On
 |   |   | Or From Sunset
 |   |   |     For 4 hours
 |   |   -)
 |   -)
 -)  


If (
   Receive X10 House Code 'A' Unit Code '2' Command '3 - on'
   Or (
       Status '04.BF.8D.1' is On
       And From Sunset
           For 3 hours
       And(
              (
               Program 'Office Hours' is True
               And Program 'Office Hours' is False
              )
           Or Control '07.EB.6D.1' is Fast On
           Or From Sunset
               For 4 hours

          )
      )
  ) 

Posted

Mark,

 

Thank you. We'll revisit for the next release.

 

Regards,

Michel

I have noticed in the Admin Console that the code is not evenly indented it is also noticeable in the code pasted in other posts. Also the more than one spaces in code is sometimes a bit wierd too. Could it be tweaked to use 4 or 5 spaces per nesting and nix the extra spaces?

 

First example:

 

If 
   Status AC is Off 
   And ( 
       Time is 5:00PM 
       Or Time is 4:00PM 
       And Temp > 90 
   )

Then 
   Set AC on 

Another example:

 

If 
   On Mon, Tue, Wed, Thu, Fri 
   From 9:00:00AM 
   To 5:30:00PM (same day) 

   Or On Sat 
   From 10:00:00AM 
   To 2:00:00PM (same day) 

Then 
   - No Actions - (To add one, press 'Action') 

Finally 
   - No Actions - (To add one, press 'Action') 

One more example:

 

If-(
 | Receive X10 House Code 'A' Unit Code '2' Command '3 - on'
 | Or-(
 |   | Status '04.BF.8D.1' is On
 |   | And From Sunset
 |   |     For 3 hours
 |   | And(
 |   |   |   -(
 |   |   |   | Program 'Office Hours' is True
 |   |   |   | And Program 'Office Hours' is False
 |   |   |   -)
 |   |   | Or Control '07.EB.6D.1' is Fast On
 |   |   | Or From Sunset
 |   |   |     For 4 hours
 |   |   -)
 |   -)
 -)  


If (
   Receive X10 House Code 'A' Unit Code '2' Command '3 - on'
   Or (
       Status '04.BF.8D.1' is On
       And From Sunset
           For 3 hours
       And(
              (
               Program 'Office Hours' is True
               And Program 'Office Hours' is False
              )
           Or Control '07.EB.6D.1' is Fast On
           Or From Sunset
               For 4 hours

          )
      )
  ) 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

    • There are no registered users currently online
  • Forum Statistics

    • Total Topics
      37.2k
    • Total Posts
      372.5k
×
×
  • Create New...