code: function isSunInWindow(blind, azimuth) {
      var sunInWindow = false;
  
      /*
       * Checks the sun azimuth is between window orientation +/- offset.
       * Where the range includes ranges each side of north, separate checks
       * need to be performed either side of north
       */
      if (blind.orientation - blind.noffset < 0) {
        if (
          (360 + blind.orientation - blind.noffset <= azimuth) &
            (azimuth <= 360) ||
          (0 <= azimuth && azimuth <= blind.orientation + blind.poffset)
        ) {
          sunInWindow = true;
        }
      } else if (blind.orientation + blind.poffset > 360) {
        if (
          (0 <= azimuth) & (azimuth <= blind.orientation + blind.poffset - 360) ||
          (blind.orientation - blind.noffset <= azimuth && azimuth <= 360)
        ) {
          sunInWindow = true;
        }
      } else {
        if (
          blind.orientation - blind.noffset <= azimuth &&
          azimuth <= blind.orientation + blind.poffset
        ) {
          sunInWindow = true;
        }
      }
      return sunInWindow;
    }
docs: /*
  Function to determine whether the sun is considered to be in the window
  based on the orientation of the window and the azimuth of the sun