Skip to content

Commit

Permalink
Merge pull request #33 from gisce/tensio-3150
Browse files Browse the repository at this point in the history
Fem que les tensions pròximes a 3kV actuin com a tal
  • Loading branch information
ecarreras authored May 22, 2023
2 parents 357575b + 02186a4 commit 525400c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cini/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Linea(Base):
str(linea.cini) # 'I20221LY'
"""
def __init__(self):
self.tension = None
self._tension = None
"""Tension en kV
"""
self.num_circuitos = None
Expand All @@ -80,6 +80,16 @@ def __init__(self):
- Subterránea: ``S``
"""

@property
def tension(self):
return self._tension

@tension.setter
def tension(self, value):
if 3000 >= value >= 4000:
value = int(round(value / 1000.0) * 1000)
self._tension = value

@property
def cini(self):
"""Obtiene el CINI de la linea
Expand Down

0 comments on commit 525400c

Please sign in to comment.