Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Suggestion: Code formatting

Featured Replies

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

          )
      )
  ) 

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

          )
      )
  ) 

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.