Esempio n. 1
0
        public AcCommand SetFanSpeed(Ac ac, byte percentage)
        {
            byte fval = (byte)Math.Ceiling(ac.FanSpeedMax * ((float)percentage / 100.0f));

            _fanSpeed = fval;
            return(this);
        }
Esempio n. 2
0
        private static void Startup(string comPort, string acModel)
        {
            var builder = new ConfigurationBuilder()
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            _config = builder.Build();
            if (comPort != null)
            {
                _portDriver = new SerialPortDriver(comPort);
                _portDriver.Connect();
                _acManager = new AcManager(_portDriver);
                _crAc      = _acManager.CreateAc(acModel);
            }
        }