blitzkopf / naim_muso

Home Assistant integration for Naim Mu-So media player
MIT License
4 stars 0 forks source link

Expected a JSON object, array, or literal. #30

Closed Lupi00 closed 3 months ago

Lupi00 commented 3 months ago

When I look at the files "manifest.json" and "strings.json" in Studio Code Server I get this message. Files are uploaded from this github.

<!DOCTYPE html> Expected a JSON object, array, or literal.

Appearently the file is HTML but the file is expected to be java (googling the error code gave this, I have not idea).

Is there a correct java file somewhere to be found or what is the problem? I followed the instructions for installation.

Thank you!

blitzkopf commented 3 months ago

I assume "Studio Code Server" is the Home Assistant Add-on.

Both manifest.json and strings.json files in this repository are in fact JSON files if they are not there must be some issue with the way you copied them.

To double check you could open a terminal window, this can be done in the Studio Code Server: Three bars(top left) -> Terminal -> New Terminal And then at the prompt do:

cat custom_components/naim_muso/strings.json

You should get a file like this:

{
  "domain": "naim_muso",
  "name": "naim Mu-so controller",
  "after_dependencies": [
    "spotify",
    "zeroconf",
    "media_source"
  ],
  "codeowners": [
    "@blitzkopf"
  ],
  "config_flow": true,
  "dependencies": [
    "ssdp"
  ],
  "documentation": "https://github.com/blitzkopf/naim_muso",
  "homekit": {},
  "integration_type": "hub",
  "iot_class": "local_polling",
  "issue_tracker": "https://github.com/blitzkopf/naim_muso/issues",
  "loggers": [
    "naimco.controllers",
    "naimco.core"
  ],
  "requirements": [
    "naimco",
    "async-upnp-client",
    "getmac==0.9.4"
  ],
  "ssdp": [
    {
      "manufacturer": "Naim Audio Ltd."
    }
  ],
  "version": "0.0.1",
  "zeroconf": [
    {
      "type": "_airplay._tcp.local.",
      "properties": {
        "manufacturer": "naim audio ltd.",
        "model": "mu-so"
      }
    }
  ]
}

But anyway you should not need to edit these files to run the integration.

Lupi00 commented 3 months ago

I can run the command but instead of the code you posted I get 1900 lines of html.

I found out what I did wrong and fixed it. Since its kind of embarrasing I wont go into detail but lets just say I wont be saving code in a file that way again :)

Problem solved and thank you for the help!