feat: add archer ax50
This commit is contained in:
@@ -8,13 +8,13 @@ import (
|
||||
"github.com/go-rod/rod"
|
||||
)
|
||||
|
||||
type switcher struct {
|
||||
type Switcher struct {
|
||||
Browser *rod.Browser
|
||||
Page *rod.Page
|
||||
config *cfg.Config
|
||||
}
|
||||
|
||||
func NewSwitcher(remoteControlBrowserUrl string, config *cfg.Config) switcher {
|
||||
func NewSwitcher(remoteControlBrowserUrl string, config *cfg.Config) Switcher {
|
||||
browser := rod.New().
|
||||
ControlURL(remoteControlBrowserUrl).
|
||||
MustConnect().
|
||||
@@ -22,14 +22,14 @@ func NewSwitcher(remoteControlBrowserUrl string, config *cfg.Config) switcher {
|
||||
|
||||
page := browser.MustPage(config.Page)
|
||||
|
||||
return switcher{
|
||||
return Switcher{
|
||||
Browser: browser,
|
||||
Page: page,
|
||||
config: config,
|
||||
}
|
||||
}
|
||||
|
||||
func (s switcher) SwitchWIFI(prv provider.ProviderIface) error {
|
||||
func (s Switcher) SwitchWIFI(prv provider.ProviderIface) error {
|
||||
defer s.Browser.MustClose()
|
||||
defer s.Page.Close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user