Ejemplo n.º 1
0
        /// <summary>
        ///     Refreshes information about the thing.
        /// </summary>
        /// <returns></returns>
        public Item Refresh()
        {
            var item = OpenHab.RestClient.ItemService.GetItem(Name);

            Type             = item.Type;
            Name             = item.Name;
            Label            = item.Label;
            Category         = item.Category;
            Tags             = item.Tags;
            GroupNames       = item.GroupNames;
            Link             = item.Link;
            State            = item.State;
            TransformedState = item.TransformedState;
            StateDescription = item.StateDescription;
            return(this);
        }
Ejemplo n.º 2
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Uid != null?Uid.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (Id != null ? Id.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (ChannelTypeUid != null ? ChannelTypeUid.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (ItemType != null ? ItemType.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Kind != null ? Kind.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Label != null ? Label.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (DefaultTags != null ? DefaultTags.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Properties != null ? Properties.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Category != null ? Category.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (StateDescription != null ? StateDescription.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Advanced.GetHashCode();
                hashCode = (hashCode * 397) ^ (ThingConfiguration != null ? ThingConfiguration.GetHashCode() : 0);
                return(hashCode);
            }
        }
Ejemplo n.º 3
0
 protected bool Equals(StateDescription other)
 {
     return(Minimum == other.Minimum && Maximum == other.Maximum && ReadOnly == other.ReadOnly &&
            Equals(Options, other.Options) && Step == other.Step && string.Equals(Pattern, other.Pattern));
 }