Skip to content

Commit

Permalink
Fix lywsd02 script - missing datetime import
Browse files Browse the repository at this point in the history
  • Loading branch information
jacekkow committed Aug 18, 2020
1 parent a8d3506 commit 9bb383b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/lywsd02
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!python

import argparse
from datetime import datetime
import lywsd02

parser = argparse.ArgumentParser()
Expand All @@ -13,7 +14,7 @@ for mac in args.mac:
client = lywsd02.Lywsd02Client(mac)
if args.action == 'sync':
print('Synchronizing time of {}'.format(mac))
client.time = datetime.datetime.now()
client.time = datetime.now()
elif args.action == 'read':
print('Fetching data from {}'.format(mac))
data = client.data
Expand Down

0 comments on commit 9bb383b

Please sign in to comment.