/// <summary> /// Get the ON/OFF state of an endpoint /// </summary> /// <param name="endpoint">Endpoint which must have an attribute named state</param> /// <returns>True when the endpoint if on / enabled, otherwise False</returns> public async Task <bool> GetOnOffStateAsync(Endpoint endpoint) { Model.Attribute stateAttribute = await GetAttributeAsync(endpoint, Enums.CommonAttributeNames.STATE); return(await GetOnOffStateAsync(stateAttribute.Uuid)); }
/// <summary> /// Get the value of an attribute /// </summary> /// <param name="attributeUuid">Attribute UUID</param> /// <returns>The value of the attribute, converted to T</returns> public async Task <T> GetAttributeValueAsync <T>(Model.Attribute attribute) { return(await GetAttributeValueAsync <T>(attribute.Uuid)); }
/// <summary> /// Send a command to change the position of an endpoint. This method will search for an attribute /// named POSITION in the endpoint's attributes list and will use that attribute UUID. /// </summary> /// <param name="endpoint">Endpoint</param> /// <param name="position">The new position</param> /// <returns>True when the request was executed succesful, otherwise False</returns> public async Task <bool> SetPositionAsync(Endpoint endpoint, int position) { Model.Attribute stateAttribute = await GetAttributeAsync(endpoint, Enums.CommonAttributeNames.POSITION); return(await SetPositionAsync(stateAttribute.Uuid, position)); }