gpulido / python-airzone

MIT License
10 stars 3 forks source link

expanding use of private variables in decorator getter #13

Closed Mike-de-bike closed 3 years ago

Mike-de-bike commented 3 years ago

Hi Gabriel,

how do you do? What is your state of implementing the localapi? I am curious about the coming HA integration? šŸ™‚

Kind ā£regards Stefan

Am 8. Juli 2021, 11:37, um 11:37, Gabriel Pulido @.> schrieb: @. requested changes on this pull request.

Thanks for the changes, please review the comments.

@@ -2,7 +2,7 @@

- +

I know it's also my fault, but we need to avoid to add the pycharm config files. The main branch doesn't have any editor configuration. We need to add a .idea to the .gitignore Once the branch is finished I will avoid to merge to the main branch any editor config

     self._machine = machine
  • self._zone_id = zone_id
  • self.zone_state = data
  • self._zone_id = zone_id
  • self._zone_state = data

The property must be used instead of the inner variable. Only use the inner if there is a proper reason to do. So this has to be self.zone_state = data

 def is_on(self):
  • return self.zone_state['on']
  • return self._zone_state['on']

Same as before. use property accessor: self.zone_state['on']

@@ -168,55 +168,55 @@ def turn_off(self):

@property
def signal_temperature_value(self):
  • return self.zone_state['setpoint']
  • return self._zone_state['setpoint']

Idem

 @signal_temperature_value.setter

def signal_temperature_value(self, setpoint): self._set_parameter_value('setpoint', setpoint)

@property
def name(self):
  • return self.zone_state['name']
  • return self._zone_state['name']

Idem

 @name.setter

def name(self, name): self._set_parameter_value('name', name)

@property
def max_temp(self):
  • return self.zone_state['maxTemp']
  • return self._zone_state['maxTemp']

idem

@property def min_temp(self):

  • return self.zone_state['minTemp']
  • return self._zone_state['minTemp']

idem

@property def local_temperature(self):

  • return self.zone_state['roomTemp']
  • return self._zone_state['roomTemp']

idem

@property def room_humidity(self):

  • return self.zone_state['humidity']
  • return self._zone_state['humidity']

idem

@property def air_demand(self):

  • return self.zone_state['air_demand']
  • return self._zone_state['air_demand']

idem

@property def floor_demand(self):

  • return self.zone_state['floor_demand']
  • return self._zone_state['floor_demand']

idem

@@ -1,5 +1,6 @@ -pyModbus +pyModbus~=2.5.2

I know it is not the proper way, but while the library is still in beta I prefer not to fix the versions of the requirements. Remove the numbers

\ No newline at end of file +requests~=2.21.0

Same

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/gpulido/python-airzone/pull/13#pullrequestreview-701840319

gpulido commented 3 years ago

Abandon PR as all changes have already been added to the branch.