Add id to client
This commit is contained in:
parent
85552a3294
commit
3eb4c78ae4
2 changed files with 10 additions and 4 deletions
|
@ -274,9 +274,9 @@ class Hugvey(object):
|
|||
"""The Hugvey client, to be ran on the Raspberry Pi's
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self.id = self.getId()
|
||||
pass
|
||||
def __init__(self, id = None):
|
||||
self.id = self.getId() if id is None else id
|
||||
logger.debug(f'Hugvey {self.id}')
|
||||
|
||||
def getId(self) -> int:
|
||||
"""Get Hugvey ID from hostname"""
|
||||
|
|
|
@ -16,6 +16,12 @@ if __name__ == '__main__':
|
|||
'-v',
|
||||
action="store_true",
|
||||
)
|
||||
argParser.add_argument(
|
||||
'--id',
|
||||
type=int,
|
||||
default=None,
|
||||
help="Force the given id to be used. Must be integer"
|
||||
)
|
||||
|
||||
args = argParser.parse_args()
|
||||
|
||||
|
@ -23,6 +29,6 @@ if __name__ == '__main__':
|
|||
level=logging.DEBUG if args.verbose else logging.INFO,
|
||||
)
|
||||
|
||||
hv = Hugvey()
|
||||
hv = Hugvey(args.id)
|
||||
hv.loadConfig(args.config)
|
||||
hv.start()
|
||||
|
|
Loading…
Reference in a new issue