Skip to content

Commit

Permalink
fix(cli): Extend device list with Smart AC (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
germainlefebvre4 authored Feb 7, 2024
1 parent c726fb6 commit 86fafaf
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion libtado/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def devices(tado):
click.echo('Serial: %s' % d['serialNo'])
click.echo('Type: %s' % d['deviceType'])
click.echo('Firmware: %s' % d['currentFwVersion'])
click.echo('Operation: %s' % d['gatewayOperation'])
click.echo('Connection: %s (%s)' % (d['connectionState']['value'], d['connectionState']['timestamp']))
elif d['deviceType'] == 'VA01':
click.echo('Serial: %s' % d['serialNo'])
Expand Down Expand Up @@ -81,6 +80,13 @@ def devices(tado):
click.echo('Connection: %s (%s)' % (d['connectionState']['value'], d['connectionState']['timestamp']))
click.echo('Mounted: %s (%s)' % (d['mountingState']['value'], d['mountingState']['timestamp']))
click.echo('Battery State: %s' % d['batteryState'])
elif d['deviceType'] == 'RU01':
# V2 smart wall theromstat
click.echo('Serial: %s' % d['serialNo'])
click.echo('Type: %s' % d['deviceType'])
click.echo('Firmware: %s' % d['currentFwVersion'])
click.echo('Connection: %s (%s)' % (d['connectionState']['value'], d['connectionState']['timestamp']))
click.echo('Battery State: %s' % d['batteryState'])
elif d['deviceType'] == 'RU02':
# V2 smart wall theromstat
click.echo('Serial: %s' % d['serialNo'])
Expand All @@ -101,6 +107,25 @@ def devices(tado):
click.echo('Type: %s' % d['deviceType'])
click.echo('Firmware: %s' % d['currentFwVersion'])
click.echo('Connection: %s (%s)' % (d['connectionState']['value'], d['connectionState']['timestamp']))
click.echo('Battery State: %s' % d['batteryState'])
elif d['deviceType'] == 'BU01':
# ???
click.echo('Serial: %s' % d['serialNo'])
click.echo('Type: %s' % d['deviceType'])
click.echo('Firmware: %s' % d['currentFwVersion'])
click.echo('Connection: %s (%s)' % (d['connectionState']['value'], d['connectionState']['timestamp']))
elif d['deviceType'] == 'WR01':
# Smart AC
click.echo('Serial: %s' % d['serialNo'])
click.echo('Type: %s' % d['deviceType'])
click.echo('Firmware: %s' % d['currentFwVersion'])
click.echo('Connection: %s (%s)' % (d['connectionState']['value'], d['connectionState']['timestamp']))
elif d['deviceType'] == 'WR02':
# Smart AC
click.echo('Serial: %s' % d['serialNo'])
click.echo('Type: %s' % d['deviceType'])
click.echo('Firmware: %s' % d['currentFwVersion'])
click.echo('Connection: %s (%s)' % (d['connectionState']['value'], d['connectionState']['timestamp']))
else:
click.secho('Device type %s not supported. Please report a bug with the following output.' % d['deviceType'], fg='black', bg='red')
d['serialNo'] = 'XXX'
Expand Down

0 comments on commit 86fafaf

Please sign in to comment.