Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Change maximum/minimum/step values of a numeric characteristic? #123

Description

@vickash

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions