Change maximum/minimum/step values of a numeric characteristic?
vickash opened this issue · comments
I'm implementing a split AC unit with no heater, starting from the included heater/cooler example. Removing the unneeded characteristics from the ServiceFactory
call works fine, and I can prevent the "Heat" option from showing up with the following code, inserted just after it:
heater_cooler.characteristics.each do |c|
if c.name == :target_heater_cooler_state
c.constraints["ValidValues"].delete("1")
end
end
I also want to limit the temperature between 17 and 31C in 1C steps, but the same strategy doesn't work there:
heater_cooler.characteristics.each do |c|
if c.name == :cooling_threshold_temperature
c.constraints["MaximumValue"] = 31
c.constraints["MinimumValue"] = 17
c.constraints["StepValue"] = 1
end
end
The slider on my phone still shows 10 to 35C in 0.5C steps. Any ideas? Thanks.
Excellent. Thanks. I'll give it a try once you're done.