Skip to content

Enhance SwitchLampUnit to accept comparison type #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 7, 2022

Conversation

jsm174
Copy link
Contributor

@jsm174 jsm174 commented Jun 30, 2022

This PR updates the SwitchLampUnit to allow for a comparison type to be used when evaluating a match. Prior to this, matches occurred when the Value was equal to the Source Value.

This change allows incrementing variables to be used to turn on / off multiple lamps:

Screen Shot 2022-06-23 at 10 02 32 AM

To support the ComparisonType enum displaying symbols instead of the enum value as a string, we created a new AttributedEnumInspector. This allows for overriding the displayed text with the Description attribute.

This new AttributedEnumInspector was then reused for the LampDataTypeInspector:

	public enum LampDataType
	{
		[Description("On/Off")]
		OnOff,

When looking at the following image, we see the drop down now shows On / Off instead of On Off:

Screen Shot 2022-06-23 at 10 10 44 AM

@jsm174 jsm174 requested a review from freezy June 30, 2022 22:41
Copy link
Member

@freezy freezy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Could you fix the white spaces, then I'll merge. :)

@jsm174
Copy link
Contributor Author

jsm174 commented Jul 7, 2022

Fixed. Sorry about that. VS mac seems to have a mind of its own with CR/LF, tabs, spaces on new and existing files.

@freezy
Copy link
Member

freezy commented Jul 7, 2022

No worries!

@freezy freezy merged commit 4925a49 into master Jul 7, 2022
@freezy freezy deleted the feature/switch-lamp-compare branch July 7, 2022 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants