Skip to content

Commit

Permalink
Merge pull request #251 from ChristianTremblay/release_210204
Browse files Browse the repository at this point in the history
Release 210204
  • Loading branch information
ChristianTremblay committed Feb 4, 2021
2 parents 91bf6d1 + 6ee3daf commit d142c59
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 7 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: "30 1 * * *"

jobs:
stale:

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
25 changes: 23 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package
name: Build & Test

on:
push:
Expand All @@ -15,7 +15,6 @@ jobs:
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -48,3 +47,25 @@ jobs:
run: |
coverage run --source BAC0 -m pytest -v
coverage report
- name: Upload coverage data to coveralls.io
if: matrix.python-version == '3.9'
run: coveralls
env:
GITHUB_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.test-name }}


# coveralls:
# name: Indicate completion to coveralls.io
# needs: build
# runs-on: ubuntu-latest
# container: python:3-slim
# steps:
# - name: Finished
# run: |
# pip3 install --upgrade coveralls
# coveralls --finish
# env:
# GITHUB_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
# COVERALLS_FLAG_NAME: ${{ matrix.test-name }}
# COVERALLS_PARALLEL: true
1 change: 1 addition & 0 deletions BAC0/core/devices/Device.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,7 @@ def connect(self, *, db=None):
self.new_state(RPDeviceConnected)

except (NoResponseFromController, AttributeError) as error:
self._log.warning("Error connecting: %s", error)
if self.properties.db_name:
self.new_state(DeviceFromDB)
else:
Expand Down
2 changes: 2 additions & 0 deletions BAC0/core/devices/mixins/read_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ def _find_propid_index(key):
for each in retrieve_type(objList, "trendLog"):
point_address = str(each[1])
tl = TrendLog(point_address, self, read_log_on_creation=False)
if tl.properties.log_device_object_property is None:
continue
ldop_type, ldop_addr = (
tl.properties.log_device_object_property.objectIdentifier
)
Expand Down
4 changes: 2 additions & 2 deletions BAC0/core/functions/cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class SubscriptionContext:

def __init__(self, address, objectID, confirmed=None, lifetime=None, callback=None):
self.address = address
self.subscriberProcessIdentifier = self.next_proc_id
self.next_proc_id += 1
self.subscriberProcessIdentifier = SubscriptionContext.next_proc_id
SubscriptionContext.next_proc_id += 1
self.monitoredObjectIdentifier = objectID
self.issueConfirmedNotifications = confirmed
self.lifetime = lifetime
Expand Down
2 changes: 1 addition & 1 deletion BAC0/infos.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
__email__ = "[email protected]"
__url__ = "https://github.com/ChristianTremblay/BAC0"
__download_url__ = "https://github.com/ChristianTremblay/BAC0/archive/master.zip"
__version__ = "21.01.28"
__version__ = "21.0204"
__license__ = "LGPLv3"
2 changes: 1 addition & 1 deletion BAC0/sql/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def save(self, filename=None, resampling=None):
filename = filename.split(".")[0]
self.properties.db_name = filename
else:
self.properties.db_name = "{}".format(self.properties.name)
self.properties.db_name = "dev_{}".format(self.properties.device_id)

if resampling is None:
resampling = self.properties.save_resampling
Expand Down
2 changes: 1 addition & 1 deletion doc/source/cov.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ the function as a callback to the subscription ::

# elements is a dict containing all the information of the COV
def my_callback(elements):
print("Present value is : {}".format(elements['properties']['presentValue'])
print("Present value is : {}".format(elements['properties']['presentValue']))

.. note::
Here you can find a typical COV notification and the content of elements.
Expand Down

0 comments on commit d142c59

Please sign in to comment.