Skip to content

Commit cbdb761

Browse files
committed
Re-introduce visible member of property descriptions, bump ipc-schema and bump version to 1.1.1
1 parent dcde5d0 commit cbdb761

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

gateway_addon/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from .outlet import Outlet
1717
from .property import Property
1818

19-
__version__ = '1.0.0'
19+
__version__ = '1.1.1'
2020
API_VERSION = 2
2121

2222

gateway_addon/property.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""High-level Property base class implementation."""
22

33
from .errors import PropertyError
4+
import warnings
45

56

67
class Property:
@@ -18,8 +19,15 @@ def __init__(self, device, name, description):
1819
self.name = name
1920
self.value = None
2021
self.description = {}
22+
self.visible = True
2123
self.fire_and_forget = False
2224

25+
# Check 'visible' for backwards compatibility
26+
if 'visible' in description:
27+
warnings.warn('''The visible member of property descriptions is
28+
deprecated.''', DeprecationWarning)
29+
self.visible = description['visible']
30+
2331
# Check 'min' and 'max' for backwards compatibility
2432
if 'min' in description:
2533
self.description['minimum'] = description['min']
@@ -57,6 +65,7 @@ def as_dict(self):
5765
prop = {
5866
'name': self.name,
5967
'value': self.value,
68+
'visible': self.visible,
6069
}
6170
prop.update(self.description)
6271
return prop

gateway_addon/schema

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
setup(
3131
name='gateway_addon',
32-
version='1.0.0',
32+
version='1.1.1',
3333
description='Bindings for WebThings Gateway add-ons',
3434
long_description=long_description,
3535
url='https://github.com/WebThingsIO/gateway-addon-python',

0 commit comments

Comments
 (0)