watchforstock / evohome-client

Python client to access the Evohome web service
Apache License 2.0
88 stars 52 forks source link

Bugfix and refactor #84

Closed zxdavb closed 5 years ago

zxdavb commented 5 years ago

This PR removed the print() and uses logger() instead. It also has some de-linting.

It cleans up ZoneBase inheritance.

Try this:

from evohomeclient2 import EvohomeClient
c = EvohomeClient(username, password, refresh_token=rt)
c.zone_schedules_backup("schedule.json")

you get:

INFO:evohomeclient2.controlsystem:Backing up schedules from ControlSystem: 3432522 (My Home)...
INFO:evohomeclient2.controlsystem:Retrieving Zone schedule: 3432521 - Main Room
INFO:evohomeclient2.controlsystem:Retrieving Zone schedule: 3432576 - Front Room
INFO:evohomeclient2.controlsystem:Retrieving Zone schedule: 3432577 - Kitchen
INFO:evohomeclient2.controlsystem:Retrieving Zone schedule: 3432578 - Bedroom
INFO:evohomeclient2.controlsystem:Retrieving Zone schedule: 3432579 - Beans Room
INFO:evohomeclient2.controlsystem:Retrieving Zone schedule: 3432580 - Noos Room
INFO:evohomeclient2.controlsystem:Retrieving Zone schedule: 3449703 - Bathroom
INFO:evohomeclient2.controlsystem:Retrieving Zone schedule: 3449740 - Test
INFO:evohomeclient2.controlsystem:Retrieving Zone schedule: 3450733 - PIV Output
INFO:evohomeclient2.controlsystem:Writing to backup file: schedule.json...
INFO:evohomeclient2.controlsystem:Backup completed.
zxdavb commented 5 years ago

@watchforstock I got into some rebase disaster (again) - are yuo happt to accept this PR without a squash.

FWIW, I have no plans for any more PRs!