Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Updated dependency and added Python 3 compatibility. #131

Merged
merged 2 commits into from
Jul 31, 2016

Conversation

ApplePy
Copy link
Contributor

@ApplePy ApplePy commented Jul 28, 2016

Updated the pysignals code to v1.9.8 from Django, and fixed str<-->bytes compatibility issues between Python 2 and 3.

My test (I left it out of the template test class; it assumes there's a WeMo switch on the network):

#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
test_ouimeaux
----------------------------------

Tests for `ouimeaux` module.
"""

import unittest


from ouimeaux.environment import Environment
import time


class TestOuimeaux(unittest.TestCase):

    def setUp(self):
        pass

    def test_switch(self):

        # Set up environment and find devices
        env = Environment()
        env.start()
        env.discover(5)

        # Make sure switches were found (Note: This is specific to my testing environment)
        if len(env.list_switches()) <= 0:
            raise ValueError("There should have been a switch detected.")

        # Toggle each switch to ensure proper connection
        for switch_name in env.list_switches():
            switch = env.get_switch(switch_name)
            switch.toggle()
            time.sleep(1)
            switch.toggle()

    def tearDown(self):
        pass

if __name__ == '__main__':
    unittest.main()

Thanks to the submitter of #107 for helping speed the process up.

* Update environment for python3 compatibility

* Update syntax to be python3 compatible

* Fix an instance of mixed indentation

* Update travis configuration

* Use six for urlparse compability between python 2 and 3
PySignals updated to code from v1.9.8 of Django.
@iancmcc
Copy link
Owner

iancmcc commented Jul 28, 2016

Will test this this evening.

@iancmcc
Copy link
Owner

iancmcc commented Jul 31, 2016

Tested on Python 3.5 and 2.7, LGTM

@iancmcc iancmcc merged commit 8d041eb into iancmcc:develop Jul 31, 2016
@iancmcc iancmcc mentioned this pull request Jul 31, 2016
@ApplePy ApplePy deleted the python3-support branch August 4, 2016 13:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants