Skip to content

Commit abb2b13

Browse files
steinbachtillsteinbach
authored andcommitted
add possibility to retrieve charging stations
1 parent 67fcf2a commit abb2b13

File tree

5 files changed

+511
-13
lines changed

5 files changed

+511
-13
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
All notable changes to this project will be documented in this file.
33

44
## [Unreleased]
5+
- No unreleased changes so far
6+
7+
## [0.11.0] - 2021-07-02
8+
### Added
9+
- Possibility to retrieve data for public charging stations
10+
511
### Fixed
612
- Make robust against null data in response
713

@@ -120,7 +126,8 @@ Minor fix in observer interface
120126
## [0.1.0] - 2021-05-26
121127
Initial release
122128

123-
[unreleased]: https://github.com/tillsteinbach/WeConnect-python/compare/v0.10.0...HEAD
129+
[unreleased]: https://github.com/tillsteinbach/WeConnect-python/compare/v0.11.0...HEAD
130+
[0.11.0]: https://github.com/tillsteinbach/WeConnect-python/releases/tag/v0.11.0
124131
[0.10.0]: https://github.com/tillsteinbach/WeConnect-python/releases/tag/v0.10.0
125132
[0.9.1]: https://github.com/tillsteinbach/WeConnect-python/releases/tag/v0.9.1
126133
[0.9.0]: https://github.com/tillsteinbach/WeConnect-python/releases/tag/v0.9.0

tests/test_addressable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ def test_AddressableLeafAdresses():
9393
parentAddressableLeaf = addressable.AddressableObject(localAddress='parent', parent=None)
9494
addressableLeaf = addressable.AddressableLeaf(localAddress='child', parent=parentAddressableLeaf)
9595

96-
getterAddress = addressableLeaf.address
96+
getterAddress = addressableLeaf.localAddress
9797
localAdress = addressableLeaf.getLocalAddress()
9898
globalAdress = addressableLeaf.getGlobalAddress()
9999

100100
assert getterAddress == localAdress
101101
assert localAdress == 'child'
102102
assert globalAdress == 'parent/child'
103103

104-
addressableLeaf.address = 'newChild'
104+
addressableLeaf.localAddress = 'newChild'
105105

106106
localAdress = addressableLeaf.getLocalAddress()
107107
globalAdress = addressableLeaf.getGlobalAddress()

weconnect/addressable.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def __init__(
1515
parent,
1616
):
1717
self.__enabled = False
18-
self.__address = localAddress
18+
self.__localAddress = localAddress
1919
self.__parent = parent
2020
self.__observers = set()
2121
self.lastChange = None
@@ -67,12 +67,12 @@ def enabled(self, setEnabled):
6767
self.__enabled = setEnabled
6868

6969
@property
70-
def address(self):
70+
def localAddress(self):
7171
return self.getLocalAddress()
7272

73-
@address.setter
74-
def address(self, newAdress):
75-
self.__address = newAdress
73+
@localAddress.setter
74+
def localAddress(self, newAdress):
75+
self.__localAddress = newAdress
7676

7777
@property
7878
def parent(self):
@@ -83,13 +83,13 @@ def parent(self, newParent):
8383
self.__parent = newParent
8484

8585
def getLocalAddress(self):
86-
return self.__address
86+
return self.__localAddress
8787

8888
def getGlobalAddress(self):
8989
address = ''
9090
if self.__parent is not None:
9191
address = f'{self.__parent.getGlobalAddress()}/'
92-
address += f'{self.__address}'
92+
address += f'{self.__localAddress}'
9393
return address
9494

9595
def getByAddressString(self, addressString):

0 commit comments

Comments
 (0)