public static DevicePayload FromDevice(Device device) { var item = new DevicePayload(); ThingPayload.CopyFromThing(item, device); LogicableItemUtils.CopyFromLogicable(item, device); return(item); }
public static ThingPayload FromThingByType(Thing thing) { if (thing is Device) { return(DevicePayload.FromDevice((Device)thing)); } if (thing is Item) { return(ItemPayload.FromItem((Item)thing)); } return(ThingPayload.FromThing(thing)); }