<s> import requests <EOL> import json <EOL> from . zone import ZoneBase <EOL> class HotWater ( ZoneBase ) : <EOL> def __init__ ( self , client , data = None ) : <EOL> super ( HotWater , self ) . __init__ ( ) <EOL> self . client = client <EOL> self . zone_type = '<STR_LIT>' <EOL> if data is not None : <EOL> self . __dict__ . update ( data ) <EOL> self . zoneId = self . dhwId <EOL> def _set_dhw ( self , data ) : <EOL> headers = dict ( self . client . headers ) <EOL> headers [ '<STR_LIT:Content-Type>' ] = '<STR_LIT:application/json>' <EOL> url = '<STR_LIT>' % self . dhwId <EOL> response = requests . put ( url , data = json . dumps ( data ) , headers = headers ) <EOL> def set_dhw_on ( self , until = None ) : <EOL> if until is None : <EOL> data = { "<STR_LIT>" : <NUM_LIT:1> , "<STR_LIT>" : <NUM_LIT:1> , "<STR_LIT>" : None } <EOL> else : <EOL> data = { "<STR_LIT>" : <NUM_LIT:1> , "<STR_LIT>" : <NUM_LIT:2> , "<STR_LIT>" : until . strftime ( '<STR_LIT>' ) } <EOL> self . _set_dhw ( data ) <EOL> def set_dhw_off ( self , until = None ) : <EOL> if until is None : <EOL> data = { "<STR_LIT>" : <NUM_LIT:0> , "<STR_LIT>" : <NUM_LIT:1> , "<STR_LIT>" : None } <EOL> else : <EOL> data = { "<STR_LIT>" : <NUM_LIT:0> , "<STR_LIT>" : <NUM_LIT:2> , "<STR_LIT>" : until . strftime ( '<STR_LIT>' ) } <EOL> self . _set_dhw ( data ) <EOL> def set_dhw_auto ( self ) : <EOL> data = { "<STR_LIT>" : <NUM_LIT:0> , "<STR_LIT>" : <NUM_LIT:0> , "<STR_LIT>" : None } <EOL> self . _set_dhw ( data ) </s>
