Exemplo n.º 1
0
        void KasaDevice_OnNewEvent(object sender, KasaDeviceEventArgs e)
        {
            switch (e.Id)
            {
            case eKasaDeviceEventId.GetNow:
                GetDevice();
                break;

            case eKasaDeviceEventId.RelayState:
                relayState = Convert.ToUInt16(e.Value);
                break;

            case eKasaDeviceEventId.Brightness:
                brightness = Convert.ToUInt16(e.Value);
                break;

            default:
                break;
            }
        }
 internal void Fire(KasaDeviceEventArgs e)
 {
     onNewEvent(null, e);
 }