Skip to content

Char: override_properties#66

Merged
ikalchev merged 4 commits intoikalchev:devfrom
cdce8p:char-template
Mar 25, 2018
Merged

Char: override_properties#66
ikalchev merged 4 commits intoikalchev:devfrom
cdce8p:char-template

Conversation

@cdce8p
Copy link
Copy Markdown
Contributor

@cdce8p cdce8p commented Mar 23, 2018

Related discussion: #26

  • Removed _create_hap_template an merged this into to_HAP
  • New method override_properties for chars
  • Removed self.has_valid_values and replaced it with runtime checks to prevent update errors

@cdce8p cdce8p changed the title Merged '_create_hap_template' into 'to_hap' Merged create_hap_template -> to_hap Mar 23, 2018
@cdce8p cdce8p changed the title Merged create_hap_template -> to_hap Char: override_properties Mar 23, 2018
Copy link
Copy Markdown
Owner

@ikalchev ikalchev left a comment

Choose a reason for hiding this comment

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

Can I ask you to add a test case for the new method in tests/test_characteristic.py?

if properties:
self.properties.update(properties)

if valid_values:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I would add:

if valid_values:
    if not "ValidValues" in self.properties:
        raise ValueError(...)
    else:
        ...

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Actually forget the above - I will check if you can set ValidValues on chars that don't have ValidValues defined and will get back to you or will submit a change myself.

@ikalchev ikalchev merged commit 4f74008 into ikalchev:dev Mar 25, 2018
@cdce8p cdce8p deleted the char-template branch March 25, 2018 08:14
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