Page 1 of 1

Upcoming event Dim level

Posted: Tue 15 Jan 2013, 18:24
by pekkak
In the web client upcoming event's action is shown only on/off with this statement:

Code: Select all

dr["Action"] = events[i].Action.ID == Common.Server.IdConstants.DeviceActionTurnOnId ? "On" : "Off";
How can I get "Dim 10%" etc. like displayed in the SK client "coming up" list's Information column?

Re: Upcoming event Dim level

Posted: Wed 16 Jan 2013, 10:24
by Martin
There is a DimLevel property on events (should be events.DimLevel) that can be used to get dim level if action equals TurnOn.

Re: Upcoming event Dim level

Posted: Wed 16 Jan 2013, 16:03
by pekkak
Got it, thank you very much! :clap:

Code: Select all

					if (events[i].Action.ID == Common.Server.IdConstants.DeviceStateOffId)
					{
						dr["Action"] = "OFF";
					}
					else if (events[i].Action.ID == Common.Server.IdConstants.DeviceStateOnId)
					{
						if (!events[i].DimLevel.HasValue || events[i].DimLevel.Value == 100)
						{
							dr["Action"] = "ON";
						}
						else
						{
							dr["Action"] = events[i].DimLevel.Value.ToString() +"%";
						}
					}
					else
						dr["Action"]  = "ON";