Skip to content

Commit

Permalink
Convert state to lower case
Browse files Browse the repository at this point in the history
  • Loading branch information
ol-iver committed Jan 31, 2021
1 parent 8cd2ee7 commit e61c62a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![PyPi](https://img.shields.io/pypi/v/denonavr.svg)](https://pypi.org/project/denonavr)
[![License](https://img.shields.io/github/license/scarface-4711/denonavr.svg)](LICENSE)

Automation Library for Denon AVR receivers - current version 0.10.0
Automation Library for Denon AVR receivers - current version 0.10.1.dev1

## Important change

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ denonavr
.. |Build Status| .. image:: https://travis-ci.com/scarface-4711/denonavr.svg?branch=master
:target: https://travis-ci.com/scarface-4711/denonavr

Automation Library for Denon AVR receivers - current version 0.10.0
Automation Library for Denon AVR receivers - current version 0.10.1.dev1

Important change
----------------
Expand Down
2 changes: 1 addition & 1 deletion denonavr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
logging.getLogger(__name__).addHandler(logging.NullHandler())

__title__ = "denonavr"
__version__ = "0.10.0"
__version__ = "0.10.1.dev1"


async def async_discover():
Expand Down
9 changes: 8 additions & 1 deletion denonavr/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
_LOGGER = logging.getLogger(__name__)


def lower_string(value: Optional[str]) -> Optional[str]:
"""Convert string to lower case."""
if value is None:
return value
return str(value).lower()


def unescape_string(value: Optional[str]) -> Optional[str]:
"""Perform HTML unescape on value."""
if value is None:
Expand Down Expand Up @@ -93,7 +100,7 @@ class DenonAVRInput(DenonAVRFoundation):
default=attr.Factory(list))

_state: Optional[str] = attr.ib(
converter=attr.converters.optional(str),
converter=attr.converters.optional(lower_string),
default=None)
_input_func: Optional[str] = attr.ib(
converter=attr.converters.optional(str),
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from setuptools import find_packages, setup

setup(name='denonavr',
version='0.10.0',
version='0.10.1.dev1',
description='Automation Library for Denon AVR receivers',
long_description='Automation Library for Denon AVR receivers',
url='https://github.com/scarface-4711/denonavr',
Expand Down

0 comments on commit e61c62a

Please sign in to comment.