Skip to content

Commit

Permalink
Make Bool type an enum8 (#625)
Browse files Browse the repository at this point in the history
* Make Bool type an enum

* Coverage
  • Loading branch information
Adminiuga committed Jan 16, 2021
1 parent 8f599fb commit 69e0192
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/test_zcl.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ async def test_write_wrong_attribute(cluster):

async def test_write_attributes_wrong_type(cluster):
with patch.object(cluster, "_write_attributes", new=AsyncMock()):
await cluster.write_attributes({18: 2})
await cluster.write_attributes({18: 0x2222})
assert cluster._write_attributes.call_count == 1


Expand Down
3 changes: 1 addition & 2 deletions zigpy/types/named.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import enum
from typing import Iterable, Tuple, Union

from . import basic
Expand Down Expand Up @@ -37,7 +36,7 @@ class KeyData(basic.FixedList, item_type=basic.uint8_t, length=16):
pass


class Bool(basic.uint8_t, enum.Enum):
class Bool(basic.enum8):
false = 0
true = 1

Expand Down

0 comments on commit 69e0192

Please sign in to comment.