Skip to content
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

Allow Int based Characteristic values to be initialised by Float or Double #105

Merged
merged 1 commit into from
May 16, 2020

Conversation

gbrooker
Copy link
Contributor

An interesting bug came up recently, when initialising a colourTemperature characteristic, where the default value in the factory method in Generated.swift was outside the max and min range specified in my init call. The value of the characteristic is an Int type, but the min and max values in Generated are stored as Double. Creating the characteristic with that new range resulted in a crash, as the double max an min values could not be converted to Int

This patch adds the ability to create an Int characteristic from a Double or Float.

@Bouke
Copy link
Owner

Bouke commented May 16, 2020

Interesting bug indeed! Travis build seems fine, despite the status not showing up here.

@Bouke Bouke merged commit e6021d0 into Bouke:master May 16, 2020
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