-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for cga4233de (#2)
* added technicolor modem * chore: updated eslintrc * chore: cleanup * init arris modem class * feat: discovery now supports both modem types * refactoring: extracted arris modem * refactoring: moved out client logic to arris-modem * feat: add technicolor restart * chore: version bump
- Loading branch information
Showing
17 changed files
with
374 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
{ | ||
"extends": [ | ||
"oclif", | ||
"oclif-typescript" | ||
"oclif-typescript", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"rules": {} | ||
"rules": { | ||
"no-useless-constructor": "off", | ||
"indent": [ | ||
"warn", | ||
2 | ||
], | ||
"lines-between-class-members": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
import Command from '@oclif/command' | ||
import {config} from 'dotenv' | ||
import {Log, OclifLogger} from './logger' | ||
config() | ||
|
||
export default abstract class extends Command { | ||
|
||
get logger(): Log { | ||
return new OclifLogger(this.log, this.warn, this.debug, this.error) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import Command from '../base-command' | ||
import {discoverModemIp, ModemDiscovery} from '../discovery' | ||
|
||
export default class Discover extends Command { | ||
static description = | ||
'Try to discover a cable modem in the network'; | ||
|
||
static examples = [ | ||
'$ vodafone-station-cli discover', | ||
]; | ||
|
||
async discoverModem(): Promise<void> { | ||
try { | ||
const modemIp = await discoverModemIp() | ||
this.log(`Possibly found modem under the following IP: ${modemIp}`) | ||
const modem = new ModemDiscovery(modemIp, this.logger) | ||
const discoveredModem = await modem.discover() | ||
this.log(`Discovered modem: ${JSON.stringify(discoveredModem)}`) | ||
} catch (error) { | ||
this.log('Something went wrong.', error) | ||
} | ||
} | ||
|
||
async run(): Promise<void> { | ||
await this.discoverModem() | ||
this.exit() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.