-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding a manual test for cov that will eventually be added to CI
- Loading branch information
1 parent
4edde83
commit e499973
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import BAC0 | ||
from BAC0.core.devices.local.models import analog_value | ||
from bacpypes.primitivedata import Real | ||
import time | ||
|
||
device = BAC0.lite('192.168.211.55/24', deviceId=123) | ||
client = BAC0.lite('192.168.212.12/24') | ||
|
||
new_obj = analog_value() | ||
new_obj.add_objects_to_application(device) | ||
|
||
# From Server | ||
dev_av = device.this_application.get_object_name('AV') | ||
print(dev_av.covIncrement) | ||
|
||
# From client | ||
dev = dev = BAC0.device('192.168.211.55', 123, client, poll=0) | ||
av = dev['AV'] | ||
dev['AV'].subscribe_cov(lifetime=0) | ||
|
||
print() | ||
while True: | ||
print(dev['AV']) | ||
time.sleep(1) | ||
dev['AV'] += 1 | ||
time.sleep(1) |