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

Reboot method #1

Open
MrViktorNikolaevich opened this issue Feb 3, 2023 · 2 comments
Open

Reboot method #1

MrViktorNikolaevich opened this issue Feb 3, 2023 · 2 comments

Comments

@MrViktorNikolaevich
Copy link

Hi, i added reboot method from your project, but I don't have the permissions to push now

@MrViktorNikolaevich
Copy link
Author

MrViktorNikolaevich commented Feb 3, 2023

package xiaomirouterapi

const (
	rebootPath = "xqsystem/reboot"
)

type RebootResp struct {
	LanIP []LanIP `json:"lanIp"`
	Code  int     `json:"code"`
}

type LanIP struct {
	Mask string `json:"mask"`
	Ip   string `json:"ip"`
}

func (api *MiWifiApi) Reboot() (*RebootResp, error){
	apiURL := api.buildApiURL(rebootPath, "api")
	resp := &RebootResp{}

	err := sendGetRequest(apiURL, &resp)
	if err != nil {
		return nil, err
	}

	return resp, nil
}

@viartos
Copy link
Owner

viartos commented Feb 10, 2023

@MrViktorNikolaevich hi, can you create a pull request from other branch to master?

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

No branches or pull requests

2 participants