Skip to content

Commit 587215d

Browse files
committed
Added write_to_eeprom
1 parent 71a4c13 commit 587215d

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "PyVantagePro_MarcoGos"
7-
version = "0.3.17"
7+
version = "0.3.18"
88
authors = [
99
{ name="Salem Harrache", email="[email protected]" },
1010
{ name="Marco Gosselink", email="[email protected]" },

pyvantagepro/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
from .logger import LOGGER, active_logger
1414
from .device import VantagePro2
1515

16-
VERSION = '0.3.17'
16+
VERSION = '0.3.18'
1717
__version__ = VERSION

pyvantagepro/device.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ def read_from_eeprom(self, hex_address, size):
152152
LOGGER.error(msg)
153153
raise BadAckException()
154154

155+
def write_to_eeprom(self, hex_address, size, data):
156+
'''Writes to EEPROM the `size` number of bytes starting at the
157+
`hex_address` with the given `data`. `data` needs to be bytes.'''
158+
self.send("EEBWR %s %.2d\n" % (hex_address, size), self.ACK)
159+
self.send(data)
160+
155161
def gettime(self):
156162
'''Returns the current datetime of the console.'''
157163
self.wake_up()
@@ -296,6 +302,11 @@ def _get_archives_generator(self, start_date=None, stop_date=None):
296302
self.link.write(self.ACK)
297303
LOGGER.info('Pages Downloading process was finished')
298304

305+
def newsetup(self, archive_period: int) -> None:
306+
'''Re-initializes the console after making certain configuration changes'''
307+
self.wake_up()
308+
self.send("NEWSETUP", self.ACK)
309+
299310
@cached_property
300311
def archive_period(self):
301312
'''Returns number of minutes in the archive period.'''

pyvantagepro/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ class HighLowParserRevB(DataParser):
318318

319319
('ExtraLeaf', '150s'), ('ExtraTemps', '80s'),
320320
('SoilMoist', '40s'), ('LeafWet', '40s'),
321-
('Unknown', 'H')
321+
('CRC', 'H')
322322
)
323323

324324
def __init__(self, data, dtime):

0 commit comments

Comments
 (0)