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

Support device model dmaker.fan.p5 #510

Closed
1043717432 opened this issue May 23, 2019 · 5 comments · Fixed by #513
Closed

Support device model dmaker.fan.p5 #510

1043717432 opened this issue May 23, 2019 · 5 comments · Fixed by #513

Comments

@1043717432
Copy link

Support device model dmaker.fan.p5

Hi, today I received my "xiaomi SmartmiFan 1x"
Sadly it is not yet recognised by your component. Could you please integrate it?

I try to give the same information which you required in similar requests, let me know if you need more information:
Mi Home App doesn't seem to display battery stats

Support device model dmaker.fan.p5

bash-4.4# mirobo --ip 192.168.120.157 --token df0xx25caxxcedxx7656368xx79aaxx9 raw-command get_prop "['$PROP']"
Sending cmd get_prop with params ['']
[True, 'nature', 35, True, 140, 0, True, False, False, 2]

@rytilahti
Copy link
Owner

Could you also post the contents of your $PROP?

@1043717432
Copy link
Author

你还可以发布$ PROP的内容吗?

How can I send it?

@rezmus
Copy link

rezmus commented May 25, 2019

    public static final String[] HOME_PROPERTIES;
    private static final String METHOD_GET_PROP = "get_prop";
    private static final String METHOD_SET_LIGHT = "s_light";
    private static final String METHOD_SET_LOCK = "s_lock";
    private static final String METHOD_SET_MODE = "s_mode";
    public static final String METHOD_SET_POWER = "s_power";
    private static final String METHOD_SET_ROLL = "s_roll";
    private static final String METHOD_SET_ROLL_ANGLE = "s_angle";
    private static final String METHOD_SET_ROLL_DIRECTION = "m_roll";
    private static final String METHOD_SET_SOUND = "s_sound";
    private static final String METHOD_SET_SPEED = "s_speed";
    private static final String METHOD_SET_TIME_OFF = "s_t_off";
    public static final String PROP_ANGLE = "roll_angle";
    public static final String PROP_CHILD_LOCK = "child_lock";
    public static final String PROP_LIGHT = "light";
    public static final String PROP_MODE = "mode";
    public static final String PROP_POWER = "power";
    public static final String PROP_ROLL = "roll_enable";
    public static final String PROP_SOUND = "beep_sound";
    public static final String PROP_SPEED = "speed";
    public static final String PROP_TIME_OFF = "time_off";

    HOME_PROPERTIES = new String[]{PROP_POWER, PROP_MODE, PROP_SPEED, PROP_ROLL, PROP_ANGLE, PROP_TIME_OFF, PROP_LIGHT, PROP_SOUND, PROP_CHILD_LOCK};

    public boolean getPower() {
        return TypeUtil.getDefaultBoolean(TypeUtil.toBoolean(this.mPropertiesMap.get(PROP_POWER)), false);
    }

    public String getMode() {
        return TypeUtil.getDefaultString(TypeUtil.toString(this.mPropertiesMap.get(PROP_MODE)), AppConst.MODE_STRAIGHT);
    }

    public int getSpeed() {
        return TypeUtil.getDefaultInteger(TypeUtil.toInteger(this.mPropertiesMap.get(PROP_SPEED)), 1);
    }

    public boolean getRollEnable() {
        return TypeUtil.getDefaultBoolean(TypeUtil.toBoolean(this.mPropertiesMap.get(PROP_ROLL)), true);
    }

    public Integer getRollAngle() {
        return Integer.valueOf(TypeUtil.getDefaultInteger(TypeUtil.toInteger(this.mPropertiesMap.get(PROP_ANGLE)), 30));
    }

    public Integer getTimeOff() {
        return Integer.valueOf(TypeUtil.getDefaultInteger(TypeUtil.toInteger(this.mPropertiesMap.get(PROP_TIME_OFF)), 0));
    }

    public boolean getLight() {
        return TypeUtil.getDefaultBoolean(TypeUtil.toBoolean(this.mPropertiesMap.get(PROP_LIGHT)), false);
    }

    public boolean getSound() {
        return TypeUtil.getDefaultBoolean(TypeUtil.toBoolean(this.mPropertiesMap.get(PROP_SOUND)), false);
    }

    public boolean getChildLock() {
        return TypeUtil.getDefaultBoolean(TypeUtil.toBoolean(this.mPropertiesMap.get(PROP_CHILD_LOCK)), false);
    }

 public void setPower(boolean power, WeakCallBack callback) {
        callMethod(METHOD_SET_POWER, R.styleable.AppCompatTheme_textAppearanceSmallPopupMenu, callback, Boolean.valueOf(power));
    }

    public void setMode(String mode, WeakCallBack callback) {
        callMethod(METHOD_SET_MODE, R.styleable.AppCompatTheme_textColorAlertDialogListItem, callback, mode);
    }

    public void setSpeed(int speed, WeakCallBack callback) {
        callMethod(METHOD_SET_SPEED, R.styleable.AppCompatTheme_textColorSearchUrl, callback, Integer.valueOf(speed));
    }

    public void setRollEnable(boolean roll, WeakCallBack callback) {
        callMethod(METHOD_SET_ROLL, R.styleable.AppCompatTheme_toolbarNavigationButtonStyle, callback, Boolean.valueOf(roll));
    }

    public void setRollDirection(String direction, WeakCallBack callback) {
        callMethod(METHOD_SET_ROLL_DIRECTION, R.styleable.AppCompatTheme_toolbarStyle, callback, direction);
    }

    public void setRollAngle(int angle, WeakCallBack callback) {
        callMethod(METHOD_SET_ROLL_ANGLE, R.styleable.AppCompatTheme_tooltipForegroundColor, callback, Integer.valueOf(angle));
    }

    public void setTimeOff(int time, WeakCallBack callback) {
        callMethod(METHOD_SET_TIME_OFF, R.styleable.AppCompatTheme_tooltipFrameBackground, callback, Integer.valueOf(time));
    }

    public void setLight(boolean light, WeakCallBack callback) {
        callMethod(METHOD_SET_LIGHT, R.styleable.AppCompatTheme_windowActionBar, callback, Boolean.valueOf(light));
    }

    public void setSound(boolean sound, WeakCallBack callback) {
        callMethod(METHOD_SET_SOUND, R.styleable.AppCompatTheme_windowActionBarOverlay, callback, Boolean.valueOf(sound));
    }

    public void setChildLock(boolean state, WeakCallBack callback) {
        callMethod(METHOD_SET_LOCK, R.styleable.AppCompatTheme_windowActionModeOverlay, callback, Boolean.valueOf(state));
    }

    public void getTimeOffProp(WeakCallBack callback) {
        callMethod(METHOD_GET_PROP, R.styleable.AppCompatTheme_windowFixedHeightMajor, callback, PROP_TIME_OFF);
    }

@rytilahti
Copy link
Owner

Sorry, I misread $PROP being from a envvar, but from the looks of it, it is like a wildcard for all the device properties, I'm wondering if that's universally available on other devices too?

@syssi
Copy link
Collaborator

syssi commented Jun 2, 2019

Could you provide the output of:

for PROP in ac_power angle angle_enable bat_charge bat_state battery button_pressed buzzer child_lock humidity led led_b natural_level power poweroff_time speed speed_level temp_dec use_time
do
  mirobo --ip IP --token TOKEN raw-command get_prop "['$PROP']"
done

and

for PROP in power mode speed roll_enable roll_angle time_off light beep_sound child_lock
do
  mirobo --ip IP --token TOKEN raw-command get_prop "['$PROP']"
done

I will implement the device support as soon as the output is known.

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 a pull request may close this issue.

4 participants