Handle numeric device id for rfxtrx devices (#2740)

This commit is contained in:
Daniel Høyer Iversen 2016-08-08 02:15:39 +02:00 committed by Paulus Schoutsen
parent 0377338a81
commit 23472cb44d
2 changed files with 2 additions and 1 deletions

View file

@ -66,6 +66,7 @@ def _valid_device(value, device_type):
key = device.get('packetid')
device.pop('packetid')
key = str(key)
if not len(key) % 2 == 0:
key = '0' + key

View file

@ -40,7 +40,7 @@ class TestSwitchRfxtrx(unittest.TestCase):
'switch': {'platform': 'rfxtrx',
'automatic_add': True,
'devices':
{'710000141010170': {
{710000141010170: {
'name': 'Test',
rfxtrx_core.ATTR_FIREEVENT: True}
}}}))