public override ScriptObject Compute(TokenType type, ScriptObject obj)
        {
            ScriptNumber val = obj as ScriptNumber;

            if (val == null)
            {
                throw new ExecutionException(Script, "逻辑计算 右边值必须为数字类型");
            }
            switch (type)
            {
            case TokenType.Plus:
                return(Script.CreateDouble(m_Value + val.ToDouble()));

            case TokenType.Minus:
                return(Script.CreateDouble(m_Value - val.ToDouble()));

            case TokenType.Multiply:
                return(Script.CreateDouble(m_Value * val.ToDouble()));

            case TokenType.Divide:
                return(Script.CreateDouble(m_Value / val.ToDouble()));

            case TokenType.Modulo:
                return(Script.CreateDouble(m_Value % val.ToDouble()));

            default:
                throw new ExecutionException(Script, "Double不支持的运算符 " + type);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Compares the object to another giving a result of less than, equal to, or greater than.
        /// </summary>
        /// <param name="obj">The object to compare.</param>
        /// <returns>Integer value corresponding to less than, equal to, or greater than.</returns>
        public int CompareTo(object obj)
        {
            var other = (UniqueChange)obj;

            // Compare versions if both folders are in version format v1.0.0.0.
            int result;

            if (Version != null && other.Version != null)
            {
                result = Version.CompareTo(other.Version);
            }
            else
            {
                // Compare folder names as is.
                result = string.Compare(Folder, other.Folder, StringComparison.InvariantCultureIgnoreCase);
            }

            // Compare script number of folders are the same.
            if (result == 0)
            {
                result = ScriptNumber.CompareTo(other.ScriptNumber);
            }

            return(result);
        }
        public override ScriptObject AssignCompute(TokenType type, ScriptObject obj)
        {
            ScriptNumber val = obj as ScriptNumber;

            if (val == null)
            {
                throw new ExecutionException(Script, "逻辑计算 右边值必须为数字类型");
            }
            switch (type)
            {
            case TokenType.AssignPlus:
                m_Value += val.ToDouble();
                return(this);

            case TokenType.AssignMinus:
                m_Value -= val.ToDouble();
                return(this);

            case TokenType.AssignMultiply:
                m_Value *= val.ToDouble();
                return(this);

            case TokenType.AssignDivide:
                m_Value /= val.ToDouble();
                return(this);

            case TokenType.AssignModulo:
                m_Value %= val.ToDouble();
                return(this);

            default:
                throw new ExecutionException(Script, "Double不支持的运算符 " + type);
            }
        }
Beispiel #4
0
        public override ScriptObject AssignCompute(TokenType type, ScriptNumber obj)
        {
            switch (type)
            {
            case TokenType.AssignPlus:
                m_Value += obj.ToDouble();
                return(this);

            case TokenType.AssignMinus:
                m_Value -= obj.ToDouble();
                return(this);

            case TokenType.AssignMultiply:
                m_Value *= obj.ToDouble();
                return(this);

            case TokenType.AssignDivide:
                m_Value /= obj.ToDouble();
                return(this);

            case TokenType.AssignModulo:
                m_Value %= obj.ToDouble();
                return(this);

            default:
                throw new ExecutionException("Double不支持的运算符 " + type);
            }
        }
        private ScriptObject ResolveOperand(CodeObject value)
        {
            m_script.SetStackInfo(value.StackInfo);
            ScriptObject ret = ResolveOperand_impl(value);

            if (value.Not)
            {
                ScriptBoolean b = ret as ScriptBoolean;
                if (b == null)
                {
                    throw new ExecutionException("Script Object Type [" + ret.Type + "] is cannot use [!] sign");
                }
                ret = b.Inverse();
            }
            else if (value.Negative)
            {
                ScriptNumber b = ret as ScriptNumber;
                if (b == null)
                {
                    throw new ExecutionException("Script Object Type [" + ret.Type + "] is cannot use [-] sign");
                }
                ret = b.Negative();
            }
            return(ret);
        }
        private ScriptObject GetVariable(CodeMember member)
        {
            ScriptObject ret = null;

            if (member.Parent == null)
            {
                string       name = member.MemberString;
                ScriptObject obj  = GetVariableObject(name);
                ret = (obj == null ? m_script.GetValue(name) : obj);
            }
            else
            {
                ret = ResolveOperand(member.Parent).GetValueInternal(GetMember(member));
            }
            if (ret == null)
            {
                throw new ExecutionException("GetVariable member is error");
            }
            if (member.Calc != CALC.NONE)
            {
                ScriptNumber num = ret as ScriptNumber;
                if (num == null)
                {
                    throw new ExecutionException("++或者--只能应用于Number类型");
                }
                return(num.Calc(member.Calc));
            }
            return(ret);
        }
Beispiel #7
0
        public override bool Compare(TokenType type, ScriptNumber num)
        {
            ScriptNumberLong val = num as ScriptNumberLong;

            if (val == null)
            {
                throw new ExecutionException("数字比较 两边的数字类型不一致 请先转换再比较 ");
            }
            switch (type)
            {
            case TokenType.Greater:
                return(m_Value > val.m_Value);

            case TokenType.GreaterOrEqual:
                return(m_Value >= val.m_Value);

            case TokenType.Less:
                return(m_Value < val.m_Value);

            case TokenType.LessOrEqual:
                return(m_Value <= val.m_Value);

            default:
                throw new ExecutionException("Number类型 操作符[" + type + "]不支持");
            }
        }
Beispiel #8
0
        ScriptObject ResolveOperand(CodeObject value)
        {
            m_script.SetStackInfo(value.StackInfo);
            ScriptObject ret = ResolveOperand_impl(value);

            if (value.Not)
            {
                ret = m_script.CreateBool(!ret.LogicOperation());
            }
            else if (value.Minus)
            {
                ScriptNumber b = ret as ScriptNumber;
                if (b == null)
                {
                    throw new ExecutionException(m_script, "Script Object Type [" + ret.Type + "] is cannot use [-] sign");
                }
                ret = b.Minus();
            }
            else if (value.Negative)
            {
                ScriptNumber b = ret as ScriptNumber;
                if (b == null)
                {
                    throw new ExecutionException(m_script, "Script Object Type [" + ret.Type + "] is cannot use [~] sign");
                }
                ret = b.Negative();
            }
            return(ret);
        }
Beispiel #9
0
        public override ScriptObject AssignCompute(Scorpio.Compiler.TokenType type, ScriptObject obj)
        {
            ScriptNumber number = obj as ScriptNumber;

            if (number == null)
            {
                throw new ExecutionException(base.m_Script, this, "赋值逻辑计算 右边值必须为数字类型");
            }
            switch (type)
            {
            case Scorpio.Compiler.TokenType.AssignMinus:
                this.m_Value -= number.ToDouble();
                return(this);

            case Scorpio.Compiler.TokenType.AssignMultiply:
                this.m_Value *= number.ToDouble();
                return(this);

            case Scorpio.Compiler.TokenType.AssignDivide:
                this.m_Value /= number.ToDouble();
                return(this);

            case Scorpio.Compiler.TokenType.AssignModulo:
                this.m_Value = this.m_Value % number.ToDouble();
                return(this);

            case Scorpio.Compiler.TokenType.AssignPlus:
                this.m_Value += number.ToDouble();
                return(this);
            }
            throw new ExecutionException(base.m_Script, this, "Double不支持的运算符 " + type);
        }
Beispiel #10
0
 public CodeMember(ScriptNumber mem, CodeObject parent)
 {
     this.Parent             = parent;
     this.MemberNumber       = mem.ToInt32();
     this.MemberNumberObject = mem.ObjectValue;
     this.Type = MEMBER_TYPE.NUMBER;
 }
Beispiel #11
0
        private ScriptObject ResolveOperand(CodeObject value)
        {
            this.m_script.SetStackInfo(value.StackInfo);
            ScriptObject obj2 = this.ResolveOperand_impl(value);

            if (value.Not)
            {
                return(this.m_script.CreateBool(!obj2.LogicOperation()));
            }
            if (value.Minus)
            {
                ScriptNumber number = obj2 as ScriptNumber;
                if (number == null)
                {
                    throw new ExecutionException(this.m_script, "Script Object Type [" + obj2.Type + "] is cannot use [-] sign");
                }
                return(number.Minus());
            }
            if (!value.Negative)
            {
                return(obj2);
            }
            ScriptNumber number2 = obj2 as ScriptNumber;

            if (number2 == null)
            {
                throw new ExecutionException(this.m_script, "Script Object Type [" + obj2.Type + "] is cannot use [~] sign");
            }
            return(number2.Negative());
        }
Beispiel #12
0
        public override ScriptObject Compute(Scorpio.Compiler.TokenType type, ScriptObject obj)
        {
            ScriptNumber number = obj as ScriptNumber;

            if (number == null)
            {
                throw new ExecutionException(base.m_Script, this, "逻辑计算 右边值必须为数字类型");
            }
            Scorpio.Compiler.TokenType type2 = type;
            if (type2 != Scorpio.Compiler.TokenType.Plus)
            {
                switch (type2)
                {
                case Scorpio.Compiler.TokenType.Multiply:
                    return(new ScriptNumberDouble(base.m_Script, this.m_Value * number.ToDouble()));

                case Scorpio.Compiler.TokenType.Divide:
                    return(new ScriptNumberDouble(base.m_Script, this.m_Value / number.ToDouble()));

                case Scorpio.Compiler.TokenType.Modulo:
                    return(new ScriptNumberDouble(base.m_Script, this.m_Value % number.ToDouble()));

                case Scorpio.Compiler.TokenType.Minus:
                    return(new ScriptNumberDouble(base.m_Script, this.m_Value - number.ToDouble()));
                }
            }
            else
            {
                return(new ScriptNumberDouble(base.m_Script, this.m_Value + number.ToDouble()));
            }
            throw new ExecutionException(base.m_Script, this, "Double不支持的运算符 " + type);
        }
Beispiel #13
0
        public void SetThermostatHold(ScriptNumber thermostatId, ScriptNumber value)
        {
            var id = _thermostats[thermostatId.ToPrimitiveInt32() - 1];

            Logger.DebugFormat("{0} Setting Nest Thermostat {1} Target Temperature to {2}", DriverDisplayNameInternal, id.Name, value);
            _nestController.SetTargetTemperatureF(id.DeviceId, value.ToPrimitiveInt32());
        }
 public override ScriptNumber Clamp(ScriptNumber min, ScriptNumber max) {
     if (m_Value < min.ToDouble())
         return new ScriptNumberDouble(m_Script, min.ToDouble());
     if (m_Value > max.ToDouble())
         return new ScriptNumberDouble(m_Script, max.ToDouble());
     return new ScriptNumberDouble(m_Script, m_Value);
 }
Beispiel #15
0
        public void SetThermostatFanMode(ScriptNumber thermostatId, ScriptNumber mode)
        {
            var id = _thermostats[thermostatId.ToPrimitiveInt32() - 1];

            Logger.DebugFormat("{0} Setting Nest Thermostat {1} fan time mode to {2}", DriverDisplayNameInternal, id.Name, mode.ToPrimitiveBoolean());
            _nestController.SetFanTimer(id.DeviceId, mode.ToPrimitiveBoolean());
        }
Beispiel #16
0
        public void SetThermostatMode(ScriptNumber thermostatId, ScriptNumber mode)
        {
            var id    = _thermostats[thermostatId.ToPrimitiveInt32() - 1];
            var state = new[] { "off", "heat", "cool", "heat-cool" }[mode.ToPrimitiveInt32()];

            Logger.DebugFormat("{0} Setting Nest Thermostat {1} HVAC mode to {2}", DriverDisplayNameInternal, id.Name, state);
            _nestController.SetHvacMode(id.DeviceId, state);
        }
Beispiel #17
0
        public void SetThermostatAwayMode(ScriptNumber structureId, ScriptNumber mode)
        {
            var id    = _structures[structureId.ToPrimitiveInt32() - 1];
            var state = new[] { "home", "away", "auto-away" }[mode.ToPrimitiveInt32()];

            Logger.DebugFormat("{0} Setting Nest Structure {1} occupancy state to {2}", DriverDisplayNameInternal, id.Name, state);
            _nestController.SetAwayState(id.StructureId, state);
        }
            public object Call(ScriptObject[] args)
            {
                Util.Assert(args.Length == 2, m_script, "toenum 第一个参数是枚举类 第二个参数必须是number类型");
                ScriptUserdata obj    = args[0] as ScriptUserdata;
                ScriptNumber   number = args[1] as ScriptNumber;

                Util.Assert(obj != null && number != null, m_script, "toenum 第一个参数是枚举类 第二个参数必须是number类型");
                return(new ScriptEnum(m_script, Util.ToEnum(obj.ValueType, number.ToInt32())));
            }
Beispiel #19
0
        //返回变量数据
        private CodeObject GetVariable(CodeObject parent)
        {
            CodeObject ret = parent;

            for ( ; ;)
            {
                Token m = ReadToken();
                if (m.Type == TokenType.Period)
                {
                    ret = new CodeMember(ReadIdentifier(), ret);
                }
                else if (m.Type == TokenType.LeftBracket)
                {
                    CodeObject member = GetObject();
                    ReadRightBracket();
                    if (member is CodeScriptObject)
                    {
                        ScriptObject obj = ((CodeScriptObject)member).Object;
                        if (member.Not)
                        {
                            ret = new CodeMember(!obj.LogicOperation(), ret);
                        }
                        else if (member.Negative)
                        {
                            ScriptNumber num = obj as ScriptNumber;
                            if (num == null)
                            {
                                throw new ParserException("Script Object Type [" + obj.Type + "] is cannot use [-] sign", m);
                            }
                            ret = new CodeMember(num.Negative().KeyValue, ret);
                        }
                        else
                        {
                            ret = new CodeMember(obj.KeyValue, ret);
                        }
                    }
                    else
                    {
                        ret = new CodeMember(member, ret);
                    }
                }
                else if (m.Type == TokenType.LeftPar)
                {
                    UndoToken();
                    ret = GetFunction(ret);
                }
                else
                {
                    UndoToken();
                    break;
                }
                ret.StackInfo = new StackInfo(m_strBreviary, m.SourceLine);
            }
            return(ret);
        }
        public void SetLightLevel(ScriptNumber lightId, ScriptNumber percentOn)
        {
            Logger.InfoFormat("Setting light #{0} level to '{1}'", lightId, percentOn);
            var value = Math.Ceiling(percentOn.ToPrimitiveDouble() * 2.55);

            _lightService.SetLightStateAsync(lightId.ToPrimitiveInt32(), new
            {
                on  = true, // cannot modify brightness when light is off
                bri = value
            });
        }
        public void SetLightColor(ScriptNumber lightId, ScriptString value)
        {
            Logger.InfoFormat("Setting light #{0} color to '{1}'", lightId, value);
            var cgPoint = HueColorConverter.XyFromColor(value.ToPrimitiveString().Replace(" ", ""));

            _lightService.SetLightStateAsync(lightId.ToPrimitiveInt32(), new
            {
                on = true,  // cannot modify color when light is off
                xy = new[] { cgPoint.x, cgPoint.y }
            });
        }
Beispiel #22
0
        public override ScriptObject AssignCompute(TokenType type, ScriptObject obj)
        {
            ScriptNumber val = obj as ScriptNumber;

            if (val == null)
            {
                throw new ExecutionException(m_Script, this, "赋值逻辑计算 右边值必须为数字类型");
            }
            switch (type)
            {
            case TokenType.AssignPlus:
                m_Value += val.ToLong();
                return(this);

            case TokenType.AssignMinus:
                m_Value -= val.ToLong();
                return(this);

            case TokenType.AssignMultiply:
                m_Value *= val.ToLong();
                return(this);

            case TokenType.AssignDivide:
                m_Value /= val.ToLong();
                return(this);

            case TokenType.AssignModulo:
                m_Value %= val.ToLong();
                return(this);

            case TokenType.AssignInclusiveOr:
                m_Value |= val.ToLong();
                return(this);

            case TokenType.AssignCombine:
                m_Value &= val.ToLong();
                return(this);

            case TokenType.AssignXOR:
                m_Value ^= val.ToLong();
                return(this);

            case TokenType.AssignShr:
                m_Value >>= val.ToInt32();
                return(this);

            case TokenType.AssignShi:
                m_Value <<= val.ToInt32();
                return(this);

            default:
                throw new ExecutionException(m_Script, this, "Long不支持的运算符 " + type);
            }
        }
 public override ScriptNumber Clamp(ScriptNumber min, ScriptNumber max)
 {
     if (m_Value < min.ToDouble())
     {
         return(Script.CreateDouble(min.ToDouble()));
     }
     if (m_Value > max.ToDouble())
     {
         return(Script.CreateDouble(max.ToDouble()));
     }
     return(Script.CreateDouble(m_Value));
 }
Beispiel #24
0
 public override ScriptNumber Clamp(ScriptNumber min, ScriptNumber max)
 {
     if (this.m_Value < min.ToDouble())
     {
         return(new ScriptNumberDouble(base.m_Script, min.ToDouble()));
     }
     if (this.m_Value > max.ToDouble())
     {
         return(new ScriptNumberDouble(base.m_Script, max.ToDouble()));
     }
     return(new ScriptNumberDouble(base.m_Script, this.m_Value));
 }
 public override ScriptNumber Clamp(ScriptNumber min, ScriptNumber max)
 {
     if (m_Value < min.ToInt32())
     {
         return(new ScriptNumberInt(m_Script, min.ToInt32()));
     }
     if (m_Value > max.ToInt32())
     {
         return(new ScriptNumberInt(m_Script, max.ToInt32()));
     }
     return(new ScriptNumberInt(m_Script, m_Value));
 }
        ScriptObject ParseAssign(CodeAssign assign)
        {
            if (assign.AssignType == TokenType.Assign)
            {
                var ret = ResolveOperand(assign.value);
                SetVariable(assign.member, ret);
                return(ret);
            }
            else
            {
                ScriptObject obj = GetVariable(assign.member);
                ScriptString str = obj as ScriptString;
                if (str != null)
                {
                    if (assign.AssignType == TokenType.AssignPlus)
                    {
                        return(str.AssignPlus(ResolveOperand(assign.value)));
                    }
                    else
                    {
                        throw new ExecutionException("string类型只支持[+=]赋值操作");
                    }
                }
                ScriptNumber num = obj as ScriptNumber;
                if (num != null)
                {
                    ScriptNumber right = ResolveOperand(assign.value) as ScriptNumber;
                    if (right == null)
                    {
                        throw new ExecutionException("[+= -=...]值只能为 number类型");
                    }
                    switch (assign.AssignType)
                    {
                    case TokenType.AssignPlus:
                        return(num.AssignPlus(right));

                    case TokenType.AssignMinus:
                        return(num.AssignMinus(right));

                    case TokenType.AssignMultiply:
                        return(num.AssignMultiply(right));

                    case TokenType.AssignDivide:
                        return(num.AssignDivide(right));

                    case TokenType.AssignModulo:
                        return(num.AssignModulo(right));
                    }
                }
                throw new ExecutionException("[+= -=...]左边值只能为number或者string");
            }
        }
        private ScriptObject GetVariable(CodeMember member)
        {
            ScriptObject ret = null;

            if (member.Parent == null)
            {
                string       name = (string)member.MemberValue;
                ScriptObject obj  = GetVariableObject(name);
                ret      = (obj == null ? m_script.GetValue(name) : obj);
                ret.Name = name;
            }
            else
            {
                ScriptObject parent = ResolveOperand(member.Parent);

                /*此处设置一下堆栈位置 否则 函数返回值取值出错会报错位置 例如
                 *  function Get() {
                 *      return null
                 *  }
                 *  Get().a
                 *
                 * 上述代码报错会报道 return null 那一行 但实际出错 是 .a 的时候 下面这句话就是把堆栈设置回 .a 那一行
                 */
                m_script.SetStackInfo(member.StackInfo);
                if (member.Type == MEMBER_TYPE.VALUE)
                {
                    object name = member.MemberValue;
                    ret      = parent.GetValue(name);
                    ret.Name = parent.Name + "." + name.ToString();
                }
                else
                {
                    object name = ResolveOperand(member.MemberObject).KeyValue;
                    ret      = parent.GetValue(name);
                    ret.Name = parent.Name + "." + name.ToString();
                }
            }
            if (ret == null)
            {
                throw new ExecutionException(m_script, "GetVariable member is error");
            }
            if (member.Calc != CALC.NONE)
            {
                ScriptNumber num = ret as ScriptNumber;
                if (num == null)
                {
                    throw new ExecutionException(m_script, "++或者--只能应用于Number类型");
                }
                return(num.Calc(member.Calc));
            }
            return(ret);
        }
Beispiel #28
0
        public override ScriptObject AssignCompute(Scorpio.Compiler.TokenType type, ScriptObject obj)
        {
            ScriptNumber number = obj as ScriptNumber;

            if (number == null)
            {
                throw new ExecutionException(base.m_Script, this, "赋值逻辑计算 右边值必须为数字类型");
            }
            switch (type)
            {
            case Scorpio.Compiler.TokenType.AssignShi:
                this.m_Value = this.m_Value << number.ToInt32();
                return(this);

            case Scorpio.Compiler.TokenType.AssignShr:
                this.m_Value = this.m_Value >> number.ToInt32();
                return(this);

            case Scorpio.Compiler.TokenType.AssignXOR:
                this.m_Value ^= number.ToLong();
                return(this);

            case Scorpio.Compiler.TokenType.AssignCombine:
                this.m_Value &= number.ToLong();
                return(this);

            case Scorpio.Compiler.TokenType.AssignMinus:
                this.m_Value -= number.ToLong();
                return(this);

            case Scorpio.Compiler.TokenType.AssignMultiply:
                this.m_Value *= number.ToLong();
                return(this);

            case Scorpio.Compiler.TokenType.AssignDivide:
                this.m_Value /= number.ToLong();
                return(this);

            case Scorpio.Compiler.TokenType.AssignModulo:
                this.m_Value = this.m_Value % number.ToLong();
                return(this);

            case Scorpio.Compiler.TokenType.AssignInclusiveOr:
                this.m_Value |= number.ToLong();
                return(this);

            case Scorpio.Compiler.TokenType.AssignPlus:
                this.m_Value += number.ToLong();
                return(this);
            }
            throw new ExecutionException(base.m_Script, this, "Long不支持的运算符 " + type);
        }
Beispiel #29
0
 public CodeMember(ScriptNumber mem, CodeObject parent)
 {
     this.Parent = parent;
     if (mem.ObjectValue is double)
     {
         this.MemberIndex = mem.ToInt32();
         this.Type        = MEMBER_TYPE.INDEX;
     }
     else
     {
         this.MemberNumber = mem.ObjectValue;
         this.Type         = MEMBER_TYPE.NUMBER;
     }
 }
Beispiel #30
0
        public ScriptString SendNotificationToUser(ScriptNumber priority, ScriptString user, ScriptString title, ScriptString message, ScriptString sound)
        {
            var response = PushMessage(
                user.ToPrimitiveString(),
                title.ToPrimitiveString(),
                priority.ToPrimitiveInt32(),
                message.ToPrimitiveString(),
                sound.ToPrimitiveString()
                );

            ProcessResponse(response);

            return(new ScriptString(response.ErrorMessage ?? response.Content));
        }
 public void SetThermostatScheduleMode(ScriptNumber thermostatID, ScriptNumber mode)
 {
     int index = thermostatID.ToPrimitiveInt32() - 1;
     if (this.thermostats.Count > index)
     {
         this.thermostats[index].SetScheduleSetting((ScheduleSetting)mode.ToPrimitiveInt32());
     }
     else
     {
         this.Logger.Error("Invalid ThermostatID [" + thermostatID.ToString() + "] in SetThermostatScheduleMode call.");
     }
 }
 public void SetThermostatHold(ScriptNumber thermostatID, ScriptBoolean hold)
 {
     Logger.Error("Not supported.");
 }
 public void SetThermostatHeatSetPoint(ScriptNumber thermostatID, ScriptNumber setPoint)
 {
     int index = thermostatID.ToPrimitiveInt32() - 1;
     if (this.thermostats.Count > index)
     {
         this.thermostats[index].SetHeatTemp(setPoint.ToPrimitiveInt32());
     }
     else
     {
         this.Logger.Error("Invalid ThermostatID [" + thermostatID.ToString() + "] in SetThermostatHeatSetPoint call.");
     }
 }
 public void SetThermostatAwayState(ScriptNumber thermostatID, ScriptNumber awayState)
 {
     int index = thermostatID.ToPrimitiveInt32() - 1;
     if (this.thermostats[index] != null)
     {
         if (this.thermostats[index] is ResidentialThermostat)
         {
             ((ResidentialThermostat)this.thermostats[index]).SetAwayState((AwayState)awayState.ToPrimitiveInt32());
         }
         else
         {
             this.Logger.Error("Invalid ThermostatID [" + thermostatID.ToString() + "] in SetThermostatAwayState call.  Only Residential thermostats support Away State.");
         }
     }
     else
     {
         this.Logger.Error("Invalid ThermostatID [" + thermostatID.ToString() + "] in SetThermostatAwayState call.");
     }
 }