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

Add support for favorite level and fix speed change #1

Merged
merged 6 commits into from
Dec 17, 2019

Conversation

mouth4war
Copy link

@mouth4war mouth4war commented Dec 14, 2019

piid 8 (motor1-speed) is not writable as per spec and seems to just report motor speed. It now seems possible to directly change favorite mode motor speed via piid 7 (m1-favorite).

Propose

  1. renaming current changeFavorite to changeFavoriteSpeed.
  2. adding properties for motor_speed and favorite_level
  3. defining new changeFavoriteLevel to directly set favorite_level

Relevant spec:

Service: siid 10: (motor-speed): 10 props, 0 actions
    * Property piid: 1 (m1-strong): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [300, 2300, 10])
    * Property piid: 2 (m1-high): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [300, 2300, 10])
    * Property piid: 3 (m1-med): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [300, 2300, 10])
    * Property piid: 4 (m1-med-l): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [300, 2300, 10])
    * Property piid: 5 (m1-low): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [300, 2300, 10])
    * Property piid: 6 (m1-silent): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [300, 2300, 10])
    * Property piid: 7 (m1-favorite): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [300, 2300, 10])
    * Property piid: 8 (motor1-speed): (int32, unit: None) (acc: ['read'], value-list: [], value-range: [0, 3000, 1])
    * Property piid: 9 (motor1-set-speed): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [0, 3000, 1])
    * Property piid: 10 (favorite fan level): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [0, 14, 1])

These are just placeholders copied from the previous version.

Relevant spec:

Service: siid 10: (motor-speed): 10 props, 0 actions
    * Property piid: 1 (m1-strong): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [300, 2300, 10])
    * Property piid: 2 (m1-high): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [300, 2300, 10])
    * Property piid: 3 (m1-med): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [300, 2300, 10])
    * Property piid: 4 (m1-med-l): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [300, 2300, 10])
    * Property piid: 5 (m1-low): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [300, 2300, 10])
    * Property piid: 6 (m1-silent): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [300, 2300, 10])
    * Property piid: 7 (m1-favorite): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [300, 2300, 10])
    * Property piid: 8 (motor1-speed): (int32, unit: None) (acc: ['read'], value-list: [], value-range: [0, 3000, 1])
    * Property piid: 9 (motor1-set-speed): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [0, 3000, 1])
    * Property piid: 10 (favorite fan level): (int32, unit: None) (acc: ['read', 'write'], value-list: [], value-range: [0, 14, 1])
@mouth4war mouth4war changed the title add property for favorite level Add support for favorite level and fix speed change Dec 16, 2019
@mouth4war
Copy link
Author

@mouth4war
Copy link
Author

So it looks like setting motor speed via piid 9 doesn't work. Favorite mode rpm can be set via piid 7.

@mouth4war
Copy link
Author

@kingkong123 ready for review/tests

@kingkong123
Copy link
Owner

@mouth4war sorry for late reply, a bit busy these days.
Thanks for the PR, looks great

@kingkong123 kingkong123 merged commit a9e8c59 into kingkong123:master Dec 17, 2019
@github9984
Copy link

How do I test this? Do I just copy and overwrite miio folder?

@kingkong123
Copy link
Owner

I think you better update the dependency in package.json to this repo and run npm install to install the package

"dependencies": {
    "miio": "github:kingkong123/miio"
  }

@github9984
Copy link

fan-speed.js is loading with errors.
Fs1 = -1;

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.

3 participants