Giter Site home page Giter Site logo

Comments (6)

StancuFlorin avatar StancuFlorin commented on May 24, 2024

Can you try with Python 2?

from google-assistant-samsung-smart-tv-integration.

wadoadi avatar wadoadi commented on May 24, 2024

With Python 2.7.9 and no changes to the script i get:
Traceback (most recent call last):
File "samsung-smart-tv-remote.py", line 3, in
import configparser, pika, json, time, samsungctl
ImportError: No module named configparser

from google-assistant-samsung-smart-tv-integration.

wadoadi avatar wadoadi commented on May 24, 2024

Then changing the configparser to ConfigParser as it appears to be using Python 3 naming "The ConfigParser module has been renamed to configparser in Python 3" but still running under Python 2.x i next get:

Traceback (most recent call last):
File "samsung-smart-tv-remote.py", line 8, in
params = pika.URLParameters(config['CloudAMQP']['url'])
AttributeError: ConfigParser instance has no attribute 'getitem'

from google-assistant-samsung-smart-tv-integration.

StancuFlorin avatar StancuFlorin commented on May 24, 2024

I guess something changed in the configparser library. I will try with a fresh setup and I would let you know.

from google-assistant-samsung-smart-tv-integration.

wadoadi avatar wadoadi commented on May 24, 2024

cool THANK YOU

from google-assistant-samsung-smart-tv-integration.

wadoadi avatar wadoadi commented on May 24, 2024

Almost Working!
So here is what I have done so far and the error now seems to be in the JSon Payload! Current error
TypeError: the JSON object must be str, not 'bytes'

Actions thus far:

Install pika and samsungctl for Python 3 with pip3
Install pip3 install pika
Install pip3 install samsungctl

Edit samsung-smart-tv-remote.py adding () to each print line

Run the python script using python3
python3 samsung-smart-tv-remote.py

Error on Pi when message is read:

pi@xxxxxx:~/SamsungTV $ python3 samsung-smart-tv-remote.py
Traceback (most recent call last):
File "samsung-smart-tv-remote.py", line 52, in
channel.start_consuming() # start consuming (blocks)
File "/usr/local/lib/python3.4/dist-packages/pika/adapters/blocking_connection.py", line 1780, in start_consuming
self.connection.process_data_events(time_limit=None)
File "/usr/local/lib/python3.4/dist-packages/pika/adapters/blocking_connection.py", line 716, in process_data_events
self._dispatch_channel_events()
File "/usr/local/lib/python3.4/dist-packages/pika/adapters/blocking_connection.py", line 518, in _dispatch_channel_events
impl_channel._get_cookie()._dispatch_events()
File "/usr/local/lib/python3.4/dist-packages/pika/adapters/blocking_connection.py", line 1403, in _dispatch_events
evt.body)
File "samsung-smart-tv-remote.py", line 39, in callback
message = json.loads(body)
File "/usr/lib/python3.4/json/init.py", line 312, in loads
s.class.name))
TypeError: the JSON object must be str, not 'bytes'

from google-assistant-samsung-smart-tv-integration.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.