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.
An interesting bug came up recently, when initialising a
colourTemperature
characteristic, where the default value in the factory method inGenerated.swift
was outside the max and min range specified in my init call. The value of the characteristic is anInt
type, but the min and max values inGenerated
are stored asDouble
. Creating the characteristic with that new range resulted in a crash, as the double max an min values could not be converted toInt
This patch adds the ability to create an
Int
characteristic from aDouble
orFloat
.