rickyphewitt / emby-skill

This skill allows audio playback from an emby server
11 stars 19 forks source link

Can't connect as settings.json is incorrectly written #45

Closed astrowave closed 5 years ago

astrowave commented 5 years ago

2019-11-20 11:33:51.606 | INFO | 641396 | Emby | failed to connect to emby, error: HTTPConnectionPool(host='emby', port=8096): Max retries exceeded with url: /Users/AuthenticateByName (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f66c2607040>: Failed to establish a new connection: [Errno -2] Name or service not known'))

It's failing to connect as the settings.json file keeps getting overwritten. Correct host is stored in settingsmeta.yaml

 skillMetadata:
   sections:
   - name: Server
     fields:
     - type: label
       label: Server settings
     - name: hostname
       type: text
       label: Url
       value: 'http://192.168.1.2'
     - name: port
       type: number
       label: Port
       value: '8096'
   - name: User Login Information
     fields:
     - type: label
       label: Username and Password. Leave the password blank if you do not use a password.
     - name: username
       type: text
       label: Username
       value: 'username'
     - name: password
       type: password
       label: Password
      value: 'password'

But settings.json is continually overwritten with http://emby: {"__mycroft_skill_firstrun": false, "port": 8096, "hostname": "http://emby", "password": "password", "username": "username"} `

All files are owned by mycroft:mycroft

astrowave commented 5 years ago

Editing line 41 of emby_client.py to read self.host = "http://localhost:8096" is a temporary fix

rickyphewitt commented 5 years ago

I'll have to take a look at this. My test env is always pointing to http://emby which may be why I have yet to run into this problem.

rickyphewitt commented 5 years ago

@astrowave, Did you configure this skill at https://account.mycroft.ai/skills or was this manually done in the settings.json file. That yaml file is just a template with defaults. Mycroft syncs the skills config to the settings.json file. I just tested this locally and when I manually set a value in the settings.json file it is overwritten with what is set at the mycroft/skills config site. I'm not sure the exact interval that mycroft syncs with the skills config site, I was able to verify this occurs after a reboot.

astrowave commented 5 years ago

Thanks for looking in to this. It was done manually, I can confirm it is not an issue if done through the web. I'm happy for this to be closed if you are.

rickyphewitt commented 5 years ago

Sounds good! Thanks for taking the time to submit an issue. As you use the skill I'd love to get feedback on how I can make the skill better.